Repository navigation
docs(architecture): clarify diagrams and explain observation, reconciliation and rendering - #954
Merged
Merged
Conversation
The architecture reference lists the headless packages as table rows and compresses the ownership ledger into a short section, so a maintainer cannot follow a native terminal session into the painted feed. Plan an exhaustive, source-grounded chapter covering the native-client constraint, package structure, channel trust, ingest, the sanitized ledger object, the shape evidence loop and fixture replay. Refs #947 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJNPX21SkzfKhRFxftriT
…feed rendering The reference described most subsystems but not the one that makes Agent Code possible: running native provider clients, observing them through the terminal mirror, model stream, transcript files and process, and reconstructing one sanitized conversation before anything paints. Document the seven headless packages with their module structure, channel model, sanitization rules and known gaps. Replace the short ownership section with a source-grounded chapter covering channel trust, ingest reducers, the sanitized ledger object, collectors, ownership and ghost rules, the ordering law, a worked turn, provider dispatch, the shape recorder and catalogs, and fixture replay with its invariants. Add 20 diagrams and record the gaps found in the risks and change map. Fixes #947 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJNPX21SkzfKhRFxftriT
Both changes rewrite the same reference document and diagram set, so they are reviewed as one PR against main instead of a stack. Refs #937, #947 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FcJNPX21SkzfKhRFxftriT
Juliusolsson05
changed the base branch from
docs/architecture-diagram-clarity
to
main
September 12, 2026 22:28
Juliusolsson05
marked this pull request as ready for review
September 12, 2026 22:36
Juliusolsson05
added a commit
that referenced
this pull request
Sep 20, 2026
Main gained three quit-time owners after this branch was cut, and each had to be placed in the committed-shutdown composition rather than left on before-quit, which runs before the renderer's unload vote: - The extension runtime (#577). Its PAUSE stays on before-quit: it is the one preparation that must finish before windows unload, and it is reversible (Keep Editing resumes it). Its disposal is a new committed stage, `stopExtensions`, which runs beside sessions and workflows — extensions run user code — and only AFTER startup settles, because startup creates the runtime and an earlier stop would complete against nothing and keep that receipt. - The performance monitor and trace drain (#958), with its 1.8s/2s bounded race, folded into the `performance` stage. Main also ran monitor/watchdog/performanceService stops in will-quit; those are already stages here, so the duplicates are dropped. - tmux recovery now goes through restoration's canonical envelope decoder. A quit committed mid-read must not authorize killing tmux sessions, so the startup assertion moved inside the reader, where it becomes the decoder's read-failure path and withholds cleanup. `workflowShutdownPromise`/`Complete` are gone with the before-quit handler that used them; workflow stop is a committed stage. The shutdown diagram was rewritten as a flowchart in main's current convention (accTitle/accDescr/scope, #954) and says what the composition actually does: the editor decides first and Keep Editing leaves every service live; only a committed quit stops execution; a failed stop keeps the app and its process lock. Re-rendered with the pinned toolchain; every other SVG restored. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
This PR combines two architecture-reference changes that touched the same sections: the diagram clarity revision (formerly #940) and the observation, reconciliation and feed-rendering chapter (formerly stacked as this PR). #940 is closed in favor of this one; its two commits are included unchanged.
Part 1 — Diagrams that answer reader questions (#937)
Several architecture diagrams repeated nearby inventories or compressed too many relationships into small labels. This part keeps the opening application map and gives each detailed view a specific reader question, scope and takeaway.
Part 2 — Terminal observation, reconciliation and feed rendering (#947)
The reference did not explain the part that makes Agent Code possible. Agent Code has no provider API client: it runs the native CLI (or OpenCode's own server or TUI), observes it from outside, and reconstructs one sanitized conversation from channels that disagree about time, identity and trust. This part documents that pipeline end to end, from PTY bytes to painted rows, and the headless packages that produce the observations.
Headless packages (5.2, 5.3)
opencode-terminal-headlessand cited an oldcodex-headlesspin.claude-code-headless: exact transcript tail, mitmproxy flow attribution, subagent/suggestion/sidecar demotion.codex-headless: causal rollout attribution with path leases, prompt-input evidence, strict semantic lifecycle.agent-transcript-parser: the neutral model and projection, and where it is and is not on the live path.Conversation reconstruction and rendering (8.3)
fp2fingerprints, the paint-time observer and recorder sidecar, per-providershapes.tscatalogs, classification, and the audit and coverage gates.Supporting sections
Findings documented rather than smoothed over:
RenderReasonvalues and three owners are never produced.Part 2 adds 20 diagrams and replaces
rendering-pipeline, for 45 in total. Inventories stay tables.Validation
RenderReasonandRenderOwnerin source appears in the document.--checkin docs(architecture): make diagrams answer reader questions #940's environment. They were reviewed at 960px and in grayscale, and the tested palette pairs meet the 4.5:1 text and 3:1 line contrast targets.--checkand were inspected at full resolution for width, clipped labels and mid-word wrapping.mainis clean, andmainhas not touched the architecture document since the base.Fixes #937
Fixes #947
Refs #100
🤖 Generated with Claude Code
https://claude.ai/code/session_01FcJNPX21SkzfKhRFxftriT