Skip to content

release: v1.0.0-rc2 Fast Lane MCP runtime and publish pipeline - #6

Merged
Ayleovelle merged 10 commits into
mainfrom
codex/release-1.0.0-rc2
Aug 3, 2026
Merged

release: v1.0.0-rc2 Fast Lane MCP runtime and publish pipeline#6
Ayleovelle merged 10 commits into
mainfrom
codex/release-1.0.0-rc2

Conversation

@Ayleovelle

@Ayleovelle Ayleovelle commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Release 2718lab DevKit v1.0.0-rc2 across the Codex plugin, MCP runtime, and AstrBot extension.
  • Add the tag-driven, allowlisted release pipeline: primary ZIP plus SHA-256 and independently buildable AstrBot wheel/sdist plus SHA-256.
  • Align release validation with runtime contracts: Windows MCP runtime and Fast Lane; Linux AstrBot and primary-artifact validation. RC tags publish as prereleases.
  • Harden Fast Lane routing, quota, task-root isolation, receipts, and contract coverage; reduce installed skills to concise manuals while keeping executable contracts in the runtime package.
  • Make MCP test fixtures task-root scoped, so CI/release no longer rely on a developer-machine worktree path.

Verification

  • Focused strict RED -> GREEN for each release/CI correction.
  • Final targeted suite: 110 passed, 199 subtests passed.
  • Ruff, py_compile, YAML job-graph validation, and git diff --check passed.
  • Remote Release run passed: https://github.com/2718labs/2718lab-devkit/actions/runs/30785398211
  • GitHub prerelease assets were downloaded and reverified: ZIP SHA-256, AstrBot wheel/sdist SHA-256, plugin manifest 1.0.0-rc2, and package metadata 1.0.0rc2.

Release

Summary by Sourcery

Prepare 2718lab DevKit v1.0.0-rc2 by hardening Fast Lane runtime/task-root isolation, exposing Fast Lane as a bounded MCP tool, and extending the release pipeline to validate and publish both the MCP ZIP and AstrBot distributions as prerelease artifacts.

New Features:

  • Expose a fastlane_compile MCP tool that compiles inert Fast Lane plans from structured requests without host-private evidence.
  • Introduce a dedicated devkit_fastlane runtime package with contracts, policies, and tests, and move Fast Lane CLI/fixtures from the skills layer into the MCP runtime.

Bug Fixes:

  • Tighten Windows task-root validation for Fast Lane bootstrap/read contexts to reject reparse points, Win32 path aliases, unsafe configured roots, and race-prone directory creation.
  • Scope runtime data and scratch directories by project or thread identity to prevent cross-project leakage when CODEX project/workspace variables are set.

Enhancements:

  • Enrich Fast Lane dispatch with explicit host_dispatch and bounded index_context packets, plus index/dispatch/cross-session protocols that make routing, indexing, and external sessions compiler-owned and host-executed.
  • Refine Fast Lane contracts and manuals into concise, non-executable documentation skills while keeping executable logic in the runtime package.
  • Update documentation and contracts (English and Chinese) to describe the 17-tool MCP surface, Fast Lane’s MCP entry point, task-root hashing, and host-scoped runtime behavior.

Build:

  • Update MCP and AstrBot package versions and tests to v1.0.0-rc2, and keep MCP lockfiles in sync.
  • Extend the primary-artifact contract tests to the new devkit_fastlane layout and environment variables forwarded by .mcp.json.

CI:

  • Restructure the release workflow into tagged metadata, Windows MCP-runtime, Linux quality, and Fast Lane contract jobs that gate publication.
  • Pin GitHub Actions to specific SHAs, route Windows jobs through task-local temp/cache configuration, and ensure RC tags create prereleases with attached ZIP and AstrBot artifacts.

Documentation:

  • Revise the main READMEs, Fast Lane contract, efficiency-automation, orchestration, and bugkiller/atlas references to match the MCP runtime-centric design, coordinator-owned acceptance, and updated routing policies.

