Skip to content

feat(ci): gate the error-code registry contract (neg-range + Result/error_info compat + cppm SSOT) #699

Description

@kcenon

Context

Part of #685. Derived from the 2026-06-13 multi-agent ecosystem analysis. The existing conformance linter (scripts/conformance_lint.py, #693) checks structure/metadata only and gates none of the cross-system contract violations the analysis found.

Problem

The centralized error-code registry (disjoint negative ranges per system) is unenforced convention:

  • container/monitoring emit POSITIVE codes into common's error_info.code (silently classified "Success")
  • database mints a local enum colliding with common's reserved -5/-6
  • logger/network fallback paths define structurally incompatible Result/error_info types

None is caught by CI. Additionally error.cppm re-declares the entire registry inline (not #include of error_codes.h), so a remap that edits one but not the other silently desyncs module-built vs header-built consumers.

Scope / Acceptance Criteria

  • Compile-time static_assert in each consumer repo: every public error code is < 0 and within that repo's reserved window
  • Runtime test: to_common_error() round-trips and never yields a Success-classified code from a real error
  • Structural compatibility check for Result/error_info fallback types (logger/network no-common paths)
  • error.cppm vs error_codes.h constexpr-declaration diff gate (fail on mismatch), OR refactor error.cppm to #include the header (single SSOT)
  • DoD: a deliberately-bad fixture (positive/out-of-range code) FAILS the build in the introducing repo
  • Gate wired as a required status check (staged rollout per the propagation epic)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions