feat(incogni): provider-declared attribution markers unioned across providers (ADR-0033) #81
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab!81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/75"
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?
One
ScrubPatternsdeclaration, two enforcement points, unioned across all registered providers — per the design pinned in #75 and documented in ADR-0033.What changed
NewRegistrynow validates every registered provider'sScrubPatternscompile as case-insensitive Go regexps (the BRE∩RE2 common dialect) — an unenforceable marker set fails at boot — and precomputes the cross-provider unions:UnionScrubPatterns(),UnionSeededPathPatterns(),ScrubRegexps(). New shared compilerprovider.CompileScrubPatterns(the(?i)twin of the hook'sgrep -i).sanitizeBodynow drops a line when it matches ANY compiled union pattern; the hardcodedattributionLine(claude shapes in core) is deleted.agentapi.Newtakes the compiled set, wired fromproviderReg.ScrubRegexps()incmd/lab(nil registry → content-inert pass-through, like the hook). Seam-repair mechanics (blank-collapse, code-fence runs, non-incogni byte-identity, runs afterensureCloses) are unchanged and still pinned.incogniSeedMeta's per-repo effective-provider resolution is replaced by the registry union — the pre-push hook now screens every registered provider's scrub AND seeded-path patterns regardless of which provider a session ran, closing the ADR-0030 per-spawn-override hole. Empty registry degrades to a content-inert guard instead of erroring.TestCoreAttributionNeutrality(Go twin of the SPA'sproviderNeutral.test.ts) scans all non-test core string literals for the attribution-marker tokens (anthropic,claude-session,co-authored-by,generated with) outsideinternal/provider/claudecodeandprovidertest; no allowlist. Its first run caught the incogni seed-prompt sentence spellingCo-Authored-By— reworded to name the shapes generically.anthropic.commention after aco-authored-by:prefix; the declared pattern requires the bracketed email (ADR-0012's stable discriminator). The declared set is adopted unchanged — the claude hook golden stays byte-identical — and the narrowed sanitizer coverage is pinned by a new test case.Acceptance (issue #75)
sanitizeBodystrips every registered provider's markers: proven with a codex-shaped fixture set and a claude+codex union test (internal/agentapi/sanitize_test.go), no Codex account needed.TestIncogniHookUnionsAllRegisteredProviderspins a repo whose own provider is codex-fake still carrying claude's patterns.TestCoreAttributionNeutrality, 129 non-test files scanned,_test.go/testdata/claudecode/providertest exempt.Closes #Nuntouched, code-fence blank runs untouched,TestPrePushHookScript_claudeGoldenbyte-identical — all green.docs/adr/0033-provider-declared-attribution-markers.md; CONTEXT.md incogni entry updated.go build ./...,go vet ./...,gofmtand the fullgo test ./...suite are green (golangci-lint unavailable in the sandbox; CI covers it).Closes #75