rcf-lite 0.8.0 → 0.10.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 (138) hide show
  1. package/CHANGELOG.md +124 -51
  2. package/README.md +8 -4
  3. package/bin/rcf.js +147 -53
  4. package/fixtures/canary-manifest.json +9 -9
  5. package/guidance/README.md +1 -1
  6. package/guidance/build-cycle-playbook.md +51 -51
  7. package/guidance/build-cycle.md +7 -7
  8. package/guidance/document-model.md +1 -1
  9. package/guidance/elicitation-playbook.md +29 -29
  10. package/guidance/harness-template.md +21 -10
  11. package/guidance/managed/README.md +1 -1
  12. package/guidance/managed/agent-instructions-block.hash +1 -1
  13. package/guidance/managed/agent-instructions-block.md +20 -9
  14. package/guidance/manifest.json +1 -1
  15. package/guidance/overview.md +4 -4
  16. package/package.json +5 -7
  17. package/rcf/adrs/adr-008.json +1 -1
  18. package/rcf/adrs/adr-009.json +4 -4
  19. package/rcf/adrs/adr-010.json +30 -0
  20. package/rcf/code-nodes/cn-016.json +1 -1
  21. package/rcf/code-nodes/cn-019.json +1 -1
  22. package/rcf/code-nodes/cn-020.json +1 -1
  23. package/rcf/code-nodes/cn-021.json +1 -1
  24. package/rcf/code-nodes/cn-022.json +1 -1
  25. package/rcf/code-nodes/cn-049.json +1 -1
  26. package/rcf/code-nodes/cn-055.json +1 -1
  27. package/rcf/code-nodes/cn-057.json +5 -5
  28. package/rcf/code-nodes/cn-058.json +18 -0
  29. package/rcf/code-nodes/cn-059.json +14 -0
  30. package/rcf/code-nodes/cn-060.json +14 -0
  31. package/rcf/code-nodes/cn-061.json +14 -0
  32. package/rcf/code-nodes/cn-062.json +14 -0
  33. package/rcf/code-nodes/cn-063.json +15 -0
  34. package/rcf/code-nodes/cn-064.json +15 -0
  35. package/rcf/code-nodes/cn-065.json +16 -0
  36. package/rcf/code-nodes/cn-066.json +14 -0
  37. package/rcf/code-nodes/cn-067.json +15 -0
  38. package/rcf/code-nodes/cn-068.json +15 -0
  39. package/rcf/code-nodes/cn-069.json +16 -0
  40. package/rcf/fbs/fbs-005.json +1 -1
  41. package/rcf/fbs/fbs-006.json +2 -2
  42. package/rcf/fbs/fbs-007.json +1 -1
  43. package/rcf/fbs/fbs-014.json +1 -1
  44. package/rcf/fbs/fbs-015.json +9 -8
  45. package/rcf/fbs/fbs-016.json +39 -0
  46. package/rcf/fbs/fbs-017.json +40 -0
  47. package/rcf/fbs/fbs-018.json +34 -0
  48. package/rcf/fbs/fbs-019.json +33 -0
  49. package/rcf/requirements/req-008.json +1 -1
  50. package/rcf/requirements/req-009.json +2 -2
  51. package/rcf/requirements/req-010.json +20 -0
  52. package/rcf/test-suites/PENDING.md +2 -2
  53. package/rcf/test-suites/ts-004.json +1 -1
  54. package/rcf/test-suites/ts-006.json +3 -3
  55. package/rcf/test-suites/ts-008.json +2 -2
  56. package/rcf/test-suites/ts-009.json +2 -2
  57. package/rcf/test-suites/ts-017.json +1 -1
  58. package/rcf/test-suites/ts-024.json +1 -1
  59. package/rcf/test-suites/ts-025.json +32 -18
  60. package/rcf/test-suites/ts-026.json +54 -0
  61. package/rcf/test-suites/ts-027.json +115 -0
  62. package/rcf/test-suites/ts-028.json +46 -0
  63. package/rcf/test-suites/ts-029.json +46 -0
  64. package/rcf/user-stories/us-1001.json +56 -0
  65. package/rcf/user-stories/us-1002.json +96 -0
  66. package/rcf/user-stories/us-1003.json +48 -0
  67. package/rcf/user-stories/us-1004.json +48 -0
  68. package/rcf/user-stories/us-805.json +2 -2
  69. package/rcf/user-stories/us-901.json +13 -13
  70. package/src/blueprint/apply.js +464 -0
  71. package/src/blueprint/conflicts.js +351 -0
  72. package/src/blueprint/diff.js +82 -0
  73. package/src/blueprint/index.js +12 -0
  74. package/src/blueprint/list.js +21 -0
  75. package/src/blueprint/loader.js +163 -0
  76. package/src/blueprint/manifest-writer.js +49 -0
  77. package/src/blueprint/namespace.js +145 -0
  78. package/src/blueprint/remove.js +105 -0
  79. package/src/blueprint/resolutions.js +83 -0
  80. package/src/blueprint/standards.js +148 -0
  81. package/src/blueprint/supersede.js +318 -0
  82. package/src/browser-verify/invariants.js +33 -6
  83. package/src/build/bundle.js +37 -14
  84. package/src/build/formatters/markdown.js +9 -9
  85. package/src/build/mark.js +3 -3
  86. package/src/build/queue.js +1 -1
  87. package/src/build/standards-selector.js +52 -0
  88. package/src/cli/blueprint.js +325 -0
  89. package/src/cli/browser-verify.js +1 -1
  90. package/src/cli/build.js +139 -69
  91. package/src/cli/coverage.js +1 -1
  92. package/src/cli/create.js +48 -3
  93. package/src/cli/delete.js +2 -2
  94. package/src/cli/design.js +10 -10
  95. package/src/cli/fbs.js +1 -1
  96. package/src/cli/finalise.js +22 -20
  97. package/src/cli/help.js +269 -89
  98. package/src/cli/impact.js +1 -1
  99. package/src/cli/init.js +20 -5
  100. package/src/cli/intake.js +3 -3
  101. package/src/cli/link.js +3 -3
  102. package/src/cli/preflight.js +2 -2
  103. package/src/cli/read.js +1 -1
  104. package/src/cli/req-baseline.js +2 -2
  105. package/src/cli/req-classify.js +3 -3
  106. package/src/cli/review.js +1 -1
  107. package/src/cli/standards.js +127 -0
  108. package/src/cli/test-suite.js +1 -1
  109. package/src/cli/trace.js +1 -1
  110. package/src/cli/ui-baseline.js +3 -3
  111. package/src/cli/ui-classify.js +4 -4
  112. package/src/cli/update.js +2 -2
  113. package/src/cli/validate.js +2 -2
  114. package/src/cli/view.js +12 -10
  115. package/src/core/store/ids.js +168 -18
  116. package/src/core/store/loader.js +27 -16
  117. package/src/core/store/walker.js +27 -15
  118. package/src/core/store/writer.js +1 -1
  119. package/src/deployment/index.js +13 -0
  120. package/src/deployment/placeholder-detector.js +113 -0
  121. package/src/design/writer.js +3 -3
  122. package/src/finalise/detect.js +32 -38
  123. package/src/finalise/index.js +0 -1
  124. package/src/finalise/install.js +9 -8
  125. package/src/finalise/spawn.js +14 -10
  126. package/src/mcp/tools.js +1 -1
  127. package/src/query/formatters/table.js +7 -10
  128. package/src/query/trace.js +45 -4
  129. package/src/req-baseline/gate.js +1 -1
  130. package/src/ui-baseline/manifest-writer.js +2 -2
  131. package/src/verify/cli/cleanup.js +1 -1
  132. package/src/verify/cli/mcp.js +1 -1
  133. package/src/verify/cli/provision.js +1 -1
  134. package/src/verify/cli/report.js +1 -1
  135. package/src/verify/cli/run.js +1 -1
  136. package/src/view-supervisor/manifest-writer.js +2 -2
  137. package/bin/rcf-verify.js +0 -122
  138. package/src/verify/cli/help.js +0 -56
