You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mcpx plugin: stamp the generated ops with the API table hash and refuse to run on a stale copy #4811
Drew (2026-11-03): 'a stale type hint is worse than not having one.' The generated plugin ops (pkgs/mcpx/plugin/opencode/mcpx/ops.gen.ts) are type hints the plugin codes against. When they drift from the daemon's real /v1 table (as in #4806), everything still type-checks and reviews fine — the types lie with confidence, and the failure only surfaces at runtime against the real API, or worse, a renamed/dropped operation is called wrongly. An untyped surface would at least be honestly dynamic.\n\n#4807 makes nix builds regenerate the file in preCheck, so nix artifacts always carry true types. What remains: from-checkout consumers (code's .opencode/plugin, editor type-checking) can still load a stale copy silently.\n\nProposal: PluginTS() emits a stamp in the generated file — a hash of the /v1 operation table plus the mcpx version. The plugin's daemon client compares the stamp against the daemon's self-reported table hash at connect time and REFUSES (clear error: regenerate or update the plugin) on mismatch, instead of calling through stale types. Needs the daemon to report its table hash (a /v1 metadata field or a field on the existing version/doctor surface). Acceptance: with a deliberately stale ops.gen.ts, the plugin fails loudly at startup with the mismatch named; with a fresh one, it connects as today.
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/none). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
agent-note:v1
event: picked_up
task: 8436 (repo-health-code-pilot; OpenChamber scheduled lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
state: picked up by atomic claim.
verified: Fresh GitHub state: issue #4811 OPEN; no held, user/owned, do-not-merge, or do-not-auto-edit labels. Related #4806 is CLOSED and #4807 is MERGED. No open PR matching #4811 found.
next: inspect current main's generated ops and daemon API metadata, confirm whether the proposed table-hash freshness guard remains a distinct fix, then post triage findings and route a follow-up if warranted.
agent-note:v1
event: triage-findings
task: 8436 (repo-health-code-pilot; OpenChamber scheduled lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
Triage — confirmed live on current main (dda1def97)
The proposal remains a distinct gap after #4806/#4807:
pkgs/mcpx/internal/api/plugin_ts.go renders PluginTS() from api.Ops(), but the generated ops.gen.ts contains no operation-table fingerprint.
pkgs/mcpx/internal/api/plugin_ts_test.go ensures the checked-in generated file matches the current table; mcpx: regenerate ops.gen.ts + generate it during the nix build #4807 additionally regenerates it during Nix builds. Those protect the build artifact, not a stale checkout loaded at runtime.
pkgs/mcpx/internal/daemon/server.go serves /v1/health with status/version/pid/uptime/endpoint and /v1/status with daemon status; neither reports the operation-table hash.
pkgs/mcpx/plugin/opencode/mcpx/daemon.ts: health() only discovers liveness/version, and connect() returns a client after discovery without comparing generated-client compatibility. Thus stale plugin types can still be used against a daemon with a different /v1 operation table.
Route: one focused small-fix follow-up: derive a deterministic fingerprint from the canonical api.Ops() table, embed the expected value in generated ops.gen.ts, expose the daemon's value through health/status, and check it before the plugin uses generated operations. Fail closed with an actionable mismatch message (including the missing-hash/older-daemon case); preserve operation behavior when hashes match. Cover deterministic generation, match, mismatch, and unavailable hash with tests. No unrelated API/schema cleanup.
Ordering: the shared Go API table/hash and daemon metadata should land before or alongside the generated plugin stamp and startup guard in the same focused change; regeneration follows any change to the table. CI should verify Go API/plugin generation tests and the targeted plugin tests. This is actionable without a Drew-only decision.
agent-note:v1
event: handed_off
task: 8436 (repo-health-code-pilot; OpenChamber scheduled lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
state: triaged; runtime stale-operation-table gap remains after #4807.
verified: current main dda1def has no table hash in PluginTS output or /v1 health/status; connect does no compatibility check. Issue #4811 remains OPEN, no matching PR.
route: queued focused small-fix task 8772 (priority 30) to hash canonical api.Ops(), stamp generated ops.gen.ts, expose the daemon fingerprint and fail closed with an actionable message on mismatch/unavailable hash. Includes generator, daemon and plugin tests; no unrelated cleanup.
next: task 8772 implements and verifies the scoped guard. Triage findings are in the preceding comment.
Links: #4811 · #4806 · #4807
Agent: queue worker (repo-worker-code), lane code-k — FALLBACK MODE (queue backend down; the fallback claim marker on this issue is the claim of record)
Progress from repo-worker-code-k: verified ALREADY DONE on current main f235cef: PluginTS emits OPERATION_FINGERPRINT into ops.gen.ts (line 23), daemon health reports operationFingerprint (internal/daemon/server.go:920,931), plugin verifyOperationCompatibility() throws on mismatch/missing (daemon.ts:425-435), tests cover match/differ/no-fingerprint (daemon.test.ts:136-154). Implementing commit 5d081e4 on branch queue/8772-4811-plugin-table-hash (this issue's own broker task 8772). Next: post evidence, close, release done.
Triage — issue #4811: ALREADY DONE on current main; closing with evidence (fallback-mode triage, lane code-k, 2026-11-07)
Verdict: the proposal was implemented in full by PR #5320 ("mcpx: fingerprint generated operations and reject stale plugin tables", merged 2026-11-05T01:54:57Z, branch queue/8772-4811-plugin-table-hash — this issue's own broker task 8772). The issue stayed open only because the closing bookkeeping never landed (its later comments are claim-evaporation repairs re-handing-off a finished task). Verified piece by piece against current main (f235cef8), not from the PR title:
Acceptance, item by item
Stamp in the generated file:PluginTS() (pkgs/mcpx/internal/api/plugin_ts.go:105) emits export const OPERATION_FINGERPRINT = "…" — a SHA-256 over the marshaled operation-fingerprint contract (OperationFingerprint(), plugin_ts.go:34). Present in the generated file itself: pkgs/mcpx/plugin/opencode/mcpx/ops.gen.ts:23 (0ac07ddb… at current main). This is the proposal's "hash of the /v1 operation table" (fingerprint of the request/response contract — strictly better than a raw table hash, since it changes exactly when the contract changes).
Daemon reports it: the daemon's health surface includes "operationFingerprint": api.OperationFingerprint() (pkgs/mcpx/internal/daemon/server.go:920 and :931) — the proposal's "/v1 metadata field on the existing version/doctor surface" (here: health).
Plugin refuses on mismatch, at connect time:DaemonClient.verifyOperationCompatibility() (pkgs/mcpx/plugin/opencode/mcpx/daemon.ts:425–435) fetches health before generated operations run and throws mcpx: /v1 operation table mismatch (plugin <fp>, daemon <fp>); update the mcpx plugin and daemon from matching versions on a differing fingerprint — and fails closed with an equally explicit error when the daemon publishes no fingerprint (older daemon) or does not answer. A deliberately stale ops.gen.ts carries a different fingerprint by construction, so the acceptance scenario ("fails loudly at startup with the mismatch named") is exactly the implemented behavior.
Tests name the acceptance cases:pkgs/mcpx/plugin/opencode/mcpx/daemon.test.ts, describe "generated operation compatibility": "allows operations when the daemon table fingerprint matches" (:136), "refuses generated operations when the daemon table fingerprint differs" (:145), "fails closed when an older daemon has no operation fingerprint" (:154). Implementing commit 5d081e4c20 ("fix(mcpx): validate generated ops against daemon table") touched exactly the six files the proposal spans (generator, daemon server, plugin client, tests, generated file).
Found via: fallback scan (queue/queued, scan order)
Outcome: triaged — the OPERATION_FINGERPRINT stamp, daemon health reporting, plugin connect-time refusal, and the three acceptance-named tests are all present on current main, delivered by PR mcpx: fingerprint generated operations and reject stale plugin tables #5320 (merged 2026-11-05, this issue's own task 8772 branch). Evidence comment on this issue, item by item with file:line. Closing as already done; no follow-up owed.
Released by repo-worker-code-k (outcome: done). Triaged ALREADY DONE: issue #4811 was implemented in full by PR #5320 (merged 2026-11-05, branch queue/8772-4811-plugin-table-hash) - OPERATION_FINGERPRINT stamp in ops.gen.ts, daemon health operationFingerprint, plugin verifyOperationCompatibility refusal, acceptance-named tests; verified item-by-item on current main f235cef with file:line evidence on the issue. Issue closed; no follow-up owed.
Activity
dezren39 commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/none). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03
dezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
opencode; handed off to the laptop claimant (opencode-claimant), which launches the bound session that drives task 8436 to its terminal state.dezren39 commentedon Nov 3, 2026
agent-note:v1
event: picked_up
task: 8436 (repo-health-code-pilot; OpenChamber scheduled lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
state: picked up by atomic claim.
verified: Fresh GitHub state: issue #4811 OPEN; no held, user/owned, do-not-merge, or do-not-auto-edit labels. Related #4806 is CLOSED and #4807 is MERGED. No open PR matching #4811 found.
next: inspect current main's generated ops and daemon API metadata, confirm whether the proposed table-hash freshness guard remains a distinct fix, then post triage findings and route a follow-up if warranted.
dezren39 commentedon Nov 3, 2026
agent-note:v1
event: triage-findings
task: 8436 (repo-health-code-pilot; OpenChamber scheduled lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
Triage — confirmed live on current main (
dda1def97)The proposal remains a distinct gap after #4806/#4807:
pkgs/mcpx/internal/api/plugin_ts.gorendersPluginTS()fromapi.Ops(), but the generatedops.gen.tscontains no operation-table fingerprint.pkgs/mcpx/internal/api/plugin_ts_test.goensures the checked-in generated file matches the current table; mcpx: regenerate ops.gen.ts + generate it during the nix build #4807 additionally regenerates it during Nix builds. Those protect the build artifact, not a stale checkout loaded at runtime.pkgs/mcpx/internal/daemon/server.goserves/v1/healthwith status/version/pid/uptime/endpoint and/v1/statuswith daemon status; neither reports the operation-table hash.pkgs/mcpx/plugin/opencode/mcpx/daemon.ts:health()only discovers liveness/version, andconnect()returns a client after discovery without comparing generated-client compatibility. Thus stale plugin types can still be used against a daemon with a different /v1 operation table.Route: one focused small-fix follow-up: derive a deterministic fingerprint from the canonical
api.Ops()table, embed the expected value in generatedops.gen.ts, expose the daemon's value through health/status, and check it before the plugin uses generated operations. Fail closed with an actionable mismatch message (including the missing-hash/older-daemon case); preserve operation behavior when hashes match. Cover deterministic generation, match, mismatch, and unavailable hash with tests. No unrelated API/schema cleanup.Ordering: the shared Go API table/hash and daemon metadata should land before or alongside the generated plugin stamp and startup guard in the same focused change; regeneration follows any change to the table. CI should verify Go API/plugin generation tests and the targeted plugin tests. This is actionable without a Drew-only decision.
dezren39 commentedon Nov 3, 2026
agent-note:v1
event: handed_off
task: 8436 (repo-health-code-pilot; OpenChamber scheduled lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
state: triaged; runtime stale-operation-table gap remains after #4807.
verified: current main dda1def has no table hash in PluginTS output or /v1 health/status; connect does no compatibility check. Issue #4811 remains OPEN, no matching PR.
route: queued focused small-fix task 8772 (priority 30) to hash canonical api.Ops(), stamp generated ops.gen.ts, expose the daemon fingerprint and fail closed with an actionable message on mismatch/unavailable hash. Includes generator, daemon and plugin tests; no unrelated cleanup.
next: task 8772 implements and verifies the scoped guard. Triage findings are in the preceding comment.
Links: #4811 · #4806 · #4807
91 remaining items
developing-today commentedon Nov 7, 2026
🤖 Agent note · picked up
repo-worker-code-k(issue mcpx plugin: stamp the generated ops with the API table hash and refuse to run on a stale copy #4811 is the task in fallback mode)queue/queued, scan order)ops.gen.tsgeneration, no daemon-reported table hash for the plugin to compare, from-checkout consumers still unguarded after mcpx: regenerate ops.gen.ts + generate it during the nix build #4807's nix-side fix), check mcpx: plugin/opencode/mcpx/ops.gen.ts is stale — TestPluginOpsAreGenerated fails on main #4806/mcpx: regenerate ops.gen.ts + generate it during the nix build #4807's current state, and disposition with the fix routed on this issue.developing-today commentedon Nov 7, 2026
Progress from
repo-worker-code-k: verified ALREADY DONE on current main f235cef: PluginTS emits OPERATION_FINGERPRINT into ops.gen.ts (line 23), daemon health reports operationFingerprint (internal/daemon/server.go:920,931), plugin verifyOperationCompatibility() throws on mismatch/missing (daemon.ts:425-435), tests cover match/differ/no-fingerprint (daemon.test.ts:136-154). Implementing commit 5d081e4 on branch queue/8772-4811-plugin-table-hash (this issue's own broker task 8772). Next: post evidence, close, release done.developing-today commentedon Nov 7, 2026
Triage — issue #4811: ALREADY DONE on current main; closing with evidence (fallback-mode triage, lane code-k, 2026-11-07)
Verdict: the proposal was implemented in full by PR #5320 ("mcpx: fingerprint generated operations and reject stale plugin tables", merged 2026-11-05T01:54:57Z, branch
queue/8772-4811-plugin-table-hash— this issue's own broker task 8772). The issue stayed open only because the closing bookkeeping never landed (its later comments are claim-evaporation repairs re-handing-off a finished task). Verified piece by piece against current main (f235cef8), not from the PR title:Acceptance, item by item
PluginTS()(pkgs/mcpx/internal/api/plugin_ts.go:105) emitsexport const OPERATION_FINGERPRINT = "…"— a SHA-256 over the marshaled operation-fingerprint contract (OperationFingerprint(), plugin_ts.go:34). Present in the generated file itself:pkgs/mcpx/plugin/opencode/mcpx/ops.gen.ts:23(0ac07ddb…at current main). This is the proposal's "hash of the /v1 operation table" (fingerprint of the request/response contract — strictly better than a raw table hash, since it changes exactly when the contract changes)."operationFingerprint": api.OperationFingerprint()(pkgs/mcpx/internal/daemon/server.go:920and:931) — the proposal's "/v1 metadata field on the existing version/doctor surface" (here: health).DaemonClient.verifyOperationCompatibility()(pkgs/mcpx/plugin/opencode/mcpx/daemon.ts:425–435) fetches health before generated operations run and throwsmcpx: /v1 operation table mismatch (plugin <fp>, daemon <fp>); update the mcpx plugin and daemon from matching versionson a differing fingerprint — and fails closed with an equally explicit error when the daemon publishes no fingerprint (older daemon) or does not answer. A deliberately staleops.gen.tscarries a different fingerprint by construction, so the acceptance scenario ("fails loudly at startup with the mismatch named") is exactly the implemented behavior.pkgs/mcpx/plugin/opencode/mcpx/daemon.test.ts, describe "generated operation compatibility": "allows operations when the daemon table fingerprint matches" (:136), "refuses generated operations when the daemon table fingerprint differs" (:145), "fails closed when an older daemon has no operation fingerprint" (:154). Implementing commit5d081e4c20("fix(mcpx): validate generated ops against daemon table") touched exactly the six files the proposal spans (generator, daemon server, plugin client, tests, generated file).No follow-up work is owed. Closing as already done.
developing-today commentedon Nov 7, 2026
🤖 Agent note · done (triage verdict: ALREADY DONE — PR #5320)
repo-worker-code-k(issue mcpx plugin: stamp the generated ops with the API table hash and refuse to run on a stale copy #4811 is the task in fallback mode)queue/queued, scan order)developing-today commentedon Nov 7, 2026
Released by
repo-worker-code-k(outcome: done). Triaged ALREADY DONE: issue #4811 was implemented in full by PR #5320 (merged 2026-11-05, branch queue/8772-4811-plugin-table-hash) - OPERATION_FINGERPRINT stamp in ops.gen.ts, daemon health operationFingerprint, plugin verifyOperationCompatibility refusal, acceptance-named tests; verified item-by-item on current main f235cef with file:line evidence on the issue. Issue closed; no follow-up owed.