Skip to content

feat(fastlane): add hostless compile-only planning - #25

Merged
Ayleovelle merged 1 commit into
mainfrom
codex/devkit-1.1.4-hostless-fastlane
Sep 4, 2026
Merged

Ayleovelle merged 1 commit into
mainfrom
codex/devkit-1.1.4-hostless-fastlane

Conversation

@Ayleovelle

@Ayleovelle Ayleovelle commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a hostless MCP fastlane_compile path that resolves caller selectors through a read-only RuntimeRoot and requires the exact current INDEX_READY Project Index snapshot, Git binding, and writer-scope coverage
  • emit a bounded, exact-key team-efficiency/fast-lane-plan-v2 descriptor with normalized assignment and plan identities
  • update the 1.1.4 manifest, lock metadata, changelog, documentation, and artifact/version contract assertions

Safety boundary

This is compile-only planning. plan_only=true does not mean dispatch: every plan fixes dispatch_state="not_dispatched" and execution_authorized=false. The compiler does not spawn agents, select or attest routes, claim leases, create worktrees, mutate Git, execute commands, tag, release, or update the marketplace. The public Python compiler/CLI remains the fail-closed plan-v1 diagnostic surface.

Verification

All commands used CODEX_TASK_TEMP=G:\2718lab\_codex\.codex-task-temp (with temp, pycache, and uv cache under that approved G-drive root).

  • uv lock --check
  • uv run --locked pytest -q devkit_fastlane/tests/test_team_efficiency.py devkit_fastlane/tests/test_fastlane_routing.py tests/test_fastlane_runtime.py tests/test_project_index_host_material.py tests/test_project_index_core.py tests/test_mcp_contract.py tests/test_mcp_stdio.py tests/test_tool_result_contract.py tests/test_bugkiller_metadata.py tests/test_primary_artifact.py tests/test_plugin_tool_packaging.py tests/test_release_workflow.py
    • 391 passed, 4 skipped, 279 subtests passed
  • changed-file uv run --locked ruff check and uv run --locked ruff format --check
    • 6 changed Python files passed and were already formatted
  • uv run --locked python -m compileall -q .
  • git diff --check
  • two real primary allowlist builds
    • 112 expected, 112 actual, 0 missing, 0 extra
    • deterministic SHA-256: e2d90b846a65f118470ad41947c083f9365ea9f2f8a02c41967cc88b1d620715

Summary by Sourcery

Add a read-only, hostless MCP Fast Lane planning path that emits verified non-dispatching plan-v2 descriptors while preserving the existing fail-closed public compiler and CLI.

New Features:

  • Add a hostless MCP Fast Lane compiler that produces verified, bounded plan-v2 descriptors from registered local workspace and project-index selectors.

Bug Fixes:

  • Normalize public plans before deriving assignment and plan identities, ensuring deterministic hashes for inactive and read-only plans.
  • Fail closed when project-index snapshots are stale, incomplete, corrupt, non-ready, Git-mismatched, or lack writer-scope coverage.

Enhancements:

  • Keep the public Python compiler and CLI as authority-inert plan-v1 diagnostics while separating MCP local planning from execution authority.
  • Enforce explicit schema boundaries, path-free index evidence, and non-dispatching plan states for generated assignments.

Build:

  • Update package, plugin, lock metadata, artifact references, and version assertions to 1.1.4.

Documentation:

  • Document the MCP plan-v2 workflow, validation requirements, safety boundary, and continued separation between planning and dispatch in English and Chinese documentation.

Tests:

  • Add coverage for local RuntimeRoot planning, exact-key and hash validation, persisted index and Git binding, stale and partial snapshots, non-ready index states, and writer-scope coverage.

Chores:

  • Publish the 1.1.4 changelog and update release metadata.

@sourcery-ai