Tests:

  • Add extensive Fast Lane bootstrap, task-root, index-context, cross-session, and MCP-tool tests, plus runtime scoping tests and release-workflow contract checks to guard the new behaviors.

@sourcery-ai

sourcery-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Reviewer's Guide

Release v1.0.0-rc2 introduces a hardened Windows Fast Lane runtime and task-root model, adds a dedicated Fast Lane/MCP tool and contracts into the MCP package, scopes runtime data per project/thread, and extends the tag-driven release workflow to build, verify, and publish the primary MCP ZIP plus AstrBot distributions as prerelease assets.

Sequence diagram for the new fastlane_compile MCP tool

sequenceDiagram
    actor Host
    participant MCPServer as server.fastlane_compile
    participant DevkitFastlane as devkit_fastlane.compile_fast_lane
    participant FastlaneCompiler as team_efficiency.compile_fast_lane

    Host->>MCPServer: fastlane_compile(request, reasoning_effort, enable)
    MCPServer->>DevkitFastlane: compile_fast_lane(request, reasoning_effort, enable)
    DevkitFastlane->>FastlaneCompiler: compile_fast_lane(request, reasoning_effort, enable)
    FastlaneCompiler-->>DevkitFastlane: plan: dict[str, Any]
    DevkitFastlane-->>MCPServer: plan
    MCPServer->>MCPServer: _fastlane_public_value(plan)
    MCPServer-->>Host: envelope_success(clean_plan)
Loading

Flow diagram for the updated tag-driven release workflow

flowchart TD
    A[Tag pushed or selected] --> B[metadata job
validate plugin, MCP, AstrBot versions
and changelog]
    B --> C[mcp-runtime job
Windows MCP runtime
uv lock/sync, ruff, py_compile, pytest]
    B --> D[quality job
Ubuntu AstrBot checks
and Linux primary artifact test]
    B --> E[fast-lane job
Windows Fast Lane contracts
ruff, py_compile, pytest]
    C --> F[publish job
build primary MCP ZIP
and SHA-256]
    D --> F
    E --> F
    F --> G[Build AstrBot wheel/sdist
compute SHA-256 checksum]
    G --> H[Validate AstrBot wheel/sdist
package contents & metadata]
    H --> I[Upload primary ZIP
and AstrBot artifacts
as GitHub Actions artifacts]
    I --> J[Create GitHub Release
attach ZIP, checksums,
AstrBot dists
mark as prerelease when RC tag]
Loading

File-Level Changes

Change Details Files
Harden Fast Lane task-root binding, path safety, and bootstrap/read-context validation on Windows.
  • Introduce configurable CODEX_FASTLANE_TASK_ROOT with strict validation against unsafe drives, volume roots, reparse points, and Win32 path aliases.
  • Refactor project/worktree/temp path handling to ensure all Fast Lane worktrees and scratch directories stay strictly beneath the derived task root and project root.
  • Add Windows-specific pinning of root-bound directories and race-checked directory creation before invoking git worktree add, failing closed on any reparse or pre-existing leaf.
  • Extend bootstrap plans to schema v2 with task_root_hash binding, and validate read contexts against the same canonical task root hash.
mcp-tools/devkit_fastlane/scripts/team_efficiency.py
mcp-tools/devkit_fastlane/tests/test_team_efficiency.py
mcp-tools/devkit_fastlane/tests/test_codex_account_quota.py
mcp-tools/devkit_fastlane/tests/test_methodology_policy.py
mcp-tools/devkit_fastlane/references/efficiency-automation.md
mcp-tools/devkit_fastlane/references/orchestration-runtime.md
mcp-tools/devkit_fastlane/references/team-patterns.md
mcp-tools/devkit_fastlane/references/work-packages.md
Introduce explicit Fast Lane host-dispatch and bounded index-context packets, and wire them through workflow policy, assignments, and cross-session projections.
  • Add host_dispatch structures with fixed schema and safety flags to all Fast Lane assignments and external lease-predecessor records, and define dispatch_protocol in workflow policy.
  • Add index_context packet schema and validation, including anchors, query bounds, worker consume-only semantics, and context_hash integrity checks.
  • Update workflow operations to use index-context preparation/consumption operations instead of worker-side index sync/query, and bind read contexts to matching execution projects.
  • Extend cross-session dispatch projection with dispatch_policy, and assert deterministic, fenced external sessions in tests.
mcp-tools/devkit_fastlane/scripts/team_efficiency.py
mcp-tools/devkit_fastlane/tests/test_team_efficiency.py
mcp-tools/devkit_fastlane/tests/test_fastlane_routing.py
mcp-tools/devkit_fastlane/tests/test_methodology_policy.py
mcp-tools/devkit_fastlane/references/efficiency-automation.md
mcp-tools/devkit_fastlane/references/team-patterns.md
Move Fast Lane contracts and implementation into the MCP runtime package and tighten the optional skills surface into documentation-only manuals.
  • Create devkit_fastlane package with a public compile_fast_lane entry that lazy-loads the large CLI module, and expose a new fastlane_compile MCP tool wired to the compiler.
  • Update primary artifact allowlist and tests to include Fast Lane contracts, assets, references, and scripts under mcp-tools/devkit_fastlane, and remove executable Work Methodology skill content from the ZIP.
  • Replace SKILL.md and methodology references with FASTLANE_CONTRACT.md and updated references under devkit_fastlane, clarifying coordinator ownership, host_dispatch/index_context semantics, and C-drive/task-root constraints.
  • Add lightweight skills (devkit-overview, workflow-design, fast-lane-routing, plus updated astrbot-plugin-dev/mcp-server-dev/python-engineering/oss-repo-ops/code-atlas/bugkiller manuals) and enforce via tests that skills contain only reference markdown without retired executable surfaces.
mcp-tools/server.py
mcp-tools/devkit_fastlane/__init__.py
mcp-tools/devkit_fastlane/FASTLANE_CONTRACT.md
mcp-tools/devkit_fastlane/references/efficiency-automation.md
mcp-tools/devkit_fastlane/references/grounding-discipline.md
mcp-tools/devkit_fastlane/references/orchestration-runtime.md
mcp-tools/devkit_fastlane/references/team-patterns.md
mcp-tools/devkit_fastlane/references/verification-checklist.md
mcp-tools/devkit_fastlane/references/work-packages.md
mcp-tools/tests/test_fastlane_runtime.py
mcp-tools/tests/test_primary_artifact.py
mcp-tools/tests/test_bugkiller_metadata.py
skills/devkit-overview/SKILL.md
skills/workflow-design/SKILL.md
skills/fast-lane-routing/SKILL.md
skills/bugkiller/SKILL.md
skills/code-atlas/SKILL.md
skills/mcp-server-dev/SKILL.md
skills/astrbot-plugin-dev/SKILL.md
skills/python-engineering/SKILL.md
skills/oss-repo-ops/SKILL.md
docs/superpowers/README.md
mcp-tools/tests/test_mcp_contract.py
mcp-tools/tests/test_mcp_stdio.py
Scope runtime data and scratch directories per project/thread identity and align quota and runtime tests with the new task-local model.
  • Extend RuntimeConfig to derive data_root and scratch_root from PLUGIN_DATA/CODEX_HOME and optional project/workspace root or ID, hashing scope into scoped-v1 subdirectories without persisting raw paths.
  • Add tests covering scoped plugin data roots, scratch roots, rejection of invalid project scopes and IDs, and default behavior when only thread IDs are provided.
  • Update Codex quota provider tests to use CODEX_TASK_TEMP-derived roots and assert quota state files are scoped to the configured task root.
