chore(src): one folder per part, and the prompts one module per Brain task - #211
Open
wine-fall wants to merge 2 commits into
Open
chore(src): one folder per part, and the prompts one module per Brain task#211wine-fall wants to merge 2 commits into
wine-fall wants to merge 2 commits into
Conversation
…ain task src/ was 49 modules laid flat. They now sit by the part they serve — brain/ director/ audio/ voice/ music/ memory/ host/ setup/ support/ — with the spine (main, app, config, contracts, paths, locale, warnings) left at the root. src/prompts.ts split along its own section markers into src/prompts/<task>.ts: talk, reply, music, rwt, cadence, setup, profile, persona, status, report; the persona seed stays beside them. No behavior change: pure moves plus import rewrites, every path mention in specs/comments re-aimed, the tarball whitelist and the TUI's one reach-in (src/host/ipc.ts) updated with the isolation test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V844VFWV8TcjrtHsvcpWP2
Peer review (codex): a co-location shorthand now implied paths that do not exist. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V844VFWV8TcjrtHsvcpWP2
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.
What
src/was 49 modules laid flat, with no line between a part and its neighbours. They now sit by the part they serve, and the one-file prompt library is one module per Brain task.Folder assignment follows each module's own header (the spec it names) and the component table in
specs/DESIGN.md§4.src/prompts.tswas split along its own// --- section ---markers;reply.ts(respond + steer) imports the shared ContextPack renderers fromtalk.ts, which is the only visibility change.specs/DESIGN.md§0 now states the per-task layout.No behavior change
git mvplus import rewrites (a script computed every relative path from the old and new locations;tscis the proof).import.meta-relative assets re-aimed (bed.ts,voice-config.ts→../../assets/; the persona seed sits besideprompts/persona.ts).config.tsstays at the root, so its../package.json/../tuiresolution is untouched.src/host/ipc.ts,src/director/activity.ts.npm pack --dry-runshowsdist/prompts/*.js+persona-seed.mdanddist/main.jswherebinexpects it.../../src/host/ipc.ts;test/front-end-isolation.test.tsreadssrc/recursively and pinshost/ipc.tsas the only crossing (changed first, red, then green).src/<name>.tsmention in specs, README-adjacent docs, Makefile, CI and comments re-aimed by the same map.test/stays flat; only its imports changed.Left in place on purpose: tool descriptions beside their zod schemas (
steer-tools,music-tools,cc-tools,voice-config) — a field and its description are one contract; only sentences shared across places (ANNOUNCE_FIELD_DESCRIPTION) are centralized. Prompts stay TS template literals rather than.md: most interpolate, and a slot engine plus prepack copies would be machinery for nothing.Evidence
pnpm run typecheck,npx oxlint …,pre-commit run --all-files: green.vitest: 69 files, 1425 passed, 1 skipped.tui:bun run typecheckgreen.--brain stub --voice stub --no-music --no-bed --max-segments 1 --plain, throwawayMURMUR_HOME): one beat aired, stopped cleanly.npm pack --dry-run: prepack builds the nesteddist/, whitelist entries exist.make pack(the global-install rehearsal). The tarball listing covers thefiles/prepack risk it exists for.Peer review (codex gpt-5.6-sol, xhigh): 1 finding, 1 applied (spec03 ducking inventory now spells out each moved module's folder), 0 dismissed. Verdict: acceptable.
AI coding brief
Original request. "The file structure is messy: everything lies flat under
src/with no business/feature grouping — refactor it (ponytail)." Mid-task: "prompts/holds one file — we surely have more than one system prompt; are they coupled inside the TS? Pull them out sensibly."Manual interventions. The user asked to see the proposed tree before the PR was opened; no assignment was changed after that.
Retro. A pure-move refactor is best done as one scripted map (old path → new path) that drives
git mv, import rewrites and the doc sed alike — the script is the spec,tscis the test. Knowing up front which files compute paths fromimport.metaand which files the tarball/TUI reach into would have been the whole checklist.🤖 Generated with Claude Code
https://claude.ai/code/session_01V844VFWV8TcjrtHsvcpWP2