sourcery-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR adds a hostless MCP Fast Lane compiler that privately verifies registered workspace, current Project Index, and Git bindings, then emits a hash-bound plan-only plan-v2 descriptor without dispatch or side effects; the public Python/CLI plan-v1 diagnostic path remains fail-closed, with release metadata and documentation updated to v1.1.4.

Sequence diagram for hostless Fast Lane compile-only planning

sequenceDiagram
    participant Caller
    participant MCP as fastlane_compile
    participant Root as RuntimeRoot
    participant Index as ProjectIndexService
    participant Compiler as LocalPlanCompiler

    Caller->>MCP: fastlane_compile(request, reasoning_effort, enable)
    MCP->>Compiler: _fast_lane_local_selector(request)
    Compiler-->>MCP: workspace_id, snapshot_id selectors
    MCP->>Root: open_uow(read_only=true)
    Root->>Index: local_plan_material(workspace_id, snapshot_id)
    Index-->>Root: INDEX_READY facts, Git HEAD, include_paths
    Root-->>MCP: private local plan material
    MCP->>Compiler: _compile_fast_lane_local_plan(...)
    Compiler-->>MCP: plan-v2 with hash-bound assignments
    MCP-->>Caller: plan_only=true, not_dispatched, execution_authorized=false
Loading

Flow diagram for Fast Lane verification and fail-closed planning

flowchart TD
    A["fastlane_compile request"] --> B["Resolve workspace and snapshot selectors"]
    B --> C{"Registered binding and Git workspace valid?"}
    C -- No --> X["Fail closed"]
    C -- Yes --> D{"Snapshot is current INDEX_READY?"}
    D -- No --> Y["INDEX_STALE or precise index error"]
    D -- Yes --> E{"include_paths cover every writer write_scope?"}
    E -- No --> Z["INDEX_PARTIAL"]
    E -- Yes --> F["Compile bounded plan-v2"]
    F --> G["plan_only=true; not_dispatched; execution_authorized=false"]
Loading

File-Level Changes

Change Details Files
Add a server-private, read-only MCP compilation path that resolves caller selectors against persisted workspace, Project Index, and Git state before planning.
  • Resolve workspace and snapshot selectors through a RuntimeRoot read-only unit of work.
  • Require an exact current INDEX_READY snapshot, canonical include paths, matching Git HEAD, registered repository root, and complete writer-scope coverage.
  • Map precise stale, partial, binding, workspace, snapshot, and Git failures to fail-closed MCP errors without consulting host authority.
mcp-tools/server.py
mcp-tools/project_index/service.py
mcp-tools/devkit_fastlane/scripts/team_efficiency.py
mcp-tools/devkit_fastlane/FASTLANE_CONTRACT.md
Introduce and validate a bounded, deterministic Fast Lane plan-v2 descriptor while preserving the public plan-v1 diagnostic API and CLI.
  • Emit exact-key plan, assignment, worktree, policy, activation, and index-evidence structures with no nulls or path-bearing private material.
  • Normalize public values before computing assignment IDs, evidence hashes, and the final plan hash.
  • Fix every result and assignment to plan-only, not-dispatched, unauthorized, unclaimed, planned execution states.
  • Use package-defined local route policy and retain route, lease, and dispatch responsibility with the coordinator.
mcp-tools/devkit_fastlane/scripts/team_efficiency.py
mcp-tools/server.py
mcp-tools/tests/test_fastlane_runtime.py
mcp-tools/devkit_fastlane/FASTLANE_CONTRACT.md
mcp-tools/devkit_fastlane/references/efficiency-automation.md
Update release metadata, documentation, and artifact/version contract checks for v1.1.4.
  • Bump manifest, Python project, lock metadata, README versions, issue-template placeholder, and artifact filenames.
  • Document the MCP plan-v2 boundary, index/Git prerequisites, error behavior, and separation from the public plan-v1 surface.
  • Add or update runtime, contract, metadata, and deterministic artifact assertions.