mcp-tools/devkit_runtime/config.py
mcp-tools/tests/test_runtime_composition.py
mcp-tools/devkit_fastlane/tests/test_codex_account_quota.py
Extend the tag-driven release workflow to validate MCP runtime, Fast Lane contracts, AstrBot distributions, and publish RC2 prerelease assets with checksums.
  • Split the release workflow into metadata, mcp-runtime (Windows), quality (Linux, AstrBot, primary artifact contract), fast-lane (Windows Fast Lane tests), and publish jobs wired via needs.
  • Pin Actions to specific SHAs, install uv at a fixed version, and configure task-local runtime storage in jobs via environment variables for temp/pycache/cache directories.
  • Add AstrBot build and validation steps to produce a wheel and sdist, verify metadata/version consistency, compute SHA-256 checksums, upload artifacts, and attach them to the GitHub Release.
  • Compute prerelease flag from version containing '-' and pass --prerelease to gh release create; ensure RC tags publish as prereleases and upload primary ZIP plus SHA-256, AstrBot artifacts plus SHA-256.
.github/workflows/release.yml
mcp-tools/tests/test_release_workflow.py
extensions/astrbot/pyproject.toml
extensions/astrbot/README.md
extensions/astrbot/src/devkit_astrbot/__init__.py
extensions/astrbot/tests/test_cli.py
Bump MCP runtime, plugin manifest, AstrBot extension, and docs to v1.0.0-rc2 and adjust tests accordingly.
  • Update MCP pyproject and uv.lock versions, plugin.json manifest version, README badges and text (English and Chinese), and issue templates to rc2.
  • Align AstrBot extension version, distribution metadata, README, and tests to 1.0.0-rc2 and pep440-compatible 1.0.0rc2.
  • Update primary artifact tests to expect rc2 metadata in pyproject and uv.lock, and changelog to describe the rc2 changes and verification policy.
mcp-tools/pyproject.toml
mcp-tools/uv.lock
extensions/astrbot/pyproject.toml
extensions/astrbot/uv.lock
extensions/astrbot/src/devkit_astrbot/__init__.py
extensions/astrbot/README.md
extensions/astrbot/tests/test_cli.py
.codex-plugin/plugin.json
README.md
README.zh-CN.md
.github/ISSUE_TEMPLATE/bug_report.yml
CHANGELOG.md
mcp-tools/tests/test_primary_artifact.py
mcp-tools/tests/test_bugkiller_metadata.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've found 2 issues, and left some high level feedback:

Fixed security issues:

  • Command injection from untrusted input passed to OS command execution (link)

  • The Windows-specific path validation and pinning logic in team_efficiency.py (alias rejection, reparse checks, directory pinning, etc.) has become quite large and intricate; consider extracting it into a dedicated helper module so the core Fast Lane compiler flow stays easier to follow and reason about.

  • With the new scoped runtime config (CODEX_PROJECT_*, CODEX_WORKSPACE_*, CODEX_THREAD_ID), it might be worth centralizing the environment-variable name sets used across devkit_runtime.config, the MCP server, and tests into a single shared definition to avoid drift between the runtime, MCP config, and artifact-contract tests.

Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The Windows-specific path validation and pinning logic in `team_efficiency.py` (alias rejection, reparse checks, directory pinning, etc.) has become quite large and intricate; consider extracting it into a dedicated helper module so the core Fast Lane compiler flow stays easier to follow and reason about.
- With the new scoped runtime config (`CODEX_PROJECT_*`, `CODEX_WORKSPACE_*`, `CODEX_THREAD_ID`), it might be worth centralizing the environment-variable name sets used across `devkit_runtime.config`, the MCP server, and tests into a single shared definition to avoid drift between the runtime, MCP config, and artifact-contract tests.

## Individual Comments

