Skip to content

audit follow-up: bring PR-A + PR-B into main + bump VERSION to 0.1.3#18

Merged
oubiwann merged 3 commits into
mainfrom
audit/0014-go-quality-audit
May 8, 2026
Merged

audit follow-up: bring PR-A + PR-B into main + bump VERSION to 0.1.3#18
oubiwann merged 3 commits into
mainfrom
audit/0014-go-quality-audit

Conversation

@oubiwann

@oubiwann oubiwann commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Brings the merged PR-A (#16) and PR-B (#17) content from audit/0014-go-quality-audit into main, plus a release-prep VERSION bump from 0.1.2 → 0.1.3.

PR #15 (the audit doc + CDC verification + 0015 plan) already merged to main; this PR carries only the action layer that landed on the audit branch afterward.

What's in this PR

Code / doc changes from PR-A (#16) — documentation pass closing 14 findings

  • F-1: cite (AP-02)(AP-13) at pkg/golist/errors.go
  • F-2: cite EH-08CC-08 + post-hoc-vs-propagation rationale at pkg/golist/golist.go
  • F-3: same fix at internal/cli/seam.go
  • F-4: rationale strengthened in both classifier comments (PR-C declined per plan recommendation)
  • F-6: "Parallel-unsafe" header on 4 seam-test files
  • F-7: cross-reference comment in cli_test.go (decline-with-doc)
  • F-8: internal/cli/helpers_test.go deleted; writeAll inlined
  • F-9: inline-map subtest name → struct table
  • F-10/F-11: post-bug-v0.1.0: silent empty output when --root is relative (default '.' is broken in real-world CI use) #12 doc/comment drift rewritten in pkg/changeset
  • F-12: PS-06 carry-forward note in CLAUDE.md Architecture §
  • F-13: dead _ = io.EOF placeholder removed
  • F-15: moduleRootSet doc-commented; flag stays
  • F-16: AP-07 deviation paragraph at version.go var block
  • PROMPT-1: audit-prompt cite TD-09 / IM-04IM-12 / TD-09

Code changes from PR-B (#17) — cousin-shape symmetry

  • F-5: *GitDiffError.Dir field added; populated from cfg.root (was discarded)
  • F-14: gitDiffResult.argv added; synthetic argv reconstruction at the cli call site removed (cannot drift from real exec)

Release prep

  • internal/project/VERSION: 0.1.2 → 0.1.3 (matches the b1a0c03 micro-bump pattern)

Diff scope

17 files changed, 168 insertions / 39 deletions:

  • 16 files from PR-A + PR-B (all already reviewed and merged into the audit branch)
  • 1 file VERSION bump

Test plan

  • make check (build + lint via golangci-lint + go test -race -count=1 ./...) — passes locally on this branch tip
  • Confirm VERSION reads 0.1.3 (cat internal/project/VERSION; should be 5 bytes, no trailing newline — symlink at ./VERSION reflects)
  • cascade --version against a built binary reports 0.1.3 once merged + tagged
  • Spot-check a representative finding closure: e.g., grep -n 'AP-13' pkg/golist/errors.go should hit; grep -n 'AP-02' pkg/golist/errors.go should miss
  • Spot-check cousin-shape parity: grep -n 'Dir ' internal/cli/errors.go pkg/golist/errors.go should show both types carry the field

Closure ledger reference

docs/dev/0014-go-quality-audit.md (already on main from PR #15) carries the per-finding closure walks for PR-A (above the existing ## Closure heading) and PR-B (appended at the bottom of the file). When this PR merges, every audit finding will be closed on main.

🤖 Generated with Claude Code

oubiwann added 3 commits May 8, 2026 03:21
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.
Per docs/dev/0015-audit-follow-up-plan-address-all-16-findings.md.

F-5: *GitDiffError grows a Dir field, mirroring *golist.ExitError's
shape. classifyGitDiffError's third parameter changes from `_` to
`dir string`; the caller at internal/cli/cli.go passes cfg.root which
is now stored on the diagnostic instead of discarded. Assertion added
in TestClassifyGitDiffError/exec_exit_error verifies ge.Dir == "/m".

F-14: gitDiffResult gains argv []string. defaultRunGitDiff constructs
argv once and uses it both for exec.CommandContext and as the returned
diagnostic argv — the two paths can no longer drift. The synthetic
argv reconstruction at cli.go's loadChangeSet (the dead-letter that
the audit flagged) is removed; the call site now reads res.argv.

Tests that synthesize gitDiffResult without setting argv produce nil
Cmd in the diagnostic; acceptable for the existing tests (none assert
on Cmd) and a future test that needs argv sets it on the synthetic.

Audit doc 0014 grows a "Post-audit closure — PR-B" section at the
bottom (separate from PR-A's closure walk to avoid merge conflict).

make check passes: build + lint (golangci-lint clean) + test
(go test -race -count=1 ./...) all green.

Closes the last 2 of 16 audit findings + 1 meta-finding (PROMPT-1)
when both PR-A and PR-B land on main.
Picks up the audit follow-up content (PR-A + PR-B) merging into main.
Matches the b1a0c03 micro-bump pattern.
@oubiwann oubiwann force-pushed the audit/0014-go-quality-audit branch from 49c8162 to d14ad7e Compare May 8, 2026 08:24
@oubiwann oubiwann merged commit 5e6d0e5 into main May 8, 2026
3 checks passed
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