package/src/cli/help.js CHANGED
@@ -1,14 +1,17 @@
1
- // Top-level and per-subcommand help. British English, ASCII hyphens
2
- // only (Phase 4 §D17).
1
+ // Top-level, per-group and per-verb help. British English, ASCII
2
+ // hyphens only (Phase 4 §D17). No em-dashes anywhere in user-facing
3
+ // strings.
3
4
  //
4
- // Single-source rule: this module owns the TOP_LEVEL block and NOTHING
5
- // else. Every per-subcommand block is imported from the module that
6
- // implements the subcommand, so `rcf help <cmd>` and `rcf <cmd> --help`
7
- // are the same string by construction. Do not reintroduce a local copy
8
- // of a subcommand's help - `test/cli/help-parity.test.js` fails the
9
- // moment the two paths differ. (This file previously kept private
10
- // duplicates of nine blocks; every one of them had drifted stale, and
11
- // `rcf help create` was hiding the `cn` kind outright.)
5
+ // Single-source rule (unchanged): each per-verb block is imported from
6
+ // the module that implements the verb, so `rcf help <group> <verb>` and
7
+ // `rcf <group> <verb> --help` are the same string by construction. Do
8
+ // not reintroduce a local copy of a verb's help - `help-parity.test.js`
9
+ // fails the moment the two paths differ.
10
+ //
11
+ // The 0.10.0 reorg introduces two new surfaces:
12
+ // - GROUP_HELP: printed by `rcf <group>` bare and `rcf help <group>`
13
+ // - TOP_LEVEL_HELP: grouped verb catalogue; the primary cold-reader
14
+ // entry point.
12
15
 
