Skip to content

Base-pin drift: manifest upstream_base_sha stale vs absorbed overlay #1229

Description

@jeonghun-jj-lee

Base-pin drift: manifest upstream_base_sha is stale vs the absorbed overlay

Problem

The overlay engine was authored against a newer anomalyco/opencode base
than the one the app-bundle manifest pins. packages/app-bundle/manifest.json
records upstream_base_sha = 7fe993879f98aa17cecc70f70d3f40d6f0f11689, but the
overlay's own files expect APIs absent from that base:

  • overlaid src/mcp/index.ts declares readonly remove on MCP.Interface
    (and a corresponding server remove endpoint), but base 7fe9938's MCP
    Interface has no remove — so the base-provided test mocks/handlers
    (test/session/snapshot-tool-race.test.ts, test/server/httpapi-mcp-oauth.test.ts,
    and amicode's test/session/prompt.test.ts mock) don't implement it.
  • amicode's test/session/llm-native-recorded.test.ts uses
    HttpRecorderInternal.promptAgnosticMatcher, absent from base 7fe9938's
    http-recorder (which is not overlaid, so it materializes at the stale base).

The result is a newer-overlay-on-older-base materialized tree — a Frankenstein
that compiles the binary (so build-binary stays green) but is type-inconsistent
and potentially behavior-inconsistent in non-overlay files. This class of drift
is invisible today precisely because the engine typecheck/test gate was missing
(#1228).

Evidence

  • Fork was green on its own test.yml/typecheck.yml, so in the fork these
    APIs existed → the fork's anomalyco base ≠ 7fe9938.
  • fork_tag was v1.18.29-amicode.30-67-g8608dcc1 (fork HEAD 8608dcc1).
  • Neither cached base (@7fe9938, @v1.18.29) exposes promptAgnosticMatcher
    / MCP remove — the correct base is neither; it must be recovered from
    fork@8608dcc1 history.

Proposed fix (needs its own verification)

  1. Determine the anomalyco commit fork@8608dcc1 actually vendored.
  2. Bump manifest.json:upstream_base_sha to it; re-run refresh_manifest /
    materialize; confirm drift_gate PASS and the overlay applies cleanly.
  3. Revert the symptom-patches added in Restore engine test/typecheck CI coverage (regression gate) #1228 for the now-consistent base
    (the mock remove additions, if the correct base already carries them).
  4. Verify the binary still builds and the new engine-tests lane (Restore engine test/typecheck CI coverage (regression gate) #1228) is green.

Acceptance criteria

  • upstream_base_sha matches the base the overlay was authored against.
  • drift_gate PASS; materialize verifies overlay files at exact hashes.
  • Engine bun turbo typecheck green without the Restore engine test/typecheck CI coverage (regression gate) #1228 symptom-patches
    (or with them reduced to genuinely-amicode-owned deltas).
  • build-binary still green.

Priority

Not blocking the gate (#1228 patches the symptom to land green), but this is
the correct fix and should follow promptly — a stale base risks other silent
inconsistencies beyond the 4 caught here.

Campaign ledger: sessions/session-20260916-engine-test-ci.md.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions