Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
78689a1
fix: recover stranded HEAD, tighten credential classifier, better par…
dcondrey Jul 14, 2026
9fbc31a
feat: reference-guided build — port from a donor implementation
dcondrey Jul 14, 2026
1c8de58
feat: expose the build report over MCP (report tool)
dcondrey Jul 14, 2026
b566c4c
feat: async build/run job lifecycle and plan-approval gate over MCP
dcondrey Jul 14, 2026
7c82007
docs: capability-gap analysis vs project-completer (donor)
dcondrey Jul 14, 2026
120e557
fix: bound job-registry retention and label stopped runs honestly
dcondrey Jul 14, 2026
d1329d6
fix: reliable parallel walk-away — unique worktree branches + answera…
dcondrey Jul 14, 2026
b01e16f
fix: prime worktree deps at setup + classify infra faults so gates te…
dcondrey Jul 14, 2026
8749786
fix: infra self-heal on build/typecheck/test gates, not just tests
dcondrey Jul 14, 2026
46694ec
fix: single terminal state in progress ledger + self-heal poisoned en…
dcondrey Jul 14, 2026
d5cd030
feat: per-worktree health probe after prime, so a broken install isn'…
dcondrey Jul 14, 2026
99e9eb8
feat: gate pre-worktree skip of already-satisfied tasks behind skip_s…
dcondrey Jul 14, 2026
d221f12
feat: post-merge health gate on the base branch with auto-revert
dcondrey Jul 14, 2026
ff295ec
feat: adaptive concurrency/timeout backoff on infra faults between waves
dcondrey Jul 15, 2026
88ec0d8
feat: persist per-project environment learnings across runs
dcondrey Jul 15, 2026
e4709a1
feat: prime worktrees by copy-on-write cloning base node_modules, not…
dcondrey Jul 15, 2026
8c2a9ec
feat: serialize wave tasks that declare a shared file; abort conflict…
dcondrey Jul 15, 2026
49dc83f
feat: escalation ladder on repeated failure (widen context -> stronge…
dcondrey Jul 15, 2026
c551016
feat: structured failure taxonomy + end-of-run summary
dcondrey Jul 15, 2026
407bb0e
feat: misterdev doctor preflight command
dcondrey Jul 15, 2026
f230167
refactor: extract parallel/worktree execution from agent.py into a mixin
dcondrey Jul 15, 2026
00215bc
refactor: extract post-wave integration gate from agent.py into a mixin
dcondrey Jul 15, 2026
fa496e6
fix: run-path summary/env-memory + make the escalation ladder actuall…
dcondrey Jul 16, 2026
6d94b38
fix: don't misclassify a 401/403 inside a test run as an external-res…
dcondrey Jul 16, 2026
9e53298
tier0: T0.2 - reject a zero-test green gate at the acceptance layer
dcondrey Jul 21, 2026
7a43a2a
tier0: T0.1 - require a prior gate for the MANIFEST acceptance pass-t…
dcondrey Jul 22, 2026
5492642
tier2: T2.1 - compile_view per-language adapter registry + tsc adapter
dcondrey Jul 22, 2026
e077c4a
tier2: T2.2 - surface named-symbol definitions on cannot-find/type-mi…
dcondrey Jul 22, 2026
1aaed2a
tier2: T2.1b - real go/swift/csharp compile_view diagnostic parsers
dcondrey Jul 22, 2026
ea665d1
tier1: T1.1 - spec-as-tests default-on (advisory); lock baseline-safe…
dcondrey Jul 22, 2026
d7ba854
tier1: T1.2 - detect same-model judge as non-independent (no silent f…
dcondrey Jul 22, 2026
31224ab
tier1: T1.3 - mutation-gate all changed source files, not just the la…
dcondrey Jul 22, 2026
dc318bf
crit: C1 - integration gate reverts a wave that breaks the build (clo…
dcondrey Jul 22, 2026
d60411e
high: F2 - sum dotnet/VSTest counts across all projects (no gate unde…
dcondrey Jul 22, 2026
fd7a02e
high: F1 - anchor C# error-code classifier on the Roslyn 'error CSxxx…
dcondrey Jul 22, 2026
cdb0014
high: R3 - route acceptance judge through build_independent_call (T1.…
dcondrey Jul 22, 2026
7ee5341
tier2: T2.3 - never truncate the edit region (truncatable=False for c…
dcondrey Jul 22, 2026
148c5f4
tier2: T2.4 - mount the docs tool (context7/fetch) by default (isolat…
dcondrey Jul 22, 2026
27f7def
tier3: T3.1 - add a real full_rewrite escalation rung (structural ret…
dcondrey Jul 22, 2026
604e40b
tier3: T3.2 - reset to a fresh task base on stall instead of iteratin…
dcondrey Jul 22, 2026
d8f967f
tier4: T4.2 - enforce size/verifiability invariant on decomposed tasks
dcondrey Jul 22, 2026
83038b8
tier4: T4.3 - proactively split high-fan-in keystone tasks before exe…
dcondrey Jul 22, 2026
ec47fbe
tier4: T4.1 - execute escalation_substeps as real gated child tasks (…
dcondrey Jul 22, 2026
fc59130
tier5: T5.1 - read the FailureLog back at runtime to inform later att…
dcondrey Jul 22, 2026
222b489
tier5: T5.2 - schedulable lock-guarded live evolution pass behind the…
dcondrey Jul 22, 2026
a4086cd
security: H1 - reject untrusted MCP runtimeHint outside the npx/uvx a…
dcondrey Jul 22, 2026
a4308f7
robustness: H2 - bound web-verify readiness wait so a silent dev serv…
dcondrey Jul 22, 2026
3edb52e
perf: H3 - memoize the Gatekeeper git-diff within one run_gates (3x -…
dcondrey Jul 22, 2026
7191748
perf: H4 - memoized per-file index for SymbolGraph file-scoped querie…
dcondrey Jul 22, 2026
af72a39
correctness: M1 - cap tasks before dep wiring and prune dangling deps…
dcondrey Jul 22, 2026
a27c4ee
robustness: M2 - bound venv setup with a timeout and capture output (…
dcondrey Jul 22, 2026
1a0863a
robustness: M3 - tear down a worktree if a prep step raises (no leak …
dcondrey Jul 22, 2026
497d2c8
correctness: M4 - widen final-attempt model selection instead of sile…
dcondrey Jul 22, 2026
06f5573
correctness: M5 - RealTimeAligner tolerates valid JSON of the wrong s…
dcondrey Jul 22, 2026
627c598
feat: A1 - persist async jobs across MCP server restart (running -> i…
dcondrey Jul 23, 2026
4e1bb1e
feat: A2 - task-level progress on async jobs (done/total/phase/messag…
dcondrey Jul 23, 2026
70466bd
feat: A3 - wire the shared MCP job registry to a durable store by def…
dcondrey Jul 23, 2026
271018f
chore: remove orphaned dead modules held_out_oracle + early_abort (ze…
dcondrey Jul 23, 2026
34d5631
feat: A4 - emit task-level progress from build/run through async jobs…
dcondrey Jul 23, 2026
d37511e
fix: low findings - unchanged-file not fully-mutated; deferral id ' -…
dcondrey Jul 23, 2026
2c0145b
chore: release v0.5.0
dcondrey Jul 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,71 @@ type.

## [Unreleased]

## [0.5.0] - 2026-07-23

A large hardening + feature run: all planned tiers, the critical/high/medium audit
findings, and the async-job lifecycle over MCP.

### Added

- **Async job lifecycle over MCP.** `build_async`/`run_async` jobs now persist
across a server restart (a job still `running` when the process died reloads as
`interrupted`) and expose task-level progress — `done`/`total`/`phase`/`message` —
surfaced by `job_status`. Persistent by default (`~/.misterdev/jobs.json`,
`MISTERDEV_STATE_DIR` override).
- **`full_rewrite` escalation rung** — a structurally different retry (rewrite the
whole target region) between context-widen and model-swap.
- **Escalation sub-steps execute as real gated child tasks** (depth-guarded);
**proactive keystone splitting** of high-fan-in tasks; a **size/verifiability
invariant** flags over-large or unverifiable decomposed tasks.
- **Runtime FailureLog read-back** (a task sees its own prior failures within the
run) and a **schedulable, benchmark-gated evolution pass**.
- **compile_view per-language adapter registry** — real rust/typescript/go/swift/
csharp diagnostic parsers — and **named-symbol definitions surfaced** on
"cannot find X" / type-mismatch diagnostics.
- **Documentation tool (context7/fetch) mounted by default** (isolation-gated,
opt-out via `mcp.docs_tool`).

### Changed

- **spec-as-tests is default-on** (advisory). The **mutation gate scores every
changed source file**, not just the largest. The **edit region is never
truncated** by the context budget. The **independent judge** detects a
same-model config as non-independent instead of silently claiming independence.

### Fixed

- **CRITICAL — the integration gate reverts a wave that breaks the build.** A
post-wave suite that no longer compiles/collects was waved through as unparseable
(a false-GREEN); it is now reverted while genuinely ambiguous failures are still
left alone.
- A **zero-test gate** and a **MANIFEST acceptance pass-through with no prior
objective gate** are hard-rejected. **dotnet/VSTest counts sum across all
projects**; the **C# classifier anchors on the Roslyn `error CSxxxx:` prefix**.
The decomposer **prunes dependencies pointing at trimmed tasks**; model selection
**widens instead of silently defaulting** when the top tier is empty;
`RealTimeAligner` tolerates a malformed `consensus.json`; an unchanged file is no
longer treated as fully mutated; deferral task ids containing ` - ` are preserved.

### Security

- **Reject an untrusted MCP `runtimeHint`** outside the npx/uvx allowlist, closing
arbitrary-binary execution via a discovered server.

### Performance

- **SymbolGraph per-file index** (file-scoped queries are no longer
O(all-symbols)); the **Gatekeeper git-diff is memoized** within one gate run
(3 subprocess passes → 1).

### Removed / robustness

- **web-verify no longer leaks a dev-server** on a silent readiness wait;
**worktrees are torn down** if batch prep raises; **venv setup is
timeout-bounded**.
- Orphaned dead modules `held_out_oracle` and `early_abort`, and the unused
`ModelSelector.is_ready`.

### Changed

- **Integration gate: identity-based regression detection on a red baseline.** The
Expand Down
86 changes: 86 additions & 0 deletions GAP_ANALYSIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# GAP_ANALYSIS — project-completer (donor) → misterdev (canonical)

Phase 1, read-only. Verdict up front, evidence below. No code changed.

**Scope:** project-completer is a ~10k-LOC JavaScript MCP server (`/Volumes/A/autocoder/project-completer`) covering the same domain as misterdev (autonomously audit/fix/complete/build projects). misterdev is the maintained, published product (PyPI + MCP registry, `dcondrey`). Goal: reimplement the donor's *good ideas* as idiomatic Python, not merge the JS.

---

## TL;DR recommendation

**Port #1 — Reference-guided build (`reference_dir` digest).** Highest value-per-unit-effort. misterdev already solves the hard part (multi-language symbol extraction via tree-sitter topography across 9 languages); the donor's `reference-analyzer` is a thin digest layer on top of capability misterdev *already has*. It's additive, offline-testable, self-contained, fits "one reviewable commit + tests," and is directly the workflow you're using right now (porting a reference implementation into a target). Effort **S–M**, risk **MED**.

**Port #2 (strategic, not a quick port) — Async job lifecycle over MCP.** The donor's single most differentiated architecture: `start → run_id → status / pause / resume / stop`. misterdev's MCP `build`/`run` are **fully synchronous** — they block until the entire build finishes and return a string. For any non-trivial autonomous build over MCP, the client can't monitor, pause, or survive a timeout. Highest raw value, but effort **L** and risk **HIGH** (deep orchestrator rework, hard to test offline). Deserves its own dedicated effort, not folded into a quick port. **Critically: do NOT copy the donor's concurrency model — that's exactly where its 5 critical bugs live** (see "Bugs not to port"). misterdev's existing worktree/parallel scheduler is already race-safe; reuse it.

Everything else the donor does, misterdev already does at equal-or-better quality. Details below.

---

## Inventories (verified against source)

### project-completer — 18 MCP tools, 3 workflows

| Workflow | Tools |
|---|---|
| **Completion** (audit→fix→verify) | `start_completion`, `get_completion_status`, `get_completion_findings`, `get_completion_report`, `pause_completion`, `resume_completion`, `stop_completion` |
| **Evolution** (analyze→plan→approve→execute) | `analyze_project`, `create_evolution_plan`, `get_evolution_plan`, `approve_plan`, `execute_plan`, `get_execution_status` |
| **Spec build** (decompose→scaffold→implement→converge) | `build_from_spec` (supports `reference_dir` porting), `get_spec_build_status`, `stop_spec_build` |

Key `lib/*.js`: `orchestrator`, `evolution-orchestrator`, `spec-build-orchestrator`, `scheduler` (concurrency + file-lock + budget), `model-router` (complexity→model), `convergence` (diminishing-returns detector), `strategies` (per-stack audit prompts), `knowledge` (approve/reject learning), `library-intel` (ecosystem detect + `npm/pip audit`), `reference-analyzer` (extract interfaces/data-models/module-graph from a donor impl), `sandbox` (native/Docker), `write-queue` (serialize SQLite). Persistence: `better-sqlite3`.

### misterdev — 5 MCP tools, 8 CLI subcommands, deep subsystems

- **MCP tools:** `list_projects`, `status`, `scan`, `build` (plan+execute a goal, synchronous), `run` (execute planned tasks, synchronous).
- **CLI:** `scan`, `list`, `status`, `report`, `run`, `build`, `plan`, `interactive` (+ `mcp`), plus natural-language routing.
- **Subsystems:** planning (`decompose_spec`, `advisor.recommend_work`, `sovereign` strategies), verification (build/test/lint/typecheck/mutation/smoke/web/held-out-oracle gates), learning (`lesson_store`, `failure_taxonomy`, `warm_start`), evolution (`EvolutionLoop`, tool invention), economics (ledger-based UCB `model_selector`), context (tree-sitter topography for 9 languages), integration (`MCPManager`).

---

## Gap table

Legend — **Have**: equivalent / partial / missing. **Value/Effort/Risk** apply only to *missing* or *partial* rows worth porting.

| # | Donor capability | misterdev today | Have | Port value | Effort | Risk | Verdict |
|---|---|---|---|---|---|---|---|
| 1 | **Reference-guided build** (`reference-analyzer`: extract interfaces / data-models / module graph from a donor impl, feed the builder) | `decompose_spec` + tree-sitter topography (9 langs) exist, but **no reference-porting layer**; `build` takes a goal string only | **missing** (spec decomposition partial) | **HIGH** | **S–M** | MED | **PORT FIRST.** Topography already does the hard multi-language extraction; this is a digest + prompt-wiring layer. |
| 2 | **Async job lifecycle over MCP** (`start`→`run_id`→`status`/`pause`/`resume`/`stop`) | MCP `build`/`run` are **synchronous, blocking, return a string** (verified: no `run_id`/job/thread/asyncio in `mcp_server.py`) | **missing** | **HIGH** | **L** | HIGH | **PORT SECOND, standalone.** Real defect for MCP use. Big lift; do NOT copy donor concurrency (buggy). |
| 3 | **Human-in-loop plan approval over MCP** (`create_plan`→`approve_items`/`reject_items`→`execute`) | Interactive `plan` CLI + `advisor.recommend_work`; **no MCP approve/reject surface** | **partial** | MED | M | MED | Defer. Overlaps existing planning; mostly an MCP-surface exposure of what CLI already does. |
| 4 | **Structured findings query** (`get_completion_findings` by severity/file/status) | Produces build *reports* + audit trail; **no queryable findings store** | **partial** | LOW–MED | M | LOW | Defer. Requires a findings store misterdev's model doesn't currently keep. |
| 5 | **Ecosystem security audit** (`library-intel`: `npm audit` / `pip-audit` / `cargo audit`) | `detection.py:139-148` **already** resolves `cargo audit` / `npm audit --omit=dev` / `pip-audit` as an advisory gate | **equivalent** | — | — | — | **SKIP — would duplicate.** |
| 6 | **Preference learning** (`knowledge`: approve/reject/success/failure) | `lesson_store`, `failure_taxonomy`, `warm_start`, metacognition | **equivalent** | — | — | — | Skip. |
| 7 | **Model routing** (`model-router`: complexity→opus/sonnet/haiku) | `model_selector` (ledger-driven UCB, quality-per-dollar under a validation floor) | **equivalent (better)** | — | — | — | Skip — misterdev's is superior. |
| 8 | **Convergence detector** (`convergence`) | `metacognition` / `advisor` diminishing-returns handling | **equivalent** | — | — | — | Skip (donor's has div-by-zero bugs anyway). |
| 9 | **Concurrency scheduler + file lock** (`scheduler`) | Parallel isolated git worktrees + integration gate + auto-bisect revert | **equivalent (safer)** | — | — | — | Skip. |
| 10 | **Sandbox** (native/Docker) | `container_env` + `evolution/sandbox` | **equivalent** | — | — | — | Skip. |
| 11 | **Per-stack audit prompts** (`strategies`) | `guidance/*` per-language conventions + analyzer prompts | **equivalent** | — | — | — | Skip. |
| 12 | **SQLite persistence + write-queue** | YAML/project registry + `.orchestrator/` progress (content-hash replay) | **equivalent (different model)** | — | — | — | Skip — no reason to adopt SQLite. |

**Net:** of 12 donor capability clusters, 8 are already equal-or-better in misterdev (skip), 2 are partial/low-priority (defer), and **2 are genuine high-value gaps** (rows 1 and 2).

---

## Bugs not to port (from donor `todo.md`: 5 critical / 14 high)

The donor's open criticals cluster almost entirely in its **async/concurrency machinery** — the exact subsystem behind Port #2. Reimplementing that surface on misterdev's existing race-safe worktree scheduler *avoids* these by construction; copying the JS structure would import them:

- **C-006 / C-009** scheduler: file lock not atomic with CLI exec; budget check reads stale value under concurrent dispatch → overruns.
- **C-007 / C-008** CLI wrapper: double-resolve on exit+error race; SIGKILL timer not cleared on normal exit (leaks event loop).
- **C-010 / H-020** server: no guard against concurrent `start_completion` on same dir (DB/file corruption); `project_dir` unvalidated (path traversal).
- **CLU-003 / CLU-004** systemic: concurrent-run corruption; resource exhaustion (DB conns / orchestrators / AbortControllers never released).
- **H-021 / H-022** convergence: div-by-zero and off-by-one → premature convergence (another reason to skip row 8).
- **SYS-001** silent error swallow across `git.js` / `fix.js` / `report.js` (catch-return-empty) — violates misterdev's "no silent swallow" baseline; do not reproduce.

---

## Recommended port order

1. **Reference-guided build** — `reference_dir` digest built on existing topography; new optional param on `build` (+ optional CLI flag), offline-testable against a fixture reference tree. **← start here.**
2. **Async MCP job lifecycle** — dedicated effort; new `run_id`-based tools alongside (not replacing) the synchronous ones; reuse misterdev's worktree scheduler; never copy the donor's concurrency code.
3. *(defer)* MCP plan-approval surface (row 3).
4. *(defer)* Findings query store (row 4).

Rows 5–12: **do not port** (duplicate existing, equal-or-better misterdev capability).

---

*Phase 2 will implement exactly one capability — your pick — as a single reviewable commit with tests, `ruff` + `pytest` green, no heavy deps, public surface intact.*
2 changes: 1 addition & 1 deletion misterdev/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""misterdev — an autonomous, extensible LLM build orchestrator."""

__version__ = "0.4.1"
__version__ = "0.5.0"
Loading
Loading