13
16
  import { HELP as BUILD_HELP } from './build.js';
14
17
  import { HELP as COVERAGE_HELP } from './coverage.js';
@@ -34,51 +37,83 @@ import { HELP as BROWSER_VERIFY_HELP } from './browser-verify.js';
34
37
  import { HELP as UPDATE_HELP } from './update.js';
35
38
  import { HELP as VALIDATE_HELP } from './validate.js';
36
39
  import { HELP as VIEW_HELP } from './view.js';
37
- // Track C+D (elicitation-and-playbook-hardening-0.7.0) verbs.
38
40
  import { HELP as REQ_CLASSIFY_HELP } from './req-classify.js';
39
41
  import { HELP as REQ_BASELINE_HELP } from './req-baseline.js';
40
42
  import { HELP as INTAKE_HELP } from './intake.js';
41
- // 0.7.1 packaging consolidation: `rcf verify <verb>` routes to the same
42
- // help block the transition-grace `rcf-verify` alias bin uses.
43
- import { TOP_LEVEL_HELP as VERIFY_HELP } from '../verify/cli/help.js';
43
+ import { HELP as BLUEPRINT_HELP } from './blueprint.js';
44
+ import { HELP as STANDARDS_HELP } from './standards.js';
45
+
46
+ // Verify group members (from the verify-suite subtree).
47
+ import { HELP as VERIFY_RUN_HELP } from '../verify/cli/run.js';
48
+ import { HELP as VERIFY_REPORT_HELP } from '../verify/cli/report.js';
49
+ import { HELP as VERIFY_PROVISION_HELP } from '../verify/cli/provision.js';
50
+ import { HELP as VERIFY_CLEANUP_HELP } from '../verify/cli/cleanup.js';
51
+ import { HELP as VERIFY_MCP_HELP } from '../verify/cli/mcp.js';
52
+
53
+ // Rendering order (spec §rcf help top-level layout): core first, then
54
+ // the five RCF stages in canonical order.
55
+ export const GROUP_ORDER = ['discover', 'define', 'build', 'verify', 'audit'];
44
56
 
