Skip to content

test: move agent_protocol's tests out of line and repoint the schema sweep pin (#15193) - #16669

Open
EffortlessSteven wants to merge 2 commits into
mainfrom
claude/relocate-tail-pr3
Open

EffortlessSteven wants to merge 2 commits into
mainfrom
claude/relocate-tail-pr3

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

Moves lsp/agent_protocol.rs's inline tests to agent_protocol/tests.rs. It is a tail owner because xtask's schema producer sweep pins capability_output_matches_the_published_schema by reading agent_protocol.rs with include_str!, so this PR points that pin and the binding's "narrower authority" text at the new file. The LSP stderr guard in lsp/tests.rs keeps reading the production file, which is what it scans. The rest is mechanical_relocation.py apply output.

Source-of-truth Links

Proposal: #15217
Governing issue or accepted claim: #15193
Acceptance delta (one sentence): Moves agent_protocol's inline tests out of the published source and repoints the schema sweep pin that names one of them.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): claude/relocate-tail-pr3
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none

Scope

Production delta:

  • None. Only #[cfg(test)] code moves.

Evidence/support delta:

  • agent_protocol/tests.rs (new), the owner, xtask/src/schema_producer_sweep.rs (one pin, one string), policy/inline-test-modules.txt, and the traceability rows that name the moved tests.

Non-goals:

Proof

  • Reproduction: mechanical_relocation.py apply on base 3b7bf9e, with only the check named below relaxed, regenerates every file in this commit byte for byte except the hand edit to xtask/src/schema_producer_sweep.rs. No check needed relaxing for this owner; the verifier refuses only because of that xtask edit.
  • mechanical_relocation.py verify refuses it as expected, so this is an ordinary PR under the size cap, not the mechanical route.
  • On 6ebd6e3: cargo xtask precommit, check-process-policy, check-capability-producers, check-verification-contracts, check-doc-artifacts, check-doc-index, check-local-context exit 0; cargo test -p xtask --bin xtask schema_producer_sweep passes 32 tests.
  • A second commit points docs/verification/schema-producer-audit.md's agent-capability row at the moved tests.
  • Independent subagent review: no findings beyond that doc row.

Source review: REVIEW_READY 6ebd6e3

  • Not run locally: the moved tests in the ripr lib binary (it runs out of memory in this container). Hosted CI runs them.

Claim Boundary

May claim: these inline tests leave the published source and still compile and run as unit tests.
Must not claim: a measured .crate size change.

Rollback

Plain revert.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

  • n/a (no workflow change).

Generated by Claude Code

