create-quiver 0.12.1 → 0.13.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 (79) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +16 -8
  3. package/README_FOR_AI.md +11 -6
  4. package/ROADMAP.md +9 -2
  5. package/docs/COMMANDS.md.template +9 -2
  6. package/package.json +2 -1
  7. package/specs/quiver-v26-0121-smoke-hardening/SPEC.md +2 -2
  8. package/specs/quiver-v26-0121-smoke-hardening/STATUS.md +5 -5
  9. package/specs/quiver-v27-reliability-ai-workflow-hardening/AUDIT_V24_V25_V26.md +67 -0
  10. package/specs/quiver-v27-reliability-ai-workflow-hardening/COMMAND_CONTRACTS.md +125 -0
  11. package/specs/quiver-v27-reliability-ai-workflow-hardening/COVERAGE_MATRIX.md +74 -0
  12. package/specs/quiver-v27-reliability-ai-workflow-hardening/EVIDENCE_REPORT.md +179 -0
  13. package/specs/quiver-v27-reliability-ai-workflow-hardening/EXECUTION_PLAN.md +71 -0
  14. package/specs/quiver-v27-reliability-ai-workflow-hardening/SPEC.md +176 -0
  15. package/specs/quiver-v27-reliability-ai-workflow-hardening/STATUS.md +37 -0
  16. package/specs/quiver-v27-reliability-ai-workflow-hardening/pr.md +132 -0
  17. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/CLOSURE_BRIEF.md +36 -0
  18. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/EXECUTION_BRIEF.md +56 -0
  19. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-00-docs-audit-coverage-and-contracts/slice.json +75 -0
  20. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/CLOSURE_BRIEF.md +37 -0
  21. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/EXECUTION_BRIEF.md +54 -0
  22. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-01-core-state-resolver-and-canonical-statuses/slice.json +79 -0
  23. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/CLOSURE_BRIEF.md +34 -0
  24. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/EXECUTION_BRIEF.md +54 -0
  25. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-02-json-export-contract-and-machine-output/slice.json +75 -0
  26. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/CLOSURE_BRIEF.md +36 -0
  27. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/EXECUTION_BRIEF.md +55 -0
  28. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-03-approved-plan-to-spec-create/slice.json +78 -0
  29. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/CLOSURE_BRIEF.md +31 -0
  30. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/EXECUTION_BRIEF.md +55 -0
  31. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-04-ai-artifact-storage-redaction-and-token-compaction/slice.json +77 -0
  32. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/CLOSURE_BRIEF.md +31 -0
  33. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/EXECUTION_BRIEF.md +55 -0
  34. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-05-worktree-lifecycle-locks-and-recovery/slice.json +84 -0
  35. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/CLOSURE_BRIEF.md +32 -0
  36. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/EXECUTION_BRIEF.md +57 -0
  37. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-06-validation-gates-and-scope-safety/slice.json +99 -0
  38. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/CLOSURE_BRIEF.md +31 -0
  39. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/EXECUTION_BRIEF.md +57 -0
  40. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-07-context-analysis-and-doctor-flow/slice.json +88 -0
  41. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/CLOSURE_BRIEF.md +31 -0
  42. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/EXECUTION_BRIEF.md +56 -0
  43. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-08-cross-platform-help-auth-and-dx/slice.json +85 -0
  44. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/CLOSURE_BRIEF.md +32 -0
  45. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/EXECUTION_BRIEF.md +56 -0
  46. package/specs/quiver-v27-reliability-ai-workflow-hardening/slices/slice-09-fixtures-smoke-docs-and-release-readiness/slice.json +91 -0
  47. package/src/create-quiver/commands/ai.js +84 -9
  48. package/src/create-quiver/commands/flow.js +52 -4
  49. package/src/create-quiver/commands/graph.js +7 -7
  50. package/src/create-quiver/commands/plan.js +6 -15
  51. package/src/create-quiver/commands/spec.js +282 -0
  52. package/src/create-quiver/index.js +83 -21
  53. package/src/create-quiver/lib/agent-profiles.js +15 -3
  54. package/src/create-quiver/lib/ai/artifacts.js +318 -0
  55. package/src/create-quiver/lib/ai/execution-plan.js +9 -0
  56. package/src/create-quiver/lib/ai/executor.js +3 -2
  57. package/src/create-quiver/lib/ai/export-state.js +242 -97
  58. package/src/create-quiver/lib/ai/github.js +80 -3
  59. package/src/create-quiver/lib/ai/plan-review.js +2 -0
  60. package/src/create-quiver/lib/ai/spec-generator.js +72 -13
  61. package/src/create-quiver/lib/ai/spec-templates.js +72 -12
  62. package/src/create-quiver/lib/analyze.js +2 -2
  63. package/src/create-quiver/lib/approvals.js +14 -2
  64. package/src/create-quiver/lib/doctor.js +79 -0
  65. package/src/create-quiver/lib/git.js +40 -1
  66. package/src/create-quiver/lib/handoff.js +43 -1
  67. package/src/create-quiver/lib/init-docs.js +11 -7
  68. package/src/create-quiver/lib/init-layout.js +1 -0
  69. package/src/create-quiver/lib/lifecycle.js +52 -3
  70. package/src/create-quiver/lib/locks.js +134 -0
  71. package/src/create-quiver/lib/package-safety.js +7 -0
  72. package/src/create-quiver/lib/paths.js +74 -0
  73. package/src/create-quiver/lib/project-scan.js +74 -0
  74. package/src/create-quiver/lib/project-state-resolver.js +236 -0
  75. package/src/create-quiver/lib/readiness.js +48 -7
  76. package/src/create-quiver/lib/scope.js +2 -1
  77. package/src/create-quiver/lib/slice.js +8 -4
  78. package/src/create-quiver/lib/spec-worktrees.js +121 -38
  79. package/src/create-quiver/lib/statuses.js +115 -0
