Skip to content

Enforce overlay provenance for main rebuilds - #1005

Merged
jeonghun-jj-lee merged 1 commit into
mainfrom
1004-enforce-overlay-provenance-for-main-rebuilds
Sep 11, 2026
Merged

Enforce overlay provenance for main rebuilds#1005
jeonghun-jj-lee merged 1 commit into
mainfrom
1004-enforce-overlay-provenance-for-main-rebuilds

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

Closes #1004

Summary

  • add revision-pinned overlay promotion and strict verification
  • keep local rebuilds overlay-independent and gate main rebuilds before installs
  • promote the overlay for local/amicode at 0667bccd6ddbe52d5bf3889f2f6778141ad763f2

Verification

  • pnpm --filter amicode test
  • pnpm --filter amicode run build
  • node packages/app-bundle/scripts/drift_gate.mjs --fork /Users/jj/harmoniqs/opencode

@jeonghun-jj-lee jeonghun-jj-lee linked an issue Sep 11, 2026 that may be closed by this pull request
9 tasks
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review September 11, 2026 01:23
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 5a11615 into main Sep 11, 2026
9 of 10 checks passed
jack-champagne pushed a commit that referenced this pull request Sep 11, 2026
manifest.upstream_base has held a commit SHA (not a tag) since recent
promotions started passing --base <sha> to overlay-promotion.mjs, but
materialize.mjs and drift_report.mjs both built the upstream fetch URL
under refs/tags/, which 404s for a SHA. This has been failing vsix-gate
on main since #1011. GitHub's /archive/<ref>.tar.gz endpoint resolves
both tags and commit SHAs through the same path, so drop refs/tags/.

Also scope overlay-promotion.mjs's main-branch promotion guard (#1005)
to the real overlay/manifest paths only. It was checking this repo's
current branch unconditionally, which correctly blocks a human running
--apply directly on main, but also blocked overlay_promotion.test.ts's
own --apply exercise (run via a custom --target/--manifest fixture,
never the live overlay) whenever CI happened to run on main — which is
every push to main, including this one. That's the second failure in
the same CI run.
jack-champagne pushed a commit that referenced this pull request Sep 11, 2026
Automates the diff JJ has been generating by hand (#947, #1005, #1006,
#1009, #1011): on a schedule (or manual dispatch), run the existing
overlay-promotion.mjs --check against the fork's local/amicode tip, and
on drift, run --apply on a deterministic review branch and open/update
one PR.

Deliberately not built: a signed webhook receiver, a GitHub App,
compare-and-swap bot-merge authority, or exception-approval automation.
JJ's own promotion PRs (#1009, #1011) were merged 6-27 seconds after
opening once CI was green — the toil is producing the diff, not
reviewing it, so a human (or required status checks) still merges here.

Verified locally against a scratch git remote + the real
harmoniqs/opencode clone (not just described):
  - --check against the current in-sync state exits 0, no PR opened
  - a simulated fork commit drifts --check to exit 1
  - --apply on the review branch (created BEFORE --apply, since #1005's
    main-branch guard would otherwise refuse it) reproduces the correct
    manifest + overlay diff
  - re-running --apply after resetting the branch from main is
    idempotent (same tree each time, safe to force-push)

If the app-bundle overlay is retired later (tracked separately, off
#1010), this workflow is deleted, not migrated.
jack-champagne added a commit that referenced this pull request Sep 11, 2026
… bot (#1010 Phase 0+1) (#1025)

* fix(app-bundle): resolve upstream_base as commit SHA, not tag

manifest.upstream_base has held a commit SHA (not a tag) since recent
promotions started passing --base <sha> to overlay-promotion.mjs, but
materialize.mjs and drift_report.mjs both built the upstream fetch URL
under refs/tags/, which 404s for a SHA. This has been failing vsix-gate
on main since #1011. GitHub's /archive/<ref>.tar.gz endpoint resolves
both tags and commit SHAs through the same path, so drop refs/tags/.

Also scope overlay-promotion.mjs's main-branch promotion guard (#1005)
to the real overlay/manifest paths only. It was checking this repo's
current branch unconditionally, which correctly blocks a human running
--apply directly on main, but also blocked overlay_promotion.test.ts's
own --apply exercise (run via a custom --target/--manifest fixture,
never the live overlay) whenever CI happened to run on main — which is
every push to main, including this one. That's the second failure in
the same CI run.

* feat(ci): add overlay-promotion-bot workflow (#1010 Phase 1)

Automates the diff JJ has been generating by hand (#947, #1005, #1006,
#1009, #1011): on a schedule (or manual dispatch), run the existing
overlay-promotion.mjs --check against the fork's local/amicode tip, and
on drift, run --apply on a deterministic review branch and open/update
one PR.

Deliberately not built: a signed webhook receiver, a GitHub App,
compare-and-swap bot-merge authority, or exception-approval automation.
JJ's own promotion PRs (#1009, #1011) were merged 6-27 seconds after
opening once CI was green — the toil is producing the diff, not
reviewing it, so a human (or required status checks) still merges here.

Verified locally against a scratch git remote + the real
harmoniqs/opencode clone (not just described):
  - --check against the current in-sync state exits 0, no PR opened
  - a simulated fork commit drifts --check to exit 1
  - --apply on the review branch (created BEFORE --apply, since #1005's
    main-branch guard would otherwise refuse it) reproduces the correct
    manifest + overlay diff
  - re-running --apply after resetting the branch from main is
    idempotent (same tree each time, safe to force-push)

If the app-bundle overlay is retired later (tracked separately, off
#1010), this workflow is deleted, not migrated.

---------

Co-authored-by: Test <test@example.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce overlay provenance for main rebuilds

1 participant