Skip to content

refactor: renew verification and test surfaces - #249

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/verification-renewal
Apr 20, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/verification-renewal

Conversation

@Sinity

@Sinity Sinity commented Apr 20, 2026 •

Copy link
Copy Markdown
Owner

Closes #246

Summary

  • migrate devtools pipeline-probe onto the authored PipelineProbeRequest and workspace contracts
  • split MCP verification helpers/tests across query, tag, and archive-ops seams instead of monolithic repo mocks
  • remove the remaining verification-time private API reach-through in verify-showcase and refresh generated devtools references

Problem

The substrate and surface renewal work had already tightened repository, archive-ops, and workspace contracts, but the verification layer was still asserting older shapes. pipeline_probe still projected an ad hoc argparse.Namespace world, MCP tests still modeled a monolithic repo surface, and verify_showcase still reached through a private runner method.

Solution

The probe path now projects CLI input onto PipelineProbeRequest, uses VerificationWorkspace, and replays archive subsets through a typed raw-conversation store seam. MCP test helpers were rebuilt around separate query/tag/archive-ops mocks so tool and resource tests assert the renewed boundaries directly. verify_showcase now uses the public run_exercise() helper, and the devtools command catalog/docs were updated to reflect the broadened probe contract.

Verification

  • ruff check devtools/pipeline_probe.py devtools/verify_showcase.py devtools/command_catalog.py tests/unit/devtools/test_pipeline_probe.py tests/infra/mcp.py tests/unit/mcp/test_mcp_edge_cases.py tests/unit/mcp/test_server_surfaces.py tests/unit/mcp/test_tool_contracts.py
  • mypy devtools/pipeline_probe.py devtools/verify_showcase.py devtools/command_catalog.py tests/unit/devtools/test_pipeline_probe.py tests/infra/mcp.py tests/unit/mcp/test_mcp_edge_cases.py tests/unit/mcp/test_server_surfaces.py tests/unit/mcp/test_tool_contracts.py
  • pytest -q tests/unit/devtools/test_pipeline_probe.py tests/unit/mcp/test_mcp_edge_cases.py tests/unit/mcp/test_server_surfaces.py tests/unit/mcp/test_tool_contracts.py
  • devtools render-devtools-reference
  • devtools render-agents
  • devtools render-all --check
  • devtools verify

@coderabbitai

coderabbitai Bot commented Apr 20, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 75064db8-9e8c-4c5b-99fc-c6690143cc8f

📥 Commits

Reviewing files that changed from the base of the PR and between b45c11e and d74c82f.

📒 Files selected for processing (9)
  • devtools/command_catalog.py
  • devtools/pipeline_probe.py
  • devtools/verify_showcase.py
  • docs/devtools.md
  • tests/infra/mcp.py
  • tests/unit/devtools/test_pipeline_probe.py
  • tests/unit/mcp/test_mcp_edge_cases.py
  • tests/unit/mcp/test_server_surfaces.py
  • tests/unit/mcp/test_tool_contracts.py

📝 Walkthrough

Walkthrough

Refactors the pipeline-probe CLI from argparse-based invocation to contract-driven architecture using PipelineProbeRequest. Splits monolithic test mock factory into granular make_query_store_mock(), make_tag_store_mock(), and make_archive_ops_mock() functions. Updates verify-showcase to use shared run_exercise helper. Updates all related tests and documentation accordingly.

Changes

