nubos-pilot 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/agents/np-ai-researcher.md +140 -0
  2. package/agents/np-code-fixer.md +363 -0
  3. package/agents/np-code-reviewer.md +351 -0
  4. package/agents/np-domain-researcher.md +136 -0
  5. package/agents/np-eval-auditor.md +167 -0
  6. package/agents/np-eval-planner.md +153 -0
  7. package/agents/np-executor.md +72 -0
  8. package/agents/np-framework-selector.md +171 -0
  9. package/agents/np-nyquist-auditor.md +185 -0
  10. package/agents/np-plan-checker.md +165 -0
  11. package/agents/np-planner.md +199 -0
  12. package/agents/np-researcher.md +150 -0
  13. package/agents/np-security-auditor.md +206 -0
  14. package/agents/np-ui-auditor.md +369 -0
  15. package/agents/np-ui-checker.md +192 -0
  16. package/agents/np-ui-researcher.md +324 -0
  17. package/agents/np-verifier.md +79 -0
  18. package/bin/check-coverage.cjs +40 -0
  19. package/bin/check-workflows.cjs +171 -0
  20. package/bin/check-workflows.test.cjs +208 -0
  21. package/bin/install.js +500 -0
  22. package/bin/np-tools/_commands.cjs +70 -0
  23. package/bin/np-tools/add-tests.cjs +171 -0
  24. package/bin/np-tools/add-tests.test.cjs +122 -0
  25. package/bin/np-tools/add-todo.cjs +108 -0
  26. package/bin/np-tools/add-todo.test.cjs +112 -0
  27. package/bin/np-tools/agent-skills.cjs +14 -0
  28. package/bin/np-tools/agent-skills.test.cjs +42 -0
  29. package/bin/np-tools/ai-integration-phase.cjs +109 -0
  30. package/bin/np-tools/ai-integration-phase.test.cjs +123 -0
  31. package/bin/np-tools/askuser.cjs +53 -0
  32. package/bin/np-tools/askuser.test.cjs +49 -0
  33. package/bin/np-tools/autonomous.cjs +69 -0
  34. package/bin/np-tools/autonomous.test.cjs +74 -0
  35. package/bin/np-tools/checkpoint.cjs +101 -0
  36. package/bin/np-tools/checkpoint.test.cjs +119 -0
  37. package/bin/np-tools/code-review.cjs +133 -0
  38. package/bin/np-tools/code-review.test.cjs +96 -0
  39. package/bin/np-tools/commit-task.cjs +120 -0
  40. package/bin/np-tools/commit-task.test.cjs +160 -0
  41. package/bin/np-tools/commit.cjs +103 -0
  42. package/bin/np-tools/commit.test.cjs +93 -0
  43. package/bin/np-tools/config.cjs +101 -0
  44. package/bin/np-tools/config.test.cjs +71 -0
  45. package/bin/np-tools/discuss-phase-power.cjs +265 -0
  46. package/bin/np-tools/discuss-phase-power.test.cjs +242 -0
  47. package/bin/np-tools/discuss-phase.cjs +132 -0
  48. package/bin/np-tools/discuss-phase.test.cjs +148 -0
  49. package/bin/np-tools/dispatch.cjs +116 -0
  50. package/bin/np-tools/doctor.cjs +242 -0
  51. package/bin/np-tools/eval-review.cjs +116 -0
  52. package/bin/np-tools/eval-review.test.cjs +123 -0
  53. package/bin/np-tools/execute-phase.cjs +182 -0
  54. package/bin/np-tools/execute-phase.test.cjs +116 -0
  55. package/bin/np-tools/execute-plan.cjs +124 -0
  56. package/bin/np-tools/execute-plan.test.cjs +82 -0
  57. package/bin/np-tools/help.cjs +28 -0
  58. package/bin/np-tools/help.test.cjs +29 -0
  59. package/bin/np-tools/init-dispatch.test.cjs +91 -0
  60. package/bin/np-tools/metrics.cjs +97 -0
  61. package/bin/np-tools/metrics.test.cjs +188 -0
  62. package/bin/np-tools/new-milestone.cjs +288 -0
  63. package/bin/np-tools/new-milestone.test.cjs +166 -0
  64. package/bin/np-tools/new-project.cjs +284 -0
  65. package/bin/np-tools/new-project.test.cjs +165 -0
  66. package/bin/np-tools/next.cjs +7 -0
  67. package/bin/np-tools/next.test.cjs +30 -0
  68. package/bin/np-tools/park.cjs +48 -0
  69. package/bin/np-tools/park.test.cjs +50 -0
  70. package/bin/np-tools/pause-work.cjs +24 -0
  71. package/bin/np-tools/pause-work.test.cjs +74 -0
  72. package/bin/np-tools/phase.cjs +71 -0
  73. package/bin/np-tools/phase.test.cjs +81 -0
  74. package/bin/np-tools/plan-diff.cjs +57 -0
  75. package/bin/np-tools/plan-diff.test.cjs +134 -0
  76. package/bin/np-tools/plan-milestone-gaps.cjs +115 -0
  77. package/bin/np-tools/plan-milestone-gaps.test.cjs +122 -0
  78. package/bin/np-tools/plan-phase.cjs +350 -0
  79. package/bin/np-tools/plan-phase.test.cjs +263 -0
  80. package/bin/np-tools/progress.cjs +7 -0
  81. package/bin/np-tools/progress.test.cjs +44 -0
  82. package/bin/np-tools/queue.cjs +213 -0
  83. package/bin/np-tools/research-phase.cjs +144 -0
  84. package/bin/np-tools/research-phase.test.cjs +154 -0
  85. package/bin/np-tools/reset-slice.cjs +17 -0
  86. package/bin/np-tools/reset-slice.test.cjs +96 -0
  87. package/bin/np-tools/resolve-model.cjs +110 -0
  88. package/bin/np-tools/resolve-model.test.cjs +200 -0
  89. package/bin/np-tools/resume-work.cjs +76 -0
  90. package/bin/np-tools/resume-work.test.cjs +91 -0
  91. package/bin/np-tools/skip.cjs +48 -0
  92. package/bin/np-tools/skip.test.cjs +66 -0
  93. package/bin/np-tools/slug.cjs +34 -0
  94. package/bin/np-tools/slug.test.cjs +46 -0
  95. package/bin/np-tools/state.cjs +16 -0
  96. package/bin/np-tools/state.test.cjs +40 -0
  97. package/bin/np-tools/stats.cjs +151 -0
  98. package/bin/np-tools/stats.test.cjs +118 -0
  99. package/bin/np-tools/triage.cjs +128 -0
  100. package/bin/np-tools/ui-phase.cjs +108 -0
  101. package/bin/np-tools/ui-phase.test.cjs +121 -0
  102. package/bin/np-tools/ui-review.cjs +108 -0
  103. package/bin/np-tools/ui-review.test.cjs +120 -0
  104. package/bin/np-tools/undo-task.cjs +31 -0
  105. package/bin/np-tools/undo-task.test.cjs +117 -0
  106. package/bin/np-tools/undo.cjs +43 -0
  107. package/bin/np-tools/undo.test.cjs +120 -0
  108. package/bin/np-tools/unpark.cjs +48 -0
  109. package/bin/np-tools/unpark.test.cjs +50 -0
  110. package/bin/np-tools/verify-work.cjs +186 -0
  111. package/bin/np-tools/verify-work.test.cjs +97 -0
  112. package/docs/adr/0001-no-daemon-invariant.md +82 -0
  113. package/docs/adr/0002-zero-runtime-dependencies.md +90 -0
  114. package/docs/adr/0003-max-six-unit-types.md +85 -0
  115. package/docs/adr/0004-atomic-commit-per-unit.md +102 -0
  116. package/docs/adr/0005-three-orthogonal-file-trees.md +98 -0
  117. package/docs/adr/0006-yaml-dependency-amendment.md +60 -0
  118. package/docs/adr/README.md +27 -0
  119. package/docs/agent-frontmatter-schema.md +84 -0
  120. package/docs/phase-artifact-schemas.md +292 -0
  121. package/docs/phase-directory-layout.md +82 -0
  122. package/lib/__tests__/README.md +1 -0
  123. package/lib/agents.cjs +98 -0
  124. package/lib/agents.test.cjs +286 -0
  125. package/lib/askuser.cjs +36 -0
  126. package/lib/askuser.test.cjs +310 -0
  127. package/lib/checkpoint.cjs +135 -0
  128. package/lib/checkpoint.test.cjs +184 -0
  129. package/lib/core.cjs +165 -0
  130. package/lib/core.test.cjs +405 -0
  131. package/lib/fixtures/README.md +1 -0
  132. package/lib/fixtures/phase-tree/README.md +1 -0
  133. package/lib/fixtures/plans/cycle/PLAN.md +16 -0
  134. package/lib/fixtures/plans/cycle/tasks/T-01.md +20 -0
  135. package/lib/fixtures/plans/cycle/tasks/T-02.md +20 -0
  136. package/lib/fixtures/plans/cycle/tasks/T-03.md +20 -0
  137. package/lib/fixtures/plans/linear/PLAN.md +16 -0
  138. package/lib/fixtures/plans/linear/tasks/T-01.md +20 -0
  139. package/lib/fixtures/plans/linear/tasks/T-02.md +20 -0
  140. package/lib/fixtures/plans/linear/tasks/T-03.md +20 -0
  141. package/lib/fixtures/plans/parallel/PLAN.md +16 -0
  142. package/lib/fixtures/plans/parallel/tasks/T-01.md +20 -0
  143. package/lib/fixtures/plans/parallel/tasks/T-02.md +20 -0
  144. package/lib/fixtures/plans/parallel/tasks/T-03.md +20 -0
  145. package/lib/fixtures/plans/wave-conflict/PLAN.md +16 -0
  146. package/lib/fixtures/plans/wave-conflict/tasks/T-01.md +20 -0
  147. package/lib/fixtures/plans/wave-conflict/tasks/T-02.md +20 -0
  148. package/lib/fixtures/roadmap/ROADMAP-malformed.md +3 -0
  149. package/lib/fixtures/roadmap/ROADMAP-minimal.md +51 -0
  150. package/lib/fixtures/roadmap/roadmap-malformed.yaml +7 -0
  151. package/lib/fixtures/roadmap/roadmap-minimal.yaml +40 -0
  152. package/lib/fixtures/roadmap/roadmap-ten-phases.yaml +101 -0
  153. package/lib/fixtures/templates/phase-context.md +6 -0
  154. package/lib/fixtures/templates/plan-skeleton.md +6 -0
  155. package/lib/frontmatter.cjs +251 -0
  156. package/lib/frontmatter.test.cjs +177 -0
  157. package/lib/gaps.cjs +197 -0
  158. package/lib/gaps.test.cjs +200 -0
  159. package/lib/git.cjs +207 -0
  160. package/lib/git.test.cjs +305 -0
  161. package/lib/install/agents-md.cjs +77 -0
  162. package/lib/install/backup.cjs +70 -0
  163. package/lib/install/codex-toml.cjs +440 -0
  164. package/lib/install/managed-block.cjs +30 -0
  165. package/lib/install/manifest.cjs +148 -0
  166. package/lib/install/mcp-writer.cjs +127 -0
  167. package/lib/install/runtime-detect.cjs +44 -0
  168. package/lib/install/staging.cjs +149 -0
  169. package/lib/metrics-aggregate.cjs +229 -0
  170. package/lib/metrics-aggregate.test.cjs +192 -0
  171. package/lib/metrics.cjs +120 -0
  172. package/lib/metrics.test.cjs +182 -0
  173. package/lib/model-aliases.regression.test.cjs +16 -0
  174. package/lib/model-profiles.cjs +42 -0
  175. package/lib/model-profiles.test.cjs +61 -0
  176. package/lib/next.cjs +236 -0
  177. package/lib/next.test.cjs +194 -0
  178. package/lib/phase.cjs +95 -0
  179. package/lib/phase.test.cjs +189 -0
  180. package/lib/plan-checker-contract.test.cjs +72 -0
  181. package/lib/plan-diff.cjs +173 -0
  182. package/lib/plan-diff.test.cjs +217 -0
  183. package/lib/plan.cjs +85 -0
  184. package/lib/plan.test.cjs +263 -0
  185. package/lib/progress.cjs +95 -0
  186. package/lib/progress.test.cjs +116 -0
  187. package/lib/researcher-contract.test.cjs +61 -0
  188. package/lib/roadmap-render.cjs +206 -0
  189. package/lib/roadmap-render.test.cjs +121 -0
  190. package/lib/roadmap.cjs +416 -0
  191. package/lib/roadmap.test.cjs +371 -0
  192. package/lib/runtime/_contract.test.cjs +61 -0
  193. package/lib/runtime/_readline.cjs +119 -0
  194. package/lib/runtime/_readline.test.cjs +126 -0
  195. package/lib/runtime/claude.cjs +48 -0
  196. package/lib/runtime/claude.test.cjs +101 -0
  197. package/lib/runtime/codex.cjs +35 -0
  198. package/lib/runtime/codex.test.cjs +114 -0
  199. package/lib/runtime/gemini.cjs +35 -0
  200. package/lib/runtime/gemini.test.cjs +109 -0
  201. package/lib/runtime/index.cjs +49 -0
  202. package/lib/runtime/index.test.cjs +181 -0
  203. package/lib/runtime/opencode.cjs +35 -0
  204. package/lib/runtime/opencode.test.cjs +124 -0
  205. package/lib/state.cjs +205 -0
  206. package/lib/state.test.cjs +264 -0
  207. package/lib/surface-audit.test.cjs +46 -0
  208. package/lib/tasks.cjs +327 -0
  209. package/lib/tasks.test.cjs +389 -0
  210. package/lib/template.cjs +66 -0
  211. package/lib/template.test.cjs +159 -0
  212. package/lib/undo.cjs +179 -0
  213. package/lib/undo.test.cjs +261 -0
  214. package/lib/verify.cjs +116 -0
  215. package/lib/verify.test.cjs +187 -0
  216. package/np-tools.cjs +303 -0
  217. package/package.json +39 -0
  218. package/templates/AI-SPEC.md +90 -0
  219. package/templates/CONTEXT.md +32 -0
  220. package/templates/PLAN.md +69 -0
  221. package/templates/PROJECT.md +60 -0
  222. package/templates/REQUIREMENTS.md +38 -0
  223. package/templates/SECURITY.md +61 -0
  224. package/templates/UI-SPEC.md +64 -0
  225. package/templates/VALIDATION.md +76 -0
  226. package/templates/claude/payload/README.md +11 -0
  227. package/templates/opencode/opencode.json +6 -0
  228. package/templates/opencode/payload/AGENTS.md +9 -0
  229. package/workflows/add-backlog.md +212 -0
  230. package/workflows/add-tests.md +69 -0
  231. package/workflows/add-todo.md +222 -0
  232. package/workflows/ai-integration-phase.md +230 -0
  233. package/workflows/autonomous.md +94 -0
  234. package/workflows/cleanup.md +325 -0
  235. package/workflows/code-review-fix.md +435 -0
  236. package/workflows/code-review.md +447 -0
  237. package/workflows/discuss-phase-assumptions.md +269 -0
  238. package/workflows/discuss-phase-power.md +139 -0
  239. package/workflows/discuss-phase.md +386 -0
  240. package/workflows/dispatch.md +9 -0
  241. package/workflows/doctor.md +10 -0
  242. package/workflows/eval-review.md +243 -0
  243. package/workflows/execute-phase.md +142 -0
  244. package/workflows/execute-plan.md +82 -0
  245. package/workflows/help.md +8 -0
  246. package/workflows/new-milestone.md +166 -0
  247. package/workflows/new-project.md +213 -0
  248. package/workflows/next.md +8 -0
  249. package/workflows/note.md +244 -0
  250. package/workflows/park.md +29 -0
  251. package/workflows/pause-work.md +34 -0
  252. package/workflows/plan-milestone-gaps.md +233 -0
  253. package/workflows/plan-phase.md +351 -0
  254. package/workflows/progress.md +8 -0
  255. package/workflows/queue.md +9 -0
  256. package/workflows/research-phase.md +327 -0
  257. package/workflows/reset-slice.md +39 -0
  258. package/workflows/resume-work.md +79 -0
  259. package/workflows/review.md +489 -0
  260. package/workflows/secure-phase.md +209 -0
  261. package/workflows/session-report.md +243 -0
  262. package/workflows/skip.md +29 -0
  263. package/workflows/state.md +7 -0
  264. package/workflows/stats.md +170 -0
  265. package/workflows/thread.md +214 -0
  266. package/workflows/triage.md +9 -0
  267. package/workflows/ui-phase.md +246 -0
  268. package/workflows/ui-review.md +222 -0
  269. package/workflows/undo-task.md +42 -0
  270. package/workflows/undo.md +55 -0
  271. package/workflows/unpark.md +29 -0
  272. package/workflows/validate-phase.md +231 -0
  273. package/workflows/verify-work.md +83 -0
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: 99-01-T02
3
+ status: pending
4
+ tier: sonnet
5
+ owner: np-executor
6
+ phase: 99
7
+ plan: 01
8
+ type: execute
9
+ wave: 2
10
+ depends_on: [T-01]
11
+ files_modified: []
12
+ autonomous: true
13
+ must_haves:
14
+ truths:
15
+ - "stub"
16
+ artifacts: []
17
+ key_links: []
18
+ ---
19
+
20
+ Task T-02 body.
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: 99-01-T03
3
+ status: pending
4
+ tier: sonnet
5
+ owner: np-executor
6
+ phase: 99
7
+ plan: 01
8
+ type: execute
9
+ wave: 3
10
+ depends_on: [T-02]
11
+ files_modified: []
12
+ autonomous: true
13
+ must_haves:
14
+ truths:
15
+ - "stub"
16
+ artifacts: []
17
+ key_links: []
18
+ ---
19
+
20
+ Task T-03 body.
@@ -0,0 +1,16 @@
1
+ ---
2
+ phase: 99
3
+ plan: 01
4
+ type: execute
5
+ wave: 1
6
+ depends_on: []
7
+ files_modified: []
8
+ autonomous: true
9
+ must_haves:
10
+ truths:
11
+ - "fixture stub"
12
+ artifacts: []
13
+ key_links: []
14
+ ---
15
+
16
+ Parallel fixture: T-01 base; T-02 and T-03 depend on T-01.
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: 99-01-T01
3
+ status: pending
4
+ tier: sonnet
5
+ owner: np-executor
6
+ phase: 99
7
+ plan: 01
8
+ type: execute
9
+ wave: 1
10
+ depends_on: []
11
+ files_modified: []
12
+ autonomous: true
13
+ must_haves:
14
+ truths:
15
+ - "stub"
16
+ artifacts: []
17
+ key_links: []
18
+ ---
19
+
20
+ Task T-01 body.
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: 99-01-T02
3
+ status: pending
4
+ tier: sonnet
5
+ owner: np-executor
6
+ phase: 99
7
+ plan: 01
8
+ type: execute
9
+ wave: 2
10
+ depends_on: [T-01]
11
+ files_modified: []
12
+ autonomous: true
13
+ must_haves:
14
+ truths:
15
+ - "stub"
16
+ artifacts: []
17
+ key_links: []
18
+ ---
19
+
20
+ Task T-02 body.
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: 99-01-T03
3
+ status: pending
4
+ tier: sonnet
5
+ owner: np-executor
6
+ phase: 99
7
+ plan: 01
8
+ type: execute
9
+ wave: 2
10
+ depends_on: [T-01]
11
+ files_modified: []
12
+ autonomous: true
13
+ must_haves:
14
+ truths:
15
+ - "stub"
16
+ artifacts: []
17
+ key_links: []
18
+ ---
19
+
20
+ Task T-03 body.
@@ -0,0 +1,16 @@
1
+ ---
2
+ phase: 99
3
+ plan: 01
4
+ type: execute
5
+ wave: 1
6
+ depends_on: []
7
+ files_modified: []
8
+ autonomous: true
9
+ must_haves:
10
+ truths:
11
+ - "fixture stub"
12
+ artifacts: []
13
+ key_links: []
14
+ ---
15
+
16
+ Wave-conflict fixture: T-02 carries wave:5 but depends on T-01 -> computed wave:2.
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: 99-01-T01
3
+ status: pending
4
+ tier: sonnet
5
+ owner: np-executor
6
+ phase: 99
7
+ plan: 01
8
+ type: execute
9
+ wave: 1
10
+ depends_on: []
11
+ files_modified: []
12
+ autonomous: true
13
+ must_haves:
14
+ truths:
15
+ - "stub"
16
+ artifacts: []
17
+ key_links: []
18
+ ---
19
+
20
+ Task T-01 body.
@@ -0,0 +1,20 @@
1
+ ---
2
+ id: 99-01-T02
3
+ status: pending
4
+ tier: sonnet
5
+ owner: np-executor
6
+ phase: 99
7
+ plan: 01
8
+ type: execute
9
+ wave: 5
10
+ depends_on: [T-01]
11
+ files_modified: []
12
+ autonomous: true
13
+ must_haves:
14
+ truths:
15
+ - "stub"
16
+ artifacts: []
17
+ key_links: []
18
+ ---
19
+
20
+ Task T-02 body.
@@ -0,0 +1,3 @@
1
+ # Roadmap
2
+
3
+ Intentionally malformed — no Phase Details section.
@@ -0,0 +1,51 @@
1
+ # Roadmap: Minimal Fixture
2
+
3
+ ## Overview
4
+
5
+ Minimal hand-authored ROADMAP for roadmap-parser regression tests.
6
+
7
+ ## Phases
8
+
9
+ - [x] **Phase 1: Foundation** - Lay the base
10
+ - [ ] **Phase 2.1: Hotfix** - Urgent insertion (INSERTED)
11
+ - [ ] **Phase 3: Core** - Main build
12
+
13
+ ## Phase Details
14
+
15
+ ### Phase 1: Foundation
16
+ **Goal**: Establish the scaffolding so later phases have something to build on.
17
+ **Depends on**: Nothing (first phase)
18
+ **Requirements**: F-01, F-02
19
+ **Success Criteria** (what must be TRUE):
20
+ 1. Scaffolding directory exists with README
21
+ 2. Initial ADR set is committed
22
+
23
+ **Plans**: 01-01 (complete)
24
+
25
+ ### Phase 2.1: Hotfix
26
+ **Goal**: Patch the critical issue that blocked Phase 2.
27
+ **Depends on**: Phase 2
28
+ **Requirements**: F-03
29
+ **Plans**: TBD
30
+
31
+ ### Phase 3: Core
32
+ **Goal**: Build the core library modules that every workflow depends on.
33
+ **Depends on**: Phase 2
34
+ **Requirements**: L-01, L-02, L-03
35
+ **Success Criteria** (what must be TRUE):
36
+ 1. Core parser exports the public surface
37
+ 2. All unit tests pass with ≥70% coverage
38
+ 3. Zero runtime dependencies added
39
+
40
+ **Plans**: TBD
41
+
42
+ ## Progress
43
+
44
+ | Phase | Plans Complete | Status | Completed |
45
+ |-------|----------------|--------|-----------|
46
+ | 1. Foundation | 1/1 | Complete | 2026-04-14 |
47
+ | 2.1. Hotfix | 0/TBD | Not started | - |
48
+ | 3. Core | 0/TBD | Not started | - |
49
+
50
+ ---
51
+ *Minimal roadmap fixture for lib/roadmap.test.cjs*
@@ -0,0 +1,7 @@
1
+ schema_version: 1
2
+ milestones:
3
+ - id: v1.0
4
+ name: "unclosed
5
+ phases:
6
+ - number: 1
7
+ name: broken-indent
@@ -0,0 +1,40 @@
1
+ schema_version: 1
2
+ milestones:
3
+ - id: v1.0
4
+ name: minimal
5
+ phases:
6
+ - number: 1
7
+ name: "Foundation"
8
+ slug: foundation
9
+ goal: "Establish the scaffolding so later phases have something to build on."
10
+ depends_on: "Nothing (first phase)"
11
+ requirements: [F-01, F-02]
12
+ success_criteria:
13
+ - "Scaffolding directory exists with README"
14
+ - "Initial ADR set is committed"
15
+ status: done
16
+ plans:
17
+ - id: "01-01"
18
+ title: ""
19
+ complete: true
20
+ - number: "2.1"
21
+ name: "Hotfix"
22
+ slug: hotfix
23
+ goal: "Patch the critical issue that blocked Phase 2."
24
+ depends_on: "Phase 2"
25
+ requirements: [F-03]
26
+ success_criteria: []
27
+ status: pending
28
+ plans: []
29
+ - number: 3
30
+ name: "Core"
31
+ slug: core
32
+ goal: "Build the core library modules that every workflow depends on."
33
+ depends_on: "Phase 2"
34
+ requirements: [L-01, L-02, L-03]
35
+ success_criteria:
36
+ - "Core parser exports the public surface"
37
+ - "All unit tests pass with ≥70% coverage"
38
+ - "Zero runtime dependencies added"
39
+ status: pending
40
+ plans: []
@@ -0,0 +1,101 @@
1
+ schema_version: 1
2
+ milestones:
3
+ - id: "1.0"
4
+ name: "Example"
5
+ phases:
6
+ - number: 1
7
+ name: "Foundation"
8
+ slug: foundation
9
+ goal: "Scaffold the project."
10
+ depends_on: null
11
+ requirements: [LIB-01]
12
+ success_criteria: []
13
+ status: done
14
+ plans:
15
+ - id: "01-01"
16
+ title: ""
17
+ complete: true
18
+ - number: 2
19
+ name: "State"
20
+ slug: state
21
+ goal: "Introduce STATE.md and frontmatter."
22
+ depends_on: "Phase 1"
23
+ requirements: [LIB-02]
24
+ success_criteria: []
25
+ status: pending
26
+ plans:
27
+ - id: "02-01"
28
+ title: ""
29
+ complete: false
30
+ - number: 3
31
+ name: "Library Core"
32
+ slug: library-core
33
+ goal: "Land the core library modules."
34
+ depends_on: "Phase 2"
35
+ requirements: [LIB-03, LIB-04, LIB-05, LIB-06, LIB-07, LIB-08]
36
+ success_criteria: []
37
+ status: pending
38
+ plans: []
39
+ - number: 4
40
+ name: "Base Workflows"
41
+ slug: base-workflows
42
+ goal: "Add the base workflows and state schemas."
43
+ depends_on: "Phase 3"
44
+ requirements: [LIB-09]
45
+ success_criteria: []
46
+ status: pending
47
+ plans: []
48
+ - number: 5
49
+ name: "Planning Workflows"
50
+ slug: planning-workflows
51
+ goal: "Planner + plan-checker loop."
52
+ depends_on: "Phase 4"
53
+ requirements: [LIB-10]
54
+ success_criteria: []
55
+ status: pending
56
+ plans: []
57
+ - number: 6
58
+ name: "Execution"
59
+ slug: execution
60
+ goal: "Executor + atomic-commit-per-unit."
61
+ depends_on: "Phase 5"
62
+ requirements: [LIB-11]
63
+ success_criteria: []
64
+ status: pending
65
+ plans: []
66
+ - number: 7
67
+ name: "Install"
68
+ slug: install
69
+ goal: "Manifest-based installer."
70
+ depends_on: "Phase 6"
71
+ requirements: [LIB-12]
72
+ success_criteria: []
73
+ status: pending
74
+ plans: []
75
+ - number: 8
76
+ name: "Runtime Adapters"
77
+ slug: runtime-adapters
78
+ goal: "Claude / Codex / Gemini / OpenCode adapters."
79
+ depends_on: "Phase 7"
80
+ requirements: [LIB-13]
81
+ success_criteria: []
82
+ status: pending
83
+ plans: []
84
+ - number: 9
85
+ name: "Orchestration"
86
+ slug: orchestration
87
+ goal: "Metrics, plan-diff, AI + UI workflows."
88
+ depends_on: "Phase 8"
89
+ requirements: [LIB-14]
90
+ success_criteria: []
91
+ status: pending
92
+ plans: []
93
+ - number: 10
94
+ name: "Review and Utilities"
95
+ slug: review-and-utilities
96
+ goal: "Code-review, eval-review, session-report, cleanup."
97
+ depends_on: "Phase 9"
98
+ requirements: [LIB-15]
99
+ success_criteria: []
100
+ status: pending
101
+ plans: []
@@ -0,0 +1,6 @@
1
+ # Phase {{phase_number}}: {{phase_name}} — Context
2
+
3
+ Phase number: {{phase_number}}
4
+ Goal: {{goal}}
5
+
6
+ Requirements: {{requirements}}
@@ -0,0 +1,6 @@
1
+ ---
2
+ phase: {{phase_number}}
3
+ plan: {{plan_number}}
4
+ ---
5
+
6
+ # Plan {{phase_number}}-{{plan_number}}
@@ -0,0 +1,251 @@
1
+ const { NubosPilotError } = require('./core.cjs');
2
+
3
+ function _parseError(line, snippet, msg) {
4
+ return new NubosPilotError(
5
+ 'frontmatter-parse-error',
6
+ msg,
7
+ { line, snippet },
8
+ );
9
+ }
10
+
11
+ function splitInlineArray(body, lineNo, rawLine) {
12
+ const items = [];
13
+ let current = '';
14
+ let inQuote = null;
15
+ for (let i = 0; i < body.length; i++) {
16
+ const ch = body[i];
17
+ if (inQuote) {
18
+ if (ch === inQuote) {
19
+ inQuote = null;
20
+ } else {
21
+ current += ch;
22
+ }
23
+ } else if (ch === '"' || ch === "'") {
24
+ inQuote = ch;
25
+ } else if (ch === ',') {
26
+ const trimmed = current.trim();
27
+ if (trimmed) items.push(_coerceScalar(trimmed));
28
+ current = '';
29
+ } else {
30
+ current += ch;
31
+ }
32
+ }
33
+ if (inQuote) {
34
+ throw _parseError(lineNo, rawLine, `Unclosed ${inQuote === '"' ? 'double' : 'single'} quote in inline array`);
35
+ }
36
+ const trimmed = current.trim();
37
+ if (trimmed) items.push(_coerceScalar(trimmed));
38
+ return items;
39
+ }
40
+
41
+ function _stripQuotes(v) {
42
+ if (v.length >= 2) {
43
+ if ((v.startsWith('"') && v.endsWith('"')) || (v.startsWith("'") && v.endsWith("'"))) {
44
+ return { stripped: v.slice(1, -1), quoted: true };
45
+ }
46
+ }
47
+ return { stripped: v, quoted: false };
48
+ }
49
+
50
+ function _coerceScalar(raw) {
51
+ const { stripped, quoted } = _stripQuotes(raw);
52
+ if (quoted) return stripped;
53
+ if (stripped === '' || stripped === '~' || stripped === 'null') return null;
54
+ if (stripped === 'true') return true;
55
+ if (stripped === 'false') return false;
56
+ if (/^-?\d+$/.test(stripped)) {
57
+
58
+ if (/^-?0\d/.test(stripped)) return stripped;
59
+ return Number(stripped);
60
+ }
61
+ if (/^-?\d+\.\d+$/.test(stripped)) return Number(stripped);
62
+ return stripped;
63
+ }
64
+
65
+ function _validateScalarQuoting(value, lineNo, rawLine) {
66
+ const trimmed = value.trim();
67
+ if (trimmed === '') return;
68
+ if (trimmed.startsWith('"')) {
69
+
70
+ if (trimmed.length < 2 || !trimmed.endsWith('"')) {
71
+ throw _parseError(lineNo, rawLine, 'Unclosed double-quoted string');
72
+ }
73
+ } else if (trimmed.startsWith("'")) {
74
+ if (trimmed.length < 2 || !trimmed.endsWith("'")) {
75
+ throw _parseError(lineNo, rawLine, 'Unclosed single-quoted string');
76
+ }
77
+ }
78
+ }
79
+
80
+ function extractFrontmatter(content) {
81
+ if (typeof content !== 'string') {
82
+ throw _parseError(0, '', 'extractFrontmatter: input must be a string');
83
+ }
84
+
85
+ const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/);
86
+ if (!match) {
87
+ return { frontmatter: {}, body: content };
88
+ }
89
+
90
+ const yaml = match[1];
91
+ const body = match[2];
92
+ const lines = yaml.split(/\r?\n/);
93
+
94
+ const frontmatter = {};
95
+
96
+
97
+ const stack = [{ container: frontmatter, indent: -1, pendingKey: null }];
98
+
99
+ for (let i = 0; i < lines.length; i++) {
100
+ const line = lines[i];
101
+ const lineNo = i + 1;
102
+ if (line.trim() === '') continue;
103
+
104
+ const leading = line.match(/^[ \t]*/)[0];
105
+ if (leading.includes('\t')) {
106
+ throw _parseError(lineNo, line, 'Tab indentation is not allowed; use spaces');
107
+ }
108
+ const indent = leading.length;
109
+
110
+
111
+ while (stack.length > 1 && indent <= stack[stack.length - 1].indent) {
112
+ const popped = stack.pop();
113
+ _demoteEmptyPlaceholder(popped, stack);
114
+ }
115
+ const current = stack[stack.length - 1];
116
+
117
+ const trimmed = line.trim();
118
+
119
+ if (trimmed.startsWith('- ') || trimmed === '-') {
120
+ const itemBody = trimmed === '-' ? '' : trimmed.slice(2);
121
+
122
+
123
+ if (current.pendingKey !== null) {
124
+
125
+
126
+ const parent = stack[stack.length - 2];
127
+ if (parent) {
128
+ parent.container[current.pendingKey] = [];
129
+ current.container = parent.container[current.pendingKey];
130
+ current.pendingKey = null;
131
+ }
132
+ }
133
+
134
+ if (!Array.isArray(current.container)) {
135
+ throw _parseError(lineNo, line, 'Unexpected "- " outside of a list context');
136
+ }
137
+
138
+ if (itemBody.includes(':') && /^[a-zA-Z0-9_-]+\s*:/.test(itemBody)) {
139
+ const kv = itemBody.match(/^([a-zA-Z0-9_-]+)\s*:\s*(.*)$/);
140
+ if (!kv) {
141
+ throw _parseError(lineNo, line, 'Malformed inline mapping in list item');
142
+ }
143
+ const itemObj = {};
144
+ _assignKeyValue(itemObj, kv[1], kv[2], lineNo, line);
145
+ current.container.push(itemObj);
146
+
147
+
148
+
149
+ stack.push({ container: itemObj, indent: indent + 1, pendingKey: null });
150
+ } else {
151
+
152
+ _validateScalarQuoting(itemBody, lineNo, line);
153
+ current.container.push(_coerceScalar(itemBody));
154
+ }
155
+ continue;
156
+ }
157
+
158
+ const kvMatch = line.match(/^\s*([a-zA-Z0-9_-]+)\s*:\s*(.*)$/);
159
+ if (!kvMatch) {
160
+ throw _parseError(lineNo, line, 'Line does not match "key: value" or "- item" pattern');
161
+ }
162
+ const key = kvMatch[1];
163
+ const value = kvMatch[2];
164
+
165
+ if (Array.isArray(current.container)) {
166
+
167
+
168
+
169
+ throw _parseError(lineNo, line, 'Unexpected key inside array context');
170
+ }
171
+
172
+ _assignKeyValue(current.container, key, value, lineNo, line, stack, indent);
173
+ }
174
+
175
+
176
+
177
+ for (const entry of stack) {
178
+ if (entry.pendingKey !== null) {
179
+ const parent = _findParentOfContainer(frontmatter, entry.container);
180
+ if (parent && parent.obj && parent.key === entry.pendingKey) {
181
+ if (typeof entry.container === 'object' && !Array.isArray(entry.container) && Object.keys(entry.container).length === 0) {
182
+ parent.obj[entry.pendingKey] = null;
183
+ }
184
+ }
185
+ }
186
+ }
187
+
188
+ return { frontmatter, body };
189
+ }
190
+
191
+ function _demoteEmptyPlaceholder(poppedEntry, remainingStack) {
192
+ if (poppedEntry.pendingKey === null) return;
193
+ const c = poppedEntry.container;
194
+ if (typeof c !== 'object' || c === null) return;
195
+ if (Array.isArray(c)) return;
196
+ if (Object.keys(c).length !== 0) return;
197
+
198
+ const parent = remainingStack[remainingStack.length - 1];
199
+ if (parent && parent.container && !Array.isArray(parent.container)) {
200
+ if (parent.container[poppedEntry.pendingKey] === c) {
201
+ parent.container[poppedEntry.pendingKey] = null;
202
+ }
203
+ }
204
+ }
205
+
206
+ function _findParentOfContainer(root, target, path = []) {
207
+ if (root === target) return null;
208
+ if (typeof root !== 'object' || root === null) return null;
209
+ if (Array.isArray(root)) {
210
+ for (let i = 0; i < root.length; i++) {
211
+ if (root[i] === target) return { obj: root, key: i };
212
+ const nested = _findParentOfContainer(root[i], target, path.concat(i));
213
+ if (nested) return nested;
214
+ }
215
+ return null;
216
+ }
217
+ for (const k of Object.keys(root)) {
218
+ if (root[k] === target) return { obj: root, key: k };
219
+ const nested = _findParentOfContainer(root[k], target, path.concat(k));
220
+ if (nested) return nested;
221
+ }
222
+ return null;
223
+ }
224
+
225
+ function _assignKeyValue(obj, key, rawValue, lineNo, line, stack, indent) {
226
+ const value = rawValue;
227
+ const trimmedValue = value.trim();
228
+
229
+ if (trimmedValue === '') {
230
+
231
+
232
+
233
+
234
+ obj[key] = {};
235
+ if (stack) {
236
+ stack.push({ container: obj[key], indent, pendingKey: key });
237
+ }
238
+ return;
239
+ }
240
+
241
+ if (trimmedValue.startsWith('[') && trimmedValue.endsWith(']')) {
242
+ const inner = trimmedValue.slice(1, -1);
243
+ obj[key] = splitInlineArray(inner, lineNo, line);
244
+ return;
245
+ }
246
+
247
+ _validateScalarQuoting(trimmedValue, lineNo, line);
248
+ obj[key] = _coerceScalar(trimmedValue);
249
+ }
250
+
251
+ module.exports = { extractFrontmatter };