Skip to content

dedup(id-caps): two policy-point implementations landed for #7916 (mcp_policy + agent_policy) — reconcile to one before step 5 #13202

Closed

Description

@dezren39

Problem

Spike step 4 for #6300 (issue #7916, the host-side policy point) was implemented twice in parallel and both implementations are now on main:

  • pkgs/id/crates/id-caps/src/mcp_policy.rs — via PR #13192 (Lane QE, merged 2b8a3e535e42, 2026-11-23T10:32:35Z): a PolicySession wrapping BridgeSession, running tool calls through ceiling → quota → audit.
  • pkgs/id/crates/id-caps/src/agent_policy.rs — via PR #13182 (Lane PV, merged c22ec1948eb4, 2026-11-23T10:37:54Z): a standalone PolicyPoint opened from the verified JoinGrant, with the §7 hash-chained, host-signed audit log, owner summaries, and the agent_parked world event type.

How it happened (claim timeline on #7916)

Ask

Reconcile to one policy point before step 5 (#7917) builds on it:

  1. Pick the surviving shape. The two are complementary, not identical: mcp_policy has the bridge-session integration the spike run will drive; agent_policy has the §7 signed/hash-chained audit chain with tamper verification, owner-summary rendering, and the standalone park-event type. The survivor must carry all of: ceiling from the role grant, quota charged before execution with visible parking, per-tool rate limits, stale-decision rejection, one audit event per action (refusals included), signed/hash-chained log with end-to-end verification, owner summary.
  2. Port any missing pieces from the other module, delete the losing module and its tests, and keep the full cargo test -p id-caps suite green.
  3. Record the survivor's name on id(phase-14): spike 5/5 — bounded program interaction + end-to-end spike run #7917 so step 5 builds on exactly one policy point.

Notes

  • Both modules are additive and independently tested; nothing else references either yet, so the reconciliation is contained to id-caps.
  • Process follow-up worth folding into lane briefs: a claim comment is a hard stop for later lanes, and a lane about to merge should re-read the issue's newest comments first (PV's miss here).
{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T10:42:20Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Claim — Lane RY (archer) taking this reconciliation now.

    Plan: read both modules on current main, pick the surviving shape, port the missing pieces so the survivor carries the full union (ceiling from role grant, quota charged before execution with visible parking, per-tool rate limits, stale-decision rejection, one audit event per action incl. refusals, signed/hash-chained audit log with end-to-end verification, owner summary, bridge-session integration), delete the losing module + its tests, keep cargo test -p id-caps green, and record the survivor's name on #7917.

  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    Done — Lane RY (archer). Reconciliation landed in PR #13220, merged ec65b1f095ca (head SHA-guarded at 576950cd81a).

    Survivor: id_caps::mcp_policy::PolicySession — the bridge-integrated shape. Deleted: agent_policy.rs (standalone PolicyPoint) and tests/agent_policy_point.rs; repo-wide grep confirms no remaining references.

    Ported from the deleted module so the survivor carries the union:

    • Per-tool rate limits (§6.3) — RoleGrant.rate_limits, a sliding admitted-call window per tool, AuditOutcome::RefusedRateLimit, RefusalKind::RateLimited. PolicySession::act now takes host time (now, unix seconds) to drive the windows.
    • Structured park event (§6.2) — PolicyRefusal.park_event is now a serializable ParkEvent (kind agent_parked, reason, message, agent key, world, at, quota spent, budget) instead of the bare message string.
    • Owner-summary refusal breakdown — OwnerSummary.refusals_by_code, keyed by the new AuditOutcome::refusal_code().

    Deliberately not ported: delegation expiry (not in this issue's union list, and RoleGrant carries no expiry field) and the join-granted opening audit event (here the bridge session's world.join call is the audited join).

    Verification (laptop, nix develop in pkgs/id — the verifying route):

    • cargo test -p id-caps: 251 lib passed / 0 failed (incl. 11 mcp_policy tests: the 9 pre-existing plus new rate-limit window-slide and summary-breakdown tests; park-event fields asserted in the updated parking test), integration suites 3 + 1 passed, doc-tests 0.
    • cargo fmt -p id-caps clean; clippy on the changed file shows no new findings (the one remaining clippy::panic hit in the parking test is byte-identical on main — pre-existing).
    • Remote dispatch attempted (run 45163041868, handle fp_128de6ec7c1619b26ddb828735338eec): failed in the "Execute target command" step — the fleet-build container cannot run nix develop today, the fix(fleet-dispatch): nix develop commands fail in the fleet-command container (nix config shaped for a daemon that is not there) #13198 shape (three identical environment failures recorded there this morning). Not a code result; main-branch CI is the remaining gate per repo policy.

    Survivor name also recorded on #7917 for step 5.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions