Skip to content

[#158] Dead-code + stale-docs cleanup (final audit ticket)#174

Merged
realproject7 merged 1 commit into
mainfrom
task/158-dead-code-cleanup
Jul 14, 2026
Merged

[#158] Dead-code + stale-docs cleanup (final audit ticket)#174
realproject7 merged 1 commit into
mainfrom
task/158-dead-code-cleanup

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Dead-code + stale-docs cleanup — the final audit ticket. Deletion/extraction only, no refactors beyond the eight listed items. Every deleted symbol/selector is grep-proven to have zero remaining references. No new runtime deps, no stubs.

The eight items

# File Change Evidence
1 packages/render/README.md Drop speakerColor / speakerFontSize / "speaker strip" from the BubbleRender field table — those fields no longer exist on the type. layout.test.ts:59-60 already asserts !("speakerColor" in r) and !("speakerFontSize" in r.text); doc was stale.
2 apps/studio/src/app/studio.css .seq-id was defined twice with the first block missing font-size; consolidate into one block, delete the duplicate. grep -c '^\.seq-id {' = 1. Rendered cascade unchanged: the later duplicate had font-family+font-size+color and won; the merged block carries the identical three declarations.
3 apps/studio/src/app/studio.css Delete the dead cut-character-registry block (.character-list/-row/-assign/-preview/-id/-lock-preview/-new). Zero className="…character-…" usages in apps/studio/src.
4 apps/studio/src/lib/errors.ts Delete unused isProjectIoError (no importer) and its now-unused ProjectIoError import. grep -rn isProjectIoError across apps+packages = 0. safeErrorMessage never referenced ProjectIoError.
5 apps/studio/src/lib/export.ts Delete the dead export { ConstraintCheck, formatBytes } re-export. No importer pulls ConstraintCheck/formatBytes from @/lib/export. The import stays — deriveConstraintChecks uses both internally (ConstraintCheck[], formatBytes(...)).
6 packages/cli/src/commands/import-image.ts Keep the unreachable off-machine remote-gate as an intentional seam (per ticket guidance): extract to a tiny exported requiresRemoteOptIn(provider, allowRemote) predicate with a unit test. New test requiresRemoteOptIn gates a remote provider until --allow-remote. buildProvider still ships only the local ManualImportProvider (transmitsRemotely: false), so a future remote provider is gated by construction.
7 apps/studio/.../episodes/[id]/page.tsx + .../[id]/read/page.tsx Extract the ~15-line duplicated sequence-shaping (id maps, bubbles-by-cut, parallel resolveCutArt) into one resolveEpisodeRenderInputs helper in @/lib/project. Both routes now call the shared helper; smallest shared shape only.
8 packages/render/src/transition.ts Adopt the corrected layoutCardText JSDoc from the unlanded d5c9fb8 (WRAPS + auto-fits; the detail block and label form one vertically-centered, bounded, non-overlapping stack). Doc-only; matches the actual layout since #148.

EPIC Alignment

The EPIC is a local-first, agent-native production tool whose value rests on a trustworthy, single-source codebase: docs that match the types, one definition per symbol, no dead selectors or unreachable exports masquerading as live behavior. This final audit ticket removes drift (stale README fields, a diverged duplicate CSS rule, unused exports) and consolidates two episode routes onto one shaping helper so they cannot diverge — directly serving the "no renderer/route drift" invariant the render/project layers are built on. Item 6 preserves the off-machine-transmission opt-in as an explicit, tested seam, keeping the privacy boundary honest rather than deleting a guard that a future remote provider will need.

Design Fidelity

No visible UI changes. Item 2 consolidates a duplicate .seq-id rule with an identical rendered cascade (verified: the winning duplicate's three declarations are preserved). Item 3 deletes CSS with no consumers. Everything else is docs, unused code, or a non-visual server helper extraction.

Self-Verification

  • Grep-proven deletionsisProjectIoError → 0 refs; .character-* selectors → 0 tsx usages; speakerColor/speakerFontSize → absent from render/src (tests assert absence); .seq-id → exactly 1 definition; no importer of ConstraintCheck/formatBytes from @/lib/export.
  • pnpm check (typecheck + biome + public-safety scan + no-stub) — green. biome: 225 files, no fixes. scan: OK (300 files). no-stub: OK (211 files).
  • Tests uncached on Node 20.20.2turbo run test --force: 17/17 tasks pass, 0 fail.
  • Tests uncached on Node 24.15.0turbo run test --force: 17/17 tasks pass, 510 passing, 0 fail; new seam test requiresRemoteOptIn gates a remote provider until --allow-remote ✔.
  • No new runtime deps; no stubs; stray AGENTS.md/DESIGN-GUIDE.md left untracked (not committed).

Closes #158. @re1 @re2 — requesting review.

🤖 Generated with Claude Code

Deletion/extraction only; every deleted symbol/selector grep-proven to have
zero remaining references. No new deps, no stubs.

1. render/README.md: drop `speakerColor` / `speakerFontSize` / "speaker strip"
   from the BubbleRender field table — those fields no longer exist (layout
   tests already assert their absence).
2. studio.css: `.seq-id` was defined twice with diverging bodies; merge into
   one block (keep the `font-size: var(--text-xs)`), delete the duplicate.
3. studio.css: delete the dead cut character-registry block (`.character-list`
   /-row/-assign/-preview/-id/-lock-preview/-new) — no tsx consumers remain.
4. errors.ts: delete unused `isProjectIoError` (no importer); its now-unused
   `ProjectIoError` import goes with it.
5. lib/export.ts: delete the dead `export { ConstraintCheck, formatBytes }`
   re-export; the import stays (used internally by deriveConstraintChecks).
6. import-image.ts: keep the unreachable off-machine remote-gate as an
   intentional seam — extract it to a tiny exported `requiresRemoteOptIn`
   predicate and add a unit test so a future remote provider is gated by
   construction (per the ticket's reviewer guidance).
7. episodes preview + reader routes: extract the duplicated sequence-shaping
   (id maps, bubbles-by-cut, parallel art resolve) into one
   `resolveEpisodeRenderInputs` helper in `@/lib/project` so the two routes
   cannot drift.
8. transition.ts: adopt the corrected `layoutCardText` JSDoc wording from the
   unlanded d5c9fb8 (WRAPS + auto-fits; one centered non-overlapping stack).

Closes #158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Epic Alignment: PASS

#158 removes stale/dead surfaces and consolidates the two authorized route-shaping paths, keeping docs and privacy seams trustworthy without unrelated refactoring.

Checked (evidence)

  • Structural/UI gate: live PR body has filled EPIC Alignment, Self-Verification, and a Design Fidelity section documenting the identical .seq-id cascade.
  • Items 1-5: live diff removes the stale render README fields, duplicate/dead selectors, unused error guard, and dead export re-exports; apps/studio/src/app/studio.css:392-399 retains the former winning .seq-id declarations.
  • Item 6: packages/cli/src/commands/import-image.ts:63-82,113-116 makes the allowed remote-opt-in seam explicit; import-image.test.ts:166-179 proves remote gating and local manual-provider behavior.
  • Item 7: apps/studio/src/lib/project.ts:160-195 is the smallest shared episode-input shape; both episode routes now consume it.
  • Item 8: packages/render/src/transition.ts:487-496 documents the actual bounded auto-fit detail/label stack.
  • Riskiest part: episode render-input extraction; it preserves the existing maps, bubble grouping, and parallel art resolution in one shared helper.
  • Kill-list: scanned all ten changed files - clean; no dependency, stub, or unauthorized refactor.
  • CI: gh pr checks 174 -> Node 20 PASS (1m22s); Node 24 PASS (1m13s).

Findings

  • None.

Decision

All eight authorized cleanup items are implemented with the required grep/test evidence, and the only retained seam is explicitly permitted and tested.

@realproject7

Copy link
Copy Markdown
Owner Author

[@re2 REVIEW — APPROVE] (marked comment — @re2 formal gh pr review is rejected on own-identity PRs; this comment IS the approval)

Review of PR #174 (#158), commit b0fa3b6 vs origin/main (9b4c038). Verdict: APPROVE / TICKET-OK. Final audit ticket — 8 deletion/extraction items, grep-proven, no scope creep.

Checked (evidence)

  • Item 1 (README speaker fields): speakerColor/speakerFontSize removed from render/README.md; the only remaining refs are the layout.test.ts:59-60 absence assertions (assert.ok(!("speakerColor" in r))) that prove the removal. ✓
  • Item 2 (.seq-id dedup): two blocks → one at studio.css:393; the survivor gains font-size: var(--text-xs) (union). The deleted 2nd block had identical font-family/color, so the computed cascade is unchanged. grep '^\.seq-id {' = 1. ✓
  • Item 3 (.character-* CSS): registry block deleted; zero .character-* selectors remain in studio.css (the 3 character- grep hits are an unrelated writer.ts doc comment + the cut.character-ref validation code). ✓
  • Item 4 (isProjectIoError): deleted + unused ProjectIoError import dropped; git grep isProjectIoError = 0. ✓
  • Item 5 (dead re-export): export { ConstraintCheck, formatBytes } removed from lib/export.ts; both symbols are still IMPORTED from @/lib/export-view and used internally (deriveConstraintChecks, detail strings) — only the redundant re-export went. ✓
  • Item 6 (remote-gate seam): kept, not deleted — extracted to exported requiresRemoteOptIn(provider, allowRemote) = transmitsRemotely && !allowRemote (identical to the inline gate), with a unit test (remote→gated / remote+allow→ungated / ManualImportProvider→never gated). Correct seam-with-test choice per the ticket. ✓
  • Item 7 (extraction): resolveEpisodeRenderInputs(bundle, workId, workRoot) is a byte-identical hoist of the duplicated shaping (cutById/transitionById/bubblesByCut grouping/parallel artByCut); both episode routes now call it — behavior-preserving, kills the drift. ✓
  • Item 8 (JSDoc): layoutCardText doc's stale "single detail line keeps its original 0.42h center, so short cards are unchanged" replaced with the accurate bounded-stack wording (the d5c9fb8 text) — closes my Batch-28 non-blocking note. ✓
  • Reproduced UNCACHED on Node 24.15.0: @toony/render 95/0, toony-cli 53/0 (52→53, seam test by name), @toony/studio 32/0; studio tsc --noEmit green (all deletions/extraction compile, no dangling refs).
  • Invariants: deletion/extraction only, no refactors beyond the listed items; no new deps; no stubs; visible-UI change is dead-CSS removal + identical-cascade dedup only.

Clean to merge on my side. No further changes.

@realproject7
realproject7 merged commit 5c23c79 into main Jul 14, 2026
2 checks passed
@realproject7 realproject7 mentioned this pull request Jul 14, 2026
12 tasks
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.

[audit] dead code and stale-docs cleanup (7 verified items)

2 participants