Skip to content

fix(mcp): let a Task Capsule record its acting Host - #22

Merged
Endofthestars merged 1 commit into
mainfrom
codex-handoff/claude-code-host-validation
Jul 31, 2026
Merged

fix(mcp): let a Task Capsule record its acting Host#22
Endofthestars merged 1 commit into
mainfrom
codex-handoff/claude-code-host-validation

Conversation

@Endofthestars

@Endofthestars Endofthestars commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Continues the REPAIR work from #21. That round left three items open; this one closes the only one that was actionable here — the Claude Code CLI Tier 1 Host validation — by actually running the trial rather than inspecting the contract.

What the trial found

Read-only discovery passed immediately: a fresh Claude Code CLI 2.1.220 conversation connected to the Benchwork MCP server and discovered all 38 registry tools, with benchwork_status and benchwork_next_actions returning ok: true / mcp-tool-result/1.0 — both from an explicit request and from the broad "What should we do next for this study?" with 26 non-MCP tools still available.

The bounded Task loop did not pass. benchwork_open_task minted every Task Capsule with a hardcoded codex Host and exposed no way for the acting Host to declare itself, so truthful claude-code provenance was refused:

VALIDATION_REJECTED: Agent Result provenance Host does not match its Task Capsule

Athanor was right to refuse. The defect was in the MCP boundary — in a module whose own docstring claims to be host-neutral. Notably the trial Host reported the rejection instead of resubmitting a false codex provenance to force a green run.

This is exactly what the evidence policy means by "contract inspection is insufficient": hosts.py already exported a ClaudeCodeHostAdapter, the Capsule schema already enumerated claude-code, and Ward already admitted it. Only a live Host reached the one line that did not.

The fix

benchwork_open_task now accepts the same optional host_session argument that benchwork_complete_task and benchwork_fail_task already took, and mints the Capsule for that Host.

  • Default remains codex, so existing clients behave exactly as before.
  • An unregistered Host is refused at the boundary instead of being minted and later rejected by Ward.
  • Additive optional field under the MCP API Policy; the 38 frozen tool names are unchanged.

Result

The repaired loop completed end to end, verified independently from Chronicle rather than from the agent's self-report:

Item Value
Task TK-B280B5160682, capability bench.code.inspect
Capsule Host claude-code
Ward PASS
Completion ok: true, Receipt RC-47D74468807A
Chronicle 2 verified events, Receipt chain intact

The recorded provenance carries the real --session-id, so it cross-checks against the transcript that produced it. The Host used only Read alongside the Benchwork tools, matching the Capsule Circle. The source repository never acquired a .benchwork/ directory.

Claude Code CLI moves from PENDING_HOST_VALIDATION to PASS. HOST-IDE-001 and WAITING_FOR_DISCLOSURE_AUTHORIZATION are untouched — neither was exercised here.

Gate

178 unittest cases OK, 175 pytest passed + 46 subtests, ruff clean, mypy clean on 35 files, 92 schemas validated, doc links verified, release policy permitted.

Coverage note: main currently measures 79.93% locally, just under the configured fail_under = 80. This branch raises it to 80.01%.

Evidence: examples/phase2-final/host-claude-code/

benchwork_open_task minted every Task Capsule with a hardcoded codex Host
and exposed no way for a non-Codex Tier 1 Host to describe itself, so a
truthful claude-code provenance was refused with VALIDATION_REJECTED.
Athanor was right to refuse; the defect was in the MCP boundary, in a module
whose own docstring claims to be host-neutral.

open_task now accepts the same optional host_session argument that
complete_task and fail_task already took. The default remains codex so
existing clients are unchanged, and an unregistered Host is refused at the
boundary instead of being minted and later rejected by Ward. This is an
additive optional field under the MCP API Policy; the 38 frozen tool names
are unchanged.

Found by the Claude Code CLI Tier 1 Host trial, which is recorded under
examples/phase2-final/host-claude-code together with the repaired loop:
Capsule TK-B280B5160682 with host claude-code, Ward PASS, and Receipt
RC-47D74468807A. Claude Code CLI moves from PENDING_HOST_VALIDATION to PASS.
@Endofthestars
Endofthestars force-pushed the codex-handoff/claude-code-host-validation branch from 53e2573 to b3e8cbf Compare July 31, 2026 12:56
@Endofthestars
Endofthestars merged commit a34298c into main Jul 31, 2026
14 checks passed
@Endofthestars
Endofthestars deleted the codex-handoff/claude-code-host-validation branch July 31, 2026 14:03
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