create-quiver 0.12.1 → 0.14.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 (110) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +24 -9
  3. package/README_FOR_AI.md +15 -6
  4. package/ROADMAP.md +15 -2
  5. package/docs/COMMANDS.md.template +12 -3
  6. package/docs/TROUBLESHOOTING.md.template +29 -0
  7. package/docs/WORKFLOW.md.template +13 -12
  8. package/package.json +2 -1
  9. package/specs/quiver-v26-0121-smoke-hardening/SPEC.md +2 -2
  10. package/specs/quiver-v26-0121-smoke-hardening/STATUS.md +5 -5
  11. package/specs/quiver-v27-reliability-ai-workflow-hardening/AUDIT_V24_V25_V26.md +67 -0
  12. package/specs/quiver-v27-reliability-ai-workflow-hardening/COMMAND_CONTRACTS.md +125 -0
  13. package/specs/quiver-v27-reliability-ai-workflow-hardening/COVERAGE_MATRIX.md +74 -0
  14. package/specs/quiver-v27-reliability-ai-workflow-hardening/EVIDENCE_REPORT.md +179 -0
  15. package/specs/quiver-v27-reliability-ai-workflow-hardening/EXECUTION_PLAN.md +71 -0
  16. package/specs/quiver-v27-reliability-ai-workflow-hardening/SPEC.md +176 -0
  17. package/specs/quiver-v27-reliability-ai-workflow-hardening/STATUS.md +37 -0
  18. package/specs/quiver-v27-reliability-ai-workflow-hardening/pr.md +132 -0
  19. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/CLOSURE_BRIEF.md +36 -0
  20. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/EXECUTION_BRIEF.md +56 -0
  21. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/slice.json +75 -0
  22. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/CLOSURE_BRIEF.md +37 -0
  23. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/EXECUTION_BRIEF.md +54 -0
  24. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/slice.json +79 -0
  25. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/CLOSURE_BRIEF.md +34 -0
  26. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/EXECUTION_BRIEF.md +54 -0
  27. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/slice.json +75 -0
  28. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/CLOSURE_BRIEF.md +36 -0
  29. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/EXECUTION_BRIEF.md +55 -0
  30. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/slice.json +78 -0
  31. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/CLOSURE_BRIEF.md +31 -0
  32. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/EXECUTION_BRIEF.md +55 -0
  33. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/slice.json +77 -0
  34. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/CLOSURE_BRIEF.md +31 -0
  35. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/EXECUTION_BRIEF.md +55 -0
  36. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/slice.json +84 -0
  37. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/CLOSURE_BRIEF.md +32 -0
  38. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/EXECUTION_BRIEF.md +57 -0
  39. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/slice.json +99 -0
  40. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/CLOSURE_BRIEF.md +31 -0
  41. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/EXECUTION_BRIEF.md +57 -0
  42. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/slice.json +88 -0
  43. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/CLOSURE_BRIEF.md +31 -0
  44. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/EXECUTION_BRIEF.md +56 -0
  45. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/slice.json +85 -0
  46. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/CLOSURE_BRIEF.md +32 -0
  47. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/EXECUTION_BRIEF.md +56 -0
  48. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/slice.json +91 -0
  49. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/COVERAGE_MATRIX.md +117 -0
  50. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/EVIDENCE_REPORT.md +200 -0
  51. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/EXECUTION_PLAN.md +60 -0
  52. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/SPEC.md +132 -0
  53. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/STATUS.md +36 -0
  54. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/pr.md +128 -0
  55. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-00-reconciliation-and-evidence-freeze/CLOSURE_BRIEF.md +44 -0
  56. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-00-reconciliation-and-evidence-freeze/EXECUTION_BRIEF.md +56 -0
  57. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-00-reconciliation-and-evidence-freeze/slice.json +71 -0
  58. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-01-ai-run-state-approvals-and-clean-output/CLOSURE_BRIEF.md +38 -0
  59. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-01-ai-run-state-approvals-and-clean-output/EXECUTION_BRIEF.md +53 -0
  60. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-01-ai-run-state-approvals-and-clean-output/slice.json +83 -0
  61. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-02-structured-technical-plan-contract-and-repair-flow/CLOSURE_BRIEF.md +33 -0
  62. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-02-structured-technical-plan-contract-and-repair-flow/EXECUTION_BRIEF.md +53 -0
  63. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-02-structured-technical-plan-contract-and-repair-flow/slice.json +85 -0
  64. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-03-active-slice-reconciliation-and-ai-inspect/CLOSURE_BRIEF.md +34 -0
  65. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-03-active-slice-reconciliation-and-ai-inspect/EXECUTION_BRIEF.md +52 -0
  66. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-03-active-slice-reconciliation-and-ai-inspect/slice.json +82 -0
  67. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-04-spec-validation-scope-and-worktree-reliability/CLOSURE_BRIEF.md +32 -0
  68. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-04-spec-validation-scope-and-worktree-reliability/EXECUTION_BRIEF.md +55 -0
  69. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-04-spec-validation-scope-and-worktree-reliability/slice.json +85 -0
  70. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-05-review-plan-closure-and-agent-dx/CLOSURE_BRIEF.md +35 -0
  71. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-05-review-plan-closure-and-agent-dx/EXECUTION_BRIEF.md +59 -0
  72. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-05-review-plan-closure-and-agent-dx/slice.json +94 -0
  73. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-06-backward-compatibility-docs-and-release-readiness/CLOSURE_BRIEF.md +40 -0
  74. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-06-backward-compatibility-docs-and-release-readiness/EXECUTION_BRIEF.md +56 -0
  75. package/specs/quiver-v28-pixel-quiver-feedback-reconciliation/slices/slice-06-backward-compatibility-docs-and-release-readiness/slice.json +98 -0
  76. package/src/create-quiver/commands/ai.js +563 -21
  77. package/src/create-quiver/commands/flow.js +52 -4
  78. package/src/create-quiver/commands/graph.js +7 -7
  79. package/src/create-quiver/commands/plan.js +6 -15
  80. package/src/create-quiver/commands/spec.js +292 -0
  81. package/src/create-quiver/index.js +125 -25
  82. package/src/create-quiver/lib/agent-profiles.js +15 -3
  83. package/src/create-quiver/lib/ai/artifacts.js +318 -0
  84. package/src/create-quiver/lib/ai/context-packs.js +2 -2
  85. package/src/create-quiver/lib/ai/execution-plan.js +9 -0
  86. package/src/create-quiver/lib/ai/executor.js +3 -2
  87. package/src/create-quiver/lib/ai/export-state.js +287 -95
  88. package/src/create-quiver/lib/ai/github.js +93 -4
  89. package/src/create-quiver/lib/ai/plan-review.js +161 -0
  90. package/src/create-quiver/lib/ai/run-state.js +17 -2
  91. package/src/create-quiver/lib/ai/spec-generator.js +87 -13
  92. package/src/create-quiver/lib/ai/spec-templates.js +72 -12
  93. package/src/create-quiver/lib/analyze.js +2 -2
  94. package/src/create-quiver/lib/approvals.js +14 -2
  95. package/src/create-quiver/lib/doctor.js +79 -0
  96. package/src/create-quiver/lib/git.js +40 -1
  97. package/src/create-quiver/lib/handoff.js +43 -1
  98. package/src/create-quiver/lib/init-docs.js +11 -7
  99. package/src/create-quiver/lib/init-layout.js +1 -0
  100. package/src/create-quiver/lib/lifecycle.js +52 -3
  101. package/src/create-quiver/lib/locks.js +134 -0
  102. package/src/create-quiver/lib/package-safety.js +7 -0
  103. package/src/create-quiver/lib/paths.js +74 -0
  104. package/src/create-quiver/lib/project-scan.js +74 -0
  105. package/src/create-quiver/lib/project-state-resolver.js +430 -0
  106. package/src/create-quiver/lib/readiness.js +48 -7
  107. package/src/create-quiver/lib/scope.js +2 -1
  108. package/src/create-quiver/lib/slice.js +8 -4
  109. package/src/create-quiver/lib/spec-worktrees.js +169 -38
  110. package/src/create-quiver/lib/statuses.js +115 -0
@@ -0,0 +1,75 @@
1
+ {
2
+ "slice_id": "slice-02-json-export-contract-and-machine-output",
3
+ "ticket": "QUIVER-27-02",
4
+ "type": "implementation",
5
+ "title": "JSON export contract and machine output",
6
+ "objective": "Define and implement a stable JSON export contract for dashboards, agents, and machine consumers.",
7
+ "description": "Adds a versioned export schema, pure stdout JSON behavior, deterministic ordering, source metadata, partial/empty/invalid semantics, sanitized paths, and alignment between ai export and export-specs.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v27-json-export-contract-machine-output",
12
+ "branch_name": "feature/QUIVER-27-02-v27-json-export-contract-machine-output"
13
+ },
14
+ "files": [
15
+ "src/create-quiver/lib/**",
16
+ "src/create-quiver/commands/**",
17
+ "src/create-quiver/index.js",
18
+ "tests/lib/**",
19
+ "tests/commands/**",
20
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
21
+ ],
22
+ "expected_read_paths": [
23
+ "src/create-quiver/lib/ai/export-state.js",
24
+ "src/create-quiver/commands/ai.js",
25
+ "src/create-quiver/index.js",
26
+ "tests/lib/ai-export-state.test.js",
27
+ "tests/commands/ai-export.test.js"
28
+ ],
29
+ "allowed_write_paths": [
30
+ "src/create-quiver/lib/**",
31
+ "src/create-quiver/commands/**",
32
+ "src/create-quiver/index.js",
33
+ "tests/lib/**",
34
+ "tests/commands/**",
35
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
36
+ ],
37
+ "depends_on": [
38
+ "slice-01-core-state-resolver-and-canonical-statuses"
39
+ ],
40
+ "parallel_safe": "no",
41
+ "parallel_safe_reason": "Export contract depends on the shared state resolver and is consumed by later slices.",
42
+ "must": [
43
+ "Define schemaVersion and stable field names.",
44
+ "Ensure --format json writes JSON only to stdout.",
45
+ "Route warnings/errors to structured JSON fields or stderr as appropriate.",
46
+ "Include source metadata and completed slices with --include-completed.",
47
+ "Sanitize local paths where needed."
48
+ ],
49
+ "not_included": [
50
+ "Dashboard UI implementation.",
51
+ "Provider execution.",
52
+ "Spec create parsing changes."
53
+ ],
54
+ "acceptance": [
55
+ "JSON output parses with JSON.parse without cleanup.",
56
+ "Export includes specs, slices, agents, runs, approvals, blockers, evidence, next steps, lifecycle, aggregates, warnings, and source metadata.",
57
+ "Completed slices appear when --include-completed is used.",
58
+ "Human logs are not mixed into JSON stdout.",
59
+ "Unsupported formats fail with non-zero exit and stderr error."
60
+ ],
61
+ "tests": [
62
+ "node --test tests/lib/ai-export-state.test.js tests/commands/ai-export.test.js",
63
+ "node --test tests/commands/cli-contract.test.js",
64
+ "git diff --check"
65
+ ],
66
+ "validation_hints": [
67
+ "Add tests that run the CLI and parse stdout directly.",
68
+ "Assert deterministic ordering in exported arrays."
69
+ ],
70
+ "estimated_hours": 5,
71
+ "actual_hours": 5,
72
+ "status": "completed",
73
+ "completed_at": "2026-05-24T13:54:36Z",
74
+ "blocked_reason": null
75
+ }
@@ -0,0 +1,36 @@
1
+ # CLOSURE BRIEF - slice-03: Approved plan to spec create
2
+
3
+ ## Summary
4
+
5
+ Implemented strict approved-plan to spec generation.
6
+
7
+ `spec create` and the spec-phase generator now require structured slice data from the reviewed and approved technical plan. They preserve every approved implementation slice, generate the mandatory `slice-00-spec-foundation`, and fail before writing when the plan is not structurally safe.
8
+
9
+ ## Validation Against Acceptance Criteria
10
+
11
+ - A plan with 8 approved implementation slices produces those 8 slices plus the mandatory `slice-00-spec-foundation`.
12
+ - Plans without a structured slices array fail before writing files.
13
+ - Duplicate slice IDs fail before writing files.
14
+ - Missing dependencies fail before writing files.
15
+ - Circular dependencies fail before writing files.
16
+ - Fenced JSON slice blocks inside Markdown plans are supported.
17
+ - Failed `spec create --dry-run` does not create a spec directory.
18
+
19
+ ## Changes
20
+
21
+ - Updated `src/create-quiver/lib/ai/spec-generator.js`.
22
+ - Updated `src/create-quiver/lib/ai/spec-templates.js`.
23
+ - Updated `tests/lib/ai-spec-generator.test.js`.
24
+ - Updated `tests/commands/spec-create.test.js`.
25
+ - Updated v27 spec status, execution plan, evidence, and this closure brief.
26
+
27
+ ## Remaining Risks
28
+
29
+ - Free-form technical plans without structured slice data now fail intentionally; users need to revise the planner prompt or add a fenced JSON slice block.
30
+ - The structured contract is currently documented through the error message and tests, not a standalone schema file.
31
+ - Generated spec execution is still not performed in this slice.
32
+
33
+ ## Follow-up Recommendations
34
+
35
+ - Update planner prompts in later slices so technical plans always include the structured slice block.
36
+ - Execute `slice-04` and `slice-05` next; they can proceed in parallel only if write scopes remain independent.
@@ -0,0 +1,55 @@
1
+ # EXECUTION BRIEF - slice-03: Approved plan to spec create
2
+
3
+ ## Context
4
+
5
+ Pixel Quiver showed that `spec create` can generate a generic two-slice scaffold instead of the approved multi-slice plan. That breaks the central WDD + SDD flow.
6
+
7
+ ## Objective
8
+
9
+ Make `spec create` faithful to the approved technical plan and safe on parse failure.
10
+
11
+ ## Scope
12
+
13
+ - Spec generator
14
+ - Approval metadata handling
15
+ - Spec templates
16
+ - Command tests and fixtures
17
+ - v27 evidence/status docs
18
+
19
+ ## Acceptance Criteria
20
+
21
+ - `spec create` uses an explicitly approved technical plan version.
22
+ - Approved slice count, IDs, dependencies, handoffs, execution plan, and PR body are generated.
23
+ - Missing/invalid structured slice data fails before writing.
24
+ - Generic fallback scaffolds are not created silently.
25
+ - Failed runs do not leave empty remnant directories.
26
+
27
+ ## Technical Plan Summary
28
+
29
+ Add structured plan extraction/validation, atomic writes, safe failure handling, and regression tests based on the Pixel Quiver failure.
30
+
31
+ ## Suggested Execution Steps
32
+
33
+ 1. Inspect current spec generator and approval selection.
34
+ 2. Define the structured slice block contract.
35
+ 3. Implement validation and atomic write flow.
36
+ 4. Add tests for good plan, missing structure, duplicates, circular dependencies, dry-run, and failure cleanup.
37
+ 5. Update docs/evidence.
38
+
39
+ ## Restrictions
40
+
41
+ - Do not execute generated slices.
42
+ - Do not open PRs.
43
+
44
+ ## Risks
45
+
46
+ - Existing free-form plans may need compatibility guidance or migration.
47
+
48
+ ## Completion Checklist
49
+
50
+ - [ ] Structured block contract implemented.
51
+ - [ ] Generic fallback removed or made explicit error.
52
+ - [ ] Atomic write behavior covered.
53
+ - [ ] Regression fixture added.
54
+ - [ ] Validation commands passed.
55
+
@@ -0,0 +1,78 @@
1
+ {
2
+ "slice_id": "slice-03-approved-plan-to-spec-create",
3
+ "ticket": "QUIVER-27-03",
4
+ "type": "implementation",
5
+ "title": "Approved plan to spec create",
6
+ "objective": "Make spec create generate the approved spec/slices/handoffs from a reviewed and approved technical plan, or fail safely before writing.",
7
+ "description": "Prevents generic fallback scaffolds by requiring structured slice data from the approved plan, validating slice IDs/dependencies/slice-00/handoffs, using atomic writes, and cleaning up safely.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v27-approved-plan-to-spec-create",
12
+ "branch_name": "feature/QUIVER-27-03-v27-approved-plan-to-spec-create"
13
+ },
14
+ "files": [
15
+ "src/create-quiver/lib/ai/spec-generator.js",
16
+ "src/create-quiver/lib/ai/spec-templates.js",
17
+ "src/create-quiver/lib/approvals.js",
18
+ "src/create-quiver/commands/spec.js",
19
+ "tests/lib/ai-spec-generator.test.js",
20
+ "tests/commands/spec-create.test.js",
21
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
22
+ ],
23
+ "expected_read_paths": [
24
+ "src/create-quiver/lib/ai/spec-generator.js",
25
+ "src/create-quiver/lib/ai/spec-templates.js",
26
+ "src/create-quiver/lib/approvals.js",
27
+ "tests/lib/ai-spec-generator.test.js",
28
+ "tests/commands/spec-create.test.js"
29
+ ],
30
+ "allowed_write_paths": [
31
+ "src/create-quiver/lib/ai/spec-generator.js",
32
+ "src/create-quiver/lib/ai/spec-templates.js",
33
+ "src/create-quiver/lib/approvals.js",
34
+ "src/create-quiver/commands/spec.js",
35
+ "tests/lib/ai-spec-generator.test.js",
36
+ "tests/commands/spec-create.test.js",
37
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
38
+ ],
39
+ "depends_on": [
40
+ "slice-01-core-state-resolver-and-canonical-statuses",
41
+ "slice-02-json-export-contract-and-machine-output"
42
+ ],
43
+ "parallel_safe": "no",
44
+ "parallel_safe_reason": "Spec generation depends on shared state/export contracts and affects core workflow.",
45
+ "must": [
46
+ "Use explicitly approved technical plan metadata.",
47
+ "Require or extract a structured slice block.",
48
+ "Generate slice-00 and every approved slice.",
49
+ "Create SPEC.md, STATUS.md, EVIDENCE_REPORT.md, EXECUTION_PLAN.md, pr.md, slice.json, EXECUTION_BRIEF.md, and CLOSURE_BRIEF.md.",
50
+ "Fail before writing if the plan cannot be parsed.",
51
+ "Use atomic writes and avoid empty scaffold remnants."
52
+ ],
53
+ "not_included": [
54
+ "Changing AI provider prompts except where needed for structured output.",
55
+ "Executing generated slices.",
56
+ "Opening PRs."
57
+ ],
58
+ "acceptance": [
59
+ "Given a plan with 8 approved slices, spec create creates 8 slices plus required artifacts.",
60
+ "Given no structured slice block, spec create fails without writing files.",
61
+ "Given duplicate IDs or circular dependencies, spec create fails before writing.",
62
+ "Generated names are derived from requirement/spec metadata and not generic approved placeholders.",
63
+ "No empty generic scaffold directories remain after failure or regeneration."
64
+ ],
65
+ "tests": [
66
+ "node --test tests/lib/ai-spec-generator.test.js tests/commands/spec-create.test.js",
67
+ "git diff --check"
68
+ ],
69
+ "validation_hints": [
70
+ "Test dry-run and real-run behavior.",
71
+ "Compare git status before/after failed spec create."
72
+ ],
73
+ "estimated_hours": 6,
74
+ "actual_hours": 6,
75
+ "status": "completed",
76
+ "completed_at": "2026-05-24T14:00:33Z",
77
+ "blocked_reason": null
78
+ }
@@ -0,0 +1,31 @@
1
+ # CLOSURE BRIEF - slice-04: AI artifact storage, redaction, and token compaction
2
+
3
+ ## Summary
4
+
5
+ Implemented AI artifact hardening for planner and review flows. Draft/review artifacts now persist clean provider output, raw stdout/stderr are stored separately under run-scoped `.quiver/runs/<run-id>/raw/*.json`, secrets and local paths are redacted, oversized revise inputs are compacted before provider execution, and package safety blocks raw AI artifacts from npm tarballs.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - Draft files contain useful output only: covered by `ai plan stores clean drafts and separates redacted raw provider logs`.
10
+ - Raw logs are run-scoped and redacted: covered by `raw_artifact_path` assertions in `ai-plan` and `ai-review-plan` tests.
11
+ - Oversized revise inputs are compacted or blocked: covered by `ai revise compacts oversized feedback before provider execution` and `ai plan rejects oversized prompts before provider execution`.
12
+ - Approved versions remain explicit: existing versioned approval tests still pass and approved metadata carries the selected draft metadata.
13
+ - Package safety blocks raw AI artifacts: covered by `tests/lib/package-safety.test.js`.
14
+
15
+ ## Changes
16
+
17
+ - Added `src/create-quiver/lib/ai/artifacts.js`.
18
+ - Updated `src/create-quiver/commands/ai.js` for clean/raw separation, prompt-size guards, and revise compaction.
19
+ - Updated `src/create-quiver/lib/approvals.js` and `src/create-quiver/lib/ai/plan-review.js` to persist raw artifact metadata.
20
+ - Updated `src/create-quiver/lib/package-safety.js` to classify `.quiver/runs/*/raw/` as unsafe package content.
21
+ - Added/updated tests in `tests/commands/ai-plan.test.js`, `tests/commands/ai-review-plan.test.js`, and `tests/lib/package-safety.test.js`.
22
+
23
+ ## Remaining Risks
24
+
25
+ - Provider-specific log formats can vary. The cleanup intentionally strips prompt echoes and common leading/trailing provider log lines while preserving the provider's main stdout content.
26
+ - Raw artifacts are redacted and ignored under `.quiver/`, but future package changes should keep package-safety checks in the release path.
27
+
28
+ ## Follow-up Recommendations
29
+
30
+ - Add provider-specific clean-output fixtures if future dogfooding finds additional Claude/Codex/Gemini transcript wrappers.
31
+ - Consider exposing prompt-size limits in user-facing docs if users need to tune `QUIVER_AI_MAX_PROMPT_BYTES`, `QUIVER_AI_MAX_REVISION_INPUT_BYTES`, or `QUIVER_AI_COMPACTED_REVISION_INPUT_BYTES`.
@@ -0,0 +1,55 @@
1
+ # EXECUTION BRIEF - slice-04: AI artifact storage, redaction, and token compaction
2
+
3
+ ## Context
4
+
5
+ Pixel Quiver showed drafts polluted with provider logs and `ai revise` failures caused by very large accumulated context. This slice hardens AI artifact persistence and token control.
6
+
7
+ ## Objective
8
+
9
+ Persist clean drafts, store raw logs separately, redact sensitive values, and compact oversized feedback safely.
10
+
11
+ ## Scope
12
+
13
+ - AI provider/output handling
14
+ - Approval draft persistence
15
+ - Raw log storage
16
+ - Redaction and package safety
17
+ - Token compaction for revise/review flows
18
+
19
+ ## Acceptance Criteria
20
+
21
+ - Drafts contain clean useful AI output.
22
+ - Raw logs are separated and redacted.
23
+ - Oversized inputs are compacted or rejected before provider execution.
24
+ - Approved version metadata remains explicit.
25
+ - Package safety covers raw AI artifacts.
26
+
27
+ ## Technical Plan Summary
28
+
29
+ Add output extraction, raw transcript storage, redaction, size checks, compaction logic, and regression tests.
30
+
31
+ ## Suggested Execution Steps
32
+
33
+ 1. Inspect AI provider and approval persistence paths.
34
+ 2. Add clean/raw separation.
35
+ 3. Add redaction and package-safety rules.
36
+ 4. Add size checks and compaction.
37
+ 5. Test contaminated provider output and long feedback inputs.
38
+
39
+ ## Restrictions
40
+
41
+ - Do not store credentials.
42
+ - Do not weaken approval gates.
43
+
44
+ ## Risks
45
+
46
+ - Over-compaction can remove important constraints; preserve decisions, risks, files, and criteria.
47
+
48
+ ## Completion Checklist
49
+
50
+ - [ ] Clean draft behavior implemented.
51
+ - [ ] Raw logs separated and redacted.
52
+ - [ ] Compaction covered by tests.
53
+ - [ ] Package safety updated.
54
+ - [ ] Validation commands passed.
55
+
@@ -0,0 +1,77 @@
1
+ {
2
+ "slice_id": "slice-04-ai-artifact-storage-redaction-and-token-compaction",
3
+ "ticket": "QUIVER-27-04",
4
+ "type": "implementation",
5
+ "title": "AI artifact storage, redaction, and token compaction",
6
+ "objective": "Keep AI drafts clean, persist raw provider logs separately with redaction, and prevent revise flows from exceeding provider context limits.",
7
+ "description": "Separates useful provider output from raw transcripts, redacts sensitive values before persistence, snapshots raw logs under run-scoped paths, and compacts long review/feedback inputs before calling providers.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v27-ai-artifacts-redaction-token-compaction",
12
+ "branch_name": "feature/QUIVER-27-04-v27-ai-artifacts-redaction-token-compaction"
13
+ },
14
+ "files": [
15
+ "src/create-quiver/lib/ai/**",
16
+ "src/create-quiver/lib/approvals.js",
17
+ "src/create-quiver/lib/package-safety.js",
18
+ "tests/lib/ai-*.test.js",
19
+ "tests/lib/package-safety.test.js",
20
+ "tests/commands/ai-*.test.js",
21
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
22
+ ],
23
+ "expected_read_paths": [
24
+ "src/create-quiver/lib/ai/providers.js",
25
+ "src/create-quiver/lib/ai/prompt-transport.js",
26
+ "src/create-quiver/lib/ai/plan-review.js",
27
+ "src/create-quiver/lib/approvals.js",
28
+ "tests/commands/ai-plan.test.js",
29
+ "tests/commands/ai-review-plan.test.js"
30
+ ],
31
+ "allowed_write_paths": [
32
+ "src/create-quiver/lib/ai/**",
33
+ "src/create-quiver/lib/approvals.js",
34
+ "src/create-quiver/lib/package-safety.js",
35
+ "tests/lib/ai-*.test.js",
36
+ "tests/lib/package-safety.test.js",
37
+ "tests/commands/ai-*.test.js",
38
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
39
+ ],
40
+ "depends_on": [
41
+ "slice-01-core-state-resolver-and-canonical-statuses"
42
+ ],
43
+ "parallel_safe": "yes",
44
+ "parallel_safe_reason": "Can run after shared resolver if it avoids files touched by worktree lifecycle work.",
45
+ "must": [
46
+ "Store clean drafts separately from raw provider output.",
47
+ "Redact secrets and sensitive local values before persisting raw logs.",
48
+ "Detect oversized inputs before provider calls.",
49
+ "Compact feedback while preserving decisions, risks, changed files, and acceptance criteria.",
50
+ "Preserve approved version metadata."
51
+ ],
52
+ "not_included": [
53
+ "Changing provider CLI installation.",
54
+ "Changing spec create parsing.",
55
+ "Adding telemetry."
56
+ ],
57
+ "acceptance": [
58
+ "Draft files contain only useful AI output, not provider logs or prompt echo.",
59
+ "Raw logs are stored in run-scoped raw paths and redacted.",
60
+ "Oversized revise inputs are compacted or blocked with an actionable message before provider execution.",
61
+ "Approved versions remain explicit and are not inferred from latest draft filenames.",
62
+ "Package safety blocks unsafe raw AI artifacts from npm publication."
63
+ ],
64
+ "tests": [
65
+ "node --test tests/lib/ai-*.test.js tests/commands/ai-plan.test.js tests/commands/ai-review-plan.test.js",
66
+ "node --test tests/lib/package-safety.test.js",
67
+ "git diff --check"
68
+ ],
69
+ "validation_hints": [
70
+ "Use fixtures with prompt echo and long review text.",
71
+ "Assert raw logs do not leak obvious token/env patterns."
72
+ ],
73
+ "estimated_hours": 5,
74
+ "status": "completed",
75
+ "completed_at": "2026-05-24",
76
+ "blocked_reason": null
77
+ }
@@ -0,0 +1,31 @@
1
+ # CLOSURE BRIEF - slice-05: Worktree lifecycle, locks, and recovery
2
+
3
+ ## Summary
4
+
5
+ Implemented worktree lifecycle hardening for persistent spec worktrees, slice worktree startup, and delegated parallel AI execution runs. The slice adds shared lock handling, stale/missing worktree recovery messages, nested worktree prevention, and focused tests for the production risks found in Pixel Quiver dogfooding.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - `spec start` dry-run and real reuse behavior remains covered by existing spec worktree tests.
10
+ - Existing spec worktrees are reused when valid; stale or manually deleted registered worktrees now fail with recovery steps instead of being silently recreated.
11
+ - Running slice startup from a linked worktree now rejects nested worktree creation unless it is reusing the exact registered worktree.
12
+ - Delegated parallel execution uses a run-level lock and fails safely before provider execution when the same run is already active.
13
+ - Dirty, missing, stale, and conflicting worktree states produce actionable recovery guidance.
14
+
15
+ ## Changes
16
+
17
+ - Added `src/create-quiver/lib/locks.js` for `.quiver/locks` helpers and local runtime-state ignore handling.
18
+ - Updated `src/create-quiver/lib/git.js` with linked-worktree and realpath-aware git directory helpers.
19
+ - Updated `src/create-quiver/lib/spec-worktrees.js` with persistent worktree reuse checks, lock handling, stale path recovery, and nested worktree safeguards.
20
+ - Updated `src/create-quiver/lib/lifecycle.js` with slice worktree locks and nested worktree prevention.
21
+ - Updated `src/create-quiver/lib/ai/execution-plan.js` with delegated run locking.
22
+ - Added regression coverage in `tests/lib/lifecycle.test.js` and `tests/commands/ai-execute-plan.test.js`.
23
+
24
+ ## Remaining Risks
25
+
26
+ - Existing user-created stale locks may require manual removal after the user confirms no Quiver process is active.
27
+ - This slice hardens lifecycle behavior but does not yet expand `check-scope`, `check-handoff`, or `spec validate`; those remain in `slice-06`.
28
+
29
+ ## Follow-up Recommendations
30
+
31
+ - Execute `slice-06-validation-gates-and-scope-safety` next so the new lifecycle guarantees are enforced by validation gates before later context and DX work.
@@ -0,0 +1,55 @@
1
+ # EXECUTION BRIEF - slice-05: Worktree lifecycle, locks, and recovery
2
+
3
+ ## Context
4
+
5
+ Pixel Quiver showed confusing worktree guidance and potential nested worktree paths. The desired workflow is one persistent worktree per spec and one commit per slice, while delegated execution may still use temporary worktrees internally.
6
+
7
+ ## Objective
8
+
9
+ Harden worktree lifecycle, locking, and recovery.
10
+
11
+ ## Scope
12
+
13
+ - Spec worktree lifecycle
14
+ - Delegated execution worktree strategy
15
+ - Git/worktree recovery messages
16
+ - Locking for concurrent operations
17
+ - Tests and docs evidence
18
+
19
+ ## Acceptance Criteria
20
+
21
+ - Spec worktrees are persistent and reused.
22
+ - Existing spec worktrees do not create nested paths.
23
+ - Temporary worktrees remain limited to delegated parallel execution.
24
+ - Dirty/missing/stale worktrees report recovery steps.
25
+ - Concurrent operations are locked or rejected safely.
26
+
27
+ ## Technical Plan Summary
28
+
29
+ Clarify worktree identity, add detection for current worktree context, add locks and recovery tests.
30
+
31
+ ## Suggested Execution Steps
32
+
33
+ 1. Inspect spec worktree and executor code.
34
+ 2. Define worktree modes and lock locations.
35
+ 3. Implement context detection and recovery messaging.
36
+ 4. Add tests for root, worktree, dirty, missing, stale, and delegated paths.
37
+ 5. Update docs/evidence.
38
+
39
+ ## Restrictions
40
+
41
+ - Do not remove delegated parallel capability.
42
+ - Do not force destructive cleanup without explicit option.
43
+
44
+ ## Risks
45
+
46
+ - Existing users may rely on current branch names; preserve compatibility where possible.
47
+
48
+ ## Completion Checklist
49
+
50
+ - [ ] Persistent spec worktree behavior covered.
51
+ - [ ] Nested worktree prevention covered.
52
+ - [ ] Delegated worktrees still pass tests.
53
+ - [ ] Lock/recovery behavior covered.
54
+ - [ ] Validation commands passed.
55
+
@@ -0,0 +1,84 @@
1
+ {
2
+ "slice_id": "slice-05-worktree-lifecycle-locks-and-recovery",
3
+ "ticket": "QUIVER-27-05",
4
+ "type": "implementation",
5
+ "title": "Worktree lifecycle, locks, and recovery",
6
+ "objective": "Harden the spec worktree lifecycle so Quiver supports one persistent worktree per spec, one commit per slice, temporary delegated worktrees, locks, and recovery.",
7
+ "description": "Clarifies spec vs temporary slice worktrees, prevents nested/conflicting paths, handles dirty root and missing worktrees, adds locks for concurrent execution, and reports recovery paths.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v27-worktree-lifecycle-locks-recovery",
12
+ "branch_name": "feature/QUIVER-27-05-v27-worktree-lifecycle-locks-recovery"
13
+ },
14
+ "files": [
15
+ "src/create-quiver/lib/spec-worktrees.js",
16
+ "src/create-quiver/lib/lifecycle.js",
17
+ "src/create-quiver/lib/locks.js",
18
+ "src/create-quiver/lib/ai/execution-plan.js",
19
+ "src/create-quiver/lib/ai/executor.js",
20
+ "src/create-quiver/lib/git.js",
21
+ "tests/lib/*worktree*.test.js",
22
+ "tests/commands/spec-worktree.test.js",
23
+ "tests/commands/ai-execute-plan.test.js",
24
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
25
+ ],
26
+ "expected_read_paths": [
27
+ "src/create-quiver/lib/spec-worktrees.js",
28
+ "src/create-quiver/lib/lifecycle.js",
29
+ "src/create-quiver/lib/git.js",
30
+ "src/create-quiver/lib/ai/execution-plan.js",
31
+ "src/create-quiver/lib/ai/executor.js",
32
+ "tests/commands/spec-worktree.test.js",
33
+ "tests/commands/ai-execute-plan.test.js",
34
+ "tests/lib/lifecycle.test.js"
35
+ ],
36
+ "allowed_write_paths": [
37
+ "src/create-quiver/lib/spec-worktrees.js",
38
+ "src/create-quiver/lib/lifecycle.js",
39
+ "src/create-quiver/lib/locks.js",
40
+ "src/create-quiver/lib/ai/execution-plan.js",
41
+ "src/create-quiver/lib/ai/executor.js",
42
+ "src/create-quiver/lib/git.js",
43
+ "tests/lib/**",
44
+ "tests/commands/**",
45
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
46
+ ],
47
+ "depends_on": [
48
+ "slice-01-core-state-resolver-and-canonical-statuses"
49
+ ],
50
+ "parallel_safe": "yes",
51
+ "parallel_safe_reason": "Can run after shared resolver if it avoids AI artifact files touched by slice-04.",
52
+ "must": [
53
+ "Preserve one persistent worktree per spec.",
54
+ "Keep temporary per-slice worktrees only for delegated parallel execution.",
55
+ "Avoid nested worktree paths.",
56
+ "Handle dirty root/worktree states with clear recovery.",
57
+ "Add locks for concurrent spec/run operations.",
58
+ "Detect stale or manually deleted worktrees."
59
+ ],
60
+ "not_included": [
61
+ "Changing PR creation behavior unless required by worktree recovery.",
62
+ "Publishing npm.",
63
+ "Changing provider execution."
64
+ ],
65
+ "acceptance": [
66
+ "spec start dry-run and real run report/reuse the same persistent spec worktree.",
67
+ "Running from an existing spec worktree does not propose a nested worktree.",
68
+ "Delegated execution can still use temporary worktrees safely.",
69
+ "Dirty, missing, stale, or deleted worktrees produce actionable recovery messages.",
70
+ "Concurrent operations use locks or fail safely."
71
+ ],
72
+ "tests": [
73
+ "node --test tests/commands/spec-worktree.test.js tests/commands/spec-close.test.js tests/commands/ai-execute-plan.test.js tests/lib/lifecycle.test.js",
74
+ "git diff --check"
75
+ ],
76
+ "validation_hints": [
77
+ "Test from repo root and from inside a spec worktree.",
78
+ "Simulate manually deleted worktree paths."
79
+ ],
80
+ "estimated_hours": 6,
81
+ "status": "completed",
82
+ "completed_at": "2026-05-24",
83
+ "blocked_reason": null
84
+ }
@@ -0,0 +1,32 @@
1
+ # CLOSURE BRIEF - slice-06: Validation gates and scope safety
2
+
3
+ ## Summary
4
+
5
+ Implemented validation gate hardening across local slice checks, scope validation, handoff validation, full spec validation, and path safety. The slice closes the Pixel Quiver gaps where validation could pass while later execution failed or where commands assumed the wrong base branch.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - `check-slice --local` now validates local execution metadata, declared scope paths, dependency contracts, and reports executed and skipped checks.
10
+ - `check-scope` now respects an explicit `--base`, then `slice.git.base_branch`, before falling back to common base branches.
11
+ - `check-handoff` now reports missing headings with accepted aliases and a minimal template.
12
+ - `spec validate` now checks spec docs, slice JSON, briefs, dependency cycles, safe paths, evidence references, and status references.
13
+ - Slice paths and declared scope paths outside the repo root or using traversal are rejected before execution guidance or scope validation.
14
+
15
+ ## Changes
16
+
17
+ - Added `spec validate` command support in `src/create-quiver/commands/spec.js` and `src/create-quiver/index.js`.
18
+ - Hardened `src/create-quiver/lib/readiness.js` for local slice checks and base-aware `check-scope`.
19
+ - Hardened `src/create-quiver/lib/handoff.js` with alias/template guidance.
20
+ - Added repo-bound path validation helpers in `src/create-quiver/lib/paths.js`.
21
+ - Applied path boundary checks in `src/create-quiver/lib/slice.js`, `src/create-quiver/lib/scope.js`, and `src/create-quiver/lib/ai/executor.js`.
22
+ - Added `quiver:spec:validate` to generated package scripts and synchronized `README.md`, `README_FOR_AI.md`, and `docs/COMMANDS.md.template`.
23
+ - Added tests in `tests/lib/check-slice.test.js`, `tests/lib/scope.test.js`, `tests/lib/handoff.test.js`, `tests/lib/paths.test.js`, `tests/commands/spec-validate.test.js`, and `tests/commands/cli-contract.test.js`.
24
+
25
+ ## Remaining Risks
26
+
27
+ - `spec validate` intentionally treats status/evidence mismatches as warnings by default for legacy compatibility; `--strict` promotes those warnings to failures.
28
+ - `check-pr` still contains older `origin/develop` assumptions and should be revisited when PR/readiness flows are hardened further.
29
+
30
+ ## Follow-up Recommendations
31
+
32
+ - Execute `slice-07-context-analysis-and-doctor-flow` next so analyzer, prepare-context, flow, and doctor can consume the stronger validation contracts.