Skip to content

fix(error): get_category_name classifies non-negative codes as Success, masking real errors #698

Description

@kcenon

Context

Derived from the 2026-06-13 multi-agent ecosystem analysis + adversarial plan review. Part of #684.

Problem

get_category_name() in include/kcenon/common/error/error_codes.h:460-461 returns "Success" for any code >= 0. Two downstream systems emit positive codes into the shared error_info.code field (monitoring 1000-4999 via monitoring/core/result_types.h:62-63; container 100+), so genuine failures crossing the common boundary are classified as success and get_error_message() returns "Unknown error". This is a live correctness defect today.

Why this must precede the v1.0.0 tag

common is Tier-0 and its public error contract freezes under SemVer at the v1.0.0 tag (#639). Tagging over the current classifier bakes the wrong classification semantics into the v1.0 ABI. The fix must land in develop before the keystone tag is cut.

Scope / Acceptance Criteria

  • get_category_name() treats code > 0 (and any code outside a registered reserved range) as an out-of-range/invalid bucket, not "Success"; only the explicit success sentinel maps to Success
  • get_error_message() returns a non-"Unknown error" diagnostic for out-of-range codes
  • Unit test: a positive/out-of-range code never classifies as Success
  • Keep the classic header and the error.cppm module export in sync (single SSOT) — coordinate with the error-code registry contract gate
  • Lands in develop before Track ecosystem-wide v1.0 API stabilization readiness #639 cuts the tag

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions