docs: diagram how context is projected through the proxy#1
Open
scottmeyer wants to merge 1 commit into
Open
Conversation
Adds docs/CONTEXT_PROJECTION.md with Mermaid diagrams covering the end-to-end /v1/messages flow, the layered byte-stability strategy, mode divergence, the per-turn feedback loop, and an index of the relevant code locations.
scottmeyer
added a commit
that referenced
this pull request
Jun 10, 2026
Root cause (two stacked defects, both fixed): 1. Header miss: proxy read 'anthropic-session-id' but Claude Code sends 'x-claude-code-session-id' → fallback hash(workspace:api-key) collapsed every fleet seat to ONE session id (438/438 rows identical in the haystack state file). Now reads x-claude-code-session-id first, anthropic-session-id as fallback. 2. Unfiltered read: read_recent took last-N rows of the shared per-workspace cycle_digests.jsonl globally, rendering peer seats' digests as first-person [t-K] turns → self-misID (evidence #1-#5). Now read_recent_for_session filters by session BEFORE the N-budget; peer digests render only under a labeled '## Peer activity (other seats, digest — NOT your turns)' section, cap 3, per ratified →1974 K2. Tests: 3 new (peer exclusion, post-filter budget, peer-section labeling); TEST_HOME_LOCK promoted crate-wide — module-local mutexes raced across standalone/cycle_digest under parallel execution (fixes a real flake). Acceptance (lead spec): post-fix, a seat can never see another seat's digest as its own turn.
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.
Adds docs/CONTEXT_PROJECTION.md with Mermaid diagrams covering the
end-to-end /v1/messages flow, the layered byte-stability strategy,
mode divergence, the per-turn feedback loop, and an index of the
relevant code locations.