Skip to content

test(mcp): prove remote status across the tools/call boundary - #1816

Merged
ScriptedAlchemy merged 1 commit into
masterfrom
pr1645/remote-status-proof
Sep 19, 2026
Merged

ScriptedAlchemy merged 1 commit into
masterfrom
pr1645/remote-status-proof

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Supersedes #1645. Same goal — prove tracedecay_remote_status at the
tools/call boundary — carrying only the test and its mod registration,
rebased onto current master.

What landed

crates/tracedecay/tests/mcp_suite/mcp_handler_test/remote_status_test.rs
plus its alphabetical mod remote_status_test; line. Two cases:

Seam Mounted reader Expected
ProductionProjectCompositionHarnessV1 (no listener, no node) yes unconfigured, markdown + JSON
Direct protocol server over JSON-RPC no unavailable, markdown + JSON, no isError

Both assert the response carries exactly one content block, which pins that
a typed read attaches no banner or token footer.

Why this gap is real

tracedecay_remote_status was already proved below the transport, in three
places: the handler unit test in tracedecay-mcp, remote_status_dispatch_tests
(dispatch function, observed + unavailable), and daemon::remote_protocol_tests
(session runtime registry, unconfigured + observed with a provisioned node and
serving listener). None of them crosses tools/call, so the two typed no-plane
outcomes could diverge at the boundary without a failing test. unconfigured
in particular had no coverage anywhere above the registry.

Why no configured-plane case here

The production harness exposes no registry accessor, so mounting an observed
plane in an integration test would mean reproducing daemon authority
acquisition, a database scope, a signed enrollment grant, and admission — to
re-prove what remote_protocol_tests (registry side) and
remote_status_dispatch_tests (dispatch side) already cover. Left to those two
and noted in the module doc comment.

What was dropped from #1645

Everything else on cursor/prove-remote-status-f89f is a stale divergent fork
of the already-merged #1789 and is not carried:

  • .github/workflows/ci.yml policy change (pull_request trigger + ci-full
    label gate)
  • nine sleep-driven retry loops added to deterministic tests
    (code_index_scheduler reconcile/serving, generation_retention_test,
    lcm_preserved_profile_journey_test, daemon_fixture, session_search_test,
    and others)
  • a weakened acceptance assertion in
    runtime_acceptance_suite/advisory_runtime_acceptance.rs
  • unrelated fixes in git_intelligence.rs, tracedecay-global-db,
    tracedecay-privacy, and ignored_dependency_admission_tests
  • the branch's mcp_handler_test.rs, which deletes 17 module registrations

The test itself is also trimmed: the assert_ne! lines that restated the
assert_eq! immediately above them (!= UNAVAILABLE_*, != "{}",
!= "_No results._\n") and a re-parse of a string already compared to its JSON
literal are gone. The isError assertion on the direct-server response stays —
successful_tool_text does not check it.

#1645 is left open for its author to close.

Verification

Check Result
cargo test -p tracedecay --features tracedecay/test-transport --test mcp_suite -- remote_status_test 2 passed, 0 failed
cargo clippy --workspace --all-targets --locked -- -D warnings clean
cargo fmt --all -- --check clean
scripts/lint-commit-range.mjs origin/master HEAD clean

CI not dispatched.

🤖 Generated with Claude Code

`tracedecay_remote_status` was proved only below the transport. The
handler unit test and `remote_status_dispatch_tests` call the dispatch
function directly, and `daemon::remote_protocol_tests` reads the session
runtime registry. Nothing exercised the tool through a real `tools/call`,
so the two typed no-plane outcomes could diverge at the boundary without
a failing test.

Add the transport-level cases the existing suites do not cover:

- A production composition harness mounts the Remote Brain reader with no
  listener and no registered node, so `tools/call` must render
  `unconfigured` in both markdown and JSON.
- A direct protocol server never installs the reader, so the same call
  over JSON-RPC must render `unavailable`, with no `isError`.

Both cases also assert the response carries exactly one content block,
pinning that a typed read attaches no banner or token footer.

The configured (`observed`) plane is left to the two suites that can
mount one cheaply: the harness exposes no registry accessor, so
provisioning a node here would duplicate `remote_protocol_tests` at the
cost of reproducing daemon authority acquisition, a signed grant, and
enrollment admission in an integration fixture.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 391c6a4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 391c6a4ddd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


let markdown = response_with_id(&responses, json!(1));
assert_eq!(
successful_tool_text(&markdown, "markdown remote status"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Assert semantic success for the markdown response

If only the default-markdown path regresses to return isError: true while preserving the expected text, this test still passes: successful_tool_text checks the JSON-RPC error and first text block, while the explicit isError assertion applies only to json_response. Assert the markdown result's semantic-success state as well so this case proves that an unmounted authority remains a typed result.

AGENTS.md reference: AGENTS.md:L192-L193

Useful? React with 👍 / 👎.

);
let json_response = response_with_id(&responses, json!(2));
assert_eq!(
successful_tool_text(&json_response, "json remote status"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Assert direct-response content cardinality

If the direct transport appends a banner or token footer as another content block, both assertions still pass because successful_tool_text reads only result.content[0]. The daemon half uses status_text to require exactly one block, but this direct-server half therefore does not enforce the same response-identity contract; validate the content array and its length for both direct responses.

AGENTS.md reference: AGENTS.md:L177-L178

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-19T06:34:00.339883Z 391c6a4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ScriptedAlchemy
ScriptedAlchemy merged commit 27822c5 into master Sep 19, 2026
1 check 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