17 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, estimate_ref, actuals, plan_head_before, plan_head_after, coverage, duration, completed, status
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | estimate_ref | actuals | plan_head_before | plan_head_after | coverage | duration | completed | status | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 11.1-summercms-documentation-for-humans-and-ai-agents | 06 | docs |
|
|
|
|
|
|
|
|
|
tokens 120000, tasks 3, confidence low |
|
4c68d31862 |
85ce154640 |
|
29min | 2026-10-01 | complete |
Phase 11.1 Plan 06: Unit tests, planted-violation corpus and final gate Summary
Every docs checker rule now has a planted fixture that must fail for its own reason, internal/docsite is at 94.8% statement coverage, one acceptance subtest per success criterion passes on the real tree, and scripts/check-phase11.1.sh --all (with the new --named stage) prints phase11.1 all passed.
Performance
- Duration: about 29 min
- Started: 2026-09-30T21:47:19Z
- Completed: 2026-09-30T22:16Z
- Tasks: 3
- Files modified: 168 (144 of them fixture files)
Accomplishments
- Planted-violation corpus.
testdata/cleanis a small root with a go.mod, three sections, four guide pages, ademomodule with a README, an Example with// Output:, a Go region, a YAML region, links with anchors, commands and callouts. It passes Check, Build (6 pages) and Sync. There are 63 overlay cases undertestdata/violations, covering every rule: frontmatter (13 variants), site (2), section, page, readme (2), snippet (21, including confinement, run rules, unclosed fences and the go fence withoutsrc=), identifier (5, including the ambiguous package name), link and anchor (7), command (4), callout (2) and heading (4). Five more plants are built at run time: the forbidden name in a source, the accented variant, the forbidden name reaching only the outputs, a symlink out of the root and a symlink to a dotfile. - Coverage. New branch tests cover strict site.yaml, frontmatter splitting (including CRLF and BOM), README ingestion, module discovery, slug IDs, link rewriting for every link class, callouts, heading anchors, the TOC threshold, exact llms.txt and llms-full.txt shapes,
.mdsiblings, the search-index schema and its 300-rune cap, base_url prefixing, generic and grouped declarations, dedent, Sync preservation and all-or-nothing writes, every tok-* class for go, yaml, json and sh, the loopback policy, Handler branches, rebuild keeping the last good build, live watch rebuilds, the identifier index forms, the go doc fallback, command token forms and example command literals. Coverage went from 83.9% to 94.8%. - CLI tests.
docs:build --checkanddocs:buildprint each problem anddocs:build: N problems, nothing written. The tests also coverdocs:syncoutput (up to date, updated, problems) and thedocs:serverefusal. - Acceptance.
TestPhase11_1Acceptancechecks five things. SC1: the sections, the frontmatter and a sidebar entry for every module. SC2: every theme marker, the 4 assets and 8 fonts, noexecof node, npm or npx (checked with go/ast), and thatdocs:serveis registered. SC3: pages,.html,.md, llms.txt and llms-full.txt agree in reading order. SC4: zero problems, every go fence hassrc=, every Example has an output comment and every referenced directory is a root-module package. SC5: the concept map and walkthrough exist, every walkthrough go fence is asrc=copy ofdocs/examples/blog, andgo listincludes the blog packages. - Gate.
--self-testalso runs the corpus through ago test -jsondetector.--namedruns 42 docsite tests, 12 cmd/summer tests, the 11 walkthrough tests and every moduleTestDocs*and output Example by exact name.--allruns preconditions, deps, self-test, docs, forbidden, claude, named and go.
Task Commits
- Task 1: Tracer: planted fixture per rule, run by the gate:
1d38e73(test) - Task 2: Branch-level tests to 94.8% coverage, with three fixes:
28afd4d(test) - Task 3: Acceptance subtests and the final gate:
c1c9a9f(test); VALIDATION.md:9419d5d(docs) - Gate scratch cleanup on refusal, found in the final sweep:
85ce154(fix)
Plan metadata: f2413f6 added this file with STATE, ROADMAP and REQUIREMENTS; a second docs(11.1-06) commit records the cleanup fix
Files Created/Modified
See key-files in the frontmatter. internal/docsite/testdata/ holds the clean fixture (13 files) and the 63 case directories.
Decisions Made
See key-decisions in the frontmatter.
Deviations from Plan
Auto-fixed Issues
1. [Rule 3 - Blocking] The gate self-test baseline failed on the current tree
- Found during: Task 1
- Issue:
--self-testcopied only docs/, modules/, go.mod and go.sum. Since plan 11.1-03 the pages showgreeter:hello, a command the checker collects fromexamples/hello, so the unplanted scratch copy failed its baseline. - Fix: The scratch copy now also carries README.md and the tracked files of
examples/(viagit ls-files, which skips the 41 MB of built binaries inexamples/hello/bin). - Files modified: scripts/check-phase11.1.sh
- Commit:
1d38e73
2. [Rule 1 - Bug] CRLF and BOM pages got a misleading frontmatter message
- Found during: Task 2 (TestFrontmatterEncodingProblems failed first)
- Issue: A page with CRLF line endings or a UTF-8 BOM was told it "must start with a --- frontmatter block", which it does.
- Fix:
frontmatterBlockProblemnames the encoding ("the file uses CRLF line endings; save it with LF line endings", "the file starts with a UTF-8 byte order mark; save it without one"). The page is still refused. - Files modified: internal/docsite/load.go, internal/docsite/load_test.go
- Commit:
28afd4d
3. [Rule 1 - Bug] src=#Type.Method missed a parenthesised receiver
- Found during: Task 2 (TestSnippetGenericsAndGroups failed first on
Box.Paren) - Issue:
funcKeydid not unwrap*ast.ParenExpr, sofunc (b (*Box[T])) Paren()was keyedParenand#Box.Parenwas not found. The identifier index already handled this form. - Fix:
funcKeyunwraps parentheses. - Files modified: internal/docsite/snippet.go, internal/docsite/snippet_test.go
- Commit:
28afd4d
4. [Rule 1 - Bug] docs:serve could miss an edit made right after it announced itself
- Found during: Task 2 (TestServeWatchRebuilds timed out under
-race) - Issue:
Serveprinted the serving line before the watch goroutine had created its watcher and added its watches, so an early edit produced no rebuild. - Fix:
Servecreates the watcher and adds the watches before it listens and prints;watchtakes the watcher. With the fix, the serve tests pass 6 of 6 runs under-race. - Files modified: internal/docsite/serve.go, internal/docsite/serve_test.go
- Commit:
28afd4d
Plan adjustments
- Violation cases are overlays on the clean fixture rather than full copies. Each case is still one fault plus a
want.txt, and the test copies the clean root and applies the overlay int.TempDir(). - The corpus has 63 committed cases, not the 30 listed. The planned cases are all there, plus site, page, second readme, env file, backslash, unclean path, directory, no tests, unrun function and type, unparsable Go, unclosed fence, empty path, module and root README identifiers, ambiguous package, source-file, absolute and empty links, README links, app name used as a tool command, README command and callout, and autolink heading.
- The plan's "go doc fallback accepting a promoted member" cannot be tested as worded:
go docdoes not resolve promotion (plan 11.1-02 found this), and the index handles promotion itself.TestIdentifierGoDocFallbackshows that the fallback accepts a declared member, caches answers and never passes a non-identifier to the argv. It also shows that a member promoted from another package is still a problem after the fallback runs. testdata/violations/snippet-unparsable-go/lib/lib.godoes not parse on purpose, so a repository-widegofmt -llists it. No gate runs gofmt, and the go tool ignorestestdata.
5. [Rule 1 - Bug] The docs gate left its scratch copy in /tmp on a refusal
- Found during: the final cleanup sweep (two 48 MB
/tmp/tmp.*directories from the Task 1 baseline refusals) - Issue: Every stage removed its
mktempdirectory with a RETURN trap, but a refusal exits from inside the stage, so the trap never ran. - Fix: An EXIT trap removes every stage's scratch paths. The self-test now copies
examples/withtar --exclude='examples/*/bin'instead ofgit ls-files, so aPHASE11_1_ROOTcopy without.gitworks. A planted refusal against a scratch copy left the/tmp/tmp.*count unchanged (29 before and after), and the two leaked directories were removed. - Files modified: scripts/check-phase11.1.sh
- Commit:
85ce154
Total deviations: 5 auto-fixed (1 blocking, 4 bugs). The three Go fixes each landed with a test that failed before the fix and passed after it. Impact: none on scope.
Mutation and refusal checks (run once by hand)
- In a scratch copy of the repository, deleting the body of the identifier checker's miss branch (
checkIdentifiers) madeTestPlantedViolations/identifier-unknown,identifier-unknown-member,identifier-module-readmeandidentifier-root-readmefail. - In a scratch copy with
PHASE11_1_ROOTpointing at it, renamingTestPlantedViolationsmade--namedrefuse withrefuse: named tests did not pass (missing, renamed or filtered out): .../internal/docsite TestPlantedViolations. RemovingTestCleanFixturerefused the same way, and addingt.Skipto it refused withrefuse: skipped .../internal/docsite TestCleanFixture. - Appending a go fence without
src=todocs/index.mdmadeTestPhase11_1Acceptancefail. The file was restored withgit checkout -- docs/index.md.
Issues Encountered
- None beyond the deviations.
go.work.sum,.gsd/, thesummerbinary and the other pre-existing untracked files were not staged..planning/milestone.lockand.planning/state.jsonwere left unstaged.
Verification
go vet ./...is clean.go test ./... -count=1(Docker) exits 0 with 35okpackages and no FAIL line.go test -race ./internal/docsitepasses.- Coverage of
go test ./internal/docsite -count=1 -coverprofileis 94.8%. go test ./internal/docsite -run '^TestPlantedViolations$' -count=1 -vprints 68--- PASS: TestPlantedViolations/lines.go test ./cmd/summer -run '^TestPhase11_1Acceptance$' -count=1 -vprints 5--- PASS: TestPhase11_1Acceptance/SClines.scripts/check-phase11.1.sh --allprintsphase11.1 all passed(2m39s, and again in 1m49s after the cleanup fix).- Every automated row command in 11.1-VALIDATION.md for plans 01 to 06 exits 0.
grep -rniE 'fonoteka|p(l|ł)ytarium' internal/docsite/testdata internal/docsite/violations_test.gofinds nothing.
Known Stubs
None. The new files are tests and fixtures.
User Setup Required
None.
Next Phase Readiness
Phase 11.1 is ready for /gsd-verify-work. The two manual UAT rows (search, and dark mode across widths and without JS) are the only open items. Phase 11.2 can serve the built docs as they are, and it can reuse the --named detector pattern.
Self-Check: PASSED
All 10 key created files exist, 63 case directories are present, and commits 1d38e73, 28afd4d, c1c9a9f, 9419d5d, f2413f6 and 85ce154 are in the log.