Cohort / File(s) Summary
Command Metadata
devtools/command_catalog.py, docs/devtools.md
Updated pipeline-probe command description to reflect new input modes (synthetic, staged, archive-subset) and typed probe interface.
Pipeline Probe Core Refactoring
devtools/pipeline_probe.py
Replaced CLI-driven run_probe(args: argparse.Namespace) with contract-driven run_probe(request: PipelineProbeRequest). Added _request_from_args() mapping, introduced _workspace_for_request(), updated _isolated_env() for workspace env vars (HOME, XDG_CACHE_HOME), refactored _run_probe_pipeline() to accept request object, and changed archive-subset seeding to depend on _RawConversationStore protocol. Updated budget reporting and JSON output path handling.
Verify Showcase Update
devtools/verify_showcase.py
Removed direct ShowcaseRunner instantiation in run_tier_0() and replaced with shared run_exercise() helper, passing invoke_showcase_cli as a dependency.
Test Mock Infrastructure
tests/infra/mcp.py
Replaced monolithic make_repo_mock() with three granular factories: make_query_store_mock() (list/search/view/get/delete conversation ops plus new async summary methods), make_tag_store_mock() (tag/metadata CRUD), and make_archive_ops_mock() (conversation/archive reads and storage stats).
Pipeline Probe Tests
tests/unit/devtools/test_pipeline_probe.py
Removed local argparse.Namespace subclasses and replaced with factory functions returning PipelineProbeRequest. Updated probe invocations to use request objects and consolidated configuration into explicit parameters for _source_subset_request() and _archive_request().
MCP Edge Case Tests
tests/unit/mcp/test_mcp_edge_cases.py, tests/unit/mcp/test_server_surfaces.py, tests/unit/mcp/test_tool_contracts.py
Updated patches from _get_repo to _get_tag_store or _get_query_store, replacing make_repo_mock() with corresponding granular mock factories. Test control flow and assertions unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • Issue #222: This PR implements a targeted CLI/pipeline refactor (argparse → typed PipelineProbeRequest, workspace contract) that aligns with the repository's larger boundary contract renewal program.
  • Issue #227: The changes align verification and test surfaces (pipeline-probe refactoring, test mock decomposition, verify-showcase helper update) with renewed substrate contracts.
  • Issue #245: This PR directly implements surface-level contractization by introducing PipelineProbeRequest, switching probe flows to contract APIs, and replacing monolithic mocks with granular store-specific factories adhering to _RawConversationStore protocols.

Poem

🐰 Contracts bloom where argparse did reign,
Mocks now split—no more domain pain,
Workspace dwells in typed request's home,
Verify hops through refactored loam! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/verification-renewal

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit 408c7e5 into master Apr 20, 2026
10 of 12 checks passed
@Sinity
Sinity deleted the feature/refactor/verification-renewal branch April 20, 2026 05:17

@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: d74c82fe53

ℹ️ 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".

Comment thread devtools/pipeline_probe.py Resolved
Sinity added a commit that referenced this pull request Apr 22, 2026
Closes #246

## Summary
- migrate `devtools pipeline-probe` onto the authored `PipelineProbeRequest` and workspace contracts
- split MCP verification helpers/tests across query, tag, and archive-ops seams instead of monolithic repo mocks
- remove the remaining verification-time private API reach-through in `verify-showcase` and refresh generated devtools references

## Problem
The substrate and surface renewal work had already tightened repository, archive-ops, and workspace contracts, but the verification layer was still asserting older shapes. `pipeline_probe` still projected an ad hoc `argparse.Namespace` world, MCP tests still modeled a monolithic repo surface, and `verify_showcase` still reached through a private runner method.

## Solution
The probe path now projects CLI input onto `PipelineProbeRequest`, uses `VerificationWorkspace`, and replays archive subsets through a typed raw-conversation store seam. MCP test helpers were rebuilt around separate query/tag/archive-ops mocks so tool and resource tests assert the renewed boundaries directly. `verify_showcase` now uses the public `run_exercise()` helper, and the devtools command catalog/docs were updated to reflect the broadened probe contract.