.codex-plugin/plugin.json
mcp-tools/pyproject.toml
mcp-tools/uv.lock
CHANGELOG.md
README.md
README.zh-CN.md
.github/ISSUE_TEMPLATE/bug_report.yml
mcp-tools/tests/test_bugkiller_metadata.py
mcp-tools/tests/test_primary_artifact.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 1 issue

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

## Individual Comments

### Comment 1
<location path="mcp-tools/devkit_fastlane/scripts/team_efficiency.py" line_range="9939-9985" />
<code_context>
+def _fast_lane_local_assignment_output(
</code_context>
<issue_to_address>
**issue (bug_risk):** Every non-`execution` assignment is rejected as `FASTLANE_REQUEST_INVALID` because `_fast_lane_local_assignment_output` includes `base_commit` and `branch` in `worktree_value`, while `_validated_fast_lane_local_worktree` requires read-only worktrees to contain only `state`, `identity_hash`, `write_scope`, and `write_scope_hash`. Review, design-probe, and prewarm plans therefore cannot be emitted.

**Triggers:** When `enable=true` selects any read-only assignment such as `review`, `design_probe`, or `prewarm`.

**Suggested fix:** Construct the read-only worktree projection without `base_commit` and `branch`, or validate the same shape that the compiler emits.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and this changes the MCP trust boundary and can produce writer assignments from locally resolved index and Git state; if those facts or validations are wrong, a coordinator could act on a bounded but incorrect plan. Reverting removes the new planning path, but any downstream work or code changes already initiated from a bad plan would need to be stopped or repaired separately.

Blocking findings: mcp-tools/devkit_fastlane/scripts/team_efficiency.py:9985


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 +9939 to +9985
def _fast_lane_local_assignment_output(
validated: Mapping[str, Any],
assignment: Mapping[str, Any],
*,
index_evidence: Mapping[str, str],
) -> dict[str, Any]:
task_id = _task_id(assignment["task_id"], "planned assignment.task_id")
role = _text(assignment["role"], "planned assignment.role", maximum=32)
unit = _fast_lane_unit_index(validated["source_plan"])[task_id]
context = _mapping(assignment.get("_context"), "planned assignment context")
execution_context = next(
(
item
for item in validated["execution_contexts"]
if item["task_id"] == task_id
),
None,
)
if role == "execution" and execution_context is None:
raise _FastLaneLocalPlanError("FASTLANE_EXECUTION_CONTEXT_MISSING")
read_context = next(
(
item
for item in validated["read_contexts"]
if item["task_id"] == task_id and item["role"] == role
),
None,
)
if role != "execution" and read_context is None:
raise _FastLaneLocalPlanError("FASTLANE_READ_CONTEXT_MISSING")
bootstrap = (
None if execution_context is None else execution_context["bootstrap_plan"]
)
worktree_path = (
bootstrap["worktree"]
if role == "execution" and bootstrap is not None
else read_context["worktree"]
)
worktree_value = {
"state": "planned",
"identity_hash": _sha256_json({"worktree": worktree_path}),
"base_commit": context["base_commit"],
"branch": context["branch"],
"write_scope": list(unit.get("write_scope", [])),
"write_scope_hash": context["write_scope_hash"],
}
worktree = _fast_lane_public_value(worktree_value)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Every non-execution assignment is rejected as FASTLANE_REQUEST_INVALID because _fast_lane_local_assignment_output includes base_commit and branch in worktree_value, while _validated_fast_lane_local_worktree requires read-only worktrees to contain only state, identity_hash, write_scope, and write_scope_hash. Review, design-probe, and prewarm plans therefore cannot be emitted.

Triggers: When enable=true selects any read-only assignment such as review, design_probe, or prewarm.

Suggested fix: Construct the read-only worktree projection without base_commit and branch, or validate the same shape that the compiler emits.

@Ayleovelle
Ayleovelle merged commit bdcb685 into main Sep 4, 2026
7 checks 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