Skip to content

feat(pm-service): mount surface C in worker.ts with H3-wired resolveOwnerSession (H4 #14262) - #17067

Merged
developing-today-fleet[bot] merged 2 commits into
mainfrom
lane/2207j-surface-c-worker-wiring
Nov 30, 2026
Merged

developing-today-fleet[bot] merged 2 commits into
mainfrom
lane/2207j-surface-c-worker-wiring

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Refs #14262 (H4, child of #9086) — lands the wiring remainder named in CEN-C15's current-state record on that issue: the backend was merged (PRs #14996, #15037) but H3's session core was not wired as surface C's injected resolveOwnerSession, and worker.ts did not mount the handler.

What

  • pm-stack/pm-service/src/worker.ts mounts createSurfaceCHandler for the surface C routes (/api/agent-credentials, /api/agent-credentials/<jti>, /oauth/token, /api/agent/whoami) ahead of the browser-session gate — those routes carry their own auth, so the gate must not pre-empt them.
  • resolveOwnerSession is derived from BROWSER_OAUTH: the H3 browser session cookie via authenticateBrowserSession, re-resolved against live roles on every mint/revoke — the exact seam surface-c-api.ts documents ("H1 front door + H3 cookie in the wired service").
  • The rest of the composition (central credential store, agent front-door deps, access-token signer, lifecycle audit) is supplied by the deployment via the new optional SURFACE_C env, mirroring the BROWSER_OAUTH pattern. Until supplied, the routes answer a structured 503 — no stub ever pretends to mint.

What this does NOT do

Full #14262 acceptance still waits on the production token signer from #9077 (OPEN — the long pole CEN-C15 named). This PR removes the worker-wiring blocker only; the issue stays open.

Verification

New test/worker-surface-c.test.ts (oracle: the CEN-C15 record + the H4 acceptance loop): 503-unconfigured, mint denied without the H3 cookie, and issue → exchange → act (with audit attribution) → revoke → next request denies, end to end through handlePmServiceFetch. Local bun test on the assembled pm-service tree: worker-surface-c (3) + worker-auth + agent-credentials suites — 19 pass, 0 fail. CI is not a gate per Drew's standing rule; the diff was read in full against the issue.

Lane 2207-J (charlie ADVANCE programmes+author, 2026-11-29).

{
  "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-30T04:39:10Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch/hatch-personal",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch/hatch-personal",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "a58b1cfc262b3e6935467ccdcb0a63da7bf7cf20"
    },
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 931a7ffc-4962-4749-ba09-053497221697

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@developing-today-fleet
developing-today-fleet Bot merged commit 3ca0239 into main Nov 30, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the lane/2207j-surface-c-worker-wiring branch November 30, 2026 04:39
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.

0 participants