## Verification
- `ruff check devtools/pipeline_probe.py devtools/verify_showcase.py devtools/command_catalog.py tests/unit/devtools/test_pipeline_probe.py tests/infra/mcp.py tests/unit/mcp/test_mcp_edge_cases.py tests/unit/mcp/test_server_surfaces.py tests/unit/mcp/test_tool_contracts.py`
- `mypy devtools/pipeline_probe.py devtools/verify_showcase.py devtools/command_catalog.py tests/unit/devtools/test_pipeline_probe.py tests/infra/mcp.py tests/unit/mcp/test_mcp_edge_cases.py tests/unit/mcp/test_server_surfaces.py tests/unit/mcp/test_tool_contracts.py`
- `pytest -q tests/unit/devtools/test_pipeline_probe.py tests/unit/mcp/test_mcp_edge_cases.py tests/unit/mcp/test_server_surfaces.py tests/unit/mcp/test_tool_contracts.py`
- `devtools render-devtools-reference`
- `devtools render-agents`
- `devtools render-all --check`
- `devtools verify`
Sinity added a commit that referenced this pull request Apr 22, 2026
Substrate and surface renewal had tightened repository, archive-ops,
and workspace contracts, but the verification layer was still
asserting older shapes. `pipeline_probe` projected an ad hoc
`argparse.Namespace` world, MCP tests modeled a monolithic repo
surface, and `verify_showcase` reached through a private runner
method.

The probe path now projects CLI input onto `PipelineProbeRequest`,
uses `VerificationWorkspace`, and replays archive subsets through a
typed raw-conversation store seam. MCP test helpers are rebuilt
around separate query / tag / archive-ops mocks so tool and resource
tests assert the renewed boundaries directly. `verify_showcase` now
uses the public `run_exercise()` helper; the devtools command
catalog and generated docs get refreshed to reflect the broadened
probe contract.

Verification: ruff + mypy + pytest over devtools probe and MCP
tests; render-devtools-reference + render-agents + render-all check
green; devtools verify green.

Closes #246
Sinity added a commit that referenced this pull request Apr 22, 2026
Substrate and surface renewal had tightened repository, archive-ops,
and workspace contracts, but the verification layer was still
asserting older shapes. `pipeline_probe` projected an ad hoc
`argparse.Namespace` world, MCP tests modeled a monolithic repo
surface, and `verify_showcase` reached through a private runner
method.

The probe path now projects CLI input onto `PipelineProbeRequest`,
uses `VerificationWorkspace`, and replays archive subsets through a
typed raw-conversation store seam. MCP test helpers are rebuilt
around separate query / tag / archive-ops mocks so tool and resource
tests assert the renewed boundaries directly. `verify_showcase` now
uses the public `run_exercise()` helper; the devtools command
catalog and generated docs get refreshed to reflect the broadened
probe contract.

Verification: ruff + mypy + pytest over devtools probe and MCP
tests; render-devtools-reference + render-agents + render-all check
green; devtools verify green.

Closes #246
Sinity added a commit that referenced this pull request Apr 22, 2026
Substrate and surface renewal had tightened repository, archive-ops,
and workspace contracts, but the verification layer was still
asserting older shapes. `pipeline_probe` projected an ad hoc
`argparse.Namespace` world, MCP tests modeled a monolithic repo
surface, and `verify_showcase` reached through a private runner
method.

The probe path now projects CLI input onto `PipelineProbeRequest`,
uses `VerificationWorkspace`, and replays archive subsets through a
typed raw-conversation store seam. MCP test helpers are rebuilt
around separate query / tag / archive-ops mocks so tool and resource
tests assert the renewed boundaries directly. `verify_showcase` now
uses the public `run_exercise()` helper; the devtools command
catalog and generated docs get refreshed to reflect the broadened
probe contract.

Verification: ruff + mypy + pytest over devtools probe and MCP
tests; render-devtools-reference + render-agents + render-all check
green; devtools verify green.

Closes #246
@Sinity

Sinity commented Apr 28, 2026

Copy link
Copy Markdown
Owner Author

🤖 Post-hoc audit note: this PR received bot review feedback verified against current HEAD as part of #544. 1 finding(s) confirmed still present → tracked in #550.

@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: renew verification and test surfaces over rewritten boundaries

1 participant