create-quiver 0.17.2 → 0.17.3

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 (44) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/docs/CLI_UX_GUIDE.md +13 -3
  3. package/docs/TROUBLESHOOTING.md +43 -2
  4. package/docs/reference/commands.md +31 -9
  5. package/docs/workflows/existing-project.md +18 -3
  6. package/package.json +1 -1
  7. package/specs/quiver-v43-cli-i18n-audit-release-readiness/command-language-mode-matrix.json +4 -0
  8. package/specs/quiver-v55-analyze-project-doc-apply-ux/EVIDENCE_REPORT.md +209 -0
  9. package/specs/quiver-v55-analyze-project-doc-apply-ux/EXECUTION_PLAN.md +49 -0
  10. package/specs/quiver-v55-analyze-project-doc-apply-ux/SPEC.md +276 -0
  11. package/specs/quiver-v55-analyze-project-doc-apply-ux/STATUS.md +29 -0
  12. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/CLOSURE_BRIEF.md +47 -0
  13. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/EXECUTION_BRIEF.md +67 -0
  14. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/pr.md +129 -0
  15. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-01-cli-proposal-contract/slice.json +82 -0
  16. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/CLOSURE_BRIEF.md +39 -0
  17. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/EXECUTION_BRIEF.md +61 -0
  18. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/pr.md +116 -0
  19. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-02-save-proposal-flow/slice.json +69 -0
  20. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/CLOSURE_BRIEF.md +36 -0
  21. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/EXECUTION_BRIEF.md +62 -0
  22. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/pr.md +132 -0
  23. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-03-noninteractive-apply-engine/slice.json +76 -0
  24. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/CLOSURE_BRIEF.md +47 -0
  25. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/EXECUTION_BRIEF.md +70 -0
  26. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/pr.md +141 -0
  27. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-04-interactive-apply-ux/slice.json +72 -0
  28. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/CLOSURE_BRIEF.md +42 -0
  29. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/EXECUTION_BRIEF.md +61 -0
  30. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/pr.md +129 -0
  31. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-05-apply-saved-proposal/slice.json +67 -0
  32. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/CLOSURE_BRIEF.md +38 -0
  33. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/EXECUTION_BRIEF.md +64 -0
  34. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/pr.md +123 -0
  35. package/specs/quiver-v55-analyze-project-doc-apply-ux/slices/slice-06-i18n-docs-release-smoke/slice.json +76 -0
  36. package/src/create-quiver/commands/ai.js +636 -66
  37. package/src/create-quiver/index.js +80 -1
  38. package/src/create-quiver/lib/ai/analyze-project-apply.js +269 -0
  39. package/src/create-quiver/lib/ai/analyze-project-interactive.js +241 -0
  40. package/src/create-quiver/lib/ai/analyze-project-proposal.js +582 -0
  41. package/src/create-quiver/lib/ai/analyze-project-validation.js +10 -8
  42. package/src/create-quiver/lib/cli/ux-flags.js +6 -0
  43. package/src/create-quiver/lib/i18n/messages/en.js +28 -0
  44. package/src/create-quiver/lib/i18n/messages/es.js +29 -0
