Repository navigation
Keep both Playgrounds in packages - #9
Merged
Merged
Conversation
The Playgrounds were already workspace packages: each has a manifest, sits in the workspace, and depends on other packages through `workspace:*`. Only their directory said otherwise, and it said so at a cost. `packages/` is where the seven architectural layers live, and Layer 7 is Applications: `cli` and `video-cli` already sat there. The Playgrounds are Applications too, so they belong beside them. The repository layout guide already described this arrangement, naming `tools/` as "boundary tests and build scripts" and the workspace as a single `packages/*` glob; the layout had drifted from the documentation rather than the reverse. Moving them collapses three globs into one and lets the per-package import boundary reach 36 files it could not see, because that check is scoped to `packages/*/(src|test)/`. It immediately found one: svml-playground read `@narratage/runtime-local/config` without declaring the dependency, which resolved only by walking up to the root install. Declared now. Co-Authored-By: Claude <[email protected]>
`pnpm --filter … exec` runs inside the package directory, so resolving `--source`, `--recipe` and `--font` against the process working directory pointed them at the Playground itself. The command the guide documents could not start: every relative path became `packages/caption-playground/<path>`. The SVML Playground already resolves against `INIT_CWD`, which pnpm sets to the directory the author typed the command in. Do the same here. Co-Authored-By: Claude <[email protected]>
The Playground admitted a Style and a display sequence by looking for a `contract` property inside the authored value. Nothing in the repository writes that property, so every Source was rejected: the documented example failed with `base-caption is not narratage.caption-style@1`. A Record carries its Type identity in `TypedRecord.type`, which `inlineExport` discarded. Compare that Type against `captionTypes.style` and `narrativeTypes.captionDisplay` instead of against a string this package invented. Naming the two owners makes a future rename a type error here rather than a request-time failure, and a mismatch now names both Types: `caption-program is @narratage/caption@1 CaptionProgram, not @narratage/caption@1 CaptionStyle`. Co-Authored-By: Claude <[email protected]>
This was referenced Nov 5, 2026
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.
Why
Both Playgrounds were already workspace packages — each has a manifest, sits in the workspace, and depends on other packages through
workspace:*. Only their directory said otherwise.packages/is where the seven architectural layers live, and Layer 7 is Applications:cliandvideo-clialready sat there. The Playgrounds are Applications too. The layout guide already described this arrangement, namingtools/as "boundary tests and build scripts" and the workspace as a singlepackages/*glob — the layout had drifted from the documentation rather than the reverse.tools/now holds exactly what the guide says it holds.What this buys
Three globs collapse into one:
pnpm-workspace.yamlstops naming the two packages individually,tsconfig.jsondrops twoincludeentries, and the roottestscript drops a pattern that no longer matches anything.More usefully, the per-package import boundary in
tools/repository-hygiene.test.mjsis scoped topackages/*/(src|test)/, so it could not see these two packages at all. It now reaches 36 previously unchecked files, and immediately found one: svml-playground read@narratage/runtime-local/configwithout declaring it, resolving only by walking up to the root install — the loophole the package guide warns about. Declared now.Two pre-existing bugs, fixed in their own commits
Both were found by actually running the Playgrounds, and neither was caused by the move.
Paths resolved against the wrong directory.
pnpm --filter … execruns inside the package directory, so--source,--recipeand--fontresolved relative to the Playground itself. The command indocs/guide/caption-playground.mdcould not start. The SVML Playground already handles this viaINIT_CWD; the Caption Playground now does too.Exports identified by a property nothing writes. The Playground admitted a Style by looking for a
contractfield inside the authored value. No package in the repository writes that field, so every Source was rejected — the documented example failed withbase-caption is not narratage.caption-style@1. A Record carries its Type inTypedRecord.type, whichinlineExportdiscarded. It now compares againstcaptionTypes.styleandnarrativeTypes.captionDisplay, so a future rename becomes a type error rather than a request-time failure, and a mismatch names both Types.Verification
Run in a clean worktree checked out from
main, not in the authoring tree:pnpm install --frozen-lockfilesucceeds — the lockfile diff is only the two importer blocks relocating, plus the one new declarationtsc -p tsconfig.json --noEmitcleanpnpm test— 527 tests, 0 failures, 15 environment-skipped; both Playground test files confirmed picked up by thepackages/*/test/**globpnpm test:release— 4/4/__svml/sessionreturns real data; caption-playground now serves the documented command verbatim with relative paths and/__caption/sessionreturns the authored Style🤖 Generated with Claude Code