Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ src-layout reorg):
- `src/browser_harness/*.py` (`daemon.py`, `admin.py`, `helpers.py`,
`run.py`, `_ipc.py`) — protected. Pull verbatim. If behavior change is
needed, upstream a PR to `browser-use/browser-harness`.
- `interaction-skills/`, `agent-workspace/domain-skills/` — verbatim.
Never edit.
- `interaction-skills/` — verbatim. Never edit.
- `(agent-workspace/)?domain-skills/` — **excluded** from vendored tree.
Sync agents skip these paths; see UPSTREAM.md §3 "Excluded paths".

Sync workflow lives in `harness-sync.md`.

Expand Down
23 changes: 20 additions & 3 deletions UPSTREAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,38 @@ Each upstream has its own append-only table. Add a row every time you pull.

---

## 3. Harness divergences
## 3. Harness divergences and excluded paths

Per-file record of where `packages/bcode-browser/harness/` deliberately differs from upstream. Read this *before* a sync diff so intentional differences aren't mistaken for missing features.
Per-file record of where `packages/bcode-browser/harness/` deliberately differs from upstream, plus the list of paths excluded from the vendored tree entirely. Read this *before* a sync diff so intentional differences aren't mistaken for missing features and excluded paths aren't accidentally re-imported.

Path-allowlist policy (decisions.md §3.7, §4.5; updated for upstream PR #229 src-layout reorg):

- `agent-workspace/agent_helpers.py` — editable; primary BrowserCode extension surface. Divergences expected.
- `src/browser_harness/*.py` (`daemon.py`, `admin.py`, `helpers.py`, `run.py`, `_ipc.py`) — protected. Pulled verbatim from upstream. If behavior change is needed, upstream a PR to `browser-use/browser-harness`.
- `interaction-skills/`, `agent-workspace/domain-skills/` — verbatim from upstream. We never edit these.
- `interaction-skills/` — verbatim from upstream. We never edit these.
- `(agent-workspace/)?domain-skills/` — **excluded.** See "Excluded paths" below.
- Other files (`pyproject.toml`, `LICENSE`, `README.md`, etc.) — divergence allowed but discouraged.

### Excluded paths

Upstream paths the vendored tree treats as if they don't exist. Sync agents skip them; the diff checker filters them out. The runtime guard in `helpers.py` (`if d.is_dir():` in `goto_url`) means absence is a clean no-op.

| Pattern | Reason |
|---|---|
| `(agent-workspace/)?domain-skills/**` | User-contributed site recipes. Quality, maintenance, and prompt-injection concerns. Browsercode (cloud-first, performance-focused) curates its own skills server-side; OSS users get the harness without bundled recipes. Both upstream paths covered: post-PR-#229 `agent-workspace/domain-skills/` and the legacy/PR-#247 top-level `domain-skills/`. The exclusion is enforced in three places that all reference this row: `script/check-harness-diff.sh` (`IGNORED_PATHS_REGEX`), `harness-sync.md` step 5 ("Excluded paths" row), and the absence of these directories from the vendored tree. |

### Modified files

| File | Section | Direction | Reason |
|---|---|---|---|
| `.gitignore` | venv entry | added `.venv/` | smoke-test workflow creates `.venv/` in the harness dir; we ignore it. Upstream uses CWD-level venv so doesn't need this. |

The vendored harness's `SKILL.md`, `README.md`, and `install.md` reference `agent-workspace/domain-skills/`, but we keep them verbatim from upstream. Rationale:

- `README.md` and `install.md` are not referenced by any browsercode prompt or TS code — the agent never reads them. Their content is dead weight in the extracted cache, not agent-visible.
- `SKILL.md` is referenced by `packages/opencode/src/tool/browser-execute.txt` today, but the long-term plan (see ROADMAP) is to replace that pointer with a browsercode-owned prompt file, making vendored `SKILL.md` inert too.
- Trimming these files would generate per-sync drift forever for zero agent-behavior benefit. Keeping them verbatim costs nothing and keeps future syncs mechanical.

---

## Drift checker
Expand Down
8 changes: 5 additions & 3 deletions harness-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ git pull origin main
Two things to read before touching anything:

- **`UPSTREAM.md`** — the latest `To SHA` row under `### browser-use/browser-harness`. That is the last commit we synced to. It is the only source of truth for "what version is vendored."
- **`UPSTREAM.md` §3 Harness divergences** — the table of files where we deliberately differ from upstream, with reasons. Read this *before* the diff so you know which differences are intentional and not "missing features."
- **`UPSTREAM.md` §3 Harness divergences and excluded paths** — the table of files where we deliberately differ from upstream, plus the list of paths excluded from the vendored tree entirely. Read both *before* the diff so you know which differences are intentional and not "missing features," and which paths to skip outright.

If the divergences table is empty (initial vendor state), every difference between us and upstream is unintentional drift; flag any in the PR.

Expand Down Expand Up @@ -65,14 +65,16 @@ This is where the agent earns its keep. For each file changed in `<recorded-sha>

| File category | Action |
|---|---|
| Files not in our divergences table (incl. `src/browser_harness/*.py`, `agent-workspace/domain-skills/`, `interaction-skills/`, `tests/`, `pyproject.toml`, `LICENSE`, etc.) | Take upstream verbatim — `cp temp/browser-harness/<path> packages/bcode-browser/harness/<path>`. |
| **Excluded paths** (`(agent-workspace/)?domain-skills/...`) | **Skip entirely.** Never copy in, never resurrect. See UPSTREAM.md §3 "Excluded paths". `script/check-harness-diff.sh` filters these out automatically. |
| Files not in our divergences table (incl. `src/browser_harness/*.py`, `interaction-skills/`, `tests/`, `pyproject.toml`, `LICENSE`, etc.) | Take upstream verbatim — `cp temp/browser-harness/<path> packages/bcode-browser/harness/<path>`. |
| Files in our divergences table | Read each upstream hunk. For each, decide: **take** (apply upstream change to our file), **skip** (our divergence wins, ignore upstream change), or **adapt** (rewrite our divergence to coexist with the upstream change). Update the divergences row if its reason or scope shifts. |
| New upstream files | Copy in. |
| New upstream files | Copy in (unless under an excluded path). |
| Files we have but upstream removed | Decide: keep ours (record in divergences) or delete. |

Path-allowlist policy stays in force during sync resolution as well as normal development:
- `agent-workspace/agent_helpers.py` — editable, agent's primary extension surface (post PR #229).
- `src/browser_harness/*.py` (`daemon.py`, `admin.py`, `helpers.py`, `run.py`, `_ipc.py`) — protected. Always take upstream verbatim. If upstream regresses, file an issue at `browser-use/browser-harness` and pin to the prior SHA, do not patch locally.
- `(agent-workspace/)?domain-skills/` — **excluded.** Treat as if not in the upstream tree. Quality + prompt-injection concerns; user-contributed site recipes do not ship with browsercode. The runtime guard in `helpers.py` (`if d.is_dir():`) means this is a clean no-op.

### 6. Smoke test

Expand Down

This file was deleted.

Loading
Loading