@@ -0,0 +1,276 @@
1
+ # Quiver v55 - Analyze Project Doc Apply UX
2
+
3
+ **Date:** 2026-06-12
4
+ **Status:** Approved, not implemented
5
+ **Source:** User-approved requirement, technical plan, production review, and stricter slice-cut review.
6
+
7
+ ## Problem
8
+
9
+ `ai analyze-project --deep --provider codex --model gpt-5.5` now generates valid, auditable doc proposals, but users still do not get an easy path to apply those proposals. Without `--review`, no final docs are written. With `--review`, Quiver opens a large JSON proposal in `$VISUAL` or `$EDITOR`, which is safe but confusing for non-technical users, especially when the editor is `vim` or another console editor.
10
+
11
+ The command needs a simpler product-grade flow that explains choices, supports English and Spanish, preserves auditability, and avoids accidental documentation writes.
12
+
13
+ ## Objective
14
+
15
+ Add a safe, bilingual, user-friendly documentation application workflow for `ai analyze-project`:
16
+
17
+ ```bash
18
+ npx create-quiver ai analyze-project --deep --apply-docs --provider codex --model gpt-5.5
19
+ npx create-quiver ai analyze-project --deep --apply-docs --yes --provider codex --model gpt-5.5
20
+ npx create-quiver ai analyze-project --deep --save-proposal --provider codex --model gpt-5.5
21
+ npx create-quiver ai analyze-project apply --run <run-id>
22
+ ```
23
+
24
+ The implementation must separate proposal generation, proposal persistence, apply logic, and interactive UX so future teams can evolve each part without duplicating write-gate logic.
25
+
26
+ ## Scope
27
+
28
+ ### Included
29
+
30
+ - New CLI contract for `--apply-docs`, `--save-proposal`, `--diff`, `--yes`, `--allow-dirty-docs`, and `ai analyze-project apply --run <run-id>`.
31
+ - Proposal artifact contract under `.quiver/runs/<run-id>/proposal/`.
32
+ - Non-interactive save proposal flow.
33
+ - Non-interactive apply flow with `--apply-docs --yes`.
34
+ - Interactive TTY selector with explained options and dynamic recommendation.
35
+ - Apply saved proposal flow with stale/dirty validation.
36
+ - English and Spanish UX copy.
37
+ - Docs, command matrix, and release smoke guidance.
38
+
39
+ ### Excluded
40
+
41
+ - Changing the provider prompt semantics.
42
+ - Relaxing the analyze-project schema.
43
+ - Writing product code in analyzed repositories.
44
+ - Generating specs automatically from project analysis.
45
+ - Removing or breaking the existing `--review` editor flow.
46
+ - Requiring live provider calls in CI.
47
+
48
+ ## Functional Requirements
49
+
50
+ 1. Normal provider mode without apply flags must clearly say that docs were not written and list the next commands.
51
+ 2. `--save-proposal` must generate and save a validated normalized proposal without writing final docs.
52
+ 3. `--apply-docs --yes` must apply validated doc updates without prompting and must be safe for automation.
53
+ 4. `--apply-docs` in TTY must show a selector with option descriptions.
54
+ 5. The selector must include:
55
+ - Apply documentation;
56
+ - View diff;
57
+ - Save proposal;
58
+ - Edit proposal;
59
+ - Cancel.
60
+ 6. The recommended option must be first and must change to View diff when docs are dirty or existing content creates higher overwrite risk.
61
+ 7. `--review` must preserve current behavior and be documented as advanced edit proposal mode.
62
+ 8. `ai analyze-project apply --run <run-id>` must apply a saved proposal without running a provider.
63
+ 9. `apply --run` must revalidate the saved proposal and current docs before writing.
64
+ 10. `--run latest` may be supported only in TTY and never with `--yes`.
65
+
66
+ ## Non-Functional Requirements
67
+
68
+ - All writes must be audited.
69
+ - All docs writes must use the existing safe write plan, snapshot, and post-write validation path.
70
+ - Human console output must stay compact.
71
+ - Full diff/proposal details must be saved as artifacts.
72
+ - `--json` output must remain parseable and must never include interactive prompts.
73
+ - The feature must work in English and Spanish.
74
+ - Commands, flags, and paths must not be translated.
75
+
76
+ ## CLI Contract
77
+
78
+ | Command | Behavior |
79
+ |---|---|
80
+ | `ai analyze-project --deep --provider ...` | Generates analysis and audited provider artifacts. Does not write final docs. Explains next apply/save commands. |
81
+ | `ai analyze-project --deep --save-proposal --provider ...` | Runs provider, validates/repairs analysis, saves normalized proposal artifacts, writes no final docs. |
82
+ | `ai analyze-project --deep --save-proposal --json --provider ...` | Same as above with clean JSON result. |
83
+ | `ai analyze-project --deep --apply-docs --provider ...` | In TTY, shows explained selector. In no-TTY, fails unless `--yes`. |
84
+ | `ai analyze-project --deep --apply-docs --yes --provider ...` | Applies valid docs directly after safety checks. |
85
+ | `ai analyze-project --deep --apply-docs --yes --json --provider ...` | Applies valid docs and emits machine-readable result. |
86
+ | `ai analyze-project --deep --review --provider ...` | Existing advanced editor review flow. |
87
+ | `ai analyze-project apply --run <run-id>` | Applies saved proposal without provider execution. |
88
+
89
+ ## Flag Rules
90
+
91
+ - `--apply-docs` and `--review` are mutually exclusive.
92
+ - `--dry-run` is incompatible with `--apply-docs`, `--save-proposal`, and `apply --run`.
93
+ - `--json + --save-proposal` is allowed.
94
+ - `--json + --apply-docs` is allowed only with `--yes`.
95
+ - `--json + --review` is prohibited.
96
+ - `--json` with an interactive selector is prohibited.
97
+ - `--allow-dirty-docs` only affects docs target dirty checks; it never permits product code writes.
98
+
99
+ ## Proposal Artifact Contract
100
+
101
+ Every saved proposal must live under:
102
+
103
+ ```text
104
+ .quiver/runs/<run-id>/proposal/
105
+ ```
106
+
107
+ Required files:
108
+
109
+ ```text
110
+ analyze-project-doc-proposal.json
111
+ analyze-project-doc-proposal.md
112
+ analyze-project-doc-proposal.diff
113
+ manifest.json
114
+ ```
115
+
116
+ Required manifest fields:
117
+
118
+ ```json
119
+ {
120
+ "schema_version": 1,
121
+ "kind": "quiver-analyze-project-doc-proposal",
122
+ "run_id": "run-...",
123
+ "created_at": "...",
124
+ "language": "en|es",
125
+ "provider": "codex",
126
+ "proposal_json": ".quiver/runs/.../proposal/analyze-project-doc-proposal.json",
127
+ "proposal_markdown": ".quiver/runs/.../proposal/analyze-project-doc-proposal.md",
128
+ "proposal_diff": ".quiver/runs/.../proposal/analyze-project-doc-proposal.diff",
129
+ "selected_context_manifest": ".quiver/runs/.../context/selected-context.json",
130
+ "repair_manifest": ".quiver/runs/.../repair/analyze-project-repair.json",
131
+ "doc_paths": [],
132
+ "doc_before_hashes": {},
133
+ "proposal_sha256": "...",
134
+ "events": []
135
+ }
136
+ ```
137
+
138
+ The write manifest must be separate:
139
+
140
+ ```text
141
+ .quiver/runs/<run-id>/writes/analyze-project-doc-writes.json
142
+ ```
143
+
144
+ It must include actions, before/after hashes, snapshot path, validation result, and partial-write status if an unexpected write failure occurs.
145
+
146
+ ## Interactive UX
147
+
148
+ Spanish example:
149
+
150
+ ```text
151
+ Analisis completado.
152
+ La IA genero una propuesta de documentacion basada en el codigo del proyecto.
153
+
154
+ Archivos propuestos:
155
+ - docs/CONTEXTO.md
156
+ - docs/AI_CONTEXT.md
157
+ - docs/ARCHITECTURE.md
158
+
159
+ Que queres hacer?
160
+
161
+ > Aplicar documentacion (Recomendado)
162
+ Escribe los archivos propuestos usando merge seguro y snapshot previo.
163
+
164
+ Ver diff
165
+ Muestra los cambios antes de decidir si aplicarlos.
166
+
167
+ Guardar propuesta
168
+ Guarda la propuesta en .quiver/runs sin modificar docs finales.
169
+
170
+ Editar propuesta
171
+ Abre la propuesta en tu editor para modificarla manualmente.
172
+
173
+ Cancelar
174
+ No escribe documentacion final.
175
+ ```
176
+
177
+ English example:
178
+
179
+ ```text
180
+ Analysis completed.
181
+ AI generated a documentation proposal from the project source code.
182
+
183
+ Proposed files:
184
+ - docs/CONTEXTO.md
185
+ - docs/AI_CONTEXT.md
186
+ - docs/ARCHITECTURE.md
187
+
188
+ What do you want to do?
189
+
190
+ > Apply documentation (Recommended)
191
+ Writes the proposed files using safe merge and a prior snapshot.
192
+
193
+ View diff
194
+ Shows the changes before deciding whether to apply them.
195
+
196
+ Save proposal
197
+ Saves the proposal under .quiver/runs without modifying final docs.
198
+
199
+ Edit proposal
200
+ Opens the proposal in your editor for manual changes.
201
+
202
+ Cancel
203
+ Does not write final documentation.
204
+ ```
205
+
206
+ ## Safety Rules
207
+
208
+ - No final docs write if final JSON/proposal is invalid.
209
+ - No final docs write if any proposed path is outside the allowlist.
210
+ - No silent partial apply.
211
+ - Dirty docs block `--yes` unless `--allow-dirty-docs` is passed.
212
+ - In repos without Git, use hash/snapshot checks and warn that Git dirty detection is unavailable.
213
+ - `apply --run` must revalidate the current repo state before writing.
214
+ - A saved proposal with stale doc hashes must warn in TTY and block `--yes` unless explicitly allowed.
215
+
216
+ ## Slice Roadmap
217
+
218
+ | Slice | Title | Status | Dependencies | Parallel Guidance |
219
+ |---|---|---|---|---|
220
+ | slice-01-cli-proposal-contract | CLI Contract + Proposal Artifact Contract | pending | none | sequential first |
221
+ | slice-02-save-proposal-flow | Save Proposal Flow | pending | slice-01 | sequential after contract |
222
+ | slice-03-noninteractive-apply-engine | Non-Interactive Apply Engine | pending | slice-01, slice-02 | sequential safety gate |
223
+ | slice-04-interactive-apply-ux | Interactive Apply UX | pending | slice-03 | sequential UI over engine |
224
+ | slice-05-apply-saved-proposal | Apply Saved Proposal | pending | slice-02, slice-03 | after apply engine |
225
+ | slice-06-i18n-docs-release-smoke | i18n, Docs, Release Smoke | pending | slice-04, slice-05 | final |
226
+
227
+ ## Execution Order
228
+
229
+ ```text
230
+ 01
231
+ └─ 02
232
+ └─ 03
233
+ ├─ 04
234
+ └─ 05
235
+ └─ 06
236
+ ```
237
+
238
+ ## Validation Strategy
239
+
240
+ Deterministic gates:
241
+
242
+ ```bash
243
+ node --test tests/commands/ai-analyze-project-review.test.js
244
+ node --test tests/commands/ai-analyze-project-provider.test.js
245
+ node --test tests/commands/ai-analyze-project.test.js
246
+ node --test tests/lib/ai-analyze-project-validation.test.js
247
+ node --test tests/lib/ai/analyze-project-repair.test.js
248
+ npm run docs:check
249
+ npm run schema:slice:check
250
+ node bin/create-quiver.js spec validate specs/quiver-v55-analyze-project-doc-apply-ux --strict
251
+ git diff --check
252
+ ```
253
+
254
+ Release smoke must use a temporary copy or disposable branch of `nika-erp`, never the main working copy.
255
+
256
+ ## Risks
257
+
258
+ - Applying proposals over stale docs can overwrite human edits.
259
+ - Adding selector logic directly inside `ai.js` can increase CLI debt.
260
+ - A broad `--yes` implementation can approve more than intended.
261
+ - Diff output can become too large and repeat the original UX problem.
262
+ - `apply --run latest` can apply the wrong proposal if not constrained.
263
+
264
+ ## Resolved Decisions
265
+
266
+ - Implement three layers: Proposal Layer, Apply Layer, UX Layer.
267
+ - Keep `--review` backward compatible.
268
+ - Permit `--json` for non-interactive save/apply flows.
269
+ - Do not require provider/model for `apply --run`.
270
+ - Save proposal artifacts before any apply.
271
+
272
+ ## Open Questions
273
+
274
+ - Exact human diff truncation limit should be chosen during implementation.
275
+ - Exact stale proposal warning copy should be finalized with i18n keys.
276
+ - Whether `--run latest` ships in v55 or is deferred should be decided during slice-05.
@@ -0,0 +1,29 @@
1
+ # Status - Quiver v55 Analyze Project Doc Apply UX
2
+
3
+ **Status:** Completed
4
+ **Last updated:** 2026-06-12
5
+
6
+ ## Current State
7
+
8
+ The requirement, acceptance criteria, technical plan, production review, and stricter slice-cut review are approved. All six slices have been implemented and validated.
9
+
10
+ ## Slice Status
11
+
12
+ | Slice | Status | Notes |
13
+ |---|---|---|
14
+ | slice-01-cli-proposal-contract | completed | CLI flags, subcommand contract, help/docs, and proposal/write manifest schema are implemented and tested. |
15
+ | slice-02-save-proposal-flow | completed | `--save-proposal` persists JSON, Markdown summary, diff, and manifest artifacts without final docs writes. |
16
+ | slice-03-noninteractive-apply-engine | completed | `--apply-docs --yes` applies valid docs through proposal artifacts, dirty/stale preflight, snapshot, write manifest, and post-write validation. |
17
+ | slice-04-interactive-apply-ux | completed | Plain TTY `--apply-docs` now shows an explained selector with apply, view diff, save, edit, and cancel actions routed through tested flows. |
18
+ | slice-05-apply-saved-proposal | completed | `ai analyze-project apply --run <run-id>` applies saved proposals without provider execution after manifest/proposal revalidation and dirty/stale checks. |
19
+ | slice-06-i18n-docs-release-smoke | completed | EN/ES help coverage, user docs, command matrix, troubleshooting, and safe nika-erp release smoke guidance are updated and validated. |
20
+
21
+ ## Blockers
22
+
23
+ - None.
24
+
25
+ ## Next Command
26
+
27
+ ```bash
28
+ npm run docs:check
29
+ ```
@@ -0,0 +1,47 @@
1
+ # CLOSURE_BRIEF - slice-01 CLI proposal contract
2
+
3
+ ## Summary
4
+
5
+ Completed. The CLI contract now recognizes the v55 doc-apply flags and `ai analyze-project apply --run <run-id>` without implementing the later save/apply flows.
6
+
7
+ Implemented:
8
+
9
+ - Parser support for `--apply-docs`, `--save-proposal`, `--diff`, and `--allow-dirty-docs`.
10
+ - Parser support for `ai analyze-project apply --run <run-id>`.
11
+ - Pre-provider contract failures for invalid flag combinations.
12
+ - Runtime contract guards that prevent provider execution for future save/apply flows until later slices implement them.
13
+ - Proposal/write manifest schema helpers in `analyze-project-proposal.js`.
14
+ - Help/reference documentation for the new command surface.
15
+ - Regression coverage for existing `--review` UX support.
16
+
17
+ ## Required Evidence
18
+
19
+ - Parser/flag tests pass.
20
+ - Invalid combination tests pass before provider execution.
21
+ - Proposal manifest schema tests pass.
22
+ - Existing `--review` tests still pass.
23
+ - Docs and slice schema checks pass.
24
+
25
+ ## Validation
26
+
27
+ Executed:
28
+
29
+ ```bash
30
+ node --test tests/lib/ai-analyze-project-proposal.test.js
31
+ node --test tests/commands/ai-analyze-project.test.js
32
+ node --test tests/commands/cli-contract.test.js
33
+ node --test tests/commands/parser-contract.test.js
34
+ node --test tests/commands/ux-flags.test.js
35
+ node --test tests/commands/ai-analyze-project-review.test.js
36
+ node --test tests/commands/ai-analyze-project-provider.test.js
37
+ node --test tests/lib/ai-analyze-project-docs.test.js tests/lib/ai-analyze-project-validation.test.js
38
+ npm run docs:check
39
+ npm run schema:slice:check
40
+ ```
41
+
42
+ Pending final gate after metadata close:
43
+
44
+ ```bash
45
+ node bin/create-quiver.js spec validate specs/quiver-v55-analyze-project-doc-apply-ux --strict
46
+ git diff --check
47
+ ```
@@ -0,0 +1,67 @@
1
+ # EXECUTION_BRIEF - slice-01 CLI proposal contract
2
+
3
+ ## Context
4
+
5
+ The new apply-docs workflow needs stable contracts before any write behavior or selector UX is implemented. This slice freezes parser behavior, flag incompatibilities, proposal artifact schemas, and command help expectations.
6
+
7
+ ## Objective
8
+
9
+ Define and test the CLI contract and proposal artifact contract for v55 without writing final docs.
10
+
11
+ ## Scope
12
+
13
+ - Parse/validate:
14
+ - `--apply-docs`
15
+ - `--save-proposal`
16
+ - `--diff`
17
+ - `--yes`
18
+ - `--allow-dirty-docs`
19
+ - `ai analyze-project apply --run <run-id>`
20
+ - Define proposal manifest schema and write manifest schema.
21
+ - Define allowed JSON combinations.
22
+ - Update command registry/help metadata if needed.
23
+ - Add contract tests only; no apply implementation.
24
+
25
+ ## Acceptance Criteria
26
+
27
+ - Parser accepts the approved flags and subaction without breaking existing `ai analyze-project --deep`.
28
+ - Invalid flag combinations fail before provider execution with actionable errors.
29
+ - `--review` remains backward compatible.
30
+ - Proposal manifest schema is documented and testable.
31
+ - `apply --run` contract does not require provider/model.
32
+ - No runtime docs write is introduced in this slice.
33
+
34
+ ## Expected Files To Modify
35
+
36
+ - `src/create-quiver/commands/ai.js`
37
+ - `src/create-quiver/lib/ai/analyze-project-*.js`
38
+ - `src/create-quiver/lib/i18n/messages/en.js`
39
+ - `src/create-quiver/lib/i18n/messages/es.js`
40
+ - `tests/commands/ai-analyze-project*.test.js`
41
+ - `tests/lib/ai*.test.js`
42
+ - `docs/reference/commands.md`
43
+ - this slice closure/status/evidence files
44
+
45
+ ## Validation Required
46
+
47
+ ```bash
48
+ node --test tests/commands/ai-analyze-project.test.js
49
+ node --test tests/commands/ai-analyze-project-review.test.js
50
+ node bin/create-quiver.js spec validate specs/quiver-v55-analyze-project-doc-apply-ux --strict
51
+ git diff --check
52
+ ```
53
+
54
+ ## Completion Checklist
55
+
56
+ - Parser and help contract updated.
57
+ - Proposal/write manifest schema contract documented.
58
+ - Contract tests added or updated.
59
+ - Existing `--review` behavior verified.
60
+ - Slice closure brief updated with evidence.
61
+
62
+ ## Constraints
63
+
64
+ - Do not implement actual docs applying.
65
+ - Do not call live providers.
66
+ - Do not relax analyze-project schema.
67
+ - Do not change `--review` semantics.
@@ -0,0 +1,129 @@
1
+ ## Title
2
+
3
+ QUIVER-55-01 - Analyze Project CLI Proposal Contract
4
+
5
+ ## Summary
6
+
7
+ Implements the first v55 slice for `ai analyze-project` doc-apply UX. This PR establishes the CLI contract, parser validation, help/docs surface, and proposal/write manifest schemas without implementing the later save/apply flows.
8
+
9
+ ## PR Policy
10
+
11
+ - One slice: `slice-01-cli-proposal-contract`.
12
+ - Runtime behavior change is limited to parser/contract guards and manifest schema helpers.
13
+ - Later slices will implement saving proposals, applying docs, interactive UX, saved proposal apply, and release smoke.
14
+
15
+ ## Scope
16
+
17
+ Included:
18
+
19
+ - Recognize `--apply-docs`, `--save-proposal`, `--diff`, and `--allow-dirty-docs`.
20
+ - Recognize `ai analyze-project apply --run <run-id>`.
21
+ - Reject invalid combinations before provider execution.
22
+ - Keep `--review` backward compatible.
23
+ - Add proposal and write manifest schema validation helpers.
24
+ - Add command help, command reference, and EN/ES help descriptions.
25
+ - Add the approved v55 spec/slice package and mark `slice-01` completed.
26
+
27
+ Excluded:
28
+
29
+ - No proposal persistence implementation.
30
+ - No docs apply implementation.
31
+ - No interactive selector.
32
+ - No saved proposal apply.
33
+ - No live provider smoke.
34
+
35
+ ## Files
36
+
37
+ - `src/create-quiver/index.js`
38
+ - `src/create-quiver/commands/ai.js`
39
+ - `src/create-quiver/lib/ai/analyze-project-proposal.js`
40
+ - `src/create-quiver/lib/cli/ux-flags.js`
41
+ - `src/create-quiver/lib/i18n/messages/en.js`
42
+ - `src/create-quiver/lib/i18n/messages/es.js`
43
+ - `tests/commands/ai-analyze-project.test.js`
44
+ - `tests/commands/cli-contract.test.js`
45
+ - `tests/lib/ai-analyze-project-proposal.test.js`
46
+ - `docs/reference/commands.md`
47
+ - `specs/quiver-v55-analyze-project-doc-apply-ux/**`
48
+
49
+ ## How to Test (DETAILED - REQUIRED)
50
+
51
+ ### Required Environment
52
+
53
+ - Node.js supported by this repository.
54
+ - npm dependencies installed.
55
+ - No provider credentials are required for this slice.
56
+
57
+ ### Worktree Access
58
+
59
+ ```bash
60
+ git checkout feature/QUIVER-55-01-v55-cli-proposal-contract
61
+ ```
62
+
63
+ ### Run the Project
64
+
65
+ No dev server is required. This is a CLI contract slice.
66
+
67
+ ### Use Cases
68
+
69
+ #### Case 1: Dry-run remains read-only
70
+
71
+ ```bash
72
+ node bin/create-quiver.js ai analyze-project --deep --dry-run
73
+ ```
74
+
75
+ Expected: reports read-only analysis and does not create final docs.
76
+
77
+ #### Case 2: Invalid apply/review combination fails before provider
78
+
79
+ ```bash
80
+ node bin/create-quiver.js ai analyze-project --deep --apply-docs --review
81
+ ```
82
+
83
+ Expected: fails with an actionable contract error before provider execution.
84
+
85
+ #### Case 3: Saved proposal apply contract is recognized
86
+
87
+ ```bash
88
+ node bin/create-quiver.js ai analyze-project apply --run run-123
89
+ ```
90
+
91
+ Expected: command is parsed without requiring provider/model and reports that execution is reserved for a later v55 slice.
92
+
93
+ ### Technical Verification
94
+
95
+ ```bash
96
+ node --test tests/lib/ai-analyze-project-proposal.test.js
97
+ node --test tests/commands/ai-analyze-project.test.js
98
+ node --test tests/commands/cli-contract.test.js
99
+ node --test tests/commands/parser-contract.test.js
100
+ node --test tests/commands/ux-flags.test.js
101
+ node --test tests/commands/ai-analyze-project-review.test.js
102
+ node --test tests/commands/ai-analyze-project-provider.test.js
103
+ node --test tests/lib/ai-analyze-project-docs.test.js tests/lib/ai-analyze-project-validation.test.js
104
+ npm run docs:check
105
+ npm run schema:slice:check
106
+ node bin/create-quiver.js spec validate specs/quiver-v55-analyze-project-doc-apply-ux --strict
107
+ git diff --check
108
+ ```
109
+
110
+ ## Evidence
111
+
112
+ - All technical verification commands passed locally.
113
+ - `slice-01` closure brief records executed evidence.
114
+ - No live provider call was required.
115
+
116
+ ## Rollback
117
+
118
+ Revert this PR:
119
+
120
+ ```bash
121
+ git revert <merge-commit-sha>
122
+ ```
123
+
124
+ Existing `ai analyze-project --deep`, `--dry-run`, provider mode, and `--review` behavior are isolated and covered by regression tests.
125
+
126
+ ## Risks / Notes
127
+
128
+ - The new flags are recognized but intentionally blocked from executing save/apply behavior until later slices.
129
+ - This PR includes the v55 spec package because the spec does not exist on `main` yet.
@@ -0,0 +1,82 @@
1
+ {
2
+ "slice_id": "slice-01-cli-proposal-contract",
3
+ "ticket": "QUIVER-55-01",
4
+ "type": "contract",
5
+ "title": "CLI Contract + Proposal Artifact Contract",
6
+ "objective": "Freeze the parser, flag, subcommand, and artifact schema contracts before implementing save/apply behavior.",
7
+ "description": "Adds the command contract for --apply-docs, --save-proposal, --diff, --yes, --allow-dirty-docs, and ai analyze-project apply --run, plus proposal/write manifest schema definitions and tests.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v55-cli-proposal-contract",
12
+ "branch_name": "feature/QUIVER-55-01-v55-cli-proposal-contract"
13
+ },
14
+ "files": [
15
+ "src/create-quiver/index.js",
16
+ "src/create-quiver/commands/ai.js",
17
+ "src/create-quiver/lib/ai/analyze-project-*.js",
18
+ "src/create-quiver/lib/cli/ux-flags.js",
19
+ "src/create-quiver/lib/i18n/messages/en.js",
20
+ "src/create-quiver/lib/i18n/messages/es.js",
21
+ "tests/commands/cli-contract.test.js",
22
+ "tests/commands/ai-analyze-project*.test.js",
23
+ "tests/lib/ai*.test.js",
24
+ "docs/reference/commands.md",
25
+ "specs/quiver-v43-cli-i18n-audit-release-readiness/command-language-mode-matrix.json",
26
+ "specs/quiver-v55-analyze-project-doc-apply-ux/**"
27
+ ],
28
+ "expected_read_paths": [
29
+ "src/create-quiver/commands/ai.js",
30
+ "src/create-quiver/lib/ai/analyze-project-review.js",
31
+ "src/create-quiver/lib/ai/analyze-project-docs.js",
32
+ "docs/CLI_UX_GUIDE.md"
33
+ ],
34
+ "allowed_write_paths": [
35
+ "src/create-quiver/index.js",
36
+ "src/create-quiver/commands/ai.js",
37
+ "src/create-quiver/lib/ai/analyze-project-proposal.js",
38
+ "src/create-quiver/lib/cli/ux-flags.js",
39
+ "src/create-quiver/lib/i18n/messages/en.js",
40
+ "src/create-quiver/lib/i18n/messages/es.js",
41
+ "tests/commands/cli-contract.test.js",
42
+ "tests/commands/ai-analyze-project.test.js",
43
+ "tests/commands/ai-analyze-project-review.test.js",
44
+ "tests/lib/ai-analyze-project-proposal.test.js",
45
+ "docs/reference/commands.md",
46
+ "specs/quiver-v43-cli-i18n-audit-release-readiness/command-language-mode-matrix.json",
47
+ "specs/quiver-v55-analyze-project-doc-apply-ux/**"
48
+ ],
49
+ "depends_on": [],
50
+ "parallel_safe": "never",
51
+ "parallel_safe_reason": "This slice defines contracts required by every later slice.",
52
+ "must": [
53
+ "Define exact flag compatibility rules.",
54
+ "Define proposal and write manifest schemas.",
55
+ "Keep --review backward compatible.",
56
+ "Ensure apply --run does not require provider/model."
57
+ ],
58
+ "not_included": [
59
+ "Saving proposal end-to-end.",
60
+ "Applying docs.",
61
+ "Interactive selector UX."
62
+ ],
63
+ "acceptance": [
64
+ "Parser accepts approved flags and subaction.",
65
+ "Invalid combinations fail before provider execution.",
66
+ "Proposal manifest schema is testable.",
67
+ "Existing --review tests remain green."
68
+ ],
69
+ "tests": [
70
+ "node --test tests/commands/ai-analyze-project.test.js",
71
+ "node --test tests/commands/ai-analyze-project-review.test.js",
72
+ "node --test tests/commands/i18n-audit-matrix.test.js",
73
+ "node bin/create-quiver.js spec validate specs/quiver-v55-analyze-project-doc-apply-ux --strict",
74
+ "git diff --check"
75
+ ],
76
+ "estimated_hours": 4,
77
+ "actual_hours": 4,
78
+ "status": "completed",
79
+ "blocked_reason": null,
80
+ "started_at": "2026-06-12T00:00:00.000Z",
81
+ "completed_at": "2026-06-12T00:00:00.000Z"
82
+ }
@@ -0,0 +1,39 @@
1
+ # CLOSURE_BRIEF - slice-02 save proposal flow
2
+
3
+ ## Summary
4
+
5
+ Implemented `--save-proposal` for `ai analyze-project`.
6
+
7
+ The command now runs the existing provider analysis path, validates and repairs provider JSON through the current schema gates, builds a normalized documentation proposal, and persists proposal artifacts under `.quiver/runs/<run-id>/proposal/` without writing final docs or creating snapshots.
8
+
9
+ Saved artifacts include:
10
+
11
+ - `analyze-project-doc-proposal.json`
12
+ - `analyze-project-doc-proposal.md`
13
+ - `analyze-project-doc-proposal.diff`
14
+ - `manifest.json`
15
+
16
+ `--save-proposal --json` emits clean parseable JSON for automation.
17
+
18
+ ## Required Evidence
19
+
20
+ - Save proposal command test passes.
21
+ - JSON output test passes.
22
+ - No-final-doc write test passes.
23
+ - Invalid provider JSON creates no usable proposal artifacts.
24
+ - Proposal Markdown summary stays compact and omits full doc contents.
25
+
26
+ ## Validation
27
+
28
+ Executed:
29
+
30
+ ```bash
31
+ node --test tests/lib/ai-analyze-project-proposal.test.js
32
+ node --test tests/commands/ai-analyze-project-provider.test.js
33
+ node --test tests/commands/ai-analyze-project.test.js tests/commands/cli-contract.test.js tests/commands/ux-flags.test.js
34
+ node --test tests/commands/ai-analyze-project-review.test.js tests/lib/ai-analyze-project-validation.test.js tests/lib/ai-analyze-project-docs.test.js
35
+ node bin/create-quiver.js spec validate specs/quiver-v55-analyze-project-doc-apply-ux --strict
36
+ git diff --check
37
+ ```
38
+
39
+ Result: all passed.