This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This doc tracks BrowserCode's relationship to its two upstream sources:
1. **anomalyco/opencode** — forked in as the bulk of this repo.
2. **browser-use/browser-harness** — vendored into `packages/bcode-browser/harness/` (planned, ROADMAP A2).
Two sections: **modification zones** (where is it safe to change upstream code?) and **sync log** (when did we last pull each upstream and to what commit?).
---
## 1. Modification zones
Every line of upstream code falls into one of three zones.
### Red — never touch
Wire-level or brand-level identifiers that would break upstream compatibility:
These are contractual with upstream and with provider APIs. Renaming breaks compatibility, auth flows, or provider trust.
### Yellow — touch, but log it
Modifications to existing upstream source files are allowed when (a) required by a BrowserCode capability that has no hook-level alternative, and (b) recorded in `EXCEPTIONS.md` with a "can we upstream this?" column (ROADMAP F8).
Current Yellow modifications (landed in the rebrand commit `866a1a9`):
- CLI `scriptName` → `bcode`
- Binary/bin rename
- USER_AGENT prefix
- mDNS domain
- Banner/wordmark
- Package name at root (`@browser-use/browsercode`)
- API description strings
Future Yellow modifications (per ROADMAP):
- `packages/opencode/src/tool/webfetch.ts` routed through `FetchUse.Service` (B2)
- Core-CLI phone-home triage (F7)
### Green — add freely
- New files under `packages/opencode/src/` that don't collide with upstream paths.
- New packages (cf. `packages/bcode-browser/`, decisions.md §1d).
- Vendored code inside `packages/bcode-browser/` (own tree, zero upstream friction).
Every Yellow modification should be evaluated for conversion to a Green extension point via upstream PR. See decisions.md §1c and ROADMAP F8.
---
## 2. Sync log
Each upstream has its own append-only table. Add a row every time you pull.
**Upstream branch we track:** `dev` (upstream default)
**Our default branch:** `main`
| Date | From SHA | To SHA | By | Notes |
|---|---|---|---|---|
| 2026-04-20 | — (initial) | `3e8abac6` | user | Mirror push after fork creation. Tagged `baseline/pre-rename`. See `scripts/check-upstream.sh` output for current drift. |
| — | — | — | — | Not vendored yet. First row lands with ROADMAP A2. |
---
## Drift checker
Run `scripts/check-upstream.sh` to see whether we're behind either upstream. It reads the latest `To SHA` from each table above and reports "N commits behind" since that point.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Integration into `packages/opencode` (tool registration, service wiring, CLI commands) is Level 2 and lives in `packages/opencode/src`. Per the one-line-hook rule, those hooks are pointers only — all logic lives here.
## Upstream tracking
- `harness/PROVENANCE.md` — source commit SHA + edit log for the vendored harness.
- Root-level `UPSTREAM.md` — sync log across both upstreams (opencode and harness).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Once the harness is vendored, the following holds:
- `harness/helpers.py` — **editable** for BrowserCode needs. Changes are ours to make.
- `harness/daemon.py`, `harness/admin.py` — **protected**. Never modify. Pulled verbatim from upstream. If behavior change needed, upstream a PR to `browser-use/browser-harness`.
## Per-file edit log
Append a row here whenever a vendored file is modified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Source of truth: UPSTREAM.md. Append a row when you pull."
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scaffold: @browser-use/bcode-browser + UPSTREAM.md + check-upstream.sh #1
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
scaffold: @browser-use/bcode-browser + UPSTREAM.md + check-upstream.sh #1
Filter by extension
Only manifest files
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.