Skip to content

Keep bounded codes from the actual Context error class - #39

Merged
Brian Krabach (bkrabach) merged 4 commits into
mainfrom
fix/context-failure-codes
Nov 28, 2026
Merged

Brian Krabach (bkrabach) merged 4 commits into
mainfrom
fix/context-failure-codes

Conversation

@bkrabach

@bkrabach Brian Krabach (bkrabach) commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Change

DRAFT. Round 4 is the one repair after review. Do not merge or release yet.

The first model-change send can still fail; this PR changes failure reporting only.

This change alone does not remove the first failure of a model change in a long chat.

A real Context error can copy a backend exception's code. The earlier lowercase pattern therefore allowed synthetic private source text into generation.failed. This repair forwards only a code from the closed CONTEXT_ERROR_CODES list. It has the 18 main-list members plus 50 developer-written model-transition, recovery, summary and journal codes. Other codes are omitted, even if they look like identifiers. All 18 earlier payloads stay word for word.

The real-class check stays exact and reads only sys.modules; no optional Context import occurs inside failure reporting. Forged classes remain rejected. A broken installed Context package cannot replace the original failure. Main 97b2c35 and its event-driven waiting stay unchanged.

Exact head: e289585. No rebase or force-push.

Closed catalog and paired host

The list is literal source in failures.py, not a pattern or a live provider result. Its producers are Context boundary/checkpoint/recovery/transition/ordinary_transition/single_pass/working_history code and Unified context_continuity/portable_handoff/uncounted_rebuild. native_compaction_failed is retained from main although no current producer was found in those sources. The model-transition refusal is raised by ordinary_transition.py:154. The four journal words come from Unified uncounted_rebuild.py and Context's reserved-call boundary. The W7 round-4 result lists every code and its producer.

Every one of the 54 codes mapped by Unified 2536's context_failures.py is in the list; the static audit found zero missing. The other 14 preserve older Context/host projection vocabulary. An unmapped future or foreign code is omitted, giving the generic notice rather than disclosing it. Host exception supplementation is a separate existing boundary and is not expanded here.

Accept Context 62 and this independent PR in either order. Move accepted pins and requalify Unified 2536 before its merge. No unmerged pin is committed.

Validation

Local whole suite: 378 passed, 3 platform skips, 8 subtests passed. Direct failures file: 143 passed. New tests forward each closed-list member, compare all 18 earlier payloads, and send a real Context-wrapped backend code through the actual live runtime: the public terminal has no error_code and no private text. Restoring the pattern on a copy fails that regression. Previous no-import, class identity, malformed-code and input/no-replay tests remain.

The existing native-adapter CI job now installs optional Context and runs the complete failure file, so the real-class and wrapped-foreign-code tests are no longer local-only. The other jobs still run without that optional dependency. The workflow retains its pre-existing streaming candidate override; this is candidate-graph evidence, not a new accepted pin.

Exact-head CI 46197584749 passed all six jobs; logs were read. Each Ubuntu/macOS Python 3.11/3.13 job reported 331 passed, 10 optional/platform skips and 8 subtests passed. Native adapter reported 50 passed, then the new real-Context step reported all 143 failure cases passed without skips. Windows installed ledger reported 21 passed and 8 subtests passed, without skips. Package/installed-wheel checks and CLA passed. The longest job was 8m38s. Counts overlap.

No paid/live request, personal transcript, credential, owner's Windows PC, version, tag or release change.

@bkrabach
Brian Krabach (bkrabach) marked this pull request as ready for review November 28, 2026 23:28
@bkrabach
Brian Krabach (bkrabach) merged commit b37c67e into main Nov 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants