Skip to content

mcp: settle the refusal-relay guard reach (403-declared app codes), pin its 5xx arm, and relay delete_records per-row refusals #37512

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Filing gate: ① · Source: fleet. These are findings S1–S3 and N1–N3 from the contract record on PR #37497 (head ef53eb66, record 7188290670). Follow-up of #37416. Under the maintainer's rule a simple issue becomes a follow-up card. Nothing here is an exposure: each item withholds more than REST does, or is missing a pin.

reach: read at PR #37497 head ef53eb66 · evidence: read (the /data half of S1 is inferred from docblocks, not traced).

What

  1. S1, guard reach. A listed refusal whose catalogue entry declares status: 403 under an app code is demoted to PERMISSION_DENIED (thrownAnswerOf, HttpStatusErrorCodeMap[403]). So the MCP relay is withheld, and the 500-character cut stays on the record tools. REST /data serves details.refusals whole for the same caller (inferred), and /actions serves the uncut userMessage. The changeset does not name this and no test pins it. Decide the reach of the The runtime dispatcher serialises a PermissionDeniedError's details to the client, so positions / permissionSets reach the browser on the /data transport #7450 withholding rule for these codes. Then either narrow the guard to the generic PERMISSION_DENIED, or keep it and say so in the docs, with a test either way.
  2. S2, the 5xx arm. The guard's 5xx arm has no test. Its jsdoc reason is also wrong: /actions and /data both still serve userMessage on a declared 5xx.
  3. S3, delete_records per-row refusals. rowRefusalOf still carries the cut sentence, and the relay does not reach it.
  4. Nits:
    • N1: the four record read tools and the delete_records outer catch are wired but have no case.
    • N2: a throw that is both FLOW_FAILED and listed (three blocks) has no case.
    • N3: on run_action / resume_run the lead text says the door "may have cut" a userMessage that door never cuts.

Expected

  • The guard's reach for 403-declared app codes is decided and pinned.
  • The 5xx arm has a case and a correct jsdoc.
  • delete_records per-row refusals are relayed like the outer refusal, or declared out of reach with a reason.
  • N1 to N3 are covered or corrected.

