docs(11.1): add a resume point after Task 3 to plan 11.1-07

Tasks 1 to 3 record their commits, Deviation: body lines and a
state.record-session line naming PLAN_BASE, so Tasks 4 and 5 can resume
in a fresh context. Their read_first lists now name only the symbols and
helpers they use. The plan stays single and autonomous.
This commit is contained in:
Jakub Zych
2026-10-01 01:51:47 +02:00
parent f78a677eb2
commit 209e44cfd7

View File

@@ -138,6 +138,8 @@ Out of scope (not cited by the verification gaps): WR-06, WR-07, IN-01, IN-03 to
Repository conventions: stdlib `testing` only in these packages (no testify), `t.TempDir()` fixtures, `t.Fatalf("x = %v, want %v")`. goldmark v1.8.6 and chroma/v2 v2.27.0 are already in go.mod; go/ast, go/build, go/doc and go/parser are stdlib: this plan adds no dependency (D-02, D-15) and go.mod/go.sum must not change. `go vet ./...` and `go test ./...` stay green at every commit. Commits: one logical change each, code and planning docs in separate commits, no co-author tags. Stage only each task's files (the worktree has unrelated untracked files). Repository conventions: stdlib `testing` only in these packages (no testify), `t.TempDir()` fixtures, `t.Fatalf("x = %v, want %v")`. goldmark v1.8.6 and chroma/v2 v2.27.0 are already in go.mod; go/ast, go/build, go/doc and go/parser are stdlib: this plan adds no dependency (D-02, D-15) and go.mod/go.sum must not change. `go vet ./...` and `go test ./...` stay green at every commit. Commits: one logical change each, code and planning docs in separate commits, no co-author tags. Stage only each task's files (the worktree has unrelated untracked files).
Planted-fixture format (from violations_test.go): each `testdata/violations/{case}/` holds only the files that differ from `testdata/clean/` (copied over it at the same relative path), an optional `remove.txt`, and a `want.txt` with `rule: ...`, optional `file: ...`, `message: ...` (substring). A case passes only when Check reports exactly one problem matching it, and Build refuses the tree. The clean fixture's `docs/extras/faq.md` ends with a text fence; new plants append after it. Planted-fixture format (from violations_test.go): each `testdata/violations/{case}/` holds only the files that differ from `testdata/clean/` (copied over it at the same relative path), an optional `remove.txt`, and a `want.txt` with `rule: ...`, optional `file: ...`, `message: ...` (substring). A case passes only when Check reports exactly one problem matching it, and Build refuses the tree. The clean fixture's `docs/extras/faq.md` ends with a text fence; new plants append after it.
Resume point: this plan has a recorded seam after Task 3 (see `<resume_point>` after `</tasks>`). Tasks 1 to 3 each write any deviation into their commit body as a `Deviation: ...` line. Before starting Task 1, check the seam: when Tasks 1 to 3 are already committed, start at Task 4 and load only what `<resume_point>` lists instead of the source files above.
</context> </context>
<tasks> <tasks>
@@ -247,6 +249,8 @@ Identifier and command forms (D-12, DOCS-05, gap 3):
5. `check_commands.go`: replace the `commandToken` regex with `commandWord(cmd string) (name string, tool bool, ok bool)` over `strings.Fields` of the trimmed command: drop a leading "$" prompt token; skip leading assignment tokens (a name of letters, digits and underscores not starting with a digit, then "="); the program is `summer` (tool), the three tokens `go run ./cmd/summer` (tool), or `./bin/{app}` or `bin/{app}` with app in [A-Za-z0-9._-]+ (application); anything else is not a command (ok false). After the program, find the command word the way cobra's stripFlags does for a root whose only flag is the bool --help/-h: "--" ends the search with no word; a token starting with "-" that contains "=" is skipped alone; "--help" and "-h" are skipped alone; any other "--name" or two-character "-x" also consumes the next token, and when only that value remains there is no word; other "-" tokens are skipped alone; the first remaining token is the word. `checkCommands` uses it (tool words against the tool set, application words against the app set) with the existing separators and message. 5. `check_commands.go`: replace the `commandToken` regex with `commandWord(cmd string) (name string, tool bool, ok bool)` over `strings.Fields` of the trimmed command: drop a leading "$" prompt token; skip leading assignment tokens (a name of letters, digits and underscores not starting with a digit, then "="); the program is `summer` (tool), the three tokens `go run ./cmd/summer` (tool), or `./bin/{app}` or `bin/{app}` with app in [A-Za-z0-9._-]+ (application); anything else is not a command (ok false). After the program, find the command word the way cobra's stripFlags does for a root whose only flag is the bool --help/-h: "--" ends the search with no word; a token starting with "-" that contains "=" is skipped alone; "--help" and "-h" are skipped alone; any other "--name" or two-character "-x" also consumes the next token, and when only that value remains there is no word; other "-" tokens are skipped alone; the first remaining token is the word. `checkCommands` uses it (tool words against the tool set, application words against the app set) with the existing separators and message.
6. docs/console/utilities.md: add one sentence to the same paragraph: a `src=` target must be code `go test ./...` compiles and runs, that is a file in the default build, inside a `Test` function or an `Example` with an `// Output:` comment, or a function one of them calls. 6. docs/console/utilities.md: add one sentence to the same paragraph: a `src=` target must be code `go test ./...` compiles and runs, that is a file in the default build, inside a `Test` function or an `Example` with an `// Output:` comment, or a function one of them calls.
Commit as `fix(11.1-07): require built, run src= code; case-sensitive go doc; parse command forms`. Commit as `fix(11.1-07): require built, run src= code; case-sensitive go doc; parse command forms`.
7. Resume point (after the commit): record progress as `<resume_point>` "Recording" describes (the three task subjects and their `Deviation:` body lines are in git; `state.record-session` names PLAN_BASE and Task 4), then go straight on to Task 4 in the same run. This is not a checkpoint: the executor does not stop and the plan stays autonomous.
</action> </action>
<verify> <verify>
<automated>go vet ./... && go test ./internal/docsite ./cmd/summer -count=1</automated> <automated>go vet ./... && go test ./internal/docsite ./cmd/summer -count=1</automated>
@@ -266,8 +270,9 @@ Commit as `fix(11.1-07): require built, run src= code; case-sensitive go doc; pa
- `grep -n 'func commandWord' internal/docsite/check_commands.go` finds one match. - `grep -n 'func commandWord' internal/docsite/check_commands.go` finds one match.
- `go test ./internal/docsite -run '^(TestSnippetGenericsAndGroups|TestSnippetTestGraph|TestSnippetConfinement|TestSnippetForms|TestIdentifierGoDocFallback|TestCommandTokenForms|TestCommandChecker)$' -count=1` passes. - `go test ./internal/docsite -run '^(TestSnippetGenericsAndGroups|TestSnippetTestGraph|TestSnippetConfinement|TestSnippetForms|TestIdentifierGoDocFallback|TestCommandTokenForms|TestCommandChecker)$' -count=1` passes.
- Each of the three planted commands prints its expected problem line, and `go run ./cmd/summer docs:build --check` prints `docs:build: no problems found`. - Each of the three planted commands prints its expected problem line, and `go run ./cmd/summer docs:build --check` prints `docs:build: no problems found`.
- Resume point recorded: `git log --format=%s -E --grep='^fix\(11\.1-07\): '` lists the Task 1, Task 2 and Task 3 subjects, `grep -n 'resume at Task 4' .planning/STATE.md` finds the stopped-at line, and `11.1-07-SUMMARY.md` does not exist yet.
</acceptance_criteria> </acceptance_criteria>
<done>Only code go test compiles and runs counts as verified, identifier spans must match case exactly, and env-prefix, flag-first, go run and bin/ command forms are checked.</done> <done>Only code go test compiles and runs counts as verified, identifier spans must match case exactly, and env-prefix, flag-first, go run and bin/ command forms are checked; the resume point after Task 3 is recorded.</done>
</task> </task>
<task type="auto" tdd="true"> <task type="auto" tdd="true">
@@ -277,8 +282,9 @@ Commit as `fix(11.1-07): require built, run src= code; case-sensitive go doc; pa
- internal/docsite/violations_test.go (plantCase, parseWant, assertOneProblem, TestCleanFixture) - internal/docsite/violations_test.go (plantCase, parseWant, assertOneProblem, TestCleanFixture)
- internal/docsite/testdata/clean/ (docs/extras/faq.md, modules/demo/demo.go, demo_test.go, example_test.go, README.md) - internal/docsite/testdata/clean/ (docs/extras/faq.md, modules/demo/demo.go, demo_test.go, example_test.go, README.md)
- internal/docsite/testdata/violations/snippet-unrun-func/ and go-fence-no-src/ (overlay examples) - internal/docsite/testdata/violations/snippet-unrun-func/ and go-fence-no-src/ (overlay examples)
- internal/docsite/docsite_test.go (page, fixtureCommands, snippetTree, writeTree helpers), checks_test.go (checkFixture, assertProblems), render_test.go (renderFixture, renderHTML), snippet_test.go (genericTree, writeFile) - the named test helpers only, each located with `grep -n 'func {name}('` and read by line range, not the whole file: internal/docsite/docsite_test.go (page, fixtureCommands, snippetTree, writeTree), checks_test.go (checkFixture, assertProblems, writeFile), render_test.go (renderFixture, renderHTML), snippet_test.go (genericTree)
- internal/docsite/fences.go, snippet.go, check_policy.go, check_commands.go, check_identifiers.go, highlight.go as changed by Tasks 1 to 3 - internal/docsite/fences.go (whole file, new in Task 1)
- from the other files Tasks 1 to 3 changed, only the symbols these tests call or match, located with `grep -n` and read by range: snippet.go (nestedSrcMessage, readmeSrcMessage, notRunMessage, buildPackage, isTestName, loadTestGraph, Sync), highlight.go (goLang), check_commands.go (commandWord), check_identifiers.go (the identIndex methods goDoc and checkSpan), render.go (openFence). "Artifacts this phase produces" lists their signatures; check_policy.go, REVIEW.md and VERIFICATION.md are not needed (the fixtures below state every expected message)
</read_first> </read_first>
<behavior> <behavior>
- Each new violation case yields exactly one problem with its own rule and message, and Build writes nothing. - Each new violation case yields exactly one problem with its own rule and message, and Build writes nothing.
@@ -345,9 +351,9 @@ Commit as `test(11.1-07): planted fixtures and unit tests for fence, execution a
<read_first> <read_first>
- cmd/summer/phase11_1_acceptance_test.go (TestPhase11_1Acceptance SC4 and SC5, docFence, pageFences, docsGoFences, buildRealTree output `out`) - cmd/summer/phase11_1_acceptance_test.go (TestPhase11_1Acceptance SC4 and SC5, docFence, pageFences, docsGoFences, buildRealTree output `out`)
- scripts/check-phase11.1.sh (run_self_test, expect_refusal, restore, DOCSITE_TESTS, SUMMER_TESTS, run_named, --all) - scripts/check-phase11.1.sh (run_self_test, expect_refusal, restore, DOCSITE_TESTS, SUMMER_TESTS, run_named, --all)
- .planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-VALIDATION.md (Per-Task Verification Map format) - .planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-VALIDATION.md (frontmatter and the Per-Task Verification Map section only)
- .planning/todos/pending/readme-go-fences-src.md - .planning/todos/pending/readme-go-fences-src.md
- .planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-VERIFICATION.md gap 1 (acceptance scanner item) - no docsite source file and not 11.1-VERIFICATION.md: action step 1 states every scanner requirement from gap 1, the acceptance scanner must not share docsite's code, and each VALIDATION row's command is the one in that task's `<verify>` above
</read_first> </read_first>
<precondition>The Docker daemon is reachable (`docker info` exits 0): the gate's --named and --go stages run the walkthrough's Postgres tests without -short.</precondition> <precondition>The Docker daemon is reachable (`docker info` exits 0): the gate's --named and --go stages run the walkthrough's Postgres tests without -short.</precondition>
<action> <action>
@@ -379,13 +385,29 @@ Commit code as `test(11.1-07): acceptance scanner sees blockquoted and aliased f
- `scripts/check-phase11.1.sh --all` prints `phase11.1 all passed`. - `scripts/check-phase11.1.sh --all` prints `phase11.1 all passed`.
- `grep -c '11.1-07-T' .planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-VALIDATION.md` prints at least 5, and `grep -n '^status: validated$' .planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-VALIDATION.md` finds a match. - `grep -c '11.1-07-T' .planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-VALIDATION.md` prints at least 5, and `grep -n '^status: validated$' .planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-VALIDATION.md` finds a match.
- `grep -n '11.1-07' .planning/todos/pending/readme-go-fences-src.md` finds the added paragraph. - `grep -n '11.1-07' .planning/todos/pending/readme-go-fences-src.md` finds the added paragraph.
- `scripts/check-phase11.1.sh --deps` passes, and `git diff --exit-code "$PLAN_BASE" HEAD -- go.mod go.sum` exits 0, where PLAN_BASE is the sha `git rev-parse HEAD` printed before Task 1's first commit (named in the SUMMARY): this plan adds no dependency. - `scripts/check-phase11.1.sh --deps` passes, and `git diff --exit-code "$PLAN_BASE" HEAD -- go.mod go.sum` exits 0, where PLAN_BASE is the sha `git rev-parse HEAD` printed before Task 1's first commit (recorded at the resume point, derivable per `<resume_point>`, and named in the SUMMARY): this plan adds no dependency.
</acceptance_criteria> </acceptance_criteria>
<done>The acceptance test's own scanner would catch every CR-01/WR-04 form and cross-checks captions, the gate plants each hole and requires every new test by name, and VALIDATION and the README todo reflect plan 07.</done> <done>The acceptance test's own scanner would catch every CR-01/WR-04 form and cross-checks captions, the gate plants each hole and requires every new test by name, and VALIDATION and the README todo reflect plan 07.</done>
</task> </task>
</tasks> </tasks>
<resume_point after="Task 3">
Tasks 1 to 3 change production code and docs; Tasks 4 and 5 add only fixtures, tests, the gate and planning docs. That seam lets Tasks 4 and 5 finish in a fresh context when the 180k-token run does not fit one, without splitting the plan (locked: one gap-closure plan) and without a checkpoint (the executor does not stop at the seam; the plan stays autonomous).
Recording (Task 3 step 7, after the Task 3 commit):
1. The git log is the progress record. Tasks 1 to 3 commit with the exact subjects their actions name, so `git log --format='%h %s' -E --grep='^fix\(11\.1-07\): '` lists them. Each of those commits carries in its body one `Deviation: ...` line per deviation (a production defect fixed, a real-tree page or source changed to pass a new check, an existing test fixture corrected), so the SUMMARY can be written without the context that made them.
2. Run `gsd_run query state.record-session --stopped-at "11.1-07 Tasks 1-3 committed (PLAN_BASE {sha}); resume at Task 4" --resume-file ".planning/phases/11.1-summercms-documentation-for-humans-and-ai-agents/11.1-07-PLAN.md"`, where {sha} is the PLAN_BASE printed before Task 1. Do not stage STATE.md here; the plan's close-out metadata commit carries it. Do not create 11.1-07-SUMMARY.md at the seam: a SUMMARY on disk marks the plan complete to execute-phase.
3. Continue with Task 4 in the same run.
Resuming (a fresh executor on this plan, spawned with `<completed_tasks>` or re-dispatched):
1. Before Task 1, run the git log command from Recording step 1. When it lists the Task 1, 2 and 3 subjects, do not redo or revert those tasks: start at Task 4. When it lists fewer, the seam was not reached: start at the first task whose subject is missing, after checking `git status` for that task's uncommitted edits.
2. Confirm the committed half once before Task 4: `go vet ./... && go test ./internal/docsite ./cmd/summer -count=1` passes and `go run ./cmd/summer docs:build --check` prints `docs:build: no problems found`. Fix a failure at its source in Task 4's commit and record it as a deviation.
3. PLAN_BASE comes from STATE.md's stopped-at line; if that line has been overwritten, it is the parent of Task 1's commit: `git rev-parse "$(git log --format=%H -F --grep='fix(11.1-07): find src= fences in the goldmark AST' -1)^"`.
4. Load only STATE.md, 11.1-CONTEXT.md (D-07, D-12, D-15, D-18), this plan and the `<read_first>` entries of Tasks 4 and 5. Skip the source files, REVIEW.md, VERIFICATION.md and 11.1-06-SUMMARY.md listed in `<context>`; "Artifacts this phase produces" lists every signature Tasks 4 and 5 call.
5. Build the SUMMARY's Tasks 1 to 3 entries (commits, deviations) from `git log --format='%h %s%n%b' -E --grep='^fix\(11\.1-07\): '`.
</resume_point>
<assumption_delta_decision> <assumption_delta_decision>
The assumption-delta detector fired on two pluralization cues ("another", "also") in the ROADMAP success-criteria prose, not on a model change. This plan tightens checker rules; no identity noun changes (a page, a fence, a src= reference and a module stay what they were). Decision: no-change. The assumption-delta detector fired on two pluralization cues ("another", "also") in the ROADMAP success-criteria prose, not on a model change. This plan tightens checker rules; no identity noun changes (a page, a fence, a src= reference and a module stay what they were). Decision: no-change.
</assumption_delta_decision> </assumption_delta_decision>
@@ -448,7 +470,7 @@ The assumption-delta detector fired on two pluralization cues ("another", "also"
| CONTEXT | D-15 | chroma/v2 only; reused for alias detection, no new dependency | 2 | COVERED | | CONTEXT | D-15 | chroma/v2 only; reused for alias detection, no new dependency | 2 | COVERED |
| CONTEXT | D-18 | README fences rendered as written: src= refused there, never captioned | 1, 2 | COVERED | | CONTEXT | D-18 | README fences rendered as written: src= refused there, never captioned | 1, 2 | COVERED |
Task count note: the user locked exactly one gap-closure plan carrying its own tests at the plan-count checkpoint, so this plan has five tasks (tracer, two expansion tasks, two closing test tasks) instead of the default two or three. Task count note: the user locked exactly one gap-closure plan carrying its own tests at the plan-count checkpoint, so this plan has five tasks (tracer, two expansion tasks, two closing test tasks) instead of the default two or three. To keep that within a context budget, `<resume_point>` records a seam after Task 3 (task commits with `Deviation:` bodies, a `state.record-session` line naming PLAN_BASE) so Tasks 4 and 5 can resume in a fresh context, and their `<read_first>` lists name only the symbols and helpers they use.
## Artifacts this phase produces ## Artifacts this phase produces