Skip to content

audit follow-up PR-A: documentation pass (14 findings)#16

Merged
oubiwann merged 1 commit into
audit/0014-go-quality-auditfrom
audit/follow-up-pr-a-doc-pass
May 8, 2026
Merged

audit follow-up PR-A: documentation pass (14 findings)#16
oubiwann merged 1 commit into
audit/0014-go-quality-auditfrom
audit/follow-up-pr-a-doc-pass

Conversation

@oubiwann

@oubiwann oubiwann commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes 14 of 16 findings from PR #15's audit, plus the meta-finding PROMPT-1. No behavioral changes — every edit is a comment, doc, test-helper, or test-table refactor that the substrate flagged. make check (build + lint via golangci-lint + go test -race -count=1 ./...) passes against this branch.

Per the disposition rows in docs/dev/0015-audit-follow-up-plan-address-all-16-findings.md. Single commit per the plan's PR-A scope.

Findings closed

ID Finding Resolution
F-1 (AP-02) cite for the string-match-Error rule (AP-13) at pkg/golist/errors.go:16
F-2 EH-08 cite for ctx-ordering rule CC-08 + post-hoc-vs-propagation rationale at pkg/golist/golist.go:204-211
F-3 Same wrong cite at internal/cli/seam.go:62-69 Same fix, mirroring rationale
F-4 ctx-as-last-param rationale Strengthened inline; PR-C (substrate-align refactor) declined per plan recommendation
F-6 Latent t.Parallel() risk against package-level seams "Parallel-unsafe" header on 4 seam-test files
F-7 Test-helper duplication (withMetadata vs inline save/restore) Decline-with-cross-reference in cli_test.go
F-8 internal/cli/helpers_test.go's 8-line writeAll wraps writeFile Inlined; file deleted
F-9 Inline-map subtest name in golist_test.go:106 Refactored to struct table with name field
F-10 Doc lies post-bug-#12 ("moduleRoot stays empty") Rewritten to describe actual behaviour at pkg/changeset/changeset.go:65-75
F-11 Same drift in internal comment Rewritten at changeset.go:113-118
F-12 pkg/ layout vs PS-06 SHOULD-AVOID Carry-forward note in CLAUDE.md Architecture §
F-13 Dead _ = io.EOF placeholder + comment Removed at pkg/golist/golist.go
F-15 moduleRootSet exists for test-driven design Documented at the field declaration
F-16 Mutable build-info globals (AP-07) "AP-07 deviation (acknowledged)" paragraph at version.go:54-71 (link-time vs runtime; kubectl/hugo/cobra precedent; no t.Parallel())
PROMPT-1 Audit prompt's TD-09 / IM-04 mis-pair IM-12 / TD-09 at workbench/cc-audit-prompt-go-quality.md

S-1 (citation drift, 3 instances + meta): closed.
S-2 (seam pattern + no-t.Parallel() discipline): closed at the doc layer; structural enforcement (custom vet linter) logged as v1.0+ future work.

Diff scope

14 files modified, 1 deleted (internal/cli/helpers_test.go); 120 insertions / 30 deletions. Plan estimated ~25 lines net change; the AP-07 / PS-06 / F-4 doc-strengthen paragraphs make the actual delta larger but still scope-clean.

Test plan

  • make check (build + lint + test)
  • Spot-check 2-3 cite fixes (F-1, F-2, F-3) against the cited file:line
  • Confirm helpers_test.go is gone and writeFile works (test passes)
  • Read the F-10/F-11 changeset doc rewrite for accuracy against the actual getCwd + filepath.Abs flow
  • Read CLAUDE.md's PS-06 carry-forward note
  • gh pr view 15 for the audit + CDC context

Stacking

Base: audit/0014-go-quality-audit (PR #15). After PR #15 merges, this PR's base can be retargeted to main.

PR-B (audit/follow-up-pr-b-cousin-shape, closing F-5 + F-14) is parallel; not stacked on this branch.

🤖 Generated with Claude Code

Per docs/dev/0015-audit-follow-up-plan-address-all-16-findings.md.
No behavioral changes; comment / doc / test-helper edits only.

Findings closed:
- F-1 cite AP-02 → AP-13 (pkg/golist/errors.go:16)
- F-2 cite EH-08 → CC-08 + post-hoc-vs-propagation rationale
  (pkg/golist/golist.go:204-211)
- F-3 cite EH-08 → CC-08 + same rationale (internal/cli/seam.go:62-69)
- F-4 rationale strengthened in both classifier comments above
  (PR-C ctx-first refactor declined per work-order recommendation)
- F-6 "Parallel-unsafe" header on each with*Seam test file (4 files)
- F-7 cross-reference comment in cli_test.go:TestRun_Version pointing
  at version_test.withMetadata as the canonical pattern
- F-8 inline writeAll into writeFile; delete helpers_test.go
- F-9 inline-map subtest name → struct table in golist_test.go
- F-10/F-11 changeset doc + internal comment rewritten to describe
  actual post-bug-#12 behaviour (filepath.Abs("") → cwd, not "stays
  empty")
- F-12 PS-06 deviation note added to CLAUDE.md Architecture §
  (carry-forward to v1.0)
- F-13 dead `_ = io.EOF` placeholder + comment removed
- F-15 moduleRootSet config field doc-commented; flag stays
- F-16 AP-07 deviation paragraph added at version.go var block
  (link-time vs runtime; kubectl/hugo/cobra precedent; no t.Parallel)
- PROMPT-1 audit-prompt cite TD-09/IM-04 → IM-12/TD-09 in
  workbench/cc-audit-prompt-go-quality.md

S-1 (citation drift): closed; all 3 concrete + 1 meta instance fixed.
S-2 (seam-pattern discipline): closed at the doc layer; structural
enforcement (vet linter) logged as v1.0+ future work.

F-5, F-14 deferred to PR-B (cousin-shape symmetry).

make check passes: build + lint (golangci-lint clean) + test
(go test -race -count=1 ./...) all green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant