Skip to content

RE: unbuilt stages honest, app.js split, and its test fallout fixed - #115

Merged
dwolfson merged 5 commits into
mainfrom
re/honest-stages
Sep 17, 2026
Merged

dwolfson merged 5 commits into
mainfrom
re/honest-stages

Conversation

@dwolfson

Copy link
Copy Markdown
Owner

Summary

  • Fixes DEFECT-UNBUILT-STAGES-RENDER-AS-BUILT.md: unbuilt /next stages (nav, sub-tabs, pane message) no longer render as if built.
  • Splits app.js into next/stages/*.js per PLAN-FINISH-REPOS.md Part 2 §1, isolating per-stage work into independent modules (app.js 6861→6022 lines).
  • Fixes 15 tests broken by the split (string-search fixtures pinned to app.js only); generalized to concatenate app.js + all stages/*.js, rebound slice end-markers to correct in-file boundaries.

Full suite: 4812 passed, 1 pre-existing unrelated failure (fixed separately on re/diagram-test-ordering-fix), 103 skipped.

See docs/design-notes/UNBUILT-STAGES-IMPLEMENTED.md and docs/design-notes/APP-JS-SPLIT-IMPLEMENTED.md (with addendum) for details.

Test plan

  • Full suite run: uv run pytest tests/ -q -k "not Postgres"
  • All 81 tests across the 9 affected test files pass individually

🤖 Generated with Claude Code

dwolfson and others added 4 commits September 16, 2026 22:04
DEFECT-UNBUILT-STAGES-RENDER-AS-BUILT.md's fix, exactly as specified:
three sites in next/app.js tested `unbuilt`, which no STAGES entry ever
sets (every entry declares `built`). Inverted all three to read `built`
so a stage added without it is honest by default:

- the intent-nav item (:581)
- the sub-tab strip, now also gated on the STAGE's own built-ness, not
  just the tab's (:3001) -- previously all four built:true SUB_TABS
  advertised working panes on all six unbuilt stages
- the pane message that explains why an unbuilt stage has nothing to
  show, never shown before this (:5053)

Also flips `understanding` to built:true -- it renders real charts via
loadChartsPane() unconditionally already; the flag was never added when
that landed.

The other "Start here" item (renderWorkListPane never called) is not a
real defect -- traced end to end and it's fully wired. See
UNBUILT-STAGES-IMPLEMENTED.md for the trace.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…art 2 §1)

Pure refactor, no behavior change. app.js (6,861 lines) had every future
stage's work colliding in one file; this extends the worklist.js/feedback.js/
format.js pattern with one module per canonical stage id under next/stages/:

- enrichment.js, curate.js, understanding.js carry the real pane code that
  existed for those three stages (renderEnrichment/renderEnrichmentEvidence,
  renderCurate + the component-tree/verdict review, loadChartsPane).
- investigation.js, scouting.js, discovery.js, assessment.js, analysis.js,
  automate.js are stub modules — there is no stage-specific rendering code
  for any of them yet (STAGES marks none `built`, so loadPane() renders the
  shared placeholder); each stub says what a future session touches to
  build it.
- activity.js added too, matching the task's own example list, though
  Activity is not one of the nine canonical stage ids in STAGES.

app.js keeps routing (loadPane() and its stage dispatch), shared state, the
chrome, and the generic Questions-checklist engine every built stage shares
(Scouting today; Discovery/Assessment/Analysis once built) — that engine is
shared infrastructure, not any one stage's own code, so it did not move.
Chart-rendering internals (drawChart/chartLayout/tokens/etc.) stayed for the
same reason: promoteToPane()'s chat-promoted-chart feature depends on them
too, not just Understanding.

Every new/modified file passes `node --input-type=module --check`. See
docs/design-notes/APP-JS-SPLIT-IMPLEMENTED.md for the full file-by-file
account, what was scoped out (no browser testing available here — no Egeria
credentials in this environment), and the done-test traced through
Enrichment.

Signed-off-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
APP-JS-SPLIT-IMPLEMENTED.md moved renderCurate/renderComponentTree/
verdictBadge/curateRowHtml (curate) and proposedFrom/renderEnrichment
(enrichment) out of app.js into stages/curate.js and stages/enrichment.js.
15 tests across four files located these functions by string search
against app.js's raw text and broke -- ValueError (marker not found) or
an empty slice (a start/end marker pair split across two files, so the
end appeared before the start in the concatenated text).

- test_next_component_review.py, test_next_curate_pane.py,
  test_next_rail_states.py: `_app()` now concatenates app.js with every
  stages/*.js file, so a marker search doesn't need to know which file a
  function ended up in.
- Several slices still used `rowKey(i)` (stayed in app.js) as an end
  boundary for content now in curate.js -- rebound each to the actual
  next function in curate.js (portsWords/recordVerdicts/
  curateWritesHtml/renderCatalogueDepthOffer as appropriate; two needed
  renderCatalogueDepthOffer specifically because the checked content
  spans from renderCurate/curateRowHtml through the click-handler wiring
  in renderCurate itself, not just the row-HTML builder).
- test_next_enrichment_fidelity.py's proposedFrom/renderEnrichment slice
  now reads stages/enrichment.js directly. Its test_all_shell_modules_
  parse discovers stages/*.js via glob rather than a hardcoded file list,
  so a future new stage module is covered without remembering to add it
  here too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…-SPLIT-IMPLEMENTED.md

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
re/honest-stages branched before #116 merged, so its CI ran against
the old byte-window assertion and failed on the same pre-existing
bug #116 fixes — not a regression from this branch's own changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit b155093 into main Sep 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant