Skip to content

Commit 217d924

Browse files
committed
ai(rules[AGENTS]) Shipped vs. Branch-Internal Narrative breaker
why: Roll out the narrative-bleed guard rule (defined in tony/skills#15) so every project in the portfolio shares the same "shipped artifacts hold current state; commits hold history" discipline and the same Published-Release Test diagnostic. what: - Add the Shipped vs. Branch-Internal Narrative section to AGENTS.md. - For repos that did not have AGENTS.md, create it with a minimal header. Refs tony/skills#15
1 parent b00b240 commit 217d924

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,3 +524,60 @@ When stuck in debugging loops:
524524
2. **Minimize to MVP**: Remove all debugging cruft and experimental code
525525
3. **Document the issue** comprehensively for a fresh approach
526526
4. Format for portability (using quadruple backticks)
527+
528+
## Shipped vs. Branch-Internal Narrative
529+
530+
Long-running branches accumulate tactical decisions — renames,
531+
refactors, attempts-then-reverts, intermediate states. Commit messages
532+
and the diff hold *what changed* and *why*. Do not restate either in
533+
artifacts the downstream reader holds: code, docstrings, README,
534+
CHANGES, PR descriptions, release notes, migration guides.
535+
536+
When deciding what counts as branch-internal, use trunk or the parent
537+
branch as the baseline — not intermediate states inside the current
538+
branch.
539+
540+
**The Published-Release Test**
541+
542+
Before adding rename history, "previously" / "formerly" / "no longer
543+
X" phrasing, "removed" / "moved" / "refactored" / "fixed" diff
544+
paraphrases, or `### Fixes` entries to a user-facing surface, ask:
545+
546+
> Did users of the most recently published release ever experience
547+
> this old name, old behavior, or bug?
548+
549+
If the answer is no, it is branch-internal narrative. Move it to the
550+
commit message and describe only the current state in the artifact.
551+
552+
**Keep in shipped artifacts**
553+
554+
- Deprecations and migration guides for symbols that actually shipped.
555+
- `### Fixes` entries for bugs that affected users of a published
556+
release.
557+
- Comments explaining *why the current code looks this way* —
558+
invariants, platform quirks, upstream bug workarounds — that make
559+
sense to a reader who never saw the previous version.
560+
561+
**Default**: when in doubt, keep the artifact clean and put the story
562+
in the commit.
563+
564+
### Cleanup in Hindsight
565+
566+
When applying this rule retroactively from inside a feature branch,
567+
first establish scope by diffing against the parent branch (or trunk)
568+
to identify which commits this branch actually introduced. Then:
569+
570+
- **Commits introduced in this branch** — prompt the user with two
571+
options: `fixup!` commits with `git rebase --autosquash` to address
572+
each causal commit at its source, or a single cleanup commit at
573+
branch tip. User chooses.
574+
- **Commits already in trunk or a parent branch** — default to
575+
leaving them alone. Do not raise them as cleanup candidates; act
576+
only on explicit user instruction. If the user opts in, fold the
577+
cleanup into a single commit at branch tip and do not rewrite trunk
578+
or parent-branch history.
579+
- **Scope guard** — if cleaning in-branch bleed would touch a
580+
colleague's in-flight work or expand the branch beyond its stated
581+
goal, default to staying in lane: protect the project's current
582+
goal, leave prior bleed alone, and don't introduce new bleed in the
583+
current change.

0 commit comments

Comments
 (0)