feat(fastlane): add hostless compile-only planning - #25
Conversation
Reviewer's GuideThis 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 planningsequenceDiagram
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
Flow diagram for Fast Lane verification and fail-closed planningflowchart 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"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| 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) |
There was a problem hiding this comment.
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.
Summary
fastlane_compilepath that resolves caller selectors through a read-only RuntimeRoot and requires the exact currentINDEX_READYProject Index snapshot, Git binding, and writer-scope coverageteam-efficiency/fast-lane-plan-v2descriptor with normalized assignment and plan identitiesSafety boundary
This is compile-only planning.
plan_only=truedoes not mean dispatch: every plan fixesdispatch_state="not_dispatched"andexecution_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 --checkuv 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.pyuv run --locked ruff checkanduv run --locked ruff format --checkuv run --locked python -m compileall -q .git diff --checke2d90b846a65f118470ad41947c083f9365ea9f2f8a02c41967cc88b1d620715Summary 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:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests:
Chores: