22 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, estimate, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | estimate | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 10.2-nest-framework-packages-under-modules-and-write-run-docs | 01 | execute | 1 |
|
true |
|
|
Phase Goal
Nest the 18 beach-named framework libraries under modules/ with rewritten import paths in both repos, then leave a green go test so Phase 11 does not add more packages at the repo root.
Purpose: D-01 through D-06. Root ls must show modules/, cmd/, admin/, examples/, internal/, scripts/ instead of eighteen beach directories beside go.mod, and this must land before Phase 11.
Output: modules/<name>/ for all 18 packages, import prefix git.golem15.com/golem15/summercms/modules/<name>, retargeted phase/admin scripts, updated internal/build stubs, green go vet/go test in summercms.go and ../fonoteka.go.
Repos: summercms.go and ../fonoteka.go. Planning docs stay in summercms.go. Commit each repo separately; planning docs and code in separate commits; never add co-author tags.
<execution_context>
@/.claude/gsd-core/workflows/execute-plan.md
@/.claude/gsd-core/templates/summary.md
</execution_context>
Artifacts this phase produces
- Directory
modules/holding the 18 beach packages (samepackagenames) - Import path prefix
git.golem15.com/golem15/summercms/modules/<name> - Tracer package
modules/festival(discretion: festival, not compass — see Task 1) - Retargeted literals:
scripts/check-admin-openapi.sh --dir modules/cabana;scripts/check-admin-dist.shandadmin/vite.config.ts→modules/boardwalk/dist;scripts/check-phase2.shandscripts/check-phase3.sh→modules/tide/testdata/one-route-spec.yaml;scripts/check-phase4.sh→./modules/phrasebook ./modules/postcard;scripts/check-phase9.sh→./modules/bouncer ./modules/cabana ./modules/lagoonand Packagegit.golem15.com/golem15/summercms/modules/lagoon;scripts/check-phase10.shHYGIENE_DIRS /./modules/cabana/./modules/bouncer/./modules/surf/./modules/boardwalk/ Packagegit.golem15.com/golem15/summercms/modules/cabana - Updated
internal/build/build.gostring literals andinternal/build/stubs/*.tmpl - Tests that must stay green:
TestEventBusesAreAppScoped,TestFireRunsAllListenersAndJoinsErrors,TestGetApiArrayEventMerge, then fullgo test ./...in both repos
Re-verify dependents before the move: search both repos and examples/ for importers of package festival. Expected three files only: backpack/app.go, examples/hello/plugins/greeter/plugin.go, ../fonoteka.go/plugins/golem15/user/classes/events_test.go. If grep finds more, rewrite those too; do not stop at the expected three.
Create modules/ if needed. git mv the festival directory to modules/festival/. Do not rename the Go package clause (D-01). Do not add a go.mod under modules/festival (D-03).
Rewrite only festival importers to git.golem15.com/golem15/summercms/modules/festival (D-04). Leave every other beach import on the root-form path. Do not touch ../fonoteka.go replace directives. Do not rewrite .planning/ docs.
Do not expand to the other 17 packages in this task.
test -d modules/festival && test ! -d festival && go test ./modules/festival -count=1 && go test ./backpack -run '^TestEventBusesAreAppScoped$' -count=1 && go test -run '^$' ./examples/hello/... ./examples/hello/plugins/base/... ./examples/hello/plugins/greeter/... ./examples/hello/plugins/optional/... && (cd ../fonoteka.go && go test ./plugins/golem15/user -run '^TestGetApiArrayEventMerge$' -count=1)
<fails_when>non-zero exit; festival still exists at repo root; modules/festival missing; a named-test command shows FAIL or lacks its requested test; the compile-only examples command fails to build any workspace module</fails_when>
<acceptance_criteria>
- test -d modules/festival && test ! -d festival succeeds.
- go test ./modules/festival -count=1 prints PASS including TestFireRunsAllListenersAndJoinsErrors.
- go test -run '^$' ./examples/hello/... ./examples/hello/plugins/base/... ./examples/hello/plugins/greeter/... ./examples/hello/plugins/optional/... exits 0, compiling the greeter importer in its nested module context without depending on unrelated example runtime tests.
- grep -F 'git.golem15.com/golem15/summercms/modules/festival' backpack/app.go examples/hello/plugins/greeter/plugin.go ../fonoteka.go/plugins/golem15/user/classes/events_test.go prints a hit in each of those three files.
- A search of tracked *.go for a festival import that is not under /modules/ prints no production importer (the three files above use the modules/ form).
</acceptance_criteria>
festival lives at modules/festival, its three importers compile against the new path in the framework, examples workspace, and fonoteka contexts, and the moved package plus named importer tests pass.
Per D-04/D-05, rewrite every remaining importer in this repo (~100 files), examples/, and ../fonoteka.go (~124 files, including plugins/golem15/fonoteka and plugins/golem15/user) so the import is git.golem15.com/golem15/summercms/modules/<name>. Cover cmd/summer/, internal/build/build.go string literals, internal/build/build_test.go, internal/build/stubs/plugin.tmpl, registry.tmpl and artifacts.tmpl, and internal/dev/ if they name a beach import. Leave replace directives pointing at the summercms.go tree. Do not rewrite historical .planning/phases/** files.
Retarget path literals so later gates do not go red or pass vacuously on missing directories (D-05):
- scripts/check-admin-openapi.sh: --dir modules/cabana (keep --generalInfo admin_openapi.go)
- scripts/check-admin-dist.sh: compare and message against modules/boardwalk/dist
- admin/vite.config.ts: build.outDir '../modules/boardwalk/dist'
- scripts/check-phase2.sh and scripts/check-phase3.sh: --spec modules/tide/testdata/one-route-spec.yaml
- scripts/check-phase4.sh: go test -race paths ./modules/phrasebook ./modules/postcard
- scripts/check-phase9.sh: ./modules/bouncer ./modules/cabana ./modules/lagoon and the self-test Package string git.golem15.com/golem15/summercms/modules/lagoon
- scripts/check-phase10.sh: HYGIENE_DIRS boardwalk/cabana/phrasebook become modules/boardwalk modules/cabana modules/phrasebook; phase10_tests/phase10_go package dirs ./modules/cabana ./modules/bouncer ./modules/surf ./modules/boardwalk; hygiene greps of boardwalk/dist become modules/boardwalk/dist; self-test Package string git.golem15.com/golem15/summercms/modules/cabana
Do not remap names onto Winter system/backend/cms (D-06). Do not rebuild admin dist (files move with boardwalk). Do not add dependencies.
test -d modules/cabana && test ! -d cabana && test -d modules/boardwalk/dist && grep -F -- '--dir modules/cabana' scripts/check-admin-openapi.sh && grep -F 'modules/boardwalk/dist' scripts/check-admin-dist.sh admin/vite.config.ts && grep -F 'modules/tide/testdata/one-route-spec.yaml' scripts/check-phase2.sh scripts/check-phase3.sh && grep -F './modules/phrasebook' scripts/check-phase4.sh && grep -F './modules/lagoon' scripts/check-phase9.sh && grep -F './modules/cabana' scripts/check-phase10.sh && grep -F '../modules/boardwalk/dist' admin/vite.config.ts
<fails_when>non-zero exit; any of the 18 beach names still a directory at repo root; any listed grep prints no matching line</fails_when>
<acceptance_criteria>
- ls at repo root lists modules/, cmd/, admin/, examples/, internal/, scripts/ and does not list any of the 18 beach names as directories.
- git ls-files -- '*.go' '*.tmpl' '*.sh' filtered to this repo plus ../fonoteka.go, excluding .planning/, contains no import of git.golem15.com/golem15/summercms/<beach> that lacks /modules/.
- test -f go.mod && test ! -f modules/cabana/go.mod && test ! -f modules/festival/go.mod succeeds.
- grep -n 'use (' -A20 go.work still lists only . and ./examples/hello* entries.
- grep -F 'replace git.golem15.com/golem15/summercms => ../summercms.go' ../fonoteka.go/go.mod prints 1.
</acceptance_criteria>
All 18 packages live under modules/, every importer and listed script/stub/vite outDir uses the nested path, and root ls no longer shows beach directories.
<threat_model>
Trust Boundaries
| Boundary | Description |
|---|---|
| Importer → framework package path | A leftover root-form import fails the build or, worse, could compile against a shadow copy if a beach dir were left at root |
| Phase/admin scripts → on-disk package dirs | Greps over missing old directories return empty and can pass vacuously; testdata and swag --dir miss after the move |
| App repo replace → framework tree | replace stays; only import paths change. A mistaken replace rewrite would pull the wrong tree |
STRIDE Threat Register
| Threat ID | Category | Component | Severity | Disposition | Mitigation Plan |
|---|---|---|---|---|---|
| T-10.2-01 | Tampering | repo-root beach directories | high | mitigate | git mv only; Task 3 and later 10.2-02 gate refuse if any of the 18 names is still a directory at root |
| T-10.2-02 | Tampering | import paths in .go/.tmpl | high | mitigate | Rewrite every importer to the modules/ prefix; go test ./... in both repos fails closed on a missing package |
| T-10.2-03 | Tampering | scripts/check-phase*.sh, check-admin-*.sh, admin/vite.config.ts | high | mitigate | Retarget every listed path literal so hygiene greps scan modules/ and cannot pass on a missing old dir |
| T-10.2-04 | Tampering | modules/*/go.mod or go.work | medium | mitigate | Keep the single root go.mod (D-03); Task 2 acceptance asserts no per-package go.mod and unchanged go.work use list |
| T-10.2-05 | Tampering | package names | medium | mitigate | Keep beach package clauses (D-01/D-06); do not remap onto Winter system/backend/cms |
| T-10.2-SC | Tampering | npm/pip/cargo installs | high | mitigate | No new dependencies this plan; do not run npm install; T-10.2-SC stays reserved |
| </threat_model> |
<success_criteria>
lsat summercms.go root shows modules/, cmd/, admin/, examples/, internal/, scripts/ and none of the 18 beach directories.- No tracked .go/.tmpl/.sh importer still uses the root-form beach import.
- Both repos test green, and every examples/hello module vets and compiles. Scripts that later gates run now point at modules/. </success_criteria>