Skip to content

fix(hosted-mcp): drift reads the claims the pin recorded, and silence withdraws them - #2023

Merged
lilyshen0722 merged 1 commit into
mainfrom
kai/task172-drift-arms
Sep 29, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
kai/task172-drift-arms

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

What this is

The successor diff to #2014's entry guards, ruled in pod 75449 / 75454 / 75457 and written into docs/plans/hosted-mcp-connection-scope.md §3 by #2016. movedTowardWrite had two arms keyed on spelling rather than the claims the pin recorded; it now has three keyed on what the pin recorded.

# arm why
1 pinned.readOnlyHint === true && live?.readOnlyHint !== true → readOnlyHint withdrawn upstream unchanged
2 pinned.destructiveHint === false && live?.destructiveHint !== false → destructiveHint: false withdrawn upstream the spec defaults an absent destructiveHint to true, so silence withdraws the claim. The old arm read pinned.destructiveHint !== true and an unannotated pin has nothing to withdraw, so a recorded destructiveHint: false could be withdrawn silently (vera 75423; measured 75445)
3 pinned.readOnlyHint === true && live?.destructiveHint === true → destructiveHint set upstream the pair #2014 refuses at entry; drift does not admit later what entry refuses

Ordering is load-bearing and witnessed: a pin that recorded both claims, against a vendor now saying destructiveHint: true, fires arms 2 and 3 — and reports the claim it lost, not the generic contradiction (75457). A pin that recorded neither claim no longer drifts when the vendor spells the spec default, so the old arm's false positive on a write pin is gone (wren 75449).

Fixtures

A scripted census of every pinned() call in the suite, run against #2014's head, found three drift fixtures that #2014 makes entry-illegal — an arm witnessing the comparison on a shape the entry layer can no longer create (75461, 75462):

  • tightened → re-pointed class: write (legal, and still ok: gaining readOnlyHint is not drift);
  • unpinned, silent → re-pointed class: write, and the recorded-nothing pair is flipped to ok, which is the ruling for a write pin.

The fourth illegal fixture is left alone on purpose: it is #2014's hole-on-record arm, whose comment already says the load guard refuses that pin.

Two comments the rulings staled are corrected: movedTowardWrite's "losing destructiveHint is not drift", and entries.ts's "a tool whose vendor annotates nothing can only be pinned write" (75440 — no entry at all).

Evidence at 89461b4f

  • entry suite 20/20; eight-drift-arm file plus the annotation describes all green.
  • neighbourhood (hostedMcp|toolBroker|grantBroker|connectorSecretKinds) 17 suites / 266 passed.
  • full backend 498 suites / 4715 tests / 4691 passed / 24 skipped / 0 failed.
  • eslint on both source files: 0 findings. The test file holds 11 messages against main's 15 (the re-points replaced Object.assign with spread).
  • Ledger on the predicate: 12 mutants — 11 killed, 1 recorded equivalent, 0 NAMED-ARM MISSES, baseline 20/20 asserted before every run, pristine restored after every run. The equivalent is the mirror's wording: the arms assert the claim is named (destructiveHint: false), not the sentence.

Gate: Vera (code).

… withdraws them

Three arms replace the two that came before (75449, 75454, 75457; written into
§3 by #2016):

- a recorded `readOnlyHint: true` is withdrawn when the vendor stops saying it
  (unchanged);
- a recorded `destructiveHint: false` is withdrawn when the vendor stops saying
  it. The spec defaults an absent `destructiveHint` to `true`, so silence is the
  unsafe value, and the old arm could not see this case at all: it read
  `pinned.destructiveHint !== true`, and an unannotated pin has no
  `destructiveHint` to withdraw (vera 75423, measured 75445);
- a live `destructiveHint: true` beside a recorded `readOnlyHint: true` is the
  pair the entry load refuses (#2014), and drift does not admit later what entry
  refuses.

Every arm reads the pin's annotations, never its class, so a pin that recorded
neither claim no longer drifts when the vendor spells the spec default (wren
75449). The withdrawn-claim arms come first: a pin that recorded both claims
reports the `destructiveHint: false` it lost rather than the generic
contradiction (75457).

The three drift fixtures #2014 makes entry-illegal are re-pointed at
`class: write` — `tightened`, `unpinned`, `silent` — and the recorded-nothing
pair is flipped to `ok`, which is what the ruling predicts for a write pin. The
hole-on-record arm stays: its pin is not a catalogue state any more, and keeping
it is the point. A census of every `pinned()` call in the suite, run against
#2014's head, is what found them (75461, 75462).

Two comments the rulings staled are corrected: `movedTowardWrite`'s "losing
`destructiveHint` is not drift", and `entries.ts`'s "a tool whose vendor
annotates nothing can only be pinned `write`" (75440).

Ledger: 12 mutants on the predicate, 11 killed, 1 recorded equivalent (the
mirror's wording may change as long as it names the claim the pin lost — the
arms assert the claim, not the sentence), 0 NAMED-ARM MISSES, baseline 20/20
asserted on every run. Neighbourhood 17 suites / 266 passed; full backend 498
suites / 4691 passed, 24 skipped, 0 failed.
@lilyshen0722
lilyshen0722 added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 9f0c58b Sep 29, 2026
16 checks passed
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.

1 participant