Skip to content

Commit 53723fb

Browse files
committed
Document preferring an upstream fix over a local workaround
Add guidance to AGENTS.md for handling failures that look like known upstream bugs: verify the fix at the source, prefer the smallest installable version bump over a workaround, treat upgrades as revertible hypotheses, and comment any unavoidable workaround with its removal condition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvxEaPhyEq2HCZ6XFjEAde
1 parent 047c652 commit 53723fb

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,27 @@ See the [README.md](README.md#packages) for detailed descriptions of each packag
3636
- On Claude Code on the web, `.claude/hooks/session-start.sh` performs the above automatically (selecting the `.nvmrc` version via nvm) at session start.
3737
- **Native (iOS/Android) builds are not part of the default bootstrap.** `npm run bootstrap` and the native `bootstrap` scripts compile artifacts that require the Android NDK / Apple toolchains, which are absent on a generic Linux worker. Focus on the Node.js tooling packages; pass an explicit target (e.g. `npx ferric --apple`) only when the corresponding SDK is installed.
3838

39+
## Prefer an upstream fix over a local workaround
40+
41+
When a build/runtime failure looks like a known upstream bug, before writing a
42+
patch or workaround:
43+
44+
1. Find where the fix actually landed and **verify at the source** — the
45+
changelog, lockfile, or the dependency's own manifest/podspec for a *specific
46+
installable version*, not the version list and not a related package's
47+
timeline (a fork or platform variant may carry a fix on a line its upstream
48+
never did).
49+
2. If an installable version within our constraints contains the fix, prefer the
50+
**smallest** bump that includes it (patch > minor > major) over a workaround.
51+
3. Treat the upgrade as a hypothesis under test: say so, and be ready to revert —
52+
every upgrade adds new unknown-bug surface. If it doesn't fix the issue, throw
53+
it away rather than stacking a workaround on top of it.
54+
4. If the bump is more than a patch, or widens scope/risk, check with me before
55+
committing to it.
56+
5. If no fixed version is reachable, a workaround is fine — but comment it with
57+
the exact condition that makes it removable (e.g. "remove once dep ships
58+
fmt ≥ 12.1"), and if you write that condition, verify it isn't already met.
59+
3960
## Critical Build Dependencies
4061

4162
- **Custom Hermes**: Currently depends on a patched Hermes with Node-API support (see [facebook/hermes#1377](https://github.com/facebook/hermes/pull/1377))

0 commit comments

Comments
 (0)