Activity

  1. added
    finding
    area:ai
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:server · Task · priority:p2 · pm:queue · size S; rationale: review follow-ups on the MCP refusal relay. A 403-declared app code is demoted, so the per-reason relay is withheld; the 5xx arm needs a pin; delete_records per-row refusals are not relayed. MCP is a key feature, and an agent gets less than REST serves: p2.

  3. added
    domain:server
    pm:queue
    priority:p2
    on Nov 26, 2026
  4. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-sales · session_01L6bhgVUz5oS8fMgmncxU96

    Claim: PM loop round 1 · 2026-11-26T10:43Z
    Area: s2-ai
    Session: session_01L6bhgVUz5oS8fMgmncxU96
    Account: os-sales
    Branch: claude/issue-37512-mcp-refusal-relay-reach
    Worktree: objectstack-issue-37512
    Domain: domain:server
    Seat: repo:objectstack#2
    File surface: packages/mcp/src/mcp-http-tools.ts, packages/mcp/src/mcp-refusal-reasons.test.ts (or a new test file named for this card), one .changeset/37512-*.md (@objectstack/mcp patch) (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate), effort: high (reason: S1 is a parity judgement against the #7450 ruling, not mechanical)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/mcp/src/mcp-http-tools.ts (objectstack-ai/objectstack): withRefusalReasonsRelay (:1446) keys on the served code alone, so a 403-declared app code demoted to PERMISSION_DENIED by thrownAnswerOf loses the per-reason relay; rowRefusalOf (:2396-2402) drops refusals for delete_records rows | REST /data serves details.refusals whole for the same 403-declared app code (classifyDataError declared-status arm + withDeclaredRefusalLines), the dispatcher's isPermissionDeniedError arm withholds them for the security gate (#7450 ruling 5248469105) | every MCP agent calling the record and action tools
    Thread-read: 7189241384
    Premise: holds (origin/main 54ea3c8: S1 guard mcp-http-tools.ts:1446, demotion actions-door-answer.ts:415, HttpStatusErrorCodeMap[403] errors.zod.ts:186; S2 no 5xx case in mcp-refusal-reasons.test.ts, jsdoc :1437-1439; S3 rowRefusalOf :2396-2402; N1 no case for the read tools / delete_records outer catch; N2 no FLOW_FAILED+listed case; N3 lead text :1405)
    Serial constraints cleared: open PR #37436 (seat 5, #36806) also edits packages/mcp/src/mcp-http-tools.ts; textual overlap is read by overlap-check.mjs before the first push and the merge queue arbitrates; no other open PR touches these files

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  6. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-sales · session_01L6bhgVUz5oS8fMgmncxU96
    os-dev-report

    {
      "issue": 37512,
      "status": "done",
      "branch": "claude/issue-37512-mcp-refusal-relay-reach",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37537",
      "head": "4682eb84568febbca9a4db4e2ce6b3347345d6c3",
      "premise_still_valid": true,
      "summary": "Container & model: `S`, `mode:subagent`, `model: TIER_DEFAULT (dispatch-gates --tier: no path-derived mandate)`, `effort: high (reason: S1 is a parity judgement against the #7450 ruling, not mechanical)`. S1: withRefusalReasonsRelay now withholds only on a served PERMISSION_DENIED with no declaredCode (the security gate's own refusal); a listed refusal an app declared at 403 (demoted to PERMISSION_DENIED beside declaredCode) gets the relay on all record and action tools, and errorResultFromThrown's PERMISSION_DENIED arm routes through the same guard while still serving no details. Parity is pinned by a test reading both REST doors' own readers on the same throw (mapDataError and actionsDoorAnswerOf each serve details.refusals equal to the lines; the dispatcher's isPermissionDeniedError reads false for it in a scratch probe), plus a gate-shaped control that gets no relay and leaks none of its details. S2: 503 cases on run_action/resume_run and a corrected jsdoc reason (catalogue entries are 4xx-only at authoring). S3: measured that delete_records group reasons are NOT cut for the catalogue's throw (its innerMessage equals userMessage, every line whole, closing last), so declared needless in rowRefusalOf's jsdoc and pinned with a list over 500 chars; grouping shape untouched. N1 (four read tools + delete_records outer catch + beside members), N2 (FLOW_FAILED and listed = three blocks) covered; N3 lead text no longer claims a cut. Two premise parts corrected with evidence in the PR body (S2 5xx catalogue entry, S3 cut sentence). L2 contract review judged owed: the diff narrows a permission-keyed withholding guard (Security-touching reads yes; no exposure found, the relay reads no details).",
      "gates": "On 4682eb8456. Package: `pnpm --filter @objectstack/mcp typecheck && pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2` under the verify lock: VERDICT command-exit 0, Test Files 86 passed (86), Tests 1557 passed (1557), check:test-typecheck OK. Card file: 31 passed (31). Ablations via scripts/ablation-replace.mjs, each restored to HEAD blob 0754deea with git diff HEAD empty: S1 guard 5 failed/26 passed; S2 isServerFault guard 2 failed/29 passed; /actions PERMISSION_DENIED arm 2 failed/29 passed. Derived set `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (3 paths vs merge base 54ea3c8c3): 67 derived, 66 exit 0, 1 NOT MEASURED `pnpm check:dual-build-cjs-loads` exit 3 (PREREQUISITE NOT MET: whole workspace unbuilt; CI Build Core runs it). `--ran` with exit codes: 67 accounted, 66 run, 1 NOT-MEASURED derived, 0 UNRUN, exit 0. overlap-check before push and before pr_create: VERDICT clean exit 0 (origin/main and #37436 merge cleanly). CI check-runs on the head: in_progress at report time (23 listed, 4 skipped by selectors, rest in_progress); CI is the authority for every family. test:repo not run locally (CI Test Core).",
      "line_budget": "267 changed lines (+251/-16, 3 files) vs the 3000 human-merge threshold: under. No skills/** or ratchet ledger touched.",
      "deviations": "1) First pr_create action file wrapped the actions in an object; the validator refused it with zero writes, then sent as the array: one write. 2) First S1 ablation was a no-op refused by ablation-replace before any run (the replacement text already occurred in the file); re-run with a distinct marker. 3) PR footer follows the dispatch order's form (Generated-with line + session URL + signed line) rather than os-dev.md's session-URL footer line; the relay read back the body identical, 8711 bytes. 4) Commit trailer uses the model-free pair from the dispatch, not the harness reminder's model-named Co-Authored-By. 5) dogfood battery not run: no ! in the title and no (narrowing) arm.",
      "files_changed": [
        ".changeset/37512-mcp-refusal-relay-reach.md",
        "packages/mcp/src/mcp-http-tools.ts",
        "packages/mcp/src/mcp-refusal-reasons.test.ts"
      ],
      "relay_writes": "2 — pr_create (objectstack-ai/objectstack#37537, draft, assignees os-sales, read back identical) and post-stamped issue comment on #37512 (this report). git push of the own branch is not a REST write.",
      "mcp_calls": "0",
      "security_findings": "none"
    }
  7. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

    L1 ACCEPT on PR #37537 at head 4682eb8 (record 7191332843); no contract face hit, so no L2 owed. Tier S: readied and auto-merge armed at 2026-11-26T11:55Z.

  8. removed
    pm:dispatched
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:serverfindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions