Repository navigation
harden(kanban): single-source the creator-stamp shape rule + contract tests - #589
Merged
Merged
Conversation
… tests Follow-up to #588 (the 2026-08-12 phantom-session regression). #588 fixed the bug but left the discrimination ('":" in stamp') inlined in TWO files — gateway/kanban_watchers.py and hermes_cli/kanban.py — which is the exact duplicated-normalizer-drift class that caused the original break (#568 hardened one assumption about tasks.session_id's format without the other call sites' knowledge). * creator_stamp_is_session_key() in gateway/routing_identity.py is now the single source of truth, with the mixed-format column documented on the helper itself (session KEY for gateway-created tasks; RAW session id for worker/CLI-created ones). * Both consumers call it; notify-repair keeps a guarded ImportError shadow matching its existing fail-closed import pattern. * tests/test_creator_stamp_shape_contract.py locks it three ways: behavioral (real key + raw-id shapes from both writers), single-source (AST sweep for inlined ':' in <stamp> shape tests outside the canonical home), and reference (both consumers must name the helper). Mutation-proven: re-inlining the shape test in a consumer turns the AST sweep RED; 74 kanban-scoped tests pass; ruff clean.
Collaborator
Author
FleetReviewConfidence: 4/5 Findings
FleetReview provenance · models: B=gpt-5.6-sol, C=claude-code-opus-4-8, D=grok-4.5, F=gpt-5.6-sol, G=grok-4.5 · cost: $3.20 · duration: 24m 26s · rounds: 3 · files examined: 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up hardening to #588. Extracts the stamp-shape discrimination into one canonical helper (creator_stamp_is_session_key), converts both call sites, and adds a contract test suite: behavioral shapes from both writers, an AST sweep that fails on any re-inlined shape test (the drift path that caused #568 to break #562), and a reference check. Mutation-proven.