Policy: replace an agent's copied footer with the policy's own #42

Merged
dario merged 1 commit from dario/policy-own-footer into main 2026-11-20 14:26:33 +01:00 AGit
Owner

Evidence

On #28, comment 392 by the implementer (run 20261120-131013-…-27-401ce9) ended with the old footer, "Written by an AI agent (factory) using this account", although #39 was in the binary. The session shows the model wrote that footer and the marker into the body itself, copied from earlier comments. The policy left texts that already carried <!-- factory:agent --> unmarked, so it posted the copy as is.

Changes

  • internal/forge/policy.go: with a personal account, the policy now removes the marker everywhere in the text, and any trailing <sub>🤖 …</sub> footer (with or without the --- line), before it adds its own footer. Every text ends with exactly one footer, which names the agent that actually posted it. Marking twice gives the same text.
  • ADR 0011: the sentence about already-marked texts.

Test evidence

  • just check: passes
  • TestPersonalAccount:
    • comment 392's case: the old footer becomes the implementer footer;
    • marking twice gives the same text;
    • a marker in the middle of a text is removed;
    • a copied inline footer in a review comment becomes the reviewer's.

🤖 Generated with Claude Code

## Evidence On #28, comment 392 by the implementer (run `20261120-131013-…-27-401ce9`) ended with the old footer, "Written by an AI agent (factory) using this account", although #39 was in the binary. The session shows the model wrote that footer and the marker into the body itself, copied from earlier comments. The policy left texts that already carried `<!-- factory:agent -->` unmarked, so it posted the copy as is. ## Changes - `internal/forge/policy.go`: with a personal account, the policy now removes the marker everywhere in the text, and any trailing `<sub>🤖 …</sub>` footer (with or without the `---` line), before it adds its own footer. Every text ends with exactly one footer, which names the agent that actually posted it. Marking twice gives the same text. - ADR 0011: the sentence about already-marked texts. ## Test evidence - `just check`: passes - `TestPersonalAccount`: - comment 392's case: the old footer becomes the implementer footer; - marking twice gives the same text; - a marker in the middle of a text is removed; - a copied inline footer in a review comment becomes the reviewer's. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dario merged commit 40b2c6a650 into main 2026-11-20 14:26:33 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dario/factory!42
No description provided.