Skip to content

Absorb the opencode fork into amicode — overlay-based binary build (#1091) - #1114

Merged
jeonghun-jj-lee merged 18 commits into
mainfrom
jj/1091-absorb-opencode-fork
Sep 14, 2026
Merged

jeonghun-jj-lee merged 18 commits into
mainfrom
jj/1091-absorb-opencode-fork

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Campaign summary

Absorbs the harmoniqs/opencode fork into amicode's overlay system. After this merges, amicode is the single repo to maintain — engine patches are edited in the overlay directly, binaries are compiled from the materialized tree, and CI no longer touches the fork.

The 6 slices (all merged into this branch)

Slice PR What it does
S1 — Overlay extension #1107 Extracts the fork's 125 engine files into overlay/packages/opencode/
S2 — Build pipeline #1108 Adds build:binary — compiles the engine from the overlay tree
S4 — CI cutover #1111 CI builds from overlay; single build-binary job + artifact sharing; 2 fork workflows deleted
S5 — System redesigns #1110 Redesigns Rebuild, repo-sync, doctor, upgrade, VSIX build for the overlay world
S6 — Infrastructure retirement #1112 Purges dead fork code (-2,455 net lines); restructures opencode.lock.json
S7 — Documentation #1113 Rewrites 7 AGENTS.md sections; overlay is now the source of truth

By the numbers

  • 192 files changed, +46,905 / -4,364 lines
  • The +46k is mostly the overlay extraction (engine source, tests)
  • Infrastructure deleted: 2,747 net lines (fork workflows, dead scripts, lock fields, env vars)
  • CI time: single build-binary job (~70s) replaces 7 independent fork-downloads
  • All CI checks pass on every slice (the only failure across all runs is the pre-existing skills_integrity vault-aaron vpath error on main)

New developer workflow

# Engine patches — edit the overlay directly
vim packages/app-bundle/overlay/packages/opencode/src/...
pnpm --filter amicode run build:binary   # compile
# Reload Extension Dev Host (Cmd/Ctrl+R)

HITL actions after merge

  • Alpha release — validate through release.yml
  • Secret removal — OPENCODE_FETCH_TOKEN + REPO_ACCESS_TOKEN (after alpha validates)
  • Fork archival — close 12 PRs, close/transfer 39 issues, disable workflows, archive harmoniqs/opencode

Rollback

Every slice was merged individually with full CI verification. The integration branch can be reverted as one commit. Secret removal is sequenced AFTER alpha validation precisely because it's non-revertable.

Closes #1091. Answers #843.

Add packages/opencode/ to the overlay scope — the engine's 125 patched
files from the fork now have a tracking copy in amicode.

- Update all 5 hardcoded scope sites (overlay-promotion.mjs, extract_overlay.mjs, manifest.json)
- Extract fork delta into packages/app-bundle/overlay/packages/opencode/
- Verify materialized tree matches fork for all 7 packages
Add build:binary — compiles the engine from the overlay-materialized
monorepo instead of downloading from the fork release.

- Materialize stock upstream + overlay → full opencode monorepo
- Build via script/build.ts with --single --skip-install --skip-embed-web-ui
- Copy binary to vendor/ with sha256 + overlay-provenance sidecars
- Wire as pnpm --filter amicode run build:binary
feat(extension): local binary build from materialized tree (#1094)
Redesign 5 systems that assumed a live fork checkout:
- Rebuild: uses build:binary from overlay tree (single mode, bun required)
- repo-sync: retire --fork mode, remove fork access check, add overlay health
- Doctor: staleness via anomalyco/opencode releases, not fork tags
- Upgrade: amicode repo git discipline + build:binary, not fork checkout
- VSIX build: remove AMICODE_OPENCODE_SRC, use build:binary

Key changes:
- SurfaceContext.rootRepoFork is now optional (deprecated for S6 migration)
- SurfaceContext.upstreamVersion replaces fork-tag-based staleness
- queryUpstreamVersion() queries gh api repos/anomalyco/opencode/releases/latest
- serverBinaryVerb operates on rootRepoAmicode, not rootRepoFork
- Fixture constants updated: FUTURE_BUILD/PAST_BUILD use meaningful versions

Part of fork-absorption campaign #1091.
feat: redesign fork-dependent systems for overlay-build world (#1097)
Replace fork-download binary provisioning with overlay-build in CI:
- Add build-binary job; consumers use needs + download-artifact
- release.yml builds from overlay, not fork release
- Delete prepare-release-candidate.yml and overlay-promotion-bot.yml
- Add .buildinfo sidecar for channel assertion
- Update package script to use build:binary
- build_binary.mjs gains --platform flag for cross-compilation
- assert_ui_gate.sh reads .buildinfo for channel verification
- app-bundle-gate verifies provenance via lock.version + upstream_base_sha

Secret removal (OPENCODE_FETCH_TOKEN, REPO_ACCESS_TOKEN) is deferred
to after alpha validation — a separate manual step.

Part of fork-absorption campaign #1091. Answers #843.
feat(ci): build binary from overlay, retire fork workflows (#1096)
Retire dead fork infrastructure and restructure opencode.lock.json:
- Delete overlay-sync, overlay-promotion, extract_overlay, opencode_dev
- Strip drift_gate to committed-overlay-only check
- Restructure lock: drop repo/tag/ref/platforms, add base_commit/overlay_hash
- Migrate all lock consumers to new schema
- Remove AMICODE_OPENCODE_SRC and DEFAULT_OPENCODE_PATH from functional code
- Update i18n placeholders and manifest hashes
- Update test fixtures for the new world

Part of fork-absorption campaign #1091.
Replace fork workflow documentation with overlay-build workflow:
- AGENTS.md: 7 sections updated (~90 lines rewritten)
- Overlay is the source of truth, not a tracking copy
- Engine patches: edit overlay directly, run build:binary
- Fork archival steps documented as HITL checklist
- Updated agents_md.test.ts: overlay-prohibition → overlay-as-source-of-truth

Part of fork-absorption campaign #1091.
feat: infrastructure retirement and lock restructure (#1098)
docs: update documentation for fork-absorption (#1099)
@jeonghun-jj-lee jeonghun-jj-lee added the hitl Needs human review before merge label Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 219 files, which is 119 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3bff0fcb-35a2-4cb0-b874-ea9e1ab4f29f

📥 Commits

Reviewing files that changed from the base of the PR and between c226204 and e005a3a.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (219)
  • .github/workflows/ci.yml
  • .github/workflows/overlay-promotion-bot.yml
  • .github/workflows/prepare-release-candidate.yml
  • .github/workflows/release.yml
  • AGENTS.md
  • CONTEXT.md
  • docs/adr/0018-rebuild-button-semantics.md
  • packages/amico-run/src/doctor.ts
  • packages/amico-run/src/surfaces.ts
  • packages/amico-run/src/upgrade.ts
  • packages/amico-run/test/amico.test.ts
  • packages/amico-run/test/helpers.ts
  • packages/amico-run/test/surfaces.test.ts
  • packages/amico-run/test/upgrade-agents.test.ts
  • packages/amico-run/test/upgrade-extension.test.ts
  • packages/amico-run/test/upgrade-server-binary.test.ts
  • packages/amico-run/test/upgrade-skills.test.ts
  • packages/app-bundle/README.md
  • packages/app-bundle/manifest.json
  • packages/app-bundle/overlay/packages/app/src/components/settings-v2/developer-tools-controller.ts
  • packages/app-bundle/overlay/packages/app/src/components/settings-v2/developer-tools.tsx
  • packages/app-bundle/overlay/packages/app/src/context/settings.tsx
  • packages/app-bundle/overlay/packages/app/src/i18n/ar.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/br.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/bs.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/da.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/de.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/en.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/es.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/fr.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/ja.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/ko.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/no.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/pl.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/rebuild-label-rename.test.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/ru.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/th.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/tr.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/uk.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/zh.ts
  • packages/app-bundle/overlay/packages/app/src/i18n/zht.ts
  • packages/app-bundle/overlay/packages/opencode/package.json
  • packages/app-bundle/overlay/packages/opencode/pasqal-live-test.mjs
  • packages/app-bundle/overlay/packages/opencode/pasqal-live-test.sh
  • packages/app-bundle/overlay/packages/opencode/script/build.ts
  • packages/app-bundle/overlay/packages/opencode/script/httpapi-exercise.ts
  • packages/app-bundle/overlay/packages/opencode/src/agent/agent.ts
  • packages/app-bundle/overlay/packages/opencode/src/cli/cmd/run/footer.question.tsx
  • packages/app-bundle/overlay/packages/opencode/src/cli/cmd/run/question.shared.ts
  • packages/app-bundle/overlay/packages/opencode/src/mcp/browser.ts
  • packages/app-bundle/overlay/packages/opencode/src/plugin/openai/codex.ts
  • packages/app-bundle/overlay/packages/opencode/src/project/instance-context.ts
  • packages/app-bundle/overlay/packages/opencode/src/project/instance-store.ts
  • packages/app-bundle/overlay/packages/opencode/src/provider/auth.ts
  • packages/app-bundle/overlay/packages/opencode/src/provider/provider.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/connections.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/credentials.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/dashboard.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/file-resolve.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/library.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/pasqal-secret.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/problems.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/profile.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/project.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/run-terminal.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/toml-lite.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/vault-browser.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/vaults.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/warrants.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/widget-frame-html.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/widget-manifest.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/widget-runtime.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/widgets-src/jump-back-in.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/amicode/widgets.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/groups/experimental.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/groups/file.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/groups/provider.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/groups/session.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/handlers/experimental.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/handlers/file.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/handlers/provider.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/handlers/session.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/routes/instance/httpapi/server.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/server.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/shared/public-ui.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/shared/ui.ts
  • packages/app-bundle/overlay/packages/opencode/src/server/shared/workspace-routing.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/business-record.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/compaction.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/evidence.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/external-diff.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/instruction.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/lineage.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/llm/request.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/message-v2.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/mutation.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/prompt.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/prompt/anthropic.txt
  • packages/app-bundle/overlay/packages/opencode/src/session/prompt/communicating.txt
  • packages/app-bundle/overlay/packages/opencode/src/session/prompt/default.txt
  • packages/app-bundle/overlay/packages/opencode/src/session/prompt/gemini.txt
  • packages/app-bundle/overlay/packages/opencode/src/session/prose-guard.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/receipt-privacy.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/receipt.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/rollout.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/session.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/summary.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/system.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/turn-output.ts
  • packages/app-bundle/overlay/packages/opencode/src/session/user-mutation.ts
  • packages/app-bundle/overlay/packages/opencode/src/snapshot/index.ts
  • packages/app-bundle/overlay/packages/opencode/src/tool/apply_patch.ts
  • packages/app-bundle/overlay/packages/opencode/src/tool/edit.ts
  • packages/app-bundle/overlay/packages/opencode/src/tool/question.txt
  • packages/app-bundle/overlay/packages/opencode/src/tool/registry.ts
  • packages/app-bundle/overlay/packages/opencode/src/tool/task.ts
  • packages/app-bundle/overlay/packages/opencode/src/tool/truncate.ts
  • packages/app-bundle/overlay/packages/opencode/src/tool/widget-author.ts
  • packages/app-bundle/overlay/packages/opencode/src/tool/widget-author.txt
  • packages/app-bundle/overlay/packages/opencode/src/tool/write.ts
  • packages/app-bundle/overlay/packages/opencode/src/worktree/index.ts
  • packages/app-bundle/overlay/packages/opencode/test/amicode-release-workflow.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/cli/run/question.shared.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/cli/run/run-process.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/event-manifest.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/fixture/fixture.ts
  • packages/app-bundle/overlay/packages/opencode/test/lib/cli-process.ts
  • packages/app-bundle/overlay/packages/opencode/test/preload.ts
  • packages/app-bundle/overlay/packages/opencode/test/project/worktree-rename.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/provider/harmoniqs-no-tools.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/provider/provider.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-connections-routes.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-connections.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-credentials.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-dashboard.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-file-resolve.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-library.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-problems.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-profile.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-project.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-toml-lite.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-vault-browser.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-vaults.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-warrants.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-widget-frame.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-widget-manifest.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-widgets-src.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/amicode-widgets.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/fixtures/credentials/cloud.json
  • packages/app-bundle/overlay/packages/opencode/test/server/fixtures/credentials/pasqal.json
  • packages/app-bundle/overlay/packages/opencode/test/server/httpapi-compression.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/httpapi-exercise/index.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/httpapi-file.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/httpapi-instance-route-auth.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/httpapi-provider.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/httpapi-ui.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/pasqal-secret.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/session-diff-missing-patch.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/session-diff-scoped.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/server/workspace-routing.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/adversarial-e2e.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/business-record.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/instruction.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/llm-native-recorded.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/message-v2.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/mutation.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/prompt.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/prose-guard.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/receipt-privacy.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/rollout.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/session.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/turn-output.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/session/user-mutation.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/share/share-next.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/tool/apply_patch.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/tool/edit.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/tool/question.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/tool/registry-schema.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/tool/task.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/tool/truncation.test.ts
  • packages/app-bundle/overlay/packages/opencode/test/tool/write.test.ts
  • packages/app-bundle/package.json
  • packages/app-bundle/scripts/drift_gate.mjs
  • packages/app-bundle/scripts/extract_overlay.mjs
  • packages/app-bundle/scripts/overlay-promotion.mjs
  • packages/app-bundle/scripts/overlay-sync.mjs
  • packages/extension/TESTING.md
  • packages/extension/opencode.lock.json
  • packages/extension/package.json
  • packages/extension/scripts/assert_ui_gate.sh
  • packages/extension/scripts/build_binary.mjs
  • packages/extension/scripts/fetch_opencode.d.mts
  • packages/extension/scripts/fetch_opencode.mjs
  • packages/extension/scripts/opencode_dev.mjs
  • packages/extension/scripts/record_amicode_fixtures.mjs
  • packages/extension/scripts/repo-sync.sh
  • packages/extension/src/chat_bridge.ts
  • packages/extension/src/opencode_binary.ts
  • packages/extension/src/rebuild/coordinator.ts
  • packages/extension/src/rebuild/dependency_resolver.ts
  • packages/extension/src/rebuild/exec_types.ts
  • packages/extension/src/rebuild/main_source_resolver.ts
  • packages/extension/src/rebuild_errors.ts
  • packages/extension/test/agents_md.test.ts
  • packages/extension/test/amicode_service_contract.test.ts
  • packages/extension/test/chat_bridge.test.ts
  • packages/extension/test/dependency_resolver.test.ts
  • packages/extension/test/download_robustness.test.ts
  • packages/extension/test/fetch_opencode.test.ts
  • packages/extension/test/main_source_resolver.test.ts
  • packages/extension/test/opencode_dev.test.ts
  • packages/extension/test/overlay_promotion.test.ts
  • packages/extension/test/overlay_sync.test.ts
  • packages/extension/test/rebuild_coordinator.test.ts
  • packages/extension/test/rebuild_errors.test.ts
  • packages/extension/test/release_workflow.test.ts
  • scripts/rebuild_amicode_locally.sh
  • scripts/rebuild_amicode_remotely.sh
  • scripts/repo-sync.sh

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…+ skills-lint #1121

# Conflicts:
#	packages/app-bundle/manifest.json
…ion-lineage engine)

Brings packages/opencode in the absorbed overlay from 517921ee to fork HEAD
8608dcc1, transferring the session-lineage engine (lineage, mutation, receipt,
receipt-privacy, rollout, evidence, business-record, user-mutation + tests) —
20 files, +6002/-0. Without this, merging PR #1114 would regress the ~6k-line
engine that main currently ships via the vendored fork binary.

- overlay/packages/opencode: 20 files written verbatim from fork@8608dcc1
- manifest: fork_sha 517921ee->8608dcc1, fork_tag ->v1.18.29-amicode.30-67-g8608dcc1fe;
  refresh_manifest recompute; exceptions collision reconciled (23 amicode-only
  legacy modules kept as exceptions, not files{}, mirroring main's partition)

Gates (director-run, command-derived):
- drift_gate: PASS (807 fork-owned + 23 exceptions = 830 overlay files in sync)
- materialize verify: 807 overlay files at exact hashes
- engine byte-exact to fork@8608: 830/830 packages/opencode files, 0 mismatch/missing/stray
- app-scope == main@8608 except 19 intentional de-fork repairs (opencodePath placeholder)
- import-resolution: 8 engine modules present; no dangling cross-package imports
- full binary build -> CI build-binary job (campaign division)

Refs #1129, #1091
Delete the two fork-era rebuild scripts that predate fork absorption
(#1091) and have no in-tree callers:
- scripts/rebuild_amicode_locally.sh (built the fork binary with bun
  from a local opencode fork checkout)
- scripts/rebuild_amicode_remotely.sh (downloaded the pinned fork
  release binary)

The in-app Rebuild surface (S8) is the supported dev path; these
fork-clone / fork-release-download flows have no analog in the
overlay-build world.

Also correct the one rebuild coordinator docstring line that still
claimed the shell scripts call it. Coordinator logic and the
fork-mode comments (S10, #1117) are untouched.

Refs #1116, part of #1091.
…es (#1117)

Fork absorption left an orphaned 'rebuild from main' path in the extension
rebuild coordinator. Remove the runRebuild orchestrator and the rebuildFromMain
resolver (only tests exercised them), relocating the shared exec type aliases
(ExecResult, ExecFn) they defined to a dedicated exec_types module first so the
live dependency-resolver and deployBuild path keep them.

- new src/rebuild/exec_types.ts holds ExecResult + ExecFn
- coordinator.ts: drop runRebuild + RebuildCoordinatorOpts/RebuildMode + dead
  imports and dead result fields; keep deployBuild fully intact; import exec
  types from ./exec_types; correct the fork-mode docstring header
- dependency_resolver.ts: import ExecResult from ./exec_types
- remove main_source_resolver.ts and its test entirely
- rebuild_coordinator.test.ts: drop the runRebuild cases, keep deployBuild cases
- dependency_resolver.test.ts: add exec-type provenance assertions
- fetch_opencode.d.mts: stop naming the removed resolver module

Fixes the integration-branch tsc error 'Property pendingPromotion does not
exist on type RebuildResult'. tsc --noEmit now green.

Part of #1091.
Merge S9+S10 (coupled coordinator cleanup) into the absorption integration branch. S10 removes the orphaned runRebuild main-path (clearing the pre-existing pendingPromotion typecheck red); S9 retires the fork rebuild scripts. CI green on ed76304 (fast/build-binary/vsix-gate/boot-smoke/schema-roundtrip).
#1115)

Restore two distinct Rebuild semantics and retire the fork-era wiring left
behind by fork absorption (#1091):

- Standardize the rebuild request mode on `local | main` end to end (UI →
  controller → payload → handler → tests). `local` builds the working tree
  as-is (no git checkout/pull); `main` fetches + checks out main + ff-only
  pulls before building. The handler now HONORS the mode via two pure helpers
  (resolveRebuildMode, rebuildGitCommand) — the git step is the one place the
  two buttons diverge. The retired `remote` value coerces to the safe `local`.
- Remove the dead "opencode repo path" field: the UI row, the controller
  getter/setter/commit + payloads, the settings-context type/default/getter/
  setter, and the opencodePath row key from all 18 locale files.
- Retire the binary live-swap: drop the two path-fed opencodeBinary writes in
  the dev-tools-update handler and delete the deprecated appBundleBuildCommand
  / mainOverlayVerificationCommand shims. The general opencodeBinary override
  is preserved (boot/health consumer) and still cleared on toggle-off.
- ADR 0018 records the two-button model + live-swap retirement; CONTEXT.md
  gains the Rebuild (local) / Rebuild (from main) / binary live-swap (retired)
  glossary terms.

Tests: extend the chat-bridge and i18n suites (reuse-first) — mode/git-command
helper assertions, binary-override lifecycle, and a locale key-removal guard.

Rebased onto integration @4966b2d4 (engine-sync 8608dcc1). Refresh manifest for
this slice's overlay edits (18 i18n + developer-tools controller/view + settings +
rebuild-label-rename.test) so the overlay stays drift-clean against the 8608 manifest;
exceptions bucket reconciled (23 amicode-only modules kept as exceptions, mirroring main).
drift_gate PASS; tsc shows only the pre-existing coordinator pendingPromotion red (cleared by S10).
Merge S8 (rebuild-surface repair for the overlay-build world) into the absorption integration branch, rebased onto ddbb998 (post S9+S10) so the coordinator typecheck is clean. Includes the overlay manifest refresh so the branch stays drift-clean. CI green on 9eef760 (fast/build-binary/vsix-gate/boot-smoke/schema-roundtrip).
jeonghun-jj-lee pushed a commit that referenced this pull request Sep 16, 2026
The fork-absorption (#1114) moved the opencode engine into the overlay but
left it with NO CI test/typecheck coverage: packages/app-bundle/overlay/
packages/opencode is not a pnpm workspace member (pnpm-workspace.yaml globs
packages/* non-recursively), so the `fast` job's `pnpm -r run typecheck` skips
it. The fork ran `bun turbo typecheck`/`bun turbo test`; the cutover (S4 #1111)
never ported them. Engine type regressions have merged unseen.

This restores the engine typecheck as a standalone `engine-tests` CI job
(materialize the full tree -> bun install -> opencode typecheck), the fork's
typecheck.yml scoped to the engine.

Green-up (pre-existing errors on dev the gate caught):
- src/session/lineage.ts: `.filter((id): id is string ...)` must narrow to
  `id is SessionID` (the branded column type); 4 cascading errors cleared.
- test/session/prompt.test.ts: MCP mock omitted `remove`, now required by the
  overlaid MCP.Interface — add `remove: () => Effect.void`.
- test/provider/transform.test.ts: cast content elements `as any` before reading
  `.type` (matches this file's own convention at :3138) — the Part-union widening
  from a recent dev merge left these two assertions behind.

Three remaining typecheck errors are a base-pin drift (manifest
upstream_base_sha=7fe9938 predates the base the overlay was authored against):
allowlisted in the gate script by file+rule, tracked in #1229. New errors
outside the allowlist fail CI (verified: injected error reds; allowlisted-only
passes). The gate is fail-closed (reds if tsgo did not execute).

Also: `pnpm test:engine` local entrypoint + AGENTS.md verification-gates row.
manifest.json refreshed for the overlay edits (drift_gate PASS).

Deferred, tracked:
- #1229 base-pin bump -> unlocks full-monorepo typecheck (ui/app also drift).
- #1233 engine unit-TEST lane (bun turbo test + test:httpapi) -> blocked on real
  amicode test fixes (amicode-connections.test.ts failures + hook-timeout slowness).

Refs #1228
jeonghun-jj-lee pushed a commit that referenced this pull request Sep 16, 2026
…1233, #1239)

The clean-CI run of the unit-test lane surfaced 3 pre-existing failures (untouched
by this change, never CI-gated since #1114): session legacy-parent aggregation
(test/session/session.test.ts), SSE chunkTimeout (test/provider/header-timeout.test.ts),
and TUI attention notify (test/cli/cmd/tui/attention.test.ts, an uncaught throw).
Exclude them at the file level in engine_test_gate.sh so the lane enforces no-new
failures on the remaining ~271 files / 3750+ tests now; tracked for fix +
re-inclusion in #1239 (base-drift llm-native-recorded stays excluded per #1229).

Refs #1233, #1239
jeonghun-jj-lee pushed a commit that referenced this pull request Sep 16, 2026
The fork-absorption (#1114) moved the opencode engine into the overlay but
left it with NO CI test/typecheck coverage: packages/app-bundle/overlay/
packages/opencode is not a pnpm workspace member (pnpm-workspace.yaml globs
packages/* non-recursively), so the `fast` job's `pnpm -r run typecheck` skips
it. The fork ran `bun turbo typecheck`/`bun turbo test`; the cutover (S4 #1111)
never ported them. Engine type regressions have merged unseen.

This restores the engine typecheck as a standalone `engine-tests` CI job
(materialize the full tree -> bun install -> opencode typecheck), the fork's
typecheck.yml scoped to the engine.

Green-up (pre-existing errors on dev the gate caught):
- src/session/lineage.ts: `.filter((id): id is string ...)` must narrow to
  `id is SessionID` (the branded column type); 4 cascading errors cleared.
- test/session/prompt.test.ts: MCP mock omitted `remove`, now required by the
  overlaid MCP.Interface — add `remove: () => Effect.void`.
- test/provider/transform.test.ts: cast content elements `as any` before reading
  `.type` (matches this file's own convention at :3138) — the Part-union widening
  from a recent dev merge left these two assertions behind.

Three remaining typecheck errors are a base-pin drift (manifest
upstream_base_sha=7fe9938 predates the base the overlay was authored against):
allowlisted in the gate script by file+rule, tracked in #1229. New errors
outside the allowlist fail CI (verified: injected error reds; allowlisted-only
passes). The gate is fail-closed (reds if tsgo did not execute).

Also: `pnpm test:engine` local entrypoint + AGENTS.md verification-gates row.
manifest.json refreshed for the overlay edits (drift_gate PASS).

Deferred, tracked:
- #1229 base-pin bump -> unlocks full-monorepo typecheck (ui/app also drift).
- #1233 engine unit-TEST lane (bun turbo test + test:httpapi) -> blocked on real
  amicode test fixes (amicode-connections.test.ts failures + hook-timeout slowness).

Refs #1228
jeonghun-jj-lee pushed a commit that referenced this pull request Sep 16, 2026
The fork-absorption (#1114) moved the opencode engine into the overlay but
left it with NO CI test/typecheck coverage: packages/app-bundle/overlay/
packages/opencode is not a pnpm workspace member (pnpm-workspace.yaml globs
packages/* non-recursively), so the `fast` job's `pnpm -r run typecheck` skips
it. The fork ran `bun turbo typecheck`/`bun turbo test`; the cutover (S4 #1111)
never ported them. Engine type regressions have merged unseen.

This restores the engine typecheck as a standalone `engine-tests` CI job
(materialize the full tree -> bun install -> opencode typecheck), the fork's
typecheck.yml scoped to the engine.

Green-up (pre-existing errors on dev the gate caught):
- src/session/lineage.ts: `.filter((id): id is string ...)` must narrow to
  `id is SessionID` (the branded column type); 4 cascading errors cleared.
- test/session/prompt.test.ts: MCP mock omitted `remove`, now required by the
  overlaid MCP.Interface — add `remove: () => Effect.void`.
- test/provider/transform.test.ts: cast content elements `as any` before reading
  `.type` (matches this file's own convention at :3138) — the Part-union widening
  from a recent dev merge left these two assertions behind.

Three remaining typecheck errors are a base-pin drift (manifest
upstream_base_sha=7fe9938 predates the base the overlay was authored against):
allowlisted in the gate script by file+rule, tracked in #1229. New errors
outside the allowlist fail CI (verified: injected error reds; allowlisted-only
passes). The gate is fail-closed (reds if tsgo did not execute).

Also: `pnpm test:engine` local entrypoint + AGENTS.md verification-gates row.
manifest.json refreshed for the overlay edits (drift_gate PASS).

Deferred, tracked:
- #1229 base-pin bump -> unlocks full-monorepo typecheck (ui/app also drift).
- #1233 engine unit-TEST lane (bun turbo test + test:httpapi) -> blocked on real
  amicode test fixes (amicode-connections.test.ts failures + hook-timeout slowness).

Refs #1228
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitl Needs human review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Absorb the opencode fork into amicode — overlay-based binary build, retire harmoniqs/opencode

1 participant