45
57
  const TOP_LEVEL = `Usage: rcf <command> [options]
46
58
 
47
- Commands:
48
- init Scaffold a new RCF project
49
- view Render the tree as HTML (live server)
50
- validate Walk the tree and report schema and reference issues
51
- create <kind> Create a new document
52
- read <id> Print a document's body to stdout
53
- update <id> Patch fields on an existing document
54
- delete <id> Delete a document (refuses on dependents by default)
55
- link <us-id> Link a US to a TAC (appends to tacIds; idempotent)
56
- unlink <us-id> Unlink a US from a TAC
57
- coverage Structural coverage report (PRD -> REQ -> US -> AC -> TS -> TC)
58
- trace <id> Walk the graph forward / back / both from an id
59
- impact <id> Impact fan-out with per-node action label
60
- build [fbs-id] Assemble FBS spec bundles and drive the build queue
61
- finalise <fbs-id> Ship gate: verify the deployed app, then mark verified
62
- doctor Diagnose init-hygiene drift (0.6.0 spec); --fix repairs
63
- guidance [topic] Print a method document from the installed pack
64
- mcp Serve the project over MCP (local stdio)
65
- preflight Elicit pre-flight service-attestation + design-shape record
66
- fbs <fbs-id> FBS-level verbs (depends-on)
67
- test-suite <ts-id> Test-suite verbs (provenance, approve)
68
- review <fbs-id> REVIEW-stage audit (test-theatre + mutation-sampling)
69
- ui-classify <id> Run the UI-bearing classifier on one FBS
70
- ui-baseline <verb> UI baseline: init | show | opt-out
71
- design <fbs-id> Design substage: dispatch worker or hand-author artefacts
72
- browser-verify <id> Stage 5 browser-verification gate for a UI-bearing FBS
73
- req-classify <id> Rerun the REQ-shape classifier and write the block
74
- req-baseline <verb> Baseline-AC sweep and opt-out ledger for classified REQs
75
- intake Variable-fidelity intake stage (classify supplied artefacts)
76
- verify <verb> Adversarial ship gate (run|report|provision|cleanup|mcp); the legacy rcf-verify bin is a transition alias
77
- help [command] Print help for a command
59
+ The Requirements Confidence Framework CLI. Verbs are grouped by the
60
+ five RCF stages, plus a small core set for platform plumbing.
61
+
62
+ core Platform plumbing that predates any RCF stage.
63
+ init Scaffold a new RCF project in this directory.
64
+ doctor Diagnose and repair init-hygiene drift.
65
+ guidance [topic] Print a method document from the installed pack.
66
+ mcp Serve the project over MCP (local stdio).
67
+ help [group] [verb] Print help for a group or a verb.
68
+
69
+ discover Learn what is already true for this project.
70
+ intake Classify supplied artefacts.
71
+ preflight Elicit third-party service dependencies.
72
+ req-classify <req-id> Classify one or every REQ by shape.
73
+ req-baseline <verb> Sweep and record baseline ACs per REQ.
74
+ ui-classify <fbs-id> Classify one FBS as UI-bearing or not.
75
+ ui-baseline <verb> Rule and record the project's UI defaults.
76
+
77
+ define Author the RCF tree.
78
+ create <kind> Create a new document.
79
+ read <id> Print a document's body.
80
+ update <id> Patch fields on an existing document.
81
+ delete <id> Delete a document.
82
+ link <us-id> Link a US to a TAC.
83
+ unlink <us-id> Unlink a US from a TAC.
84
+ validate Walk the tree and report schema and reference
85
+ issues.
86
+ design <fbs-id> <verb> Design substage for a UI-bearing FBS.
87
+ blueprint <verb> Compose blueprints onto the project.
88
+ standards <verb> Register standards packs against the project.
89
+
90
+ build Drive the FBS queue and the five-stage build cycle.
91
+ queue Show the FBS build queue.
92
+ bundle <fbs-id> Spec bundle for one FBS (or --next).
93
+ mark <fbs-id> <status> Record a lifecycle transition.
94
+ finalise <fbs-id> Ship gate: run the independent verifier and
95
+ promote a complete FBS to verified.
96
+ review <fbs-id> Stage-3-to-Stage-4 audit.
97
+ fbs <fbs-id> <verb> FBS-level operations.
98
+ test-suite <ts-id> <verb> Test-suite operations.
99
+
100
+ verify Run the independent adversarial ship-gate verifier.
101
+ run Run adversarial verification; emit a report.
102
+ report <path> Re-render a prior report artifact.
103
+ provision Stand up prerequisite accounts and sandboxes.
104
+ cleanup Tear down provisioned artefacts.
105
+ mcp Serve verify over MCP (local stdio).
106
+ browser <fbs-id> Stage 5 browser-verification gate.
107
+
108
+ audit Inspect the tree and its rollups.
109
+ view Live HTML tree render (long-running server).
110
+ coverage [scope-id] Structural coverage over the REQ chain.
111
+ trace <id> Walk the graph forward, back, or both from a node.
112
+ impact <id> Change-impact fan-out from a node.
78
113
 
79
114
  Options:
80
- --version Print the package version and exit
81
- --help Print this help and exit
115
+ --version Print the package version and exit.
116
+ --help Print this help and exit.
82
117
 
83
118
  Exit codes:
84
119
  0 success
@@ -87,48 +122,180 @@ Exit codes:
87
122
  3 schema validation or broken references
88
123
  4 refused (delete with dependents; other blocked mutations)
89
124
 
90
- Run 'rcf help <command>' for command-specific help.
125
+ Run 'rcf help <group>' for group help; 'rcf help <group> <verb>' for
126
+ per-verb help.
127
+ `;
128
+
129
+ const DISCOVER_HELP = `Usage: rcf discover <verb> [options]
130
+
131
+ Learn what is already true for this project: classify supplied
132
+ artefacts, elicit external dependencies, propose baseline defaults from
133
+ prior art, classify existing REQs and FBS items.
134
+
135
+ Verbs:
136
+ intake Classify supplied artefacts.
137
+ preflight Elicit third-party service dependencies.
138
+ req-classify <req-id> Classify one or every REQ by shape.
139
+ req-baseline <verb> Sweep and record baseline ACs per REQ.
140
+ ui-classify <fbs-id> Classify one FBS as UI-bearing or not.
141
+ ui-baseline <verb> Rule and record the project's UI defaults.
142
+
143
+ Run 'rcf help discover <verb>' for per-verb help.
91
144
  `;
92
145
 
