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