status: active
timestamp: 2026-07-01
tags: [rules, agent, forks, upstream, pr]
No fork divergence — upstream PRs only
Local forks in repos/frk/* stay byte-identical to upstream main. Every local change files as an upstream PR immediately.
No fork divergence — upstream PRs only
Rule
Every fork under repos/frk/* MUST stay byte-identical to upstream/main. Any local change — bug fix, missing dep, patch — must be filed as an upstream PR in the same turn as the edit. No exceptions for “just this once” or “we’ll upstream it later.”
Why
Divergence rots silently. The failure mode is:
- Local edits accumulate in the fork’s
main - Upstream releases new versions
git pull upstream/mainproduces merge conflicts- The team “fixes” the conflict by reverting local changes and losing the work
- Or worse: keeps both, ships broken hybrid, blames the upstream
We hit this today (2026-07-01): our fork’s package.json had two runtime deps (@toon-format/toon, safe-regex) that upstream imports but didn’t declare. We ADDED them locally without filing. That’s divergence for a fix that helps upstream too.
How
When you spot a bug in fork source and reach for Edit:
- STOP. Do not edit fork’s
main. git -C <fork> checkout -b <slug>fromupstream/main.- Make the fix on the branch.
git push origin <slug>(push tochirag127/<repo>, our fork).gh pr create --repo <upstream-owner>/<upstream-repo> --head "chirag127:<slug>" --base main --title "..." --body-file <path>— file the PR against upstream.- Switch fork back to
main. Fork’smainstays clean. - Fetch/pull happens against
upstream/mainonly.
Exception (narrow)
Local main may carry:
- Non-code artifacts that CANNOT be upstreamed (e.g.
.source/regenerated locally,.envdecrypted locally,pnpm-lock.yamlif upstream shipspackage-lock.json). - These must be gitignored where possible; where impossible, documented in the fork’s per-agent stub.
Runtime source code, dependency declarations, config in package.json, scripts, docs, tests — all upstream-only.
Enforcement
Before ending any session that touched a fork:
git -C repos/frk/<name> diff upstream/main -- package.json 'src/**' 'open-sse/**' 'bin/**' 'scripts/**' '*.md'
Non-empty output = divergence rule violation. File the PR before committing to fork main.
Cross-refs
fork-discipline— forks live inrepos/frk/<upstream-name>with upstream wired as remotemcp-fork-pattern-in-frk— MCP fork narrower caseself-update-rule— same-turn write discipline- Real incident this rule was born from: OmniRoute fork’s
@toon-format/toon+safe-regexruntime deps added locally 2026-07-01, later filed upstream as PR #5766