93
- // Every value here is an import. See the single-source rule at the top
94
- // of this file before adding an entry.
95
- const HELP_MAP = {
146
+ const DEFINE_HELP = `Usage: rcf define <verb> [options]
147
+
148
+ Author the RCF tree: create, edit, link, and validate RCF documents;
149
+ compose blueprints and register standards packs; author the design
150
+ substage for UI-bearing work. Everything that writes durable spec
151
+ content lives here.
152
+
153
+ Verbs:
154
+ create <kind> Create a new document.
155
+ read <id> Print a document's body.
156
+ update <id> Patch fields on an existing document.
157
+ delete <id> Delete a document.
158
+ link <us-id> Link a US to a TAC.
159
+ unlink <us-id> Unlink a US from a TAC.
160
+ validate Walk the tree and report schema and reference
161
+ issues.
162
+ design <fbs-id> <verb> Design substage for a UI-bearing FBS.
163
+ blueprint <verb> Compose blueprints onto the project.
164
+ standards <verb> Register standards packs against the project.
165
+
166
+ Run 'rcf help define <verb>' for per-verb help.
167
+ `;
168
+
169
+ const BUILD_GROUP_HELP = `Usage: rcf build <verb> [options]
170
+
171
+ Drive the FBS queue and the five-stage build cycle. Every FBS item
172
+ walks: Define -> Build -> Review -> Test -> Finalise.
173
+
174
+ Verbs:
175
+ queue Show the FBS build queue with parallel-safe tiers.
176
+ bundle <fbs-id> Assemble the spec bundle for one FBS (or --next).
177
+ mark <fbs-id> <status> Record a lifecycle transition (notStarted ->
178
+ inProgress -> complete). 'verified' is written
179
+ only by 'build finalise'.
180
+ finalise <fbs-id> Ship gate: run the independent verifier and
181
+ promote a complete FBS to verified.
182
+ review <fbs-id> Stage-3-to-Stage-4 audit (test-theatre and
183
+ mutation-sampling).
184
+ fbs <fbs-id> <verb> FBS-level operations (depends-on).
185
+ test-suite <ts-id> <verb> Test-suite operations (provenance, approve).
186
+
187
+ Run 'rcf help build <verb>' for per-verb help.
188
+ `;
189
+
190
+ const VERIFY_GROUP_HELP = `Usage: rcf verify <verb> [options]
191
+
192
+ Run the fresh-context adversarial ship-gate verifier against a running
193
+ app, and gate UI-bearing work through browser verification. Independent
194
+ ship-readiness signal, not a correctness proof.
195
+
196
+ Verbs:
197
+ run Run adversarial verification; emit a report.
198
+ report <path> Re-render a prior report artifact.
199
+ provision Stand up prerequisite accounts and sandboxes.
200
+ cleanup Tear down provisioned artefacts (all prefixed
201
+ 'zzverify-').
202
+ mcp Serve verify over MCP (local stdio).
203
+ browser <fbs-id> Stage 5 browser-verification gate for a
204
+ UI-bearing FBS.
205
+
206
+ Run 'rcf help verify <verb>' for per-verb help.
207
+ `;
208
+
209
+ const AUDIT_HELP = `Usage: rcf audit <verb> [options]
210
+
211
+ Inspect the tree and its rollups: live HTML view, structural coverage,
212
+ forward and backward trace, change-impact fan-out. Read-only visibility
213
+ over what has been defined and built.
214
+
215
+ Verbs:
216
+ view Live HTML tree render (long-running server).
217
+ coverage [scope-id] Structural coverage over the PRD -> REQ -> US ->
218
+ AC -> TS -> TC chain.
219
+ trace <id> Walk the graph forward, back, or both from a node.
220
+ impact <id> Change-impact fan-out from a node.
221
+
222
+ Run 'rcf help audit <verb>' for per-verb help.
223
+ `;
224
+
225
+ export const GROUP_HELP = {
226
+ discover: DISCOVER_HELP,
227
+ define: DEFINE_HELP,
228
+ build: BUILD_GROUP_HELP,
229
+ verify: VERIFY_GROUP_HELP,
230
+ audit: AUDIT_HELP,
231
+ };
232
+
233
+ // Per-verb HELP_MAP is a two-level structure keyed by [group][verb].
234
+ // Every value is an import from the module that implements the verb.
235
+ // See the single-source rule at the top of this file before adding an
236
+ // entry.
237
+ export const HELP_MAP = {
238
+ discover: {
239
+ intake: INTAKE_HELP,
240
+ preflight: PREFLIGHT_HELP,
241
+ 'req-classify': REQ_CLASSIFY_HELP,
242
+ 'req-baseline': REQ_BASELINE_HELP,
243
+ 'ui-classify': UI_CLASSIFY_HELP,
244
+ 'ui-baseline': UI_BASELINE_HELP,
245
+ },
246
+ define: {
247
+ create: CREATE_HELP,
248
+ read: READ_HELP,
249
+ update: UPDATE_HELP,
250
+ delete: DELETE_HELP,
251
+ link: LINK_HELP,
252
+ unlink: UNLINK_HELP,
253
+ validate: VALIDATE_HELP,
254
+ design: DESIGN_HELP,
255
+ blueprint: BLUEPRINT_HELP,
256
+ standards: STANDARDS_HELP,
257
+ },
258
+ build: {
259
+ queue: BUILD_HELP,
260
+ bundle: BUILD_HELP,
261
+ mark: BUILD_HELP,
262
+ finalise: FINALISE_HELP,
263
+ review: REVIEW_HELP,
264
+ fbs: FBS_HELP,
265
+ 'test-suite': TEST_SUITE_HELP,
266
+ },
267
+ verify: {
268
+ run: VERIFY_RUN_HELP,
269
+ report: VERIFY_REPORT_HELP,
270
+ provision: VERIFY_PROVISION_HELP,
271
+ cleanup: VERIFY_CLEANUP_HELP,
272
+ mcp: VERIFY_MCP_HELP,
273
+ browser: BROWSER_VERIFY_HELP,
274
+ },
275
+ audit: {
276
+ view: VIEW_HELP,
277
+ coverage: COVERAGE_HELP,
278
+ trace: TRACE_HELP,
279
+ impact: IMPACT_HELP,
280
+ },
281
+ };
282
+
283
+ // Core-verb HELP blocks live outside the group tree.
284
+ export const CORE_HELP = {
96
285
  init: INIT_HELP,
97
- validate: VALIDATE_HELP,
98
- create: CREATE_HELP,
99
- read: READ_HELP,
100
- update: UPDATE_HELP,
101
- delete: DELETE_HELP,
102
- link: LINK_HELP,
103
- unlink: UNLINK_HELP,
104
- coverage: COVERAGE_HELP,
105
- trace: TRACE_HELP,
106
- impact: IMPACT_HELP,
107
- build: BUILD_HELP,
108
- finalise: FINALISE_HELP,
109
286
  doctor: DOCTOR_HELP,
110
287
  guidance: GUIDANCE_HELP,
111
288
  mcp: MCP_HELP,
112
- view: VIEW_HELP,
113
- preflight: PREFLIGHT_HELP,
114
- review: REVIEW_HELP,
115
- fbs: FBS_HELP,
116
- 'test-suite': TEST_SUITE_HELP,
117
- 'ui-classify': UI_CLASSIFY_HELP,
118
- 'ui-baseline': UI_BASELINE_HELP,
119
- design: DESIGN_HELP,
120
- 'browser-verify': BROWSER_VERIFY_HELP,
121
- // Track C+D (elicitation-and-playbook-hardening-0.7.0) verbs.
122
- 'req-classify': REQ_CLASSIFY_HELP,
123
- 'req-baseline': REQ_BASELINE_HELP,
124
- intake: INTAKE_HELP,
125
- // 0.7.1 packaging consolidation: verify subcommand tree.
126
- verify: VERIFY_HELP,
127
289
  };
128
290
 
129
291
  /**
130
- * `rcf help [command]` handler. Positional after `help` names the
131
- * subcommand; absent → top-level help.
292
+ * `rcf help [group] [verb]` handler.
293
+ *
294
+ * Positional layout:
295
+ * - no positionals -> top-level help
296
+ * - <core-verb> -> per-verb help for a core verb
297
+ * - <group> -> group help
298
+ * - <group> <verb> -> per-verb help for a grouped verb
132
299
  *
133
300
  * @param {string[]} argv - argv slice after `help`
134
301
  * @param {object} [deps]
@@ -141,16 +308,29 @@ export async function main(argv, deps = {}) {
141
308
  stdout.write(TOP_LEVEL);
142
309
  return 0;
143
310
  }
144
- const cmd = argv[0];
145
- const body = HELP_MAP[cmd];
146
- if (!body) {
147
- stderr.write(`[error] usage no help topic named '${cmd}'\n`);
148
- stdout.write(TOP_LEVEL);
149
- return 2;
311
+ const first = argv[0];
312
+ if (first in CORE_HELP) {
313
+ stdout.write(CORE_HELP[first]);
314
+ return 0;
315
+ }
316
+ if (first in GROUP_HELP) {
317
+ const verb = argv[1];
318
+ if (!verb) {
319
+ stdout.write(GROUP_HELP[first]);
320
+ return 0;
321
+ }
322
+ const body = HELP_MAP[first][verb];
323
+ if (!body) {
324
+ stderr.write(`[error] usage no help topic '${first} ${verb}'\n`);
325
+ stdout.write(GROUP_HELP[first]);
326
+ return 2;
327
+ }
328
+ stdout.write(body);
329
+ return 0;
150
330
  }
151
- stdout.write(body);
152
- return 0;
331
+ stderr.write(`[error] usage no help topic named '${first}'\n`);
332
+ stdout.write(TOP_LEVEL);
333
+ return 2;
153
334
  }
154
335
 
155
336
  export const TOP_LEVEL_HELP = TOP_LEVEL;
156
- export { HELP_MAP };
package/src/cli/impact.js CHANGED
@@ -26,7 +26,7 @@ const OPTION_SPEC = {
26
26
  'to-code': { type: 'boolean' },
27
27
  };
28
28
 
29
- export const HELP = `Usage: rcf impact <id> [options]
29
+ export const HELP = `Usage: rcf audit impact <id> [options]
30
30
 
31
31
  Report the fan-out for 'if <id> changes'. Emits ancestors (up to the
32
32
  root PRD / TAD / BS) plus descendants (down to test-leaves) with a
package/src/cli/init.js CHANGED
@@ -22,7 +22,7 @@ import { parseArgs } from 'node:util';
22
22
  import { createInterface } from 'node:readline/promises';
23
23
 
24
24
  import { readFile, writeFile } from 'node:fs/promises';
25
- import { join } from 'node:path';
25
+ import { basename, join } from 'node:path';
26
26
 
27
27
  import { initProject } from '#core/store/init.js';
28
28
  import {
@@ -61,7 +61,11 @@ to elicit. Re-running on an existing project leaves the tree alone and
61
61
  refreshes the wiring.
62
62
 
63
63
  Options:
64
- --project-name <name> Project name (required for --non-interactive)
64
+ --project-name <name> Project name. In non-interactive mode this
65
+ defaults to the working directory's basename
66
+ (pass explicitly to override); an unusable
67
+ basename (empty, '.', or '/') still requires
68
+ the flag.
65
69
  --non-interactive Skip prompts; use seed values (default when
66
70
  not on a TTY or when piped)
67
71
  --no-agent-setup Scaffold the tree only; print the manual
@@ -115,10 +119,21 @@ export async function main(argv, deps = {}) {
115
119
  rl.close();
116
120
  }
117
121
  } else {
122
+ // Non-interactive: --project-name defaults to the working
123
+ // directory's basename. An unusable basename (empty, '.', or '/')
124
+ // still requires the flag - no silent fallback to a generic name.
118
125
  if (!projectName) {
119
- stderr.write('[error] usage --project-name is required in non-interactive mode\n');
120
- stderr.write(HELP);
121
- return 2;
126
+ const candidate = basename(cwd).trim();
127
+ if (candidate && candidate !== '.' && candidate !== '/') {
128
+ projectName = candidate;
129
+ } else {
130
+ stderr.write(
131
+ `[error] usage --project-name is required in non-interactive mode `
132
+ + `(cwd basename '${candidate}' is unusable as a default)\n`,
133
+ );
134
+ stderr.write(HELP);
135
+ return 2;
136
+ }
122
137
  }
123
138
  }
124
139
 
package/src/cli/intake.js CHANGED
@@ -30,8 +30,8 @@ const OPTION_SPEC = {
30
30
  help: { type: 'boolean' },
31
31
  };
32
32
 
33
- export const HELP = `Usage: rcf intake [--artefact <path>[,path]] [--kind <kind>] [--dry-run]
34
- rcf intake --input <config.json> [--dry-run]
33
+ export const HELP = `Usage: rcf discover intake [--artefact <path>[,path]] [--kind <kind>] [--dry-run]
34
+ rcf discover intake --input <config.json> [--dry-run]
35
35
 
36
36
  Variable-fidelity intake: read what the operator supplied, classify its
37
37
  fidelity, validate it against elicitation integrity, and record an
@@ -109,7 +109,7 @@ export async function main(argv, deps = {}) {
109
109
 
110
110
  const walkResult = await walkTree({ projectRoot });
111
111
  if (walkResult.errors.length > 0) {
112
- stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf validate' for details)\n`);
112
+ stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf define validate' for details)\n`);
113
113
  }
114
114
 
115
115
  const outcome = await runIntakePhases({
package/src/cli/link.js CHANGED
@@ -15,7 +15,7 @@ const OPTION_SPEC = {
15
15
  help: { type: 'boolean' },
16
16
  };
17
17
 
18
- export const HELP = `Usage: rcf link <us-id> --tac <tac-id> [options]
18
+ export const HELP = `Usage: rcf define link <us-id> --tac <tac-id> [options]
19
19
 
20
20
  Options:
21
21
  --tac <tac-id> TAC id to link (repeatable to link multiple
@@ -25,7 +25,7 @@ Options:
25
25
  --help Print this help
26
26
  `;
27
27
 
28
- export const UNLINK_HELP = `Usage: rcf unlink <us-id> --tac <tac-id> [options]
28
+ export const UNLINK_HELP = `Usage: rcf define unlink <us-id> --tac <tac-id> [options]
29
29
 
30
30
  Options:
31
31
  --tac <tac-id> TAC id to unlink (repeatable)
@@ -77,7 +77,7 @@ export async function main(argv, deps = {}) {
77
77
  // B5: pre-existing tree breakage no longer blocks write verbs - the
78
78
  // write is gated on the POST-write tree state inside the writer.
79
79
  if (walkResult.errors.length > 0) {
80
- stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf validate' for details)\n`);
80
+ stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf define validate' for details)\n`);
81
81
  }
82
82
  const us = walkResult.tree.byId.get(usId);
83
83
  if (!us || walkResult.tree.kindById.get(usId) !== 'userStory') {
@@ -47,7 +47,7 @@ const OPTION_SPEC = {
47
47
  help: { type: 'boolean' },
48
48
  };
49
49
 
50
- export const HELP = `Usage: rcf preflight [options]
50
+ export const HELP = `Usage: rcf discover preflight [options]
51
51
 
52
52
  Elicit the pre-flight configuration record: for every third-party
53
53
  service the PRD or TAD names, force one of the five attestation modes,
@@ -115,7 +115,7 @@ export async function main(argv, deps = {}) {
115
115
 
116
116
  const walkResult = await walkTree({ projectRoot });
117
117
  if (walkResult.errors.length > 0) {
118
- stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding — run 'rcf validate' for details\n`);
118
+ stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - run 'rcf define validate' for details\n`);
119
119
  }
120
120
  const { tree } = walkResult;
121
121
 
package/src/cli/read.js CHANGED
@@ -13,7 +13,7 @@ const OPTION_SPEC = {
13
13
  help: { type: 'boolean' },
14
14
  };
15
15
 
16
- export const HELP = `Usage: rcf read <id> [options]
16
+ export const HELP = `Usage: rcf define read <id> [options]
17
17
 
18
18
  Prints the document body to stdout and a schema-validity report to
19
19
  stderr: a valid document is reported as valid; an invalid-but-present
@@ -47,7 +47,7 @@ const OPTION_SPEC = {
47
47
  help: { type: 'boolean' },
48
48
  };
49
49
 
50
- export const HELP = `Usage: rcf req-baseline <verb> [options]
50
+ export const HELP = `Usage: rcf discover req-baseline <verb> [options]
51
51
 
52
52
  Verbs:
53
53
  sweep [--req <id> | --all] [--status] [--dry-run] [--yes] [--json]
@@ -131,7 +131,7 @@ export async function main(argv, deps = {}) {
131
131
 
132
132
  const walkResult = await walkTree({ projectRoot });
133
133
  if (walkResult.errors.length > 0) {
134
- stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf validate' for details)\n`);
134
+ stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf define validate' for details)\n`);
135
135
  }
136
136
 
137
137
  if (verb === 'sweep') {
@@ -21,8 +21,8 @@ const OPTION_SPEC = {
21
21
  help: { type: 'boolean' },
22
22
  };
23
23
 
24
- export const HELP = `Usage: rcf req-classify <req-id> [options]
25
- rcf req-classify --all [options]
24
+ export const HELP = `Usage: rcf discover req-classify <req-id> [options]
25
+ rcf discover req-classify --all [options]
26
26
 
27
27
  Rerun the REQ-shape classifier for one requirement (or every requirement
28
28
  in the tree with --all) and write the resulting shapeClassification
@@ -86,7 +86,7 @@ export async function main(argv, deps = {}) {
86
86
 
87
87
  const walkResult = await walkTree({ projectRoot });
88
88
  if (walkResult.errors.length > 0) {
89
- stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf validate' for details)\n`);
89
+ stderr.write(`[warn] tree has ${walkResult.errors.length} pre-existing issue(s); proceeding - writes are validated against the post-write state (run 'rcf define validate' for details)\n`);
90
90
  }
91
91
 
92
92
  const reqIds = [];
package/src/cli/review.js CHANGED
@@ -45,7 +45,7 @@ const OPTION_SPEC = {
45
45
  help: { type: 'boolean' },
46
46
  };
47
47
 
48
- export const HELP = `Usage: rcf review <fbs-id> [options]
48
+ export const HELP = `Usage: rcf build review <fbs-id> [options]
49
49
 
50
50
  Run the REVIEW-stage audit (test-theatre + mutation-sampling) and write
51
51
  the reviewAudit record to the manifest. Exit 4 on any warn or block