### Comment 1
<location path="mcp-tools/tests/test_fastlane_runtime.py" line_range="50-59" />
<code_context>
+    assert result["error"]["code"] == "FASTLANE_REQUEST_INVALID"
+
+
+def test_fastlane_tool_never_spawns_or_executes() -> None:
+    """The MCP compiler emits descriptors; the host owns execution and refill."""
+
+    helper, request, _ = _sample_request()
+    try:
+        result = server.fastlane_compile(
+            request=request, reasoning_effort="ultra", enable=True
+        )
+    finally:
+        helper.tearDown()
+    assert result["ok"] is True
+    data = result["data"]
+    assert data["schema"] == "team-efficiency/fast-lane-plan-v1"
+    assert "host_actions" not in data
+    assert data["workflow_policy"]["dispatch_protocol"] == {
+        "schema": "team-efficiency/fast-lane-dispatch-protocol-v1",
+        "tool": "collaboration.spawn_agent",
</code_context>
<issue_to_address>
**suggestion (testing):** Exercise the default `enable=False` and a non-dict request path for fastlane_compile

Currently, `fastlane_compile` is only covered with `enable=True` and a valid request dict, even though it guards against `type(request) is not dict` and `type(enable) is not bool` by returning `FASTLANE_REQUEST_INVALID`. Please add tests that pass a non-dict `request` (e.g., list or string) and a non-bool `enable` to assert this error code and keep the invalid-input contract stable.
</issue_to_address>

### Comment 2
<location path="mcp-tools/tests/test_fastlane_runtime.py" line_range="38-47" />
<code_context>
+def test_fastlane_tool_never_spawns_or_executes() -> None:
+    """The MCP compiler emits descriptors; the host owns execution and refill."""
+
+    helper, request, _ = _sample_request()
+    try:
+        result = server.fastlane_compile(
+            request=request, reasoning_effort="ultra", enable=True
+        )
+    finally:
+        helper.tearDown()
+    assert result["ok"] is True
+    data = result["data"]
+    assert data["schema"] == "team-efficiency/fast-lane-plan-v1"
+    assert "host_actions" not in data
+    assert data["workflow_policy"]["dispatch_protocol"] == {
+        "schema": "team-efficiency/fast-lane-dispatch-protocol-v1",
+        "tool": "collaboration.spawn_agent",
</code_context>
<issue_to_address>
**suggestion (testing):** Add coverage for _fastlane_public_value to ensure nested null sentinels are removed from the MCP payload

The new `fastlane_compile` wraps the compiled plan with `_fastlane_public_value` to strip compiler-only `None` sentinels from nested structures before calling `envelope_success`. The current tests only check the top-level shape and `workflow_policy`, so they don’t confirm that nested `None` values are removed. Please add a test that injects known `None` fields into a synthetic plan and then exercises `_fastlane_public_value` (or `fastlane_compile`) to assert that those keys/items are absent in the returned payload, preserving the MCP “no nulls” contract.

Suggested implementation:

```python
def test_fastlane_tool_rejects_host_private_inputs() -> None:
    """Host attestations stay private; public MCP receives only an inert request."""

    helper, request, _ = _sample_request()
    try:
        request["host_status"] = {"workflow_id": "foreign"}
        result = server.fastlane_compile(
            request=request, reasoning_effort="ultra", enable=True
        )
    finally:
        helper.tearDown()
    assert result["ok"] is False
    assert result["error"]["code"] == "FASTLANE_REQUEST_INVALID"


def test_fastlane_tool_never_spawns_or_executes() -> None:
    """The MCP compiler emits descriptors; the host owns execution and refill."""

    helper, request, _ = _sample_request()
    try:
        result = server.fastlane_compile(
            request=request, reasoning_effort="ultra", enable=True
        )
    finally:
        helper.tearDown()
    assert result["ok"] is True
    data = result["data"]
    assert data["schema"] == "team-efficiency/fast-lane-plan-v1"
    assert "host_actions" not in data
    assert data["workflow_policy"]["dispatch_protocol"] == {
        "schema": "team-efficiency/fast-lane-dispatch-protocol-v1",
        "tool": "collaboration.spawn_agent",
        "model_source": "assignment.host_dispatch.model",
        "reasoning_effort_source": "assignment.host_dispatch.reasoning_effort",
        "inherit_current_session_model": False,
        "require_explicit_route": True,
        "missing_route_action": "reject",
    }


def test_fastlane_public_value_strips_nested_nulls() -> None:
    """_fastlane_public_value removes compiler-only None sentinels from nested structures."""

    raw_plan = {
        "schema": "team-efficiency/fast-lane-plan-v1",
        # Top-level None should be stripped.
        "host_actions": None,
        "workflow_policy": {
            # Nested dict field with None should be stripped.
            "null_field": None,
            "dispatch_protocol": {
                "schema": "team-efficiency/fast-lane-dispatch-protocol-v1",
                "tool": "collaboration.spawn_agent",
                # Nested None key that should be stripped.
                "optional_null": None,
                # List containing a None item and an entry with a None-valued field.
                "routes": [
                    {"id": "keep", "target": "foo"},
                    None,
                    {"id": "drop_field", "target": None},
                ],
            },
        },
        # List of steps containing None and a step with a None-valued field.
        "steps": [
            {
                "id": "step-1",
                "description": "do something",
                "maybe_null": None,
            },
            None,
        ],
    }

    public_plan = server._fastlane_public_value(raw_plan)

    # Top-level None key removed.
    assert "host_actions" not in public_plan

    # Nested dict None keys removed.
    assert "null_field" not in public_plan["workflow_policy"]
    assert "optional_null" not in public_plan["workflow_policy"]["dispatch_protocol"]

    # None list entries removed and None-valued fields dropped from remaining entries.
    routes = public_plan["workflow_policy"]["dispatch_protocol"]["routes"]
    assert len(routes) == 2
    assert all(route is not None for route in routes)
    assert routes[0]["id"] == "keep"
    assert routes[0]["target"] == "foo"
    assert routes[1]["id"] == "drop_field"
    assert "target" not in routes[1]

    # Steps list has None entries removed and None-valued fields stripped.
    steps = public_plan["steps"]
    assert len(steps) == 1
    assert steps[0]["id"] == "step-1"
    assert "maybe_null" not in steps[0]

```

If `server._fastlane_public_value` is not part of the public surface for tests (e.g., it is not imported or exposed on `server`), you may need to:
1. Import or expose `_fastlane_public_value` from the module that defines it so that `mcp-tools/tests/test_fastlane_runtime.py` can access it.
2. Alternatively, if you prefer testing via `fastlane_compile`, adapt the test to construct a request whose compiled plan contains the synthetic nested `None` sentinels, then assert against `result["data"]` after calling `server.fastlane_compile`. The core assertions about removal of `None` keys/items would remain the same.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +50 to +59
def test_fastlane_tool_never_spawns_or_executes() -> None:
"""The MCP compiler emits descriptors; the host owns execution and refill."""

helper, request, _ = _sample_request()
try:
result = server.fastlane_compile(
request=request, reasoning_effort="ultra", enable=True
)
finally:
helper.tearDown()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (testing): Exercise the default enable=False and a non-dict request path for fastlane_compile

Currently, fastlane_compile is only covered with enable=True and a valid request dict, even though it guards against type(request) is not dict and type(enable) is not bool by returning FASTLANE_REQUEST_INVALID. Please add tests that pass a non-dict request (e.g., list or string) and a non-bool enable to assert this error code and keep the invalid-input contract stable.

Comment on lines +38 to +47
helper, request, _ = _sample_request()
try:
request["host_status"] = {"workflow_id": "foreign"}
result = server.fastlane_compile(
request=request, reasoning_effort="ultra", enable=True
)
finally:
helper.tearDown()
assert result["ok"] is False
assert result["error"]["code"] == "FASTLANE_REQUEST_INVALID"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (testing): Add coverage for _fastlane_public_value to ensure nested null sentinels are removed from the MCP payload

The new fastlane_compile wraps the compiled plan with _fastlane_public_value to strip compiler-only None sentinels from nested structures before calling envelope_success. The current tests only check the top-level shape and workflow_policy, so they don’t confirm that nested None values are removed. Please add a test that injects known None fields into a synthetic plan and then exercises _fastlane_public_value (or fastlane_compile) to assert that those keys/items are absent in the returned payload, preserving the MCP “no nulls” contract.

Suggested implementation:

def test_fastlane_tool_rejects_host_private_inputs() -> None:
    """Host attestations stay private; public MCP receives only an inert request."""

    helper, request, _ = _sample_request()
    try:
        request["host_status"] = {"workflow_id": "foreign"}
        result = server.fastlane_compile(
            request=request, reasoning_effort="ultra", enable=True
        )
    finally:
        helper.tearDown()
    assert result["ok"] is False
    assert result["error"]["code"] == "FASTLANE_REQUEST_INVALID"


def test_fastlane_tool_never_spawns_or_executes() -> None:
    """The MCP compiler emits descriptors; the host owns execution and refill."""

    helper, request, _ = _sample_request()
    try:
        result = server.fastlane_compile(
            request=request, reasoning_effort="ultra", enable=True
        )
    finally:
        helper.tearDown()
    assert result["ok"] is True
    data = result["data"]
    assert data["schema"] == "team-efficiency/fast-lane-plan-v1"
    assert "host_actions" not in data
    assert data["workflow_policy"]["dispatch_protocol"] == {
        "schema": "team-efficiency/fast-lane-dispatch-protocol-v1",
        "tool": "collaboration.spawn_agent",
        "model_source": "assignment.host_dispatch.model",
        "reasoning_effort_source": "assignment.host_dispatch.reasoning_effort",
        "inherit_current_session_model": False,
        "require_explicit_route": True,
        "missing_route_action": "reject",
    }


def test_fastlane_public_value_strips_nested_nulls() -> None:
    """_fastlane_public_value removes compiler-only None sentinels from nested structures."""

    raw_plan = {
        "schema": "team-efficiency/fast-lane-plan-v1",
        # Top-level None should be stripped.
        "host_actions": None,
        "workflow_policy": {
            # Nested dict field with None should be stripped.
            "null_field": None,
            "dispatch_protocol": {
                "schema": "team-efficiency/fast-lane-dispatch-protocol-v1",
                "tool": "collaboration.spawn_agent",
                # Nested None key that should be stripped.
                "optional_null": None,
                # List containing a None item and an entry with a None-valued field.
                "routes": [
                    {"id": "keep", "target": "foo"},
                    None,
                    {"id": "drop_field", "target": None},
                ],
            },
        },
        # List of steps containing None and a step with a None-valued field.
        "steps": [
            {
                "id": "step-1",
                "description": "do something",
                "maybe_null": None,
            },
            None,
        ],
    }

    public_plan = server._fastlane_public_value(raw_plan)

    # Top-level None key removed.
    assert "host_actions" not in public_plan

    # Nested dict None keys removed.
    assert "null_field" not in public_plan["workflow_policy"]
    assert "optional_null" not in public_plan["workflow_policy"]["dispatch_protocol"]

    # None list entries removed and None-valued fields dropped from remaining entries.
    routes = public_plan["workflow_policy"]["dispatch_protocol"]["routes"]
    assert len(routes) == 2
    assert all(route is not None for route in routes)
    assert routes[0]["id"] == "keep"
    assert routes[0]["target"] == "foo"
    assert routes[1]["id"] == "drop_field"
    assert "target" not in routes[1]

    # Steps list has None entries removed and None-valued fields stripped.
    steps = public_plan["steps"]
    assert len(steps) == 1
    assert steps[0]["id"] == "step-1"
    assert "maybe_null" not in steps[0]

If server._fastlane_public_value is not part of the public surface for tests (e.g., it is not imported or exposed on server), you may need to:

  1. Import or expose _fastlane_public_value from the module that defines it so that mcp-tools/tests/test_fastlane_runtime.py can access it.
  2. Alternatively, if you prefer testing via fastlane_compile, adapt the test to construct a request whose compiled plan contains the synthetic nested None sentinels, then assert against result["data"] after calling server.fastlane_compile. The core assertions about removal of None keys/items would remain the same.

@Ayleovelle
Ayleovelle merged commit 1149ff2 into main Aug 3, 2026
10 checks passed
@Ayleovelle
Ayleovelle deleted the codex/release-1.0.0-rc2 branch August 3, 2026 15:25
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