…sweep pin (#15193)

The agent-capability schema binding in xtask's schema producer sweep pins
capability_output_matches_the_published_schema by reading agent_protocol.rs
with include_str!. The test now lives in agent_protocol/tests.rs, so the pin
and its authority text read that file. The LSP stderr guard keeps reading the
production file, which is what it scans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzV3JdcCDM6STapqHBr
@EffortlessSteven EffortlessSteven self-assigned this Nov 30, 2026
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary by CodeRabbit

  • Tests
    • Organized the agent protocol tests into a dedicated test suite. Coverage checks schema and capability consistency, compatibility across schema versions, valid command and envelope fields, and read-only behavior.
    • Updated verification references to match the reorganized test suite; protocol contracts and behavior remain unchanged.

Walkthrough

The inline agent protocol tests moved to crates/ripr/src/lsp/agent_protocol/tests.rs. Traceability, schema audit, policy, and schema-sweep references were updated to reflect the new test location.

Changes

Agent Protocol Test Relocation

Layer / File(s) Summary
Test module and capability schema checks
crates/ripr/src/lsp/agent_protocol.rs, crates/ripr/src/lsp/agent_protocol/tests.rs, .ripr/traceability.toml, docs/verification/schema-producer-audit.md, policy/inline-test-modules.txt, xtask/src/schema_producer_sweep.rs
The inline tests moved into tests.rs. Capability fixtures and schema checks are in the test module. Traceability and schema-sweep references now use the new path, and the inline-test ceiling entry was removed.
Protocol versions, routes, and command specs
crates/ripr/src/lsp/agent_protocol/tests.rs, .ripr/traceability.toml
Tests cover protocol and schema versions, route compatibility, readiness values, command-spec serialization, and validation of route/spec combinations. Traceability entries point to the relocated tests.
Envelope decoding and read-only boundaries
crates/ripr/src/lsp/agent_protocol/tests.rs, docs/verification/schema-producer-audit.md
Tests check envelope fields, snapshot identities, typed values, unknown fields, and read-only boundaries. The schema audit points to the relocated envelope tests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • Issue 2707 describes the manual traceability path updates required when tests move. This PR updates the affected test paths in .ripr/traceability.toml.
  • Issue 15217 describes a verified size-cap exception for inline test-module relocations. This PR relocates the test module and removes its inline-test ceiling entry, but does not add a separate exception mechanism.
Merge Risk: Minimal · up to 6ebd6

This is a test-only relocation with updated references and no production code change. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: moving agent_protocol's inline tests out of line into a separate file, and repointing the schema sweep pin to the new file. It is a conventional-commit title of 87 cha…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template for the sections that matter most to this change. It states the summary and scope (test-only relocation of inline tests from lsp/agent_protocol.rs to ag…
Full details: Title check

Explanation

The title names the main change: moving agent_protocol's inline tests out of line into a separate file, and repointing the schema sweep pin to the new file. It is a conventional-commit title of 87 characters, within a typical length, and matches the changeset.

Full details: Description check

Explanation

The description follows the repository template for the sections that matter most to this change. It states the summary and scope (test-only relocation of inline tests from lsp/agent_protocol.rs to agent_protocol/tests.rs), links the proposal, governing issue, and acceptance delta, names the candidate branch and records no stack parent or replacement, and gives a single production/evidence delta with non-goals. It also covers claim boundary, rollback, static language check, and CI economics (n/a, no workflow change), and it reports concrete proof: a reproduction via mechanical_relocation.py, local precommit and focused xtask checks, and the one test run that was not done locally. Gaps: the Swarm / Source Boundary checkbox is not ticked, Support-tier Impact and Policy Impact sections are not filled in (the policy/inline-test-modules.txt ceiling change is not recorded under Ledger or exception notes), the Spec-Test-Code Traceability section is blank, the Engineering Check and Gates checkboxes are unticked, and the Proof section lacks a fenced command block and does not state a clear result for the full Gates list. Because the core intent, scope, and proof are clear, the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the schema rows,
Then hops where every test now goes.
The routes and envelopes pass review,
Their typed fields steady, clear, and true.
The old inline burrow rests;
A fresh file holds the tests.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 0a652cf8-907b-4de7-9c03-fc931057424e
Commits

Reviewing files that changed from the base of the PR and between 3b7bf9e and 6ebd6e3.

Files selected for processing: 6

  • .ripr/traceability.toml
  • crates/ripr/src/lsp/agent_protocol.rs
  • crates/ripr/src/lsp/agent_protocol/tests.rs
  • docs/verification/schema-producer-audit.md
  • policy/inline-test-modules.txt
  • xtask/src/schema_producer_sweep.rs
Files with no reviewable changes: 1

  • policy/inline-test-modules.txt

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

…tocol/tests.rs (#15193)

The parity and resolver tests the row names moved with the relocation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzSjosVsQMRGZjsjVDi

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

SOURCE_REVIEW_READY

Head: 6ebd6e3

Inspected: the full diff, a byte-for-byte reproduction of the moved files with the repository's relocation transform (only the xtask pin is a hand edit), and an independent subagent review.

  • The schema sweep pin now reads agent_protocol/tests.rs, where capability_output_matches_the_published_schema sits directly under #[test]; the binding's reason text still names the test.
  • The LSP stderr guard in lsp/tests.rs keeps reading the production file, which is what it scans; verification_contracts.rs producer pins match the version constant, which stays in production.
  • The second commit points the schema producer audit row at the moved parity and resolver tests.
    Local on this head: cargo xtask precommit, check-process-policy, check-capability-producers, check-verification-contracts, check-doc-artifacts, check-doc-index and check-local-context exit 0, and cargo test -p xtask --bin xtask schema_producer_sweep passes 32 tests. The moved unit tests run in hosted CI only.

Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 30, 2026 07:39
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants