7.0 KiB
7.0 KiB
Constructive Editing Runtime Plan (Low-Res)
Objective
Move from MCP contract-level/runtime packet behavior to real constructive editing and code generation execution for representative languages:
cpprustpythontypescriptjavascriptgojavaelisp
Current Baseline
- Sprint 146-155 MCP handlers are now runtimeized and stateful.
- Representative language runtime exists and is wired to tool handlers.
- Handler-level step tests (
1703-1795tool surface set) are passing. - Taskitem pipeline logging is active and appending LoRA capture records.
Low-Res Plan
- Runtime to Engine Binding
- Replace synthetic stage outcomes with calls into existing adapter/sync/ regeneration/merge modules.
- Keep current response envelope stable while adding real engine evidence.
- File Mutation and Replay Integrity
- Add real file-level mutation application paths for constructive step/loop.
- Persist before/after snapshots and replay metadata per operation.
- Toolchain Execution Integration
- Wire provider routing to real build/test command execution paths.
- Normalize diagnostics from execution output into canonical payloads.
- Multi-Language Qualification
- Run representative-language deterministic replay and diff checks.
- Gate language tier transitions using real replay/rollback evidence.
- GA Hardening
- Add end-to-end constructive smoke scenarios per language family.
- Finalize rollout controls and promote only evidence-backed tiers.
- First-Class Planning Readiness
- Add pre-execution spec readiness scoring and gap detection.
- Synthesize missing constraints/acceptance/environment scaffolds before taskitem generation.
- Gate taskitem execution on minimum planning-readiness thresholds.
Implementation Map
Phase A: Bind Constructive Step to Real Adapter Operations
Primary files:
editor/src/mcp/RegisterSprint152Tools.heditor/src/graduation/RepresentativeLanguageRuntime.heditor/src/CppConstructiveEditAdapter.heditor/src/RustGoConstructiveEditAdapter.heditor/src/PythonTypeScriptConstructiveEditAdapter.heditor/src/AdapterOperationUtil.h
Deliverables:
whetstone_run_constructive_stepuses language-specific adapter execution.whetstone_get_constructive_statusreturns real adapter diagnostics.whetstone_run_constructive_looprecords per-stage real outcomes.
Validation:
- Existing step tests:
1763,1764,1765. - New integration test family: constructive step with real adapter outputs.
Phase B: Real Sync/Regenerate/Merge Path
Primary files:
editor/src/mcp/RegisterSprint142Tools.heditor/src/mcp/RegisterSprint143Tools.heditor/src/mcp/RegisterSprint144Tools.heditor/src/TextASTSync.heditor/src/graduation/CppTextDeltaParserBridgeModel.heditor/src/graduation/ConflictRegionDetectorModel.heditor/src/graduation/MergePolicyEngineModel.h
Deliverables:
- Sync tools call real text->AST machinery for supported languages.
- Regeneration tools call real AST->text generator path.
- Merge tools emit real conflict regions and policy outcomes.
Validation:
- Existing step tests:
1663-1665,1673-1675,1683-1685. - New cross-language sync/regenerate/merge integration tests.
Phase C: Real Toolchain Provider and Diagnostic Integration
Primary files:
editor/src/mcp/RegisterSprint151Tools.heditor/src/BuildSystem.heditor/src/Diagnostics.heditor/src/StructuredDiagnostics.heditor/src/LspOps.heditor/src/graduation/DiagnosticNormalizationCanonicalModel.h
Deliverables:
whetstone_list_toolchain_providersreflects runtime-detected providers.whetstone_probe_toolchain_providerexecutes probe checks.whetstone_normalize_diagnosticsingests raw provider/LSP output.
Validation:
- Existing step tests:
1753,1754,1755. - New tests with representative toolchain output fixtures.
Phase D: Replay/Transaction/GA Evidence from Real Runs
Primary files:
editor/src/mcp/RegisterSprint153Tools.heditor/src/mcp/RegisterSprint154Tools.heditor/src/mcp/RegisterSprint155Tools.heditor/src/graduation/ConstructiveTransactionSchema.heditor/src/graduation/ConstructiveReleaseCertificationPacketModel.heditor/src/graduation/MCPReplayDiagnosticsArtifact.h
Deliverables:
- Replay suite compares real run traces.
- Transaction resume/rollback replays actual state transitions.
- GA gate evaluates real determinism and recovery evidence.
Validation:
- Existing step tests:
1773-1775,1783-1785,1793-1795. - New end-to-end replay and rollback scenario tests.
Taskitem Execution Policy for This Plan
- For each implementation phase, generate taskitems using:
tools/mcp/run_sprint_taskitem_pipeline.sh <phase_plan_or_sprint_plan.md>
- Export each run:
tools/mcp/export_taskitem_run_for_lora.sh <run_output_dir>
- Keep
training_data/lora/taskitem_pipeline_runs.jsonlappend-only.
Immediate Next Slice
Start Phase A:
- Bind
whetstone_run_constructive_stepto concrete language adapters. - Keep fallback path for unsupported operations.
- Add targeted integration tests for
cpp,rust,python,typescript.
Parallel planning tranche (active):
sprint228_plan.mdtosprint231_plan.md- baseline artifacts:
logs/taskitem_runs/TEST_ONLY_spec_planning_baseline_20260226/fullstack_spec_readiness.jsonlogs/taskitem_runs/TEST_ONLY_spec_planning_baseline_20260226/deterministic_spec_readiness.json
Planning runtime controls (active):
sprint232_plan.mdtosprint243_plan.md- semantic bridge + intake augmentation + requirement injection + expansion gating are wired into:
tools/mcp/run_sprint_taskitem_pipeline.sh
- current policy default is native-first semantic fallback:
WSTONE_SEMANTIC_TASK_EXPANSION_MODE=fallback_only
- fallback diagnostics + remediation metadata are emitted by:
tools/mcp/analyze_semantic_fallback_gaps.py
- fallback budget gating is available via:
tools/mcp/check_semantic_fallback_budget.pytools/mcp/run_semantic_fallback_budget_gate.sh
- native decomposition quality gate is available in pipeline summary/hard-fail path:
native_decomposition_gate
- native reason enrichment can inject semantic tags into native task reasons:
WSTONE_NATIVE_REASON_ENRICHMENTnative_reason_enrichment
- native decomposition retry path can run second-pass task generation:
WSTONE_NATIVE_DECOMP_RETRYWSTONE_NATIVE_DECOMP_TARGET_MIN_TASKSnative_decomposition_retry
- impact-specific native decomposition coverage can be enforced:
WSTONE_NATIVE_IMPACT_COVERAGE_GATEWSTONE_NATIVE_IMPACT_COVERAGE_ENFORCEWSTONE_NATIVE_IMPACT_COVERAGE_PROFILESnative_impact_coverage
- remediation loop can synthesize profile-specific extra constraints and rerun:
WSTONE_EXTRA_NORMALIZED_REQUIREMENTS_FILEtools/mcp/synthesize_native_impact_remediation_requirements.pytools/mcp/run_native_impact_remediation_loop.sh
- remediation loop can also synthesize and inject profile-specific task bundles:
WSTONE_EXTRA_TASKS_FILEtools/mcp/synthesize_native_impact_remediation_tasks.py