fix(mission-driver): actionable-fixes loop, run-scoped reaper, CHECK semantics, parser hardening - #6
Merged
entropy-cloud merged 17 commits intoJul 30, 2026
Conversation
…ding mission
This repo now serves two audiences explicitly:
1. Real project - develops tools/mission-driver/ using its own AGE workflow
2. Template - consumers run ./install-age.sh to bootstrap a new AGE project
- Move 16 fill-in files + START-HERE-after-copy.md to template/ (pristine copies)
- Rewrite root AGENTS.md as real-project contract (Dual-Audience Repo +
In-Tree Tool sections; all 15 Operating Rules preserved)
- Restore root README.md / README.zh.md to rich original (~370/~140 lines,
was over-cut to 53 lines) with minimal updates for install-age.sh + onboarding
- New root DEVELOPMENT.md (this repo's own dev process)
- Fill 11 root docs from template stubs (context/*, architecture/*,
process/app-workflow, backlog/README, index.md, testing/known-good-baselines)
- New docs/architecture/template-vs-realproject-boundary.md (architecture truth)
- install-age.sh: TEMPLATE_COPIED array + extended sed-replace (all fill-in
files now get <project-name> substitution; shared methodology untouched);
onboarding.json heredoc + mkdir docs/plans/onboarding; updated NEXT STEPS
- install-age.manifest: 15 entries gain template/ prefix + 1 onboarding entry
- New template/docs/backlog/onboarding-roadmap.md (8 WIscovering context/*,
architecture/*, index, app-workflow, known-good-baselines + logs/{year}/)
- New tools/check-install-age.sh (persisted closure-gate test, 10 assertions)
- tools/README.md: add check-install-age.sh to Core Tools
- tools/package.json: add check:install script
Verified: pnpm --prefix tools check:install 10/10 PASS; mission-check.mjs
validates onboarding.json; ./tools/mission-driver.sh list from real-target
install shows base + demo + onboarding (3 missions).
…lit + onboarding mission - docs/analysis/2026-07-27-0000-template-realproject-split-proposal.md (v4, passed 4 rounds of independent audit; recommendation: template/ subdirectory overlay extending existing install-age.sh mechanism) - docs/plans/2026-07-27-0000-template-realproject-split-plan.md (Plan Status: completed; independent draft review + closure audit by subagents) - docs/plans/2026-07-27-0100-onboarding-mission-plan.md (Plan Status: completed; independent draft review; solo closure per AGENTS.md Reviewer-Availability Fallback for additive non-protected change) - docs/logs/2026/07-27.md (both plans' execution log + audit lessons) Audit trail: proposal survived 4 independent audit rounds (B1 enumeration, B2 pnpm justification, B3 carry-forward, B4 sed-replace breakage); plan 1 survived 1 draft review (2B+5N fixed) + 1 closure audit (B1 clerical fixed); plan 2 survived 1 draft review (2B+8N fixed) + 1 post-implementation audit (B1 onboarding-roadmap instructional <project-name> corruption fixed).
…on/prompt
Three orthogonal improvements plus a test fix:
1. tools/ → pnpm workspace (Phase 1)
- Add tools/pnpm-workspace.yaml (members: mission-driver, mission-driver/web)
- Single lockfile (tools/pnpm-lock.yaml); unified PM pin pnpm@10.27.0
- Sync .github/workflows/web-dist-check.yml to workspace topology
- Supersedes 2026-07-24-1030 Decision 2 (preserves its no-autobuild constraint)
2. heredoc materialization (Phase 2)
- Move ~200 lines of install-age.sh heredoc into template/install/ real files
- install-age.manifest: add '> dst' / ':: flags' optional syntax
- install-age.sh: 422 → 259 lines (manifest-driven copy + flags)
3. install-age.sh → tools/install-age.mjs (Phase 3)
- Zero-dep Node ESM (only node: builtins); JSDoc types
- install-age.sh → 16-line thin shim; add install-age.cmd (Windows native)
- 15 unit tests (pnpm install-age:test); check-install-age.sh 10/10 PASS
4. fix runner.js session forwarding + prompt transport
- DEFAULT_DRIVER_ARGS missing {session} token → --session never injected
- promptMode default 'arg' → 'stdin' (mdr-3 Phase 2 design intent)
- md:test now 556/556 full green (was 549 pass / 7 fail)
Verification: pnpm md:test 556/0 + pnpm md:web:check:dist exit=0
+ pnpm install-age:test 15/0 + check-install-age.sh 10/10
.opencode/skills/mission-driver/ 此前不在 install-age.manifest 中,
consumer 项目装出来缺这个 skill。新增 3 个条目(SKILL.md +
references/{mission-config-schema,roadmap-template}.md),installer
无需改动(已支持任意相对路径 + 自动 mkdir + skip-existing)。
Verification (full green):
- readManifest 解析 3 条目 flags=[] src=dst
- 实跑 node tools/install-age.mjs <tmp>/age-test TestProject 三文件全部 +
- diff -q 与源字节一致 (18962 / 13081 / 12551 B)
两轮 consumer 维护性改进: 1. project-context.md 加 Companion Context Files 段 — flow 各 step 通过此文件路由到 ai-autonomy-policy / codebase-map / source-of-truth。 治本 consumer 自定义 AGENTS.md 后丢掉 Read This First 的断链。 2. AGE-FILES-GUIDE.md (新) — 88 文件维护指南,6 类分类 (A 引擎基建 / B 一次性配置 / C onboarding 填 / D 需求设计填 / E 即装即用 / F 运行时)。 install 到 consumer docs/references/age-files-guide.md。 Verification (full green): - readManifest: 88 entries parse clean - install to temp: 88 copied / 0 skipped - grep installed guide: all numbers consistent (no stray 87)
startup reaper 原假设整机同一时刻只有一个 mission-driver,并发启动时会把另一活跃 run 的 opencode 子进程当崩溃残留误杀。改为按 run 维度判孤儿:spawn 的 opencode 打 [MISSION_DRIVER:<runId>] 标记;新增全局 active-run 登记 (~/.mission-driver/active/<runId>-<driverPid>.json);reaper 复用 isAliveAndOurs 判活,活跃并行 run 一律 spare,仅回收拥有进程已确证死亡的崩溃 run 残留;无登记/旧标记走 _parentIsAliveDriver 保守回退(无法证明死亡则 spare,R2)。 - 新增 src/active-run-registry.mjs(零依赖,保持引擎零 npm 不变式) - runner.js 标记带 runId;engine.js run() 注册(runId && missionName 守卫,draft/analyze 不登记);main.js finally 唯一注销点;executor heartbeat touch - reap-orphans.mjs Phase 1 重写 + _parentIsAliveDriver;_warnOrphans 传 ownRunId - 新增 test/reap-orphans.test.js(analysis §5 全 6 场景)+ test/active-run-registry.test.js;更新 prompt-cmdline-limit.test.js - EXECUTION-PRINCIPLE.md / CONTEXT.md 标记契约 + 并行安全同步 验证 (full green): pnpm --prefix tools/mission-driver test -> 593 pass / 0 fail + prompt-check OK; node src/reap-orphans.mjs --startup exit=0. 独立 subagent draft review 2 轮 (accept) + closure audit。 Plan: docs/plans/2026-07-29-0900-mission-driver-reaper-concurrent-runs-plan.md (completed)
…heck gate - Add "approved"->"all_complete" marker alias to eliminate wasted parse-model correction calls during REVIEW_PLANS forEach (mdr-fix-1) - Support per-mission promptsDir: mission-level dir shadows shared dir, with per-file then built-in TOOL_ROOT fallback chain (mdr-fix-2) - Make CHECK command configurable via mission.commands.check; rewrite health-check prompt; sync context-map checkCmd + EXPECTED_VARS (mdr-fix-3) - Add forEach-marker-alias.test.js and prompts-dir.test.js - full-green verification: 593 tests pass / 0 fail, prompt-check OK, web typecheck + build OK Plan: docs/plans/mission-driver-actionable-fixes/2026-07-29-1221-1-review-approved-marker-alias.md
- Add docs/backlog/mission-driver-actionable-fixes-roadmap.md - Add 3 docs/analysis/2026-07-29-* mission-driver analyses - Add docs/plans/mission-driver-actionable-fixes/ (3 plans) - Update docs/logs/2026/07-29.md (mdr-fix-1 full-green record) Plan: docs/plans/mission-driver-actionable-fixes/2026-07-29-1221-1-review-approved-marker-alias.md
- Mark plan 2026-07-29-1221-2 (per-mission promptsDir) completed; roadmap work item 2 -> done - Record mdr-fix-2 daily log entry in docs/logs/2026/07-29.md (full-green verification) - Update CONTEXT.md with optional promptsDir field + 3-level prompt resolution chain Plan: docs/plans/mission-driver-actionable-fixes/2026-07-29-1221-2-per-mission-promptsdir.md
- Add test/check-configurable.test.js (4 cases): flow-shape (needs_fix retry + fail/onMaxRetries stay terminal = OPT-4 coexistence, no silent deletion) and engine behavior via real createMissionDriverFlow + makeMockDelegates - needs_fix once then pass reaches REVIEW_PLANS within maxRetries (CHECK x2); needs_fix past maxRetries ends failed via onMaxRetries (CHECK invoked exactly 3x = 1 + maxRetries:2, no death-loop) - full-green verification: 597 tests pass / 0 fail, prompt-check OK, web typecheck + build OK (dist unchanged) Plan: docs/plans/mission-driver-actionable-fixes/2026-07-29-1221-3-check-configurable-gate.md
- Mark plan 2026-07-29-1221-3 (CHECK configurable gate) completed; roadmap work item 3 -> done - Record mdr-fix-3 daily log entry in docs/logs/2026/07-29.md (full-green verification) - Update CONTEXT.md: CHECK as configurable deterministic-state gate (commands.check + needs_fix retry semantics) Plan: docs/plans/mission-driver-actionable-fixes/2026-07-29-1221-3-check-configurable-gate.md
…references
- Reword mission-brief.md:9 to 'Target file or directory (optional)', clarify --target-file as optional input aid
- Add note in mission-draft.md that user request may reference directories/multi-file/abstract goals
- Reword --target-file help text at main.js:867 (option name + plumbing unchanged, <description> still sole required arg)
- Align user-manual en+zh per Decision A + add directory-based example each
- Preserve {{targetFile}} substitution, BRIEF markers, no literal docs/backlog/; output contract unchanged
Verification (full-green): 597 tests pass / 0 fail, prompt-check: OK, web typecheck+build clean, lint:prompts OK
Plan: C:\Work\opensource\attractor-guided-engineering-template\docs\plans\mission-driver-actionable-fixes\2026-07-29-1620-1-draft-description-directory-support.md
- Add docs/plans/mission-driver-actionable-fixes/2026-07-29-1620-1-draft-description-directory-support.md - Update docs/backlog/mission-driver-actionable-fixes-roadmap.md (work item 4 -> done, section header) - Update docs/logs/2026/07-29.md (mdr-fix-4 entry, full-green verification) Plan: C:\Work\opensource\attractor-guided-engineering-template\docs\plans\mission-driver-actionable-fixes\2026-07-29-1620-1-draft-description-directory-support.md
- Add `commands.check` to mission-draft.md commands example + Notes (shallow-merge reminder) - Add `check` to user-manual en+zh commands examples (quickstart + full reference) - Correct CHECK step rows (en+zh) to deterministic-state-gate semantics (pass/needs_fix/fail) full-green verification: typecheck + build clean (web/dist byte-identical), 597/597 tests pass, prompt-check OK Plan: docs/plans/mission-driver-actionable-fixes/2026-07-30-0902-1-surface-commands-check.md
- Add plan 2026-07-30-0902-1-surface-commands-check.md (completed) - Add open-audit record for mission-driver-actionable-fixes - Update roadmap Follow-up Backlog (P1 resolved, P2 tracked) + last-updated - Add daily log entry (full-green verification: 597/597 tests pass) Plan: docs/plans/mission-driver-actionable-fixes/2026-07-30-0902-1-surface-commands-check.md
…c sweep - Correct ASCII loop-diagram captions (en:39/zh:39) to deterministic-state-gate semantics - Correct "first loop" prose bullets (en:341/zh:547) - Align one-sentence summary stage label (en:11/zh:11): state-check / 状态检查 - Update roadmap Follow-up Backlog (P1-followup resolved) + daily log full-green verification: lint:prompts OK, web typecheck+build clean (web/dist byte-identical), 597/597 tests pass Plan: docs/plans/mission-driver-actionable-fixes/2026-07-30-0936-1-check-semantics-doc-sweep.md
… status - roadmap-check.mjs: support English "Milestone" keyword in milestone regex; normalize todo/planned to not-done (milestones are derived states) - SKILL.md: document status-section header as hard parser contract; add smoke-test command; require explicit commands block in mission config - roadmap-template.md: rename "Work Items" to "Work Item Status"; add parser-contract warnings and anti-pattern entry - template/backlog/implementation-roadmap.md: align template with new status-section naming and simplify stale work-item stubs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mission-driver 引擎的一批修复与泛化:actionable-fixes 闭环(marker 别名 + per-mission promptsDir + 可配置 check 门)、reaper 改为 run 维度判孤儿以支持并行运行、draft 描述支持目录/多文件引用、surface
commands.check并修正 CHECK 语义、硬化 parser 契约并泛化 milestone 状态。配套补齐测试、roadmap/plan/log 文档与用户手册。Type of change
Changes
引擎修复 / 行为
reap-orphans.mjs)promptsDir、可配置 check 门commands.check,修正 CHECK 语义新增能力 / 模块
active-run-registry.mjs:活跃 run 注册表,支撑并发 run 判定execute/closure-audit/build-verify,及 actionable-fixes 的execute测试
active-run-registry.test.js、reap-orphans.test.js、check-configurable.test.js、forEach-marker-alias.test.js、prompts-dir.test.jsprompt-cmdline-limit.test.js微调文档 / 流程
user-manual.zh.md/user-manual.en.md(CHECK 语义)CONTEXT.md、EXECUTION-PRINCIPLE.md、memory/lessons.mddocs/logs/2026/07-29.md、07-30.mdTest plan
cd tools/mission-driver && pnpm test(新增 5 个测试文件全绿)pnpm run mission-check(actionable-fixes mission 配置自检)Related
Stacked on #5.