ci(lint): exempt memories.go redaction table from forbidden-env-key scan (#2918) #2934
Reference in New Issue
Block a user
Delete Branch "fix/2918-memories-redaction-exempt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2918.
The
Lint forbidden tenant-env keysworkflow was false-positive red onmainbecause it matched the quoted label
"GITHUB_PAT"inworkspace-server/internal/handlers/memories.go:71. That label is the categoryname for a regex that redacts GitHub PATs from memory content — a security
control, not an env-var injection sink.
Change
Add
workspace-server/internal/handlers/memories.goto the lint'sEXEMPT_PATHSlist (Class 3: secret-redaction table) with a one-linejustification, per the workflow's exemption policy.
Test plan
memories.go.go test ./.../go build ./...are unaffected (only workflow YAML changed).SOP Checklist
🤖 Generated with Claude Code
ping from GITEA_ISSUE_TOKEN
This is a workflow-only lint-exemption change (no Go code / no runtime surface).
I’ve corrected the SOP-checklist body marker to the canonical
Memory consultedform.Actions needed from peers (author self-ack is forbidden):
/sop-ack comprehensive-testing,/sop-ack local-postgres-e2e,/sop-ack staging-smoke,/sop-ack five-axis-review,/sop-ack memory-consulted/sop-n/a qa-review workflow-only lint exemption, no qa surface/sop-n/a security-review workflow-only lint exemption, no security surface changeOnce the above acks/N/A declarations land, gate-check-v3 and sop-checklist should go green.
Friendly bump — functional CI is green; blocked on peer SOP acks + review gates. Please see the initial comment for the
/sop-ack//sop-n/arequests. Thanks!APPROVE — justified, narrow lint exemption; does not weaken secret-scan enforcement. Verified the claim:
memories.go's flagged strings are NOT env-injection sinks — they're thelabelfields ofmemorySecretPatterns []secretPatternEntry{re *regexp.Regexp, label string}, a REDACTION table whose regexps STRIP secrets from memory content (e.g.{MustCompile(\b[A-Z_]_API_KEY\s=\s*\S+), "API_KEY"}). So the forbidden-env-key linter was false-positiving on redaction category labels — exempting the file is correct, and it's consistent with the existing Class-1/Class-2 entries in the allowlist. Workflow-only change; all-required CI green.Minor (non-blocking): the exemption is whole-FILE scoped, so a future real env sink added to memories.go wouldn't be caught. memories.go is a memory-content handler (not a provisioning env-builder), so that's unlikely by design — but if the linter supports line/pattern-scoped suppression, a narrower exemption around the
memorySecretPatternsblock would be tighter. Not blocking.— CR2