Repository navigation
refactor(layers): declare RuntimeRenderInput — the ledger's licensed input (#493 PR-2) - #502
Merged
Merged
Conversation
…input contract (#493 PR-2) The decide layer's input is now a DECLARED seven-field pick instead of an undeclared reach into the whole SessionRuntime: - session-runtime/state.ts: RuntimeRenderInput = Pick<SessionRuntime, entries | semantic | ghosts | streamPhase | streamPhasePendingToolName | streamPhasePendingToolUseId | lastJsonlEntryAt> — exactly what the pipeline reads today, nothing speculative. A Pick (not a wrapper) so callers pass the SAME object and the D11 reference-identity chain is untouched. - useLedgerFeedItems / ledgerFeedContextFromRuntime / replay's runtimeViewFor now take RuntimeRenderInput. Both former `as unknown as SessionRuntime` casts are gone: replay's runtimeViewFor builds an honestly-typed object (and gained the lastJsonlEntryAt + full-semantic fields the cast was hiding the absence of). Cut the last value-level rendering -> features/feed edge: - isAgentSpawnToolName moved from features/feed/lib/agentSpawnTools.ts into providers/registry.renderer.capabilities.ts — it is a pure union over each provider's isSpawnTool capability, i.e. provider vocabulary owned by that registry. The committed collector and the feed rows now share it through the providers layer, which both may legally import. tsconfig node exclude + web include updated so the relocated test stays exactly as type-checked as before (providers-root files are reached by no glob; the node project must NOT walk it — same rationale as the registry's own exclude). Deleted dead code (plan D6): rendering/policy/foldPolicy.ts + test — zero consumers since the Stage-3 cutover; the D10 provider-asymmetry idea it encoded lives on as the actively-consumed semanticFoldPolicy provider capability. Git history preserves it. Gates: tsc node+web clean, vitest 467/467 (delta from PR-1 = foldPolicy's own 9 tests deleted with it), remote-client build OK. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 9, 2026
Merged
Juliusolsson05
added a commit
that referenced
this pull request
Jul 9, 2026
…ack + #498 paste fix) One conflict, SessionView.tsx imports: union of this branch's chrome imports (PaneHeader/ComposerInput/useComposerAutoGrow) with main's post-#493 paths — useLedgerFeedItems now lives in features/feed/ledger, the runtime view types against RuntimeRenderInput from session-runtime/state (the SessionRuntime cast died in #502), and NO_GHOSTS is ReadonlyMap<string, GhostEntry>. The file body auto-merged main's honestly-typed runtimeView (semantic: transcript.semantic) under this branch's chrome unchanged. Co-Authored-By: Claude Fable 5 <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.
Part 2 of 3 for #493, stacked on #501. Plan:
docs/superpowers/plans/2026-07-09-layer-isolation.md§3.What
The contract.
RuntimeRenderInputinsession-runtime/state.ts— the declared seven-field slice the DECIDE layer may read (entries · semantic · ghosts · streamPhase · streamPhasePendingToolName · streamPhasePendingToolUseId · lastJsonlEntryAt). It is exactly what the pipeline reads today (fromuseLedgerFeedItems' slice assembly +ledgerFeedContextFromRuntime) — deliberately NOT the issue's speculative list (conditions/screen/totalEntrieshave no decide-layer reader; including them would license future back-door reads). APick(+ aReadonlyMapghosts field — the decide layer only reads the ghost plane), so desktop callers pass the sameruntimeobject unchanged and the D11 reference-identity chain is untouched.Both
as unknown as SessionRuntimecasts are dead:runtimeViewFornow builds an honestly-typedRuntimeRenderInput— and gained thelastJsonlEntryAt+ full-semanticfields the cast had been hiding the absence of;SessionViewruntime view is exactly typed; the remote store now mirrors the fullSemanticRuntimeStateinto its snapshot (same ticks as the existing scalar mirrors) sosemanticis the real fold state, not a fabricated partial.Last value-level rendering→feed edge cut.
isAgentSpawnToolNamemoved fromfeatures/feed/lib/intoproviders/registry.renderer.capabilities.ts— it's a pure union over each provider'sisSpawnToolcapability, i.e. provider vocabulary that registry owns. The committed collector and the feed rows share it through the providers layer, which both legally import. (tsconfig node exclude + web include updated so the relocated test keeps exactly its previous type-check coverage — providers-root files are reached by no glob.)Dead code deleted (plan D6):
rendering/policy/foldPolicy.ts+ test — zero consumers since the Stage-3 cutover.Verified
Gates: tsc node+web clean · vitest 467/467 (delta from PR-1 = foldPolicy's own tests went with it) · remote-client build OK.
Remaining after this: PR-3 flips the output seam (
rendering/view/→features/feed/ledger/).🤖 Generated with Claude Code