Implement docs/prds/static-analysis-gate.md. Enable gosec in .golangci.yml with a curated rule set (G101, G103, G204, G304, G404 excluded with recorded reasons), exclude generated contract code, testdata/ and the diagnostics skill scripts by path, and land the adopted-rule fixes so task lint starts clean with no unexplained suppression.
Notes
Measured gate baseline differs from the first ad-hoc scan. Enabling gosec through golangci-lint over the module reports 227 findings: 41 in shipped code, 186 in test files. golangci-lint drops generated contract and sqlc files via exclusions.generated and never reads testdata or dot-directories, so G103 and the generated G101 sites do not appear at all. Rules present only in the golangci run: G120, G602, G705, G710. Decision: add a _test.go exclusion for gosec (186 of 227 findings) rather than suppress test fixtures. Two test-file G115 sites (internal/daemon/daemon_test.go, internal/gateway/redelivery_test.go) are deliberately deferred to that decision, because annotating them is dead work if gosec does not run on tests.
Gate-ordering trap: the docsite enumerates PRD pages from git ls-files, so a PRD that is untracked when task check runs is invisible to docs:artifact:check. The check therefore passes, and the commit that adds the PRD makes dev-docs.json stale retroactively. Stage new files before running task check, or regenerate the artifact and verify after the file becomes tracked.
Complete. gosec is enabled in .golangci.yml and reaches the gate through task lint -> task check -> the quality workflow, covering the tools module through the same config. Four rules are excluded with a recorded reason (G101, G204, G304, G404) and gosec is scoped out of _test.go, which removes 186 of the 227 findings. Every shipped-code finding under an adopted rule is fixed or annotated with a checkable reason. task lint reports zero issues in both modules, and removing a suppression makes it fail (verified: 4 G124 issues, exit 1). Follow-up filed for the one gap: G301/G302 are silenced by the inherited legacy exclusion preset, so the directory-mode half of the class table is review-enforced.
REJECTED AND REVERTED. The maintainer rejected this approach on the ground that gosec does not need to run constantly and task check is already slow and compute heavy. Every part of it is reverted: .golangci.yml is byte-identical to the base revision, the PRD is deleted, all 42 inline nolint:gosec annotations are removed, and the dev-docs artifact is back to its base content. The genuine defects the review surfaced are kept as separate fixes: temp-file close results, ReadHeaderTimeout on the webhook receivers, the forge line-number bound and the tar mode mask. No further work until a decoupled design exists -- the constraint is that a scanner must not run on every task check.
Close reason
Closed
Imported from beads archie-core-2ptu · GitHub #1452 · type epic · priority P2 · created 2026-10-02 · closed 2026-10-02
Implement docs/prds/static-analysis-gate.md. Enable gosec in .golangci.yml with a curated rule set (G101, G103, G204, G304, G404 excluded with recorded reasons), exclude generated contract code, testdata/ and the diagnostics skill scripts by path, and land the adopted-rule fixes so task lint starts clean with no unexplained suppression.
### Notes
Measured gate baseline differs from the first ad-hoc scan. Enabling gosec through golangci-lint over the module reports 227 findings: 41 in shipped code, 186 in test files. golangci-lint drops generated contract and sqlc files via exclusions.generated and never reads testdata or dot-directories, so G103 and the generated G101 sites do not appear at all. Rules present only in the golangci run: G120, G602, G705, G710. Decision: add a _test.go exclusion for gosec (186 of 227 findings) rather than suppress test fixtures. Two test-file G115 sites (internal/daemon/daemon_test.go, internal/gateway/redelivery_test.go) are deliberately deferred to that decision, because annotating them is dead work if gosec does not run on tests.
Gate-ordering trap: the docsite enumerates PRD pages from git ls-files, so a PRD that is untracked when task check runs is invisible to docs:artifact:check. The check therefore passes, and the commit that adds the PRD makes dev-docs.json stale retroactively. Stage new files before running task check, or regenerate the artifact and verify after the file becomes tracked.
Complete. gosec is enabled in .golangci.yml and reaches the gate through task lint -> task check -> the quality workflow, covering the tools module through the same config. Four rules are excluded with a recorded reason (G101, G204, G304, G404) and gosec is scoped out of _test.go, which removes 186 of the 227 findings. Every shipped-code finding under an adopted rule is fixed or annotated with a checkable reason. task lint reports zero issues in both modules, and removing a suppression makes it fail (verified: 4 G124 issues, exit 1). Follow-up filed for the one gap: G301/G302 are silenced by the inherited legacy exclusion preset, so the directory-mode half of the class table is review-enforced.
REJECTED AND REVERTED. The maintainer rejected this approach on the ground that gosec does not need to run constantly and task check is already slow and compute heavy. Every part of it is reverted: .golangci.yml is byte-identical to the base revision, the PRD is deleted, all 42 inline nolint:gosec annotations are removed, and the dev-docs artifact is back to its base content. The genuine defects the review surfaced are kept as separate fixes: temp-file close results, ReadHeaderTimeout on the webhook receivers, the forge line-number bound and the tar mode mask. No further work until a decoupled design exists -- the constraint is that a scanner must not run on every task check.
### Close reason
Closed
---
_Imported from beads `archie-core-2ptu` · GitHub #1452 · type epic · priority P2 · created 2026-10-02 · closed 2026-10-02_
sam
added the mediumepic labels 2026-10-27 13:38:42 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implement docs/prds/static-analysis-gate.md. Enable gosec in .golangci.yml with a curated rule set (G101, G103, G204, G304, G404 excluded with recorded reasons), exclude generated contract code, testdata/ and the diagnostics skill scripts by path, and land the adopted-rule fixes so task lint starts clean with no unexplained suppression.
Notes
Measured gate baseline differs from the first ad-hoc scan. Enabling gosec through golangci-lint over the module reports 227 findings: 41 in shipped code, 186 in test files. golangci-lint drops generated contract and sqlc files via exclusions.generated and never reads testdata or dot-directories, so G103 and the generated G101 sites do not appear at all. Rules present only in the golangci run: G120, G602, G705, G710. Decision: add a _test.go exclusion for gosec (186 of 227 findings) rather than suppress test fixtures. Two test-file G115 sites (internal/daemon/daemon_test.go, internal/gateway/redelivery_test.go) are deliberately deferred to that decision, because annotating them is dead work if gosec does not run on tests.
Gate-ordering trap: the docsite enumerates PRD pages from git ls-files, so a PRD that is untracked when task check runs is invisible to docs:artifact:check. The check therefore passes, and the commit that adds the PRD makes dev-docs.json stale retroactively. Stage new files before running task check, or regenerate the artifact and verify after the file becomes tracked.
Complete. gosec is enabled in .golangci.yml and reaches the gate through task lint -> task check -> the quality workflow, covering the tools module through the same config. Four rules are excluded with a recorded reason (G101, G204, G304, G404) and gosec is scoped out of _test.go, which removes 186 of the 227 findings. Every shipped-code finding under an adopted rule is fixed or annotated with a checkable reason. task lint reports zero issues in both modules, and removing a suppression makes it fail (verified: 4 G124 issues, exit 1). Follow-up filed for the one gap: G301/G302 are silenced by the inherited legacy exclusion preset, so the directory-mode half of the class table is review-enforced.
REJECTED AND REVERTED. The maintainer rejected this approach on the ground that gosec does not need to run constantly and task check is already slow and compute heavy. Every part of it is reverted: .golangci.yml is byte-identical to the base revision, the PRD is deleted, all 42 inline nolint:gosec annotations are removed, and the dev-docs artifact is back to its base content. The genuine defects the review surfaced are kept as separate fixes: temp-file close results, ReadHeaderTimeout on the webhook receivers, the forge line-number bound and the tar mode mask. No further work until a decoupled design exists -- the constraint is that a scanner must not run on every task check.
Close reason
Closed
Imported from beads
archie-core-2ptu· GitHub #1452 · type epic · priority P2 · created 2026-10-02 · closed 2026-10-02