@@ -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.
@@ -0,0 +1,57 @@
1
+ # EXECUTION BRIEF - slice-06: Validation gates and scope safety
2
+
3
+ ## Context
4
+
5
+ Pixel Quiver showed that some validation gates passed while later execution failed, or skipped checks because of wrong branch assumptions. This slice turns validation into a reliable preflight.
6
+
7
+ ## Objective
8
+
9
+ Harden validation gates and path/scope safety.
10
+
11
+ ## Scope
12
+
13
+ - `check-slice`
14
+ - `check-scope`
15
+ - `check-handoff`
16
+ - `spec validate`
17
+ - path safety helpers
18
+ - tests and docs evidence
19
+
20
+ ## Acceptance Criteria
21
+
22
+ - Local slice validation catches local execution preconditions or clearly lists skipped checks.
23
+ - Scope validation respects `--base` and `slice.git.base_branch`.
24
+ - Handoff errors include templates or aliases.
25
+ - `spec validate` validates full spec structure and evidence consistency.
26
+ - Path traversal/out-of-root writes are rejected.
27
+
28
+ ## Technical Plan Summary
29
+
30
+ Align validators with execution behavior, add strict/legacy modes where needed, and cover real dogfooding failures with tests.
31
+
32
+ ## Suggested Execution Steps
33
+
34
+ 1. Inspect validation and scope code.
35
+ 2. Add missing base/path/brief checks.
36
+ 3. Implement `spec validate` if not present.
37
+ 4. Add compatibility handling for legacy specs.
38
+ 5. Add regression tests.
39
+
40
+ ## Restrictions
41
+
42
+ - Do not break legacy specs without documented strict mode.
43
+ - Do not silently skip validation when base information is available.
44
+
45
+ ## Risks
46
+
47
+ - End users may have older specs; use warnings or migration guidance when appropriate.
48
+
49
+ ## Completion Checklist
50
+
51
+ - [ ] check-slice covered.
52
+ - [ ] check-scope covered.
53
+ - [ ] check-handoff covered.
54
+ - [ ] spec validate covered.
55
+ - [ ] path safety covered.
56
+ - [ ] Validation commands passed.
57
+
@@ -0,0 +1,99 @@
1
+ {
2
+ "slice_id": "slice-06-validation-gates-and-scope-safety",
3
+ "ticket": "QUIVER-27-06",
4
+ "type": "implementation",
5
+ "title": "Validation gates and scope safety",
6
+ "objective": "Harden check-slice, check-scope, check-handoff, spec validate, and path safety so validation gates catch real execution failures.",
7
+ "description": "Aligns local slice validation with execution preconditions, fixes base branch resolution, improves handoff template errors and aliases, adds spec validate, and prevents path traversal/out-of-scope writes.",
8
+ "git": {
9
+ "branch_type": "feature",
10
+ "base_branch": "main",
11
+ "branch_slug": "v27-validation-gates-scope-safety",
12
+ "branch_name": "feature/QUIVER-27-06-v27-validation-gates-scope-safety"
13
+ },
14
+ "files": [
15
+ "src/create-quiver/lib/readiness.js",
16
+ "src/create-quiver/lib/scope.js",
17
+ "src/create-quiver/lib/handoff.js",
18
+ "src/create-quiver/lib/paths.js",
19
+ "src/create-quiver/lib/slice.js",
20
+ "src/create-quiver/lib/ai/executor.js",
21
+ "src/create-quiver/lib/init-layout.js",
22
+ "src/create-quiver/commands/spec.js",
23
+ "src/create-quiver/index.js",
24
+ "package.json",
25
+ "README.md",
26
+ "README_FOR_AI.md",
27
+ "docs/COMMANDS.md.template",
28
+ "tests/lib/**",
29
+ "tests/commands/**",
30
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
31
+ ],
32
+ "expected_read_paths": [
33
+ "src/create-quiver/lib/readiness.js",
34
+ "src/create-quiver/lib/scope.js",
35
+ "src/create-quiver/lib/handoff.js",
36
+ "src/create-quiver/lib/paths.js",
37
+ "src/create-quiver/lib/slice.js",
38
+ "src/create-quiver/lib/init-layout.js",
39
+ "tests/lib/check-slice.test.js",
40
+ "tests/lib/scope.test.js",
41
+ "tests/lib/handoff.test.js"
42
+ ],
43
+ "allowed_write_paths": [
44
+ "src/create-quiver/lib/readiness.js",
45
+ "src/create-quiver/lib/scope.js",
46
+ "src/create-quiver/lib/handoff.js",
47
+ "src/create-quiver/lib/paths.js",
48
+ "src/create-quiver/lib/slice.js",
49
+ "src/create-quiver/lib/ai/executor.js",
50
+ "src/create-quiver/lib/init-layout.js",
51
+ "src/create-quiver/commands/spec.js",
52
+ "src/create-quiver/index.js",
53
+ "package.json",
54
+ "README.md",
55
+ "README_FOR_AI.md",
56
+ "docs/COMMANDS.md.template",
57
+ "tests/lib/**",
58
+ "tests/commands/**",
59
+ "specs/quiver-v27-reliability-ai-workflow-hardening/**"
60
+ ],
61
+ "depends_on": [
62
+ "slice-01-core-state-resolver-and-canonical-statuses",
63
+ "slice-05-worktree-lifecycle-locks-and-recovery"
64
+ ],
65
+ "parallel_safe": "no",
66
+ "parallel_safe_reason": "Validation gates depend on resolver and worktree lifecycle behavior.",
67
+ "must": [
68
+ "Align check-slice --local with start/execute preconditions or list skipped checks.",
69
+ "Make check-scope respect --base and slice git.base_branch before fallbacks.",
70
+ "Add or harden spec validate.",
71
+ "Improve check-handoff error templates and Spanish/English aliases.",
72
+ "Reject path traversal and writes outside project root.",
73
+ "Support legacy/strict validation modes where needed."
74
+ ],
75
+ "not_included": [
76
+ "Changing export schema.",
77
+ "Changing AI provider behavior.",
78
+ "Publishing npm."
79
+ ],
80
+ "acceptance": [
81
+ "check-slice --local catches required local metadata for execution or documents skipped checks.",
82
+ "check-scope does not hardcode develop when --base or slice base_branch is provided.",
83
+ "check-handoff prints minimal templates or accepted aliases when headings are missing.",
84
+ "spec validate checks spec docs, slices, JSON, briefs, evidence, and status consistency.",
85
+ "Paths outside the repo root are rejected."
86
+ ],
87
+ "tests": [
88
+ "node --test tests/lib/check-slice.test.js tests/lib/scope.test.js tests/lib/handoff.test.js tests/lib/paths.test.js tests/commands/cli-contract.test.js",
89
+ "git diff --check"
90
+ ],
91
+ "validation_hints": [
92
+ "Add tests for main, master, develop, --base, and missing remote.",
93
+ "Add path traversal and symlink cases."
94
+ ],
95
+ "estimated_hours": 6,
96
+ "status": "completed",
97
+ "completed_at": "2026-05-24",
98
+ "blocked_reason": null
99
+ }
@@ -0,0 +1,31 @@
1
+ # CLOSURE BRIEF - slice-07: Context analysis and doctor flow
2
+
3
+ ## Summary
4
+
5
+ Hardened context analysis and diagnostics so `analyze`, `prepare-context`, `flow`, and `doctor` provide evidence-based guidance without unsafe dry-run writes or misleading examples.
6
+
7
+ ## Validation Against Acceptance Criteria
8
+
9
+ - `analyze --dry-run` now builds the scan in memory, reports planned writes, and does not create `.quiver/`, `docs/PROJECT_MAP.md`, or `docs/AI_CONTEXT.md`.
10
+ - React + Vite projects are detected as `react` with `vite` as an additional framework; `vite.config.*` no longer implies Vue.
11
+ - `prepare-context` keeps detected package manager, stack, and scripts as facts while leaving unknown architecture boundaries as TODO/pending confirmation.
12
+ - `flow` reports context source/freshness in human output and JSON facts.
13
+ - `doctor` examples target an active slice when available, the single spec when unambiguous, or generic placeholders when multiple specs have no active slice.
14
+
15
+ ## Changes
16
+
17
+ - Added scan status metadata in `src/create-quiver/lib/project-scan.js`.
18
+ - Added true `analyze --dry-run` handling and React/Vite detection fixes in `src/create-quiver/index.js`.
19
+ - Added `flow` context-source output.
20
+ - Added doctor example target selection.
21
+ - Added focused command and library tests for analyze, flow, doctor, project scan status, and prepare-context evidence behavior.
22
+ - Updated v27 spec/status/evidence docs.
23
+
24
+ ## Remaining Risks
25
+
26
+ - Analyzer heuristics remain intentionally conservative. More real-world fixtures should be added in slice-09 before release readiness.
27
+
28
+ ## Follow-up Recommendations
29
+
30
+ - Continue with `slice-08-cross-platform-help-auth-and-dx`.
31
+ - In slice-09, include tarball/package smoke coverage for `analyze --dry-run`, `flow`, and `doctor` examples.
@@ -0,0 +1,57 @@
1
+ # EXECUTION BRIEF - slice-07: Context analysis and doctor flow
2
+
3
+ ## Context
4
+
5
+ Pixel Quiver showed analyzer stack mistakes, `analyze --dry-run` writes, placeholder-heavy `prepare-context`, stale docs, and doctor examples pointing to the wrong spec. This slice hardens context commands and first-use guidance.
6
+
7
+ ## Objective
8
+
9
+ Make context analysis and doctor/flow guidance evidence-based, read-only where promised, and accurate.
10
+
11
+ ## Scope
12
+
13
+ - `analyze`
14
+ - project scan
15
+ - `ai prepare-context`
16
+ - `flow`
17
+ - `doctor`
18
+ - fixtures and tests
19
+
20
+ ## Acceptance Criteria
21
+
22
+ - `analyze --dry-run` writes nothing.
23
+ - React + Vite detection is correct.
24
+ - `prepare-context` is conservative and evidence-based.
25
+ - `flow` reports source/staleness.
26
+ - `doctor` does not suggest commands for the wrong spec.
27
+
28
+ ## Technical Plan Summary
29
+
30
+ Improve scan heuristics, dry-run behavior, docs contradiction detection, active context selection, and test fixtures.
31
+
32
+ ## Suggested Execution Steps
33
+
34
+ 1. Inspect analyze/project-scan behavior.
35
+ 2. Add no-write dry-run guard and tests.
36
+ 3. Improve stack detection.
37
+ 4. Improve prepare-context contradiction output.
38
+ 5. Improve flow/doctor state source and example selection.
39
+ 6. Add fixtures and evidence.
40
+
41
+ ## Restrictions
42
+
43
+ - Do not overwrite human-authored docs without snapshots/review.
44
+ - Do not execute providers.
45
+
46
+ ## Risks
47
+
48
+ - Analyzer heuristics can regress other stacks; add representative fixtures.
49
+
50
+ ## Completion Checklist
51
+
52
+ - [ ] Dry-run no-write test added.
53
+ - [ ] React/Vite fixture added.
54
+ - [ ] prepare-context evidence behavior covered.
55
+ - [ ] flow/doctor guidance covered.
56
+ - [ ] Validation commands passed.
57
+