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,125 @@
1
+ # Command Contracts - Quiver v27 Reliability and AI Workflow Hardening
2
+
3
+ ## Purpose
4
+
5
+ These contracts apply to every command touched by v27. A slice may add stricter behavior, but it must not weaken these defaults without documenting a migration path.
6
+
7
+ ## Output Streams
8
+
9
+ - Human-readable progress, hints, warnings, and debug text go to `stderr` when `--format json` is used.
10
+ - Machine-readable JSON goes to `stdout` only.
11
+ - A successful JSON command must produce valid JSON parseable without stripping banners, logs, colors, prompts, or extra lines.
12
+ - Non-JSON human commands may use `stdout` for primary content and `stderr` for warnings/errors.
13
+ - Error details must be actionable and include the command area, failing precondition, and next safe step when known.
14
+
15
+ ## Exit Codes
16
+
17
+ | Code | Meaning |
18
+ |---:|---|
19
+ | 0 | Success. Requested operation completed or dry-run was valid. |
20
+ | 1 | General command failure with no more specific category. |
21
+ | 2 | Invalid user input, unsupported option, missing required argument, or schema validation failure. |
22
+ | 3 | Unsafe repository state, missing dependency, dirty worktree, stale lock, or failed precondition. |
23
+ | 4 | External tool/provider failure, including AI provider, `gh`, git, npm, or package manager failures. |
24
+ | 5 | Partial state was detected and recovery is required. The command must report exact files/state involved. |
25
+
26
+ ## Dry-Run
27
+
28
+ - `--dry-run` is strictly read-only.
29
+ - A dry-run command must not write, create, delete, rename, stage, commit, or modify files anywhere in the repository.
30
+ - This includes `.quiver/`, `docs/`, `specs/`, generated logs, cache files, lock files, and package artifacts.
31
+ - Dry-run output must clearly state what would change, where it would be written, and which validations would run.
32
+ - If a command cannot guarantee read-only behavior, it must fail before doing work and explain why dry-run is unsupported.
33
+
34
+ ## Write Classes
35
+
36
+ Every writing command must fit one of these classes:
37
+
38
+ | Class | Meaning | Requirements |
39
+ |---|---|---|
40
+ | inspect | Read-only command. | Must not write. Supports JSON when useful. |
41
+ | generate | Creates new files from validated input. | Must preflight collisions and fail atomically where possible. |
42
+ | update | Modifies existing files or state. | Must backup or preserve recoverable previous valid state when practical. |
43
+ | execute | Performs implementation or lifecycle action. | Must validate dependencies, scope, git state, and target worktree first. |
44
+ | external | Calls git, GitHub, package manager, or AI provider. | Must report external command failure clearly and preserve local state. |
45
+
46
+ ## Atomicity and Partial State
47
+
48
+ - Commands that write multiple files must validate all inputs before the first write whenever possible.
49
+ - If partial writes can occur, the command must report exactly which files were written and how to recover.
50
+ - Failed generation must not leave empty directories unless they are explicitly reported as recoverable partial state.
51
+ - Existing valid files must not be replaced with invalid output.
52
+
53
+ ## Idempotency
54
+
55
+ - Re-running a successful command with the same inputs should either produce the same result or report that no change is needed.
56
+ - Collision handling must be deterministic and documented.
57
+ - Commands that create slugs, spec ids, slice ids, branches, or worktree paths must use stable generation rules.
58
+
59
+ ## Path Safety
60
+
61
+ - All write paths must resolve inside the project root unless the command explicitly documents an external target.
62
+ - Path traversal (`..`), symlink escape, absolute-path injection, and writing into parent directories must be rejected.
63
+ - Paths printed in help or next-step examples must be copy-safe when project paths include spaces.
64
+ - Shell examples must be safe for the target shell family: macOS/Linux POSIX shells, Windows PowerShell, Git Bash, and WSL.
65
+
66
+ ## Root Detection
67
+
68
+ - Commands must resolve and report the project root used for reads and writes.
69
+ - Running from a subdirectory, a worktree, or a simple monorepo package must produce deterministic root resolution.
70
+ - If multiple plausible roots exist, the command must stop and ask for an explicit root or print the safe command to run.
71
+
72
+ ## Package Manager Detection
73
+
74
+ - Quiver must prefer the package manager indicated by lockfiles and package metadata.
75
+ - Detection priority must be deterministic and documented.
76
+ - Suggested commands must match the detected package manager: npm, pnpm, yarn, or bun.
77
+ - If detection is ambiguous, Quiver must report the ambiguity and use the safest explicit command form.
78
+
79
+ ## Deterministic Ordering
80
+
81
+ - JSON arrays for specs, slices, agents, runs, approvals, blockers, evidence, and next steps must be sorted deterministically.
82
+ - Stable order should prefer declared dependency order, numeric slice order, created timestamp, and then id as a tiebreaker.
83
+ - Human summaries must follow the same order where practical.
84
+
85
+ ## Status Catalogs
86
+
87
+ Commands must use shared canonical statuses from the resolver once slice-01 introduces them. Until then, commands must not invent one-off lifecycle names.
88
+
89
+ Minimum canonical families:
90
+
91
+ - Spec: `draft`, `planned`, `approved`, `in-progress`, `blocked`, `review`, `done`, `archived`
92
+ - Slice: `planned`, `ready`, `in-progress`, `blocked`, `review`, `completed`, `skipped`
93
+ - Run: `draft`, `waiting-approval`, `approved`, `running`, `blocked`, `done`, `failed`
94
+ - Agent: `idle`, `planning`, `reading`, `coding`, `reviewing`, `blocked`, `waiting-approval`, `done`
95
+ - Approval: `pending`, `approved`, `rejected`, `superseded`
96
+
97
+ ## JSON Schema and Versioning
98
+
99
+ - Machine-readable exports must include `schema_version`.
100
+ - Breaking changes require a new schema version and migration guidance.
101
+ - Payloads must include `generated_at`, `project_root`, `source`, and `warnings`.
102
+ - Optional fields must be present as empty arrays/objects when that makes downstream parsing simpler and stable.
103
+
104
+ ## Legacy and Strict Modes
105
+
106
+ - Existing commands should preserve legacy behavior by default when changing output would break users.
107
+ - New strict behavior may be introduced behind explicit flags or by adding new command variants.
108
+ - When legacy behavior is used, output should point to the stricter command or flag where appropriate.
109
+
110
+ ## Security and Redaction
111
+
112
+ - Secrets, tokens, auth headers, provider keys, private URLs, and unnecessary absolute local paths must be redacted from committed fixtures and generated evidence.
113
+ - Raw AI transcripts must be stored separately from clean drafts.
114
+ - Redaction must happen before writing logs that may be committed.
115
+
116
+ ## Validation Expectations
117
+
118
+ Each implementation slice must add or update tests for the contracts it touches. At minimum:
119
+
120
+ - Successful `--format json` output parses as JSON.
121
+ - Failing commands write diagnostics to `stderr` and exit non-zero.
122
+ - Dry-run commands leave the git diff unchanged.
123
+ - Path safety rejects writes outside the project root.
124
+ - Fixtures preserve deterministic order.
125
+
@@ -0,0 +1,74 @@
1
+ # Coverage Matrix - Quiver v27 Reliability and AI Workflow Hardening
2
+
3
+ ## Purpose
4
+
5
+ This matrix maps every Pixel Quiver dogfooding problem (`QP-*`) and improvement suggestion (`QIS-*`) to the v27 implementation slice that must close it.
6
+
7
+ The source files are evidence inputs, not fixtures. Do not copy unsanitized local paths, user names, command output, or project-specific data into committed fixtures without explicit sanitization.
8
+
9
+ ## Problem Coverage
10
+
11
+ | Evidence | Area | Primary Slice | Risk if missed | Validation strategy |
12
+ |---|---|---|---|---|
13
+ | QP-001 | `flow` source discovery and stale examples | slice-07 | Users and agents follow incorrect next steps. | Fixture with current and stale spec state; `flow` output checked against resolver state. |
14
+ | QP-002 | Paths with spaces and copy-safe examples | slice-08 | Commands fail in common macOS/Linux/Windows project paths. | Cross-platform path formatting snapshots for macOS, Linux, PowerShell, Git Bash, and WSL examples. |
15
+ | QP-003 | Classic and AI commands disagree about completed slices | slice-01, slice-02 | Agents act on incomplete or stale lifecycle state. | Shared resolver tests plus export tests with completed, planned, blocked, and active slices. |
16
+ | QP-004 | GitHub authentication and alias guidance | slice-08 | PR creation or preflight fails late with unclear recovery. | `ai doctor` and PR preflight fixtures for missing `gh`, wrong account, missing scopes, and alias expectations. |
17
+ | QP-005 | Analyzer misdetects React/Vite context | slice-07 | Context docs are wrong, causing bad onboarding and bad prompts. | React/Vite fixture with expected stack detection and no false Vue classification. |
18
+ | QP-006 | `prepare-context` lacks evidence and next-step clarity | slice-07 | Agents cannot trust generated context or understand what to do next. | Snapshot output includes evidence, stale/missing docs, and next safe command. |
19
+ | QP-007 | Agent docs gaps and missing prompts | slice-07, slice-08 | Users manually invent onboarding and execution prompts. | Docs/help tests confirm planner, executor, and handoff guidance exists and links to generated files. |
20
+ | QP-008 | Source-of-truth docs drift | slice-00, slice-07 | README, roadmap, and AI docs contradict product state. | Documentation audit plus docs sync checks in final release slice. |
21
+ | QP-009 | `ai revise` grows context without compaction | slice-04 | Planner calls exceed provider limits or waste tokens. | Token-limit fixture validates compacted feedback or safe refusal before provider overflow. |
22
+ | QP-010 | Prompt echo and raw logs mix into final drafts | slice-04 | Specs and plans contain unusable provider noise. | AI artifact fixture separates clean draft from raw transcript and redacts secrets. |
23
+ | QP-011 | `spec create` ignores approved plan structure | slice-03 | Quiver creates generic or incomplete scaffolds after approval. | Approved-plan fixture creates expected spec, slices, handoffs, execution plan, and PR body. |
24
+ | QP-012 | Failed `spec create` leaves empty dirs | slice-03 | Repo state becomes dirty and confusing after failure. | Failure fixture asserts no partial writes or exact recovery report. |
25
+ | QP-013 | `check-slice --local` misses execution preconditions | slice-06 | Later execution fails after a passing local check. | Local check fixture validates required git, worktree, brief, dependency, and scope preconditions or lists skipped checks. |
26
+ | QP-014 | `analyze --dry-run` writes files | slice-07 | Users cannot safely inspect impact before generating docs. | Dry-run test asserts no file changes, including `.quiver/`, `docs/`, and `specs/`. |
27
+ | QP-015 | `doctor` points to wrong spec/slice examples | slice-07 | First-use guidance sends users to stale work. | Doctor fixture derives active spec/slice from resolver state. |
28
+ | QP-016 | `check-scope` assumes wrong base branch | slice-06 | Valid branches fail scope checks or bad diffs are compared. | Scope fixtures cover `--base`, `git.base_branch`, remote default, and fallback order. |
29
+ | QP-017 | `check-handoff` missing actionable template/aliases | slice-06 | Users cannot quickly fix invalid briefs. | Handoff fixture prints missing headings, minimal template, and supported aliases. |
30
+ | QP-018 | Worktree lifecycle causes nested/conflicting worktrees | slice-05 | Spec work becomes scattered, dirty, or unsafe to merge. | Worktree fixtures cover persistent spec worktree, locks, stale state, dirty state, and recovery. |
31
+ | QP-019 | JSON export not dashboard-ready | slice-02 | UIs and agents need custom parsing or cannot consume Quiver state. | JSON schema and fixture parse tests with deterministic output. |
32
+
33
+ ## Suggestion Coverage
34
+
35
+ | Evidence | Area | Primary Slice | Risk if missed | Validation strategy |
36
+ |---|---|---|---|---|
37
+ | QIS-001 | Improve `flow` source references | slice-07 | Flow output remains untrustworthy. | Flow snapshot includes source file, status, and active target. |
38
+ | QIS-002 | Quote/copy-safe command examples | slice-08 | Users with spaces in paths hit preventable failures. | Help snapshot validates quoted examples per shell family. |
39
+ | QIS-003 | Add/strengthen `spec validate` | slice-06 | Broken specs/slices pass until later commands fail. | Spec validation fixture covers schema, dependencies, briefs, worktree hints, and source metadata. |
40
+ | QIS-004 | Export canonical dashboard data | slice-02 | Dashboard and agents keep using unstable ad-hoc output. | Export schema fixture validates required top-level datasets and aggregates. |
41
+ | QIS-005 | Generate executor handoff packages | slice-06 | Executors need too much context and burn tokens. | Handoff package fixture includes only selected slice, briefs, constraints, evidence, and validation commands. |
42
+ | QIS-006 | One resolver for classic and AI commands | slice-01 | Commands keep disagreeing about lifecycle state. | Unit tests require classic and AI command adapters to consume the same resolver output. |
43
+ | QIS-007 | Improve framework detection | slice-07 | Context docs misrepresent stack and workflow. | Analyzer fixtures for React/Vite, package-manager variants, and unknown stack. |
44
+ | QIS-008 | Evidence-backed context generation | slice-07 | Generated docs cannot be trusted or maintained. | `prepare-context` output references source files and marks assumptions. |
45
+ | QIS-009 | GitHub/PR readiness diagnostics | slice-08 | PR creation fails late. | Doctor/preflight output includes `gh`, auth, account, scopes, alias, remote, and next action. |
46
+ | QIS-010 | Agent onboarding guide | slice-07, slice-08 | Users manually paste long prompts repeatedly. | README/help docs expose planner/executor/doctor/reviewer flows with minimal-context guidance. |
47
+ | QIS-011 | `ai agent set --dry-run` or equivalent preflight | slice-08 | Users configure agents without seeing effect or missing dependencies. | Dry-run setup output lists provider command, availability, and files that would change without writing. |
48
+ | QIS-012 | Token compaction for revisions | slice-04 | Iteration becomes expensive and brittle. | Revision fixture compacts accepted history and preserves required decisions. |
49
+ | QIS-013 | Separate clean draft and raw transcript | slice-04 | Prompt echo corrupts committed docs. | Artifact tests assert separate files and redacted raw output. |
50
+ | QIS-014 | Approved-plan parser | slice-03 | Structured human approvals cannot become accurate slices. | Parser fixtures cover valid, invalid, partial, and ambiguous slice blocks. |
51
+ | QIS-015 | Deterministic slug/path generation | slice-03 | Repeated `spec create` creates inconsistent names or collisions. | Slug fixtures cover accents, spaces, punctuation, long titles, and collisions. |
52
+ | QIS-016 | Stronger slice execution gate | slice-06 | Execution starts with missing dependencies or invalid scope. | `start-slice`/`check-slice` fixture blocks unsafe execution and prints recovery. |
53
+ | QIS-017 | Strict dry-run contract | slice-07 | Trust in Quiver inspection commands is lost. | Dry-run mutation guard across analysis/context commands. |
54
+ | QIS-018 | Doctor active-state awareness | slice-07 | Doctor suggests stale examples. | Doctor fixture uses resolver current state and reports stale docs. |
55
+ | QIS-019 | Base branch configuration | slice-06 | Scope checks fail in repos using `main`, `develop`, or custom branches. | Base resolution fixture covers CLI option, slice config, git config, remote HEAD, fallback. |
56
+ | QIS-020 | Handoff template guidance | slice-06 | Invalid briefs are hard to fix. | `check-handoff` output includes minimal copyable template. |
57
+ | QIS-021 | Persistent spec worktree lifecycle | slice-05 | One-spec-per-worktree model remains manual and error-prone. | Worktree commands create/reuse/report one persistent worktree per spec. |
58
+ | QIS-022 | Machine-readable output contract | slice-02 | Agents cannot parse command output safely. | `--format json` tests validate stdout-only JSON, stderr diagnostics, schema versioning, and deterministic ordering. |
59
+
60
+ ## Slice Responsibility Summary
61
+
62
+ | Slice | Responsibility |
63
+ |---|---|
64
+ | slice-00 | Documentary foundation, evidence mapping, command contracts, v24/v25/v26 audit. |
65
+ | slice-01 | Shared state resolver and canonical statuses for specs, slices, runs, approvals, agents, evidence, and worktrees. |
66
+ | slice-02 | Stable JSON export and pure machine-readable command output. |
67
+ | slice-03 | Approved technical plan parsing and reliable spec/slice generation. |
68
+ | slice-04 | AI draft storage, raw logs, redaction, and token compaction. |
69
+ | slice-05 | Persistent spec worktree lifecycle, locks, recovery, and no nested worktrees. |
70
+ | slice-06 | Validation gates, scope safety, handoff packages, and local execution preconditions. |
71
+ | slice-07 | Context analysis, prepare-context, flow, doctor, dry-run safety, and source-backed docs. |
72
+ | slice-08 | Cross-platform help, GitHub auth, agent setup guidance, and first-use DX. |
73
+ | slice-09 | Fixtures, smoke tests, docs sync, package smoke, and release readiness. |
74
+
@@ -0,0 +1,179 @@
1
+ # Evidence Report - Quiver v27 Reliability and AI Workflow Hardening
2
+
3
+ ## Initial Evidence
4
+
5
+ - Pixel Quiver final dogfooding produced `QP-001` to `QP-019` and `QIS-001` to `QIS-022`.
6
+ - The approved plan requires a single spec with slices ordered by shared contracts first, command fixes second, and release readiness last.
7
+ - `README_FOR_AI.md` was read before creating this spec.
8
+ - `ROADMAP.md` and `BACKLOG.md` were reviewed before creating this spec.
9
+
10
+ ## Validation Status
11
+
12
+ - v27 source, fixture, smoke, guided workflow, and packaged tarball validation passed on 2026-05-24.
13
+ - npm publication was intentionally not performed by this spec.
14
+
15
+ ## Slice 00 Evidence - 2026-05-24
16
+
17
+ - Created `COVERAGE_MATRIX.md` to map all `QP-001..QP-019` and `QIS-001..QIS-022` to a responsible slice, risk, and validation strategy.
18
+ - Created `COMMAND_CONTRACTS.md` to define shared production contracts for output streams, exit codes, dry-run behavior, write classes, atomicity, idempotency, path safety, root detection, package manager detection, deterministic ordering, status catalogs, JSON versioning, legacy/strict modes, security, and validation.
19
+ - Created `AUDIT_V24_V25_V26.md` to separate existing v24/v25/v26 implementation surfaces from the dogfooding gaps that v27 must still close.
20
+ - Audited existing command and test surfaces with `rg` across `src/create-quiver`, `tests`, and v24/v25/v26 specs for resolver/export/spec-create/check-scope/check-handoff/worktree/analyze/dry-run/doctor/path/redaction surfaces.
21
+ - Confirmed `README_FOR_AI.md`, `ROADMAP.md`, and `CHANGELOG.md` were updated so v26 remains the shipped release and v27 is not described as published.
22
+
23
+ ## Slice 01 Evidence - 2026-05-24
24
+
25
+ - Added `src/create-quiver/lib/statuses.js` with shared canonical status catalogs and alias normalization for specs, slices, runs, approvals, agents, and datasets.
26
+ - Added `src/create-quiver/lib/project-state-resolver.js` as the shared resolver over slice discovery, graph building, deterministic ordering, scoped reads, completed-slice filtering, progress, spec grouping, and graph summaries.
27
+ - Routed classic `plan` and `graph` commands through the shared resolver while preserving existing human output and adding `canonical_status` to machine payloads.
28
+ - Routed AI lifecycle export/list/inspect state through the shared resolver so classic and AI surfaces agree about completed slices when `includeCompleted` is requested.
29
+ - Added `tests/lib/project-state-resolver.test.js` for canonical statuses, scoped read safety, and plan/export agreement on completed slices.
30
+ - Ran targeted command and library tests for resolver, AI export, plan, graph, next, and doctor.
31
+ - Ran `npm run smoke:doctor-fixtures`.
32
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 320 tests.
33
+ - Ran `git diff --check`.
34
+
35
+ ## Slice 02 Evidence - 2026-05-24
36
+
37
+ - Bumped lifecycle export schema to `schema_version: 2`.
38
+ - Extended `ai export` JSON with `source_metadata`, `warnings`, `approvals`, top-level `blockers`, `evidence`, `next_steps`, `lifecycle`, and `aggregates` while preserving existing `summary`, `project`, `agents`, `runs`, `specs`, `slices`, `graph`, `migration`, and `dashboard` fields.
39
+ - Kept source metadata sanitized by exposing the project root name rather than an absolute local path.
40
+ - Added canonical statuses to exported slices, runs, agents, specs, and approvals.
41
+ - Added CLI tests that parse stdout JSON directly, assert stderr is empty on success, assert unsupported formats write to stderr with non-zero exit, and assert `--include-completed` includes completed slices.
42
+ - Ran `node --test tests/lib/ai-export-state.test.js tests/commands/ai-export.test.js`.
43
+ - Ran `node --test tests/commands/cli-contract.test.js tests/lib/project-state-resolver.test.js`.
44
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 321 tests.
45
+ - Ran `git diff --check`.
46
+
47
+ ## Slice 03 Evidence - 2026-05-24
48
+
49
+ - Updated approved-plan parsing to extract structured slice data from full JSON input or fenced JSON blocks inside Markdown.
50
+ - Removed silent generic fallback behavior for plans without structured slices.
51
+ - Added pre-write validation for duplicate slice IDs, missing dependencies, invalid slice IDs, and dependency cycles.
52
+ - Kept `slice-00-spec-foundation` mandatory while preserving every approved implementation slice from the plan.
53
+ - Added atomic failure coverage showing missing structured slices fail before creating a spec directory or temporary build remnant.
54
+ - Added command-level coverage for `spec create --dry-run` failing safely when the reviewed approved plan lacks structured slices.
55
+ - Ran `node --test tests/lib/ai-spec-generator.test.js tests/commands/spec-create.test.js tests/commands/ai-plan-spec-phase.test.js`.
56
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 327 tests.
57
+
58
+ ## Slice 04 Evidence - 2026-05-24
59
+
60
+ - Added `src/create-quiver/lib/ai/artifacts.js` to centralize clean AI output extraction, raw provider artifact persistence, local path redaction, prompt-size checks, and revise-input compaction.
61
+ - Updated `ai plan`, `ai revise`, and `ai review-plan` persistence so saved drafts/reviews use clean provider output while raw stdout/stderr are stored separately under `.quiver/runs/<run-id>/raw/*.json`.
62
+ - Added prompt echo stripping and provider-log edge cleanup so draft artifacts do not include provider logs or prompt echoes when useful stdout is available.
63
+ - Added raw artifact metadata to planner approval and plan-review metadata, including `raw_artifact_path`, `output_source`, and revise `input_compaction`.
64
+ - Preserved explicit approved draft versions while carrying raw artifact metadata from the selected draft into approved metadata.
65
+ - Added revise-input compaction for oversized feedback, preserving decisions, risks, files, acceptance criteria, validation, blockers, dependencies, assumptions, rollback, and evidence lines.
66
+ - Added prompt-size rejection before provider execution with an actionable `AI_PROMPT_TOO_LARGE` error.
67
+ - Added package-safety coverage for raw AI artifacts under `.quiver/runs/*/raw/`.
68
+ - Ran `node --test tests/commands/ai-plan.test.js tests/commands/ai-review-plan.test.js tests/lib/ai-providers.test.js tests/lib/package-safety.test.js`.
69
+ - Ran `node --test tests/lib/ai-*.test.js tests/commands/ai-plan.test.js tests/commands/ai-review-plan.test.js`.
70
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 330 tests.
71
+ - Ran `node bin/create-quiver.js plan --spec quiver-v27-reliability-ai-workflow-hardening --include-completed`.
72
+ - Ran `node bin/create-quiver.js graph --spec quiver-v27-reliability-ai-workflow-hardening`.
73
+ - Ran `git diff --check`.
74
+
75
+ ## Slice 05 Evidence - 2026-05-24
76
+
77
+ - Added `src/create-quiver/lib/locks.js` to centralize `.quiver/locks` lock acquisition, release, stale lock diagnostics, and automatic local exclusion of Quiver runtime state.
78
+ - Hardened `spec start` and `spec close` with spec-level locks, persistent worktree reuse, stale/missing worktree detection, and actionable recovery guidance.
79
+ - Hardened slice worktree startup to reject nested worktree creation when commands run from an existing linked worktree.
80
+ - Hardened git helpers to detect missing paths, linked worktrees, absolute git dirs, and shared git common dirs reliably across realpath differences such as `/var` and `/private/var`.
81
+ - Added delegated execution locks for parallel AI execution runs so duplicate concurrent run IDs fail before provider execution.
82
+ - Added tests for stale spec worktrees, concurrent spec locks, nested slice worktrees, and delegated execution lock collisions.
83
+ - Ran `node --test tests/lib/lifecycle.test.js tests/commands/spec-worktree.test.js tests/commands/spec-close.test.js tests/commands/ai-execute-plan.test.js`.
84
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 334 tests.
85
+
86
+ ## Slice 06 Evidence - 2026-05-24
87
+
88
+ - Hardened `check-slice --local` so it validates execution git metadata, declared write/read paths, dependency contracts, and reports exactly which checks are executed or skipped in local mode.
89
+ - Updated `check-scope` to resolve base branches from `--base`, then `slice.git.base_branch`, then safe fallbacks instead of hardcoding `develop`.
90
+ - Added actionable `check-handoff` failures with accepted heading aliases and a minimal copyable template for legacy handoffs, execution briefs, and closure briefs.
91
+ - Added `spec validate` to validate spec docs, slices, JSON parseability, brief contracts, dependency cycles, safe paths, evidence references, and status references.
92
+ - Added shared path safety helpers and applied them to slice resolution, scope validation, and AI executor prompt/scope construction so absolute, traversal, and external slice paths are rejected.
93
+ - Synced the new `spec validate` command into generated `quiver:spec:validate` scripts, README command references, `README_FOR_AI.md`, and `docs/COMMANDS.md.template`.
94
+ - Ran `node bin/create-quiver.js spec validate specs/quiver-v27-reliability-ai-workflow-hardening`.
95
+ - Ran `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/spec-validate.test.js tests/commands/cli-contract.test.js`.
96
+ - Ran `node --test tests/commands/spec-create.test.js tests/commands/spec-worktree.test.js tests/commands/spec-close.test.js tests/commands/ai-execute-slice.test.js tests/commands/ai-execute-plan.test.js tests/lib/scope.test.js tests/lib/check-slice.test.js tests/lib/handoff.test.js tests/lib/paths.test.js`.
97
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 343 tests.
98
+
99
+ ## Slice 07 Evidence - 2026-05-24
100
+
101
+ - Added `analyze --dry-run` as a true no-write mode that reports planned scan, project map, and AI context writes without creating `.quiver/` or `docs/`.
102
+ - Fixed React + Vite detection so `vite.config.*` no longer classifies a project as Vue unless Vue evidence exists.
103
+ - Added project scan source/freshness metadata through `readProjectScanStatus`, including current, legacy, partial, stale, invalid, and missing states.
104
+ - Updated `flow` to print the context source summary and include the same metadata in JSON output.
105
+ - Updated `doctor` examples to prefer an active non-completed slice, use the only spec when unambiguous, or fall back to placeholders when multiple specs have no active slice.
106
+ - Added prepare-context coverage showing evidence-backed stack and command facts are preserved while unknown architecture boundaries remain marked for confirmation.
107
+ - Added tests for analyze dry-run, React/Vite classification, scan source summaries, flow context source output, doctor active/generic examples, and prepare-context evidence behavior.
108
+ - Ran `node --test tests/commands/analyze.test.js tests/commands/ai-onboard.test.js tests/commands/flow.test.js tests/commands/doctor.test.js tests/lib/project-scan.test.js tests/lib/doctor.test.js`.
109
+ - Ran `npm run smoke:doctor-fixtures`.
110
+ - Ran `node bin/create-quiver.js spec validate specs/quiver-v27-reliability-ai-workflow-hardening`.
111
+ - Ran `git diff --check`.
112
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 349 tests.
113
+ - Ran `node bin/create-quiver.js plan --spec quiver-v27-reliability-ai-workflow-hardening --include-completed`.
114
+ - Ran `node bin/create-quiver.js graph --spec quiver-v27-reliability-ai-workflow-hardening`.
115
+
116
+ ## Slice 08 Evidence - 2026-05-24
117
+
118
+ - Added real `ai agent set --dry-run` preview behavior that validates the requested profile and reports the planned `.quiver/agents/profiles.json` change without writing files.
119
+ - Updated top-level help and examples so `--help` includes the agent dry-run flow.
120
+ - Hardened GitHub auth failures with actionable account, scope, and SSH alias guidance plus a safe `gh auth status` next command.
121
+ - Added shell-specific path guidance for identity files and PR commands with spaces across macOS/Linux, Windows PowerShell, Git Bash, and WSL.
122
+ - Updated `flow` to report the detected package manager and matching generated `quiver:flow` script command.
123
+ - Updated init/migrate auto-install fallback warnings to respect the detected package manager instead of always printing npm.
124
+ - Synced `README.md`, `README_FOR_AI.md`, and `docs/COMMANDS.md.template` with the new help/auth/dry-run behavior.
125
+ - Ran `node --test tests/commands/cli-contract.test.js tests/commands/ai-agent.test.js tests/lib/ai-github.test.js tests/commands/flow.test.js`.
126
+ - Ran `node --test tests/commands/cli-contract.test.js tests/commands/ai-agent.test.js tests/lib/ai-github.test.js tests/commands/flow.test.js tests/lib/init-docs.test.js`.
127
+ - Ran `node --test tests/commands/cli-contract.test.js tests/commands/ai-agent.test.js tests/lib/ai-github.test.js tests/lib/doctor.test.js tests/commands/flow.test.js tests/lib/init-docs.test.js`.
128
+ - Ran `npm run smoke:doctor-fixtures`.
129
+ - Ran `node bin/create-quiver.js spec validate specs/quiver-v27-reliability-ai-workflow-hardening`.
130
+ - Ran `node --test tests/**/*.test.js` passed with 354 tests.
131
+ - Ran `node bin/create-quiver.js plan --spec quiver-v27-reliability-ai-workflow-hardening --include-completed`.
132
+ - Ran `node bin/create-quiver.js graph --spec quiver-v27-reliability-ai-workflow-hardening`.
133
+ - Ran `git diff --check`.
134
+
135
+ ## Slice 09 Evidence - 2026-05-24
136
+
137
+ - Extended the sanitized doctor fixture matrix to cover Pixel Quiver-style completed specs, multiple-spec fallback behavior, stale generated context, old `.quiver` state, no-Git projects, and paths with spaces.
138
+ - Hardened `scripts/ci/smoke-doctor-fixtures.js` so every declared fixture state must have executable coverage references and those references must exist.
139
+ - Added doctor command coverage for stale generated docs when the scan is newer than `docs/PROJECT_MAP.md`.
140
+ - Added doctor command coverage for old incomplete `.quiver` state so legacy projects recommend `migrate` instead of `init`.
141
+ - Extended `scripts/ci/smoke-create-quiver.sh` to smoke `flow` package-manager guidance, source `ai agent set --dry-run`, packaged CLI `--help`, packaged `flow`, and packaged `ai agent set --dry-run`.
142
+ - Synced `README_FOR_AI.md`, `ROADMAP.md`, `CHANGELOG.md`, `README.md`, v27 `STATUS.md`, `SPEC.md`, `EXECUTION_PLAN.md`, `pr.md`, and this evidence report with the implemented-but-unpublished v27 state.
143
+ - Ran `node --test tests/commands/doctor.test.js`.
144
+ - Ran `npm run smoke:doctor-fixtures`.
145
+ - Ran `npm run smoke:create-quiver`.
146
+ - Ran `npm run smoke:guided-workflow`.
147
+ - Ran `npm run package:quiver`.
148
+ - Ran full Node test suite: `node --test tests/**/*.test.js` passed with 356 tests.
149
+ - Ran `node bin/create-quiver.js spec validate specs/quiver-v27-reliability-ai-workflow-hardening`.
150
+ - Ran `node bin/create-quiver.js plan --spec quiver-v27-reliability-ai-workflow-hardening --include-completed`.
151
+ - Ran `node bin/create-quiver.js graph --spec quiver-v27-reliability-ai-workflow-hardening --include-completed`.
152
+ - Ran `node bin/create-quiver.js next --spec quiver-v27-reliability-ai-workflow-hardening`; no ready slices remain.
153
+ - Ran targeted regression suite: `node --test tests/commands/doctor.test.js tests/lib/project-state-resolver.test.js tests/commands/plan.test.js tests/commands/graph.test.js` passed with 31 tests.
154
+ - Ran `git diff --check`.
155
+
156
+ ## Spec Package Validation - 2026-05-24
157
+
158
+ - Every `slice.json` under `specs/quiver-v27-reliability-ai-workflow-hardening` parsed successfully with Node.
159
+ - Every `EXECUTION_BRIEF.md` passed `node bin/create-quiver.js check-handoff`.
160
+ - Every `CLOSURE_BRIEF.md` passed `node bin/create-quiver.js check-handoff`.
161
+ - `node bin/create-quiver.js plan --spec quiver-v27-reliability-ai-workflow-hardening --include-completed` passed and reported 10 planned slices.
162
+ - `node bin/create-quiver.js graph --spec quiver-v27-reliability-ai-workflow-hardening` passed and produced the expected dependency levels.
163
+ - `node bin/create-quiver.js check-slice --local <slice.json>` passed for all 10 slices.
164
+ - `git diff --check` passed.
165
+
166
+ ## Slice Evidence
167
+
168
+ | Slice | Evidence |
169
+ |---|---|
170
+ | slice-00 | Completed: coverage matrix, command contracts, v24/v25/v26 audit, source-of-truth docs sync, and spec package validation. |
171
+ | slice-01 | Completed: shared resolver, canonical status catalogs, classic/AI resolver adapters, scoped-read tests, completed-slice consistency tests, and targeted validation. |
172
+ | slice-02 | Completed: schema v2 export contract, pure stdout/stderr CLI checks, completed-slice export coverage, source metadata, warnings, approvals, evidence, next steps, lifecycle, and aggregates. |
173
+ | slice-03 | Completed: structured approved-plan extraction, no generic fallback, duplicate/dependency/cycle validation, eight-slice preservation, safe failure cleanup, and command coverage. |
174
+ | slice-04 | Completed: clean drafts/reviews, redacted run-scoped raw provider artifacts, revise compaction, prompt-size guardrails, approval metadata, and raw artifact package-safety coverage. |
175
+ | slice-05 | Completed: spec/slice worktree locks, stale and missing worktree recovery, nested worktree prevention, delegated run lock safety, and lifecycle/git helper coverage. |
176
+ | slice-06 | Completed: stronger local slice gates, base-aware scope validation, actionable handoff templates, spec validate, and repo-bound path safety. |
177
+ | slice-07 | Completed: read-only analyze dry-run, React/Vite stack detection, scan source/freshness reporting, flow context source output, active/generic doctor examples, and prepare-context evidence coverage. |
178
+ | slice-08 | Completed: agent profile dry-run, grouped help sync, cross-platform path guidance, GitHub account/scope/alias diagnostics, package-manager-aware flow guidance, install fallback messages, and focused command/library tests. |
179
+ | slice-09 | Completed: sanitized fixture matrix coverage, fixture coverage validator, stale-doc and old-state doctor regressions, source and packaged CLI smokes, full test suite, package smoke, and docs/release readiness sync. |
@@ -0,0 +1,71 @@
1
+ # Execution Plan - Quiver v27
2
+
3
+ ## Wave 0 - Required Foundation
4
+
5
+ 1. `slice-00-docs-audit-coverage-and-contracts` - completed
6
+ - Must run first.
7
+ - Audits docs/code/tests against Pixel Quiver evidence.
8
+ - Defines the contracts that prevent partial fixes.
9
+
10
+ ## Wave 1 - Shared Model
11
+
12
+ Run sequentially:
13
+
14
+ 1. `slice-01-core-state-resolver-and-canonical-statuses` - completed
15
+
16
+ This slice owns the state model used by later command fixes.
17
+
18
+ ## Wave 2 - Export and Spec Generation
19
+
20
+ Run after Wave 1. Prefer sequential order:
21
+
22
+ 1. `slice-02-json-export-contract-and-machine-output` - completed
23
+ 2. `slice-03-approved-plan-to-spec-create` - completed
24
+
25
+ These touch shared AI/spec data contracts and should not run in parallel unless file scopes are proven independent.
26
+
27
+ ## Wave 3 - AI Artifacts and Worktrees
28
+
29
+ Can run in parallel after Wave 1 if write scopes do not overlap:
30
+
31
+ 1. `slice-04-ai-artifact-storage-redaction-and-token-compaction` - completed
32
+ 2. `slice-05-worktree-lifecycle-locks-and-recovery` - completed
33
+
34
+ Status: Wave 3 is complete.
35
+
36
+ ## Wave 4 - Validation Gates
37
+
38
+ Run after Wave 3:
39
+
40
+ 1. `slice-06-validation-gates-and-scope-safety` - completed
41
+
42
+ Status: Wave 4 is complete.
43
+
44
+ ## Wave 5 - Context and DX
45
+
46
+ Run after Wave 4:
47
+
48
+ 1. `slice-07-context-analysis-and-doctor-flow` - completed
49
+ 2. `slice-08-cross-platform-help-auth-and-dx` - completed
50
+
51
+ `slice-08` depends on `slice-07` because help/auth guidance should reference the hardened diagnostics contract.
52
+
53
+ Status: Wave 5 is complete.
54
+
55
+ ## Wave 6 - Final Readiness
56
+
57
+ Run last:
58
+
59
+ 1. `slice-09-fixtures-smoke-docs-and-release-readiness`
60
+
61
+ This slice validates the whole package from source and tarball.
62
+
63
+ Status: Wave 6 is complete.
64
+
65
+ ## Parallel Safety Notes
66
+
67
+ - Keep one commit per slice.
68
+ - Do not run slices in parallel when `allowed_write_paths` overlap.
69
+ - `slice-00`, `slice-01`, `slice-02`, `slice-03`, `slice-06`, and `slice-09` are sequential checkpoints.
70
+ - `slice-04` and `slice-05` are the main candidates for parallel execution after `slice-01`.
71
+ - Do not publish npm from this spec.
@@ -0,0 +1,176 @@
1
+ # Quiver v27 - Reliability and AI Workflow Hardening
2
+
3
+ **Date:** 2026-05-24
4
+ **Status:** Active
5
+ **Source:** Pixel Quiver dogfooding evidence, final worktree traceability
6
+
7
+ Slice numbering resets here. This spec intentionally starts at `slice-00`.
8
+
9
+ ## Problem
10
+
11
+ Real use of Quiver in Pixel Quiver exposed that several AI-first workflow areas are still fragile even though related capabilities were introduced across v24, v25, and v26.
12
+
13
+ The current risk is not a missing single feature. The risk is systemic: commands can disagree about specs/slices, machine-readable output is not stable enough for dashboards, `spec create` can generate incomplete scaffolds from an approved plan, dry-run behavior is not consistently read-only, and validation/worktree guidance can leave users or agents in ambiguous states.
14
+
15
+ ## Objective
16
+
17
+ Make Quiver reliable for production-grade AI-first WDD + SDD workflows by hardening the core state model, command contracts, spec/slice generation, exports, AI artifacts, worktrees, validations, context preparation, cross-platform DX, and release evidence.
18
+
19
+ ## Evidence Sources
20
+
21
+ Primary requirement inputs are the final Pixel Quiver dogfooding files:
22
+
23
+ - `/Users/fabrijk/Documents/Work/Proyectos Personales/nika/.worktrees/Pixel Quiver/feature-REAL-QUIVER-AI-LIFECYCLE-01-quiver-ai-config-and-context/QUIVER_PROBLEMS.md`
24
+ - `/Users/fabrijk/Documents/Work/Proyectos Personales/nika/.worktrees/Pixel Quiver/feature-REAL-QUIVER-AI-LIFECYCLE-01-quiver-ai-config-and-context/QUIVER_IMPROVEMENT_SUGGESTIONS.md`
25
+ - `/Users/fabrijk/Documents/Work/Proyectos Personales/nika/.worktrees/Pixel Quiver/feature-REAL-QUIVER-AI-LIFECYCLE-01-quiver-ai-config-and-context/COMMAND_LOG.md`
26
+
27
+ The final traceability set contains:
28
+
29
+ - `QP-001` to `QP-019`
30
+ - `QIS-001` to `QIS-022`
31
+
32
+ ## Core Decisions
33
+
34
+ - Audit existing v24/v25/v26 behavior before changing code.
35
+ - Treat `README_FOR_AI.md` as the repository source of truth.
36
+ - Keep `npx create-quiver` as the canonical bootstrap command.
37
+ - Preserve existing command names and compatibility unless a breaking change is explicitly justified.
38
+ - Define shared contracts before fixing individual commands.
39
+ - Make `slice.json` and `.quiver/` operational state the source of truth; visible docs are derived and validated.
40
+ - Keep `--dry-run` strictly read-only.
41
+ - Keep machine-readable output parseable without cleanup.
42
+ - Keep one persistent worktree per spec and one commit per slice; delegated temporary worktrees remain an internal execution mode.
43
+ - Do not publish npm or open PRs from this spec unless explicitly requested after implementation and validation.
44
+
45
+ ## Scope
46
+
47
+ ### Included
48
+
49
+ - Audit and coverage matrix for all `QP-*` and `QIS-*`.
50
+ - Command contracts: exit codes, stdout/stderr, dry-run, write classes, idempotency, atomic writes, path safety, root detection, package manager detection, and deterministic ordering.
51
+ - Unified state resolver for specs, slices, runs, approvals, agents, evidence, worktrees, status, and source metadata.
52
+ - Canonical status catalogs for specs, slices, runs, approvals, agents, and datasets.
53
+ - JSON export contract for dashboards and agents.
54
+ - Alignment between `ai export` and the stable export contract.
55
+ - `spec create` generation from a reviewed and approved technical plan.
56
+ - Structured approved-plan slice block validation.
57
+ - Clean AI drafts, separated raw logs, redaction, and token compaction.
58
+ - Worktree lifecycle hardening, locks, recovery, and no nested worktree guidance.
59
+ - Validation gates for `check-slice`, `check-scope`, `check-handoff`, and `spec validate`.
60
+ - Context and diagnostics hardening for `analyze`, `prepare-context`, `flow`, and `doctor`.
61
+ - Cross-platform DX for macOS, Linux, Windows PowerShell, Git Bash, and WSL.
62
+ - GitHub auth diagnostics and help/error messages.
63
+ - Real/sanitized fixtures and smoke tests, including tarball/package validation.
64
+
65
+ ### Excluded
66
+
67
+ - Building a web dashboard inside Quiver core.
68
+ - Publishing npm.
69
+ - Opening a PR.
70
+ - Replacing the WDD + SDD methodology.
71
+ - Removing existing legacy compatibility without an explicit migration path.
72
+ - Storing provider credentials or API keys.
73
+
74
+ ## Acceptance Criteria
75
+
76
+ 1. Given the v27 spec is created, when `slice-00` completes, then every `QP-*` and `QIS-*` is mapped to a slice, command area, risk, and validation strategy.
77
+ 2. Given a command supports `--dry-run`, when it completes, then no repository file changes, including `.quiver/`, `docs/`, and `specs/`.
78
+ 3. Given a command emits `--format json`, when it succeeds, then `stdout` is valid JSON parseable without removing logs or human text.
79
+ 4. Given a command fails, when it exits, then it writes the error to `stderr`, exits non-zero, and leaves previous valid state intact or reports exact partial state.
80
+ 5. Given Quiver resolves project state, when commands inspect specs/slices, then classic and AI commands use the same resolver and agree on status, dependencies, completed slices, runs, approvals, agents, and evidence.
81
+ 6. Given a project has completed slices, when export runs with `--include-completed`, then completed specs/slices appear in deterministic order.
82
+ 7. Given Quiver exports JSON, when a dashboard consumes it, then the payload includes schema version, dataset source, generated timestamp, source metadata, warnings, specs, slices, agents, runs, approvals, blockers, evidence, next steps, lifecycle, and aggregates.
83
+ 8. Given an approved technical plan includes a structured slice block, when `spec create` runs, then it creates the approved spec, slices, handoffs, execution plan, and PR body without generic fallback.
84
+ 9. Given an approved technical plan lacks a parseable structured slice block, when `spec create` runs, then it fails before writing files and prints the expected format.
85
+ 10. Given an AI provider returns prompt echo, logs, or mixed output, when Quiver persists drafts, then the useful draft is clean and raw logs are stored separately with redaction.
86
+ 11. Given feedback is near provider context limits, when `ai revise` runs, then Quiver compacts safely or requests smaller input before exceeding limits.
87
+ 12. Given a spec worktree exists, when `spec start`, `spec status`, or slice execution commands run, then Quiver reuses the persistent spec worktree and avoids nested or conflicting worktrees.
88
+ 13. Given a worktree or lock is stale, missing, dirty, or manually removed, when Quiver detects it, then it reports recovery steps without corrupting state.
89
+ 14. Given a slice is checked locally, when `check-slice --local` runs, then it validates all local preconditions required by later execution or explicitly lists skipped checks.
90
+ 15. Given `check-scope` receives `--base` or a slice declares `git.base_branch`, when it runs, then it uses that base before falling back.
91
+ 16. Given a handoff/brief is incomplete, when `check-handoff` runs, then it prints the missing heading, a minimal template, and supported aliases where applicable.
92
+ 17. Given a path is outside the project root or attempts traversal, when a write path is resolved, then Quiver rejects it.
93
+ 18. Given Quiver runs in a simple repo, subdirectory, worktree, or basic monorepo, when it resolves the root, then it uses or reports the project root clearly.
94
+ 19. Given a project uses npm, pnpm, yarn, or bun, when Quiver suggests package commands, then it respects the detected package manager.
95
+ 20. Given a project path contains spaces, when Quiver prints commands, then examples are copy-safe for macOS, Linux, Windows PowerShell, Git Bash, and WSL.
96
+ 21. Given GitHub auth is missing or ambiguous, when `ai doctor` or PR preflight runs, then Quiver reports account/scopes/alias expectations and the next safe command.
97
+ 22. Given old `.quiver/` state exists, when `migrate --dry-run` runs, then it reports exactly what would be updated and preserves existing data.
98
+ 23. Given fixtures are added from real projects, when committed, then they are sanitized and do not expose unnecessary personal paths or credentials.
99
+ 24. Given release readiness is validated, when final smoke runs, then it uses the packaged tarball or installed package path, not only local source files.
100
+
101
+ ## Coverage Matrix
102
+
103
+ The full coverage matrix lives in `COVERAGE_MATRIX.md`. Summary:
104
+
105
+ | Evidence | Covered by |
106
+ |---|---|
107
+ | QP-001, QIS-001 | slice-07 |
108
+ | QP-002, QIS-002 | slice-08 |
109
+ | QP-003, QIS-006 | slice-01, slice-02 |
110
+ | QP-004, QIS-009 | slice-08 |
111
+ | QP-005, QIS-007 | slice-07 |
112
+ | QP-006, QIS-008 | slice-07 |
113
+ | QP-007, QIS-010 | slice-07, slice-08 |
114
+ | QP-008, QIS-008 | slice-00, slice-07 |
115
+ | QP-009, QIS-012 | slice-04 |
116
+ | QP-010, QIS-013 | slice-04 |
117
+ | QP-011, QIS-014, QIS-015 | slice-03 |
118
+ | QP-012 | slice-03 |
119
+ | QP-013, QIS-016 | slice-06 |
120
+ | QP-014, QIS-017 | slice-07 |
121
+ | QP-015, QIS-018 | slice-07 |
122
+ | QP-016, QIS-019 | slice-06 |
123
+ | QP-017, QIS-020 | slice-06 |
124
+ | QP-018, QIS-021 | slice-05 |
125
+ | QP-019, QIS-004, QIS-022 | slice-02 |
126
+ | QIS-003 | slice-06 |
127
+ | QIS-005 | slice-06 |
128
+ | QIS-011 | slice-08 |
129
+
130
+ ## Technical Plan
131
+
132
+ 1. Publish a documentation-only foundation that audits current docs, code, tests, and dogfooding evidence.
133
+ 2. Define command contracts and the shared internal state model before command-specific fixes.
134
+ 3. Build or refactor a core resolver that every relevant command can consume.
135
+ 4. Define and test a stable JSON export contract with pure machine output.
136
+ 5. Make `spec create` require a reviewed, approved, structured plan and fail safely otherwise.
137
+ 6. Clean AI artifact persistence, raw logs, redaction, and token compaction.
138
+ 7. Harden worktree, lock, branch, and recovery behavior for the spec/slice lifecycle.
139
+ 8. Harden validation gates and scope/path safety.
140
+ 9. Harden context commands, diagnostics, first-use guidance, and cross-platform help.
141
+ 10. Validate with fixtures, command tests, smokes, tarball/package smoke, docs sync, and release readiness.
142
+
143
+ ## Slice Roadmap
144
+
145
+ | Slice | Title | Status | Dependencies |
146
+ |---|---|---|---|
147
+ | slice-00 | Docs audit, coverage, and contracts | completed | none |
148
+ | slice-01 | Core state resolver and canonical statuses | completed | slice-00 |
149
+ | slice-02 | JSON export contract and machine output | completed | slice-01 |
150
+ | slice-03 | Approved plan to spec create | completed | slice-01, slice-02 |
151
+ | slice-04 | AI artifact storage, redaction, and token compaction | completed | slice-01 |
152
+ | slice-05 | Worktree lifecycle, locks, and recovery | completed | slice-01 |
153
+ | slice-06 | Validation gates and scope safety | completed | slice-01, slice-05 |
154
+ | slice-07 | Context analysis and doctor flow | completed | slice-01, slice-06 |
155
+ | slice-08 | Cross-platform help, auth, and DX | completed | slice-07 |
156
+ | slice-09 | Fixtures, smoke, docs, and release readiness | completed | slice-02, slice-03, slice-04, slice-05, slice-06, slice-07, slice-08 |
157
+
158
+ ## Validation Strategy
159
+
160
+ - `node --test tests/**/*.test.js`
161
+ - `npm run smoke:doctor-fixtures`
162
+ - `npm run smoke:guided-workflow`
163
+ - `npm run smoke:create-quiver`
164
+ - `npm run package:quiver`
165
+ - Tarball smoke from `/private/tmp`
166
+ - `git diff --check`
167
+ - JSON parse validation for every `slice.json`
168
+ - `check-handoff` for every `EXECUTION_BRIEF.md` and `CLOSURE_BRIEF.md`
169
+
170
+ ## Risks
171
+
172
+ - Some v24/v25/v26 docs may claim behavior that is only partially implemented.
173
+ - A shared resolver can create broad regressions if introduced without command-by-command compatibility tests.
174
+ - Export schema stabilization can break ad-hoc consumers unless old behavior is kept or documented.
175
+ - Worktree lifecycle changes can affect existing users with in-flight branches.
176
+ - Real fixtures can expose local paths unless sanitized.