Phase 10: "How this works" analysis (T-10.14) + cleanup/retro (T-10.15) - #182
Merged
Conversation
A single quiet disclosure on the module page opens an AI-written walkthrough of the module's design: a plain-language summary, the data flow (input -> transform -> output), the key functions, what it touches, and its honest limits. The long form of the T-10.8 input signature. Decision (recorded in the schema v7 comment): the analysis is generated app-side and cached on first request, not at engine extraction. The engine extractor makes no LLM call and the manual-approve path is pure Swift with no engine, so an engine-only cache would leave every manually-approved and older module permanently unanalyzed. Generating in the app, where the user's provider/model/key already live, is one mechanism that covers every module uniformly and honors the hard constraints: instant on open (cache read), never blocks on a live call at view time, and never auto-summons a model on page open (the refining-loop rule -- unanalyzed modules show a quiet "Not analyzed yet" with a single on-demand "Analyze" action). - Schema v7 (app-only, additive): module_analyses, keyed per module, upsert-in-place. No mcp/src/schema/v7.sql -- the gunk-mcp/TS-engine migrators pin LATEST_VERSION = 4 and read explicit columns, so v7 is invisible to them (parity check unaffected). - ModuleAnalysis(+Content/Function), ModuleAnalysisComposer (prompt + JSON schema + parse, pure/testable), LiveModuleAnalysisGenerator (resolves provider/model/key), Store read/list/upsert, BrowseModel cache + generateAnalysis seam. - ModulePageView disclosure: closed by default; mono only for code references; honesty footer naming the model. GUNK_DEBUG_HOW_IT_WORKS= closed|open|missing stages the states for screenshot capture. - Tests: StoreTests (v6->v7 upgrade, upsert/read, replace-in-place), BrowseModelTests (cache, persistence, error path, input derivation), ModuleAnalysisComposerTests (prompt, schema, parsing). Build + tests green (257 passing, 1 sandbox-availability skip). Co-authored-by: Cursor <cursoragent@cursor.com>
Delete the orphaned legacy RunConsoleView and close out Phase 10. - Remove the legacy `RunConsoleView` struct: superseded by `RunConsoleStageView` (the module-run-v2 presentation) when the v2 run console landed in T-10.9, yet never instantiated anywhere (rg confirmed zero references, including the screenshot hooks, which live on the still-used `RunConsoleModel`). T-10.13 had even updated its deferred label copy -- editing dead code. Renamed the file to RunConsoleModel.swift to match its sole surviving content; RunConsoleModel and GUNK_DEBUG_RUN_CONSOLE staging are intact. The inline ModuleDetailView was already gone (T-10.4); only docstrings name it. - ADR-0017 (MCP run tool) -> Accepted (implemented in T-10.12); both Phase 10 ADRs (0016 sandbox, 0017 run tool) now linked from the roadmap. - Roadmap Phase 10 items checked off (Tested-badge item recorded as superseded by the coverage ledger + sign-off per CP-F; UI-module launch left open as deferred); T-10.14 status noted in the task doc. - docs/retros/phase-10.md written; CHANGELOG close-out entry added. Regression pass at 960x600 and default width across the module page and every run state confirms the toolbox-v2 constraints (graphite surfaces, mono only for paths/code/terminal, accent green only on earned meaning, glass on the controls layer) and the two-surfaces rule hold. Schema-parity check still passes (v0-v4 only; v5/v6/v7 are app-only). Build + tests green (257 passing, 1 sandbox-availability skip). Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Deploy Preview for velvety-moxie-c6d22b canceled.
|
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.
Finishes the last two Phase 10 tasks, in two commits.
Commit 1 —
feat(app): "How this works" on-demand analysis (T-10.14)A single quiet How this works disclosure on the module page opens an
AI-written walkthrough of a module's design — a plain-language summary, the
data flow (input → transform → output), the key functions, what it touches, and
its honest limits. The long form of the T-10.8 input signature.
Decision (the task's "decide and report"): generated app-side and cached on
first request, not at engine extraction. The engine extractor makes no LLM
call and the manual-approve path is pure Swift with no engine, so an
engine-only cache would leave every manually-approved and older module
permanently unanalyzed. Generating in the app — where the user's
provider/model/key already live — is one mechanism that covers every module and
honors the hard constraints:
"Not analyzed yet" with a single on-demand "Analyze" action (the refining-loop
rule),
(
module_analyses, keyed per module, upsert-in-place).Mono is used only for the code references inside the analysis. A
GUNK_DEBUG_HOW_IT_WORKS=closed|open|missinghook stages the states.New
ModuleAnalysis/ModuleAnalysisComposer(pure prompt + JSON schema +parse) /
LiveModuleAnalysisGenerator, Store read/list/upsert, and aBrowseModelcache +generateAnalysisseam.Commit 2 —
chore(app): phase-10 cleanup, regression pass, retro (T-10.15)RunConsoleView— superseded byRunConsoleStageViewwhen the v2 run console landed (T-10.9), yet neverinstantiated anywhere (rg confirmed zero references; the screenshot hooks live
on the still-used
RunConsoleModel). T-10.13 had even updated its deferredlabel copy — editing dead code. File renamed to
RunConsoleModel.swifttomatch its sole surviving content. The inline
ModuleDetailViewwas alreadygone (T-10.4).
Phase 10 ADRs (0016 sandbox, 0017 run tool) now linked from the roadmap.
superseded by the coverage ledger + sign-off per CP-F; UI-module launch left
open as deferred).
docs/retros/phase-10.mdwritten; CHANGELOG updated.Constraints / verification
mcp/src/schema/v7.sql— the gunk-mcp andTS-engine migrators pin
LATEST_VERSION = 4and read explicit columns, so v7is invisible to them. The schema-parity check still passes (v0–v4 only).
paths/code/terminal, accent green only on earned meaning, glass on the
controls layer; the two-surfaces rule (smoke run ≠ extraction inspector) is
intact.
Test plan
cd app && swift build && swift test(257 passing, 1 skip)caches, and re-opens instantly; mono only on the code references.
Analyze action (no model call on page open).
(
GUNK_DEBUG_MODULE_PAGE+GUNK_DEBUG_RUN_CONSOLE+GUNK_DEBUG_HOW_IT_WORKS).Made with Cursor