paqad-ai 1.46.2 → 1.49.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 (33) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/dist/cli/index.js +5447 -1202
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/index.d.ts +37 -4
  5. package/dist/index.js +1669 -873
  6. package/dist/index.js.map +1 -1
  7. package/dist/kernel/gate.js +696 -519
  8. package/dist/kernel/gate.js.map +1 -1
  9. package/dist/rule-scripts/index.d.ts +31 -1
  10. package/dist/rule-scripts/index.js +34 -0
  11. package/dist/rule-scripts/index.js.map +1 -1
  12. package/dist/session-ledger/disabled-audit.js +6 -0
  13. package/dist/session-ledger/disabled-audit.js.map +1 -1
  14. package/dist/session-ledger/project-ledger.js +6 -0
  15. package/dist/session-ledger/project-ledger.js.map +1 -1
  16. package/dist/stage-evidence/live-writer.js +46 -13
  17. package/dist/stage-evidence/live-writer.js.map +1 -1
  18. package/dist/stage-evidence/marker-parse.d.ts +3 -0
  19. package/dist/stage-evidence/marker-parse.js +53 -17
  20. package/dist/stage-evidence/marker-parse.js.map +1 -1
  21. package/dist/stage-evidence/narration.d.ts +6 -4
  22. package/dist/stage-evidence/narration.js +22 -12
  23. package/dist/stage-evidence/narration.js.map +1 -1
  24. package/package.json +7 -7
  25. package/runtime/AGENT-BOOTSTRAP.md +14 -8
  26. package/runtime/base/skills/cross-module-impact-scanner/assets/output.template.md +1 -1
  27. package/runtime/base/skills/diff-minimizer/assets/output.template.md +2 -2
  28. package/runtime/base/skills/performance-regression-estimator/assets/output.template.md +2 -2
  29. package/runtime/base/skills/test-per-ac-planner/assets/output.template.md +1 -1
  30. package/runtime/capabilities/coding/rules/feature-development.md +11 -2
  31. package/runtime/hooks/agent-entry-prompt-gate.mjs +36 -8
  32. package/runtime/hooks/ticket-intake-prompt.mjs +59 -0
  33. package/runtime/scripts/verify-backstop.mjs +14 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,189 @@
1
1
  # paqad-ai
2
2
 
3
+ ## 1.49.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 93bdd54: Stage-Spine 09 (#324): record and consume the lane — scale process depth to risk.
8
+
9
+ paqad's deterministic classify→route→lane engine was fully built but never invoked
10
+ in a live session, so every change (a one-line typo or an auth migration) paid the
11
+ same full ceremony and the ledger's `lane` was always null. This wires the existing
12
+ engine into the prompt seam and makes the lane real:
13
+
14
+ - The prompt seam runs the deterministic classifier + router on the prompt text,
15
+ stashes the chosen lane, and records it on the change's open ledger row (no LLM
16
+ call added — path/prompt signals only).
17
+ - The pre-code gate scales the specification requirement to the lane: the **fast**
18
+ lane relaxes it (planning-only) while **graduated/full** keep the frozen-spec
19
+ requirement. A null lane fails safe to full.
20
+ - A new optional `sensitivity: high` per module in `module-map.yml` floors any change
21
+ touching a sensitive path back to the full lane — a cheap, deterministic risk floor.
22
+ - The completion backstop consumes the recorded lane instead of a hardcoded `'full'`,
23
+ so a small change is no longer forced through the heaviest quality measurement set.
24
+
25
+ Enforcement is tiered by host (hard-block on Claude Code; record-only on Codex/Gemini;
26
+ prompt-followed on advisory hosts).
27
+
28
+ - 93bdd54: Stage-Spine 10 (#325): one end-of-change paqad receipt — surface the verdict, cut the noise.
29
+
30
+ paqad's most valuable narration moment (the final verdict) had no reliable visible
31
+ surface and didn't use the contract's own words, while the cheapest moments (per-stage
32
+ boundaries) were spoken twice. This inverts the cadence:
33
+
34
+ - The trust verdict now speaks the contract vocabulary — `Safe to merge` /
35
+ `Needs your attention` / `Inconclusive` with the fixed status glyphs, led by the
36
+ `▸ paqad` frame — consuming `paqad-voice.ts` (fulfilling its single-source claim).
37
+ - A new end-of-change **receipt** composes the verdict headline with one line per stage,
38
+ each carrying honest provenance: a stage that was only marked (no artifact, or a
39
+ near-zero duration) reads 🟡 "marked (no recorded work)", never 🟢 "done".
40
+ - The receipt is emitted as a visible `{systemMessage}` on the Claude completion hook
41
+ (was buried on stdout); the git/CI backstop keeps plain text.
42
+ - The duplicated per-marker END narration line is muted (the ledger write is unchanged —
43
+ only the second spoken line is dropped).
44
+ - The generated narration contract now states, per host, who narrates: Claude Code's
45
+ hooks speak for you, but on Codex/Gemini the record hook is silent so the model must
46
+ narrate its own markers — it no longer claims hook-driven ledger narration there.
47
+
48
+ - 93bdd54: Stage-Spine 11 (#326): truth tooling — `paqad-ai config effective` and a real `decision` CLI verb.
49
+
50
+ Two small commands that make the framework honest and self-explaining:
51
+
52
+ - **`paqad-ai config effective`** prints, per knob, the value that actually binds, the
53
+ surface it came from (env → local `.paqad/.config` → tracked `configs/.config.*` →
54
+ default), and the gate that consumes it. A knob shown `consumed by: NOTHING` is a
55
+ placebo — a setting a team can change with no effect. The scan flags 12 verified
56
+ placebos (the strictness/escalation/decision-threshold/research knobs). `rule_compliance`
57
+ and `stages_mode` are shown through their real floored resolvers so the yaml-as-real-input
58
+ truth (#319) is visible. Strictly read-only.
59
+ - **`paqad-ai decision create|resolve|list`** is a real, install-resolved CLI verb for the
60
+ Decision Pause Contract, replacing the `node runtime/base/skills/decision/scripts/*.mjs`
61
+ path the contract named — which ENOENTs in a real onboarded project (the scripts only
62
+ exist in the dev repo). It wraps the existing engine (`createPendingDecision` /
63
+ `resolvePendingDecision` — same ULID mint, same packet format, no fork), validates the
64
+ category with a nearest-match suggestion, supports `--other "<text>"` write-ins on
65
+ resolve, and lists pending/resolved packets. The generated Decision Pause Contract now
66
+ names `npx paqad-ai decision …`.
67
+
68
+ ## 1.48.0
69
+
70
+ ### Minor Changes
71
+
72
+ - 93e45d3: Stage-Spine 05 (#320): artifact-bearing stage markers — prove the work, not just the claim.
73
+
74
+ A stage-end marker can now carry an artifact the recorder validates over its real
75
+ on-disk bytes: `paqad:stage <stage> end -- <path>` (and `paqad-ai stage end <stage>
76
+ --artifact <path>`). The thinking stages — planning, specification, review — must
77
+ reference a substantive (present, non-empty) artifact to count as complete. A bare
78
+ marker pair, a missing file, or an empty file now folds to **inconclusive**, not
79
+ complete, and no longer clears the pre-code gate. Mutation stages (development, checks,
80
+ documentation_sync) are unchanged — the observed edit is their proof. Reuses the single
81
+ `hashArtifacts` path (returns null when no real bytes exist) and preserves same-turn
82
+ remediation (#307) and the docs/`.paqad` scope exclusion (#310).
83
+
84
+ - 93e45d3: Stage-Spine 06 (#321): per-change completion gate — stop later changes free-riding on the first.
85
+
86
+ The end-of-change completeness gate no longer fires only once per session. On a passing
87
+ verify, finalize now appends a `close` row and resets the session ledger's `.open` pointer
88
+ (`closeSessionOrdinal`), so the next stage/edit opens a fresh ordinal and the pre-code gate
89
+ re-arms — change #2+ earns its own verdict instead of inheriting change #1's markers. The
90
+ verify-once early return is gone (each Stop re-verifies the open change; the last verify is
91
+ the verdict), and the redo cap now counts only failed verifies since the last stage mutation,
92
+ so re-verifying never spuriously trips it while a stuck change still marches to `blocked`
93
+ (#303 bite-once preserved). Docs-only / `.paqad`-only changes still no-op (#310).
94
+
95
+ - 93e45d3: Stage-Spine 07 (#322): deterministic ticket intake — make "do PQD-123" fetch the real ticket.
96
+
97
+ Wires the front door of the ticket → PR loop so the spec grounds in the actual ticket text
98
+ instead of a guess from the id:
99
+
100
+ - **`paqad-ai intake fetch <ref>`** — GitHub issues via `gh issue view` (mapped through a new
101
+ `GithubIssuesTicketProvider`), Jira via the Atlassian MCP in-session; prints the normalized
102
+ ticket and records an optional `ticket_intake` stage row. Graceful when `gh` is absent or the
103
+ ref is unrecognised; intake is a bookend and never blocks a change.
104
+ - **Prompt-seam detector** (`detectTicketRefs`) + a Claude-Code `UserPromptSubmit` arming hook:
105
+ a ticket ref in a prompt surfaces a `▸ paqad` line pointing at `intake fetch`. Advisory on
106
+ hosts without the seam.
107
+ - Adds an optional "Stage 0 — ticket_intake" to the feature-development rule and fixes the
108
+ `conventions.intake_decisions` → `process.intake_decisions` key mismatch in the policy text.
109
+
110
+ - 93e45d3: Stage-Spine 08 (#323): ship `paqad-ai deliver` — wire the dead delivery engine and close the CI loop.
111
+
112
+ The ~1,900-line delivery engine (branch/commit/PR + CI wait-for-green + on-red-stop + evidence
113
+ comment) had no invocation path. `paqad-ai deliver` now runs the tested chain end-to-end:
114
+
115
+ - `--dry-run` renders the branch/commit/PR text without pushing.
116
+ - The real path asks first via a mandatory `delivery.open_pr` Decision Packet (opening a PR is
117
+ outward-facing and hard to reverse), then runs `renderDelivery → runDelivery → runCiGate`,
118
+ waits for CI (`wait_for_green` / `on_red: stop`), stops with a clear reason on red (never a
119
+ false success), and posts the rendered verification evidence to the PR on green.
120
+ - Reuses `src/delivery/*` — no hand-rolled git/gh flow.
121
+
122
+ Also fixes the delivery-policy evidence instruction that promised an auto-posted comment that
123
+ never happened: it now names `paqad-ai deliver` (auto-posts on green) plus the manual
124
+ `paqad-ai evidence --output … && gh pr comment --body-file …` fallback.
125
+
126
+ Deferred (follow-ups): a Bash `PreToolUse` deny of hand-rolled `gh pr create` / `git push` while
127
+ a `delivery.open_pr` packet is pending (the pause is already enforced by the verb), and adding a
128
+ delivery block to this repo's `feature-development.yaml` + having `paqad-ai update` append missing
129
+ default blocks (ties to #12).
130
+
131
+ ## 1.47.0
132
+
133
+ ### Minor Changes
134
+
135
+ - 49db0e3: Make the session-context rule contract fail-safe (#316). `writeRuleContext` could
136
+ write a drift-, memory-, or retrieval-only artifact with zero rules when the compiled
137
+ rules store was absent or empty. Because the framework bootstrap only loads the full
138
+ `docs/instructions/rules/` tree when the artifact is _missing_, a rules-less file was
139
+ silently treated as the rule contract and every project rule vanished from context.
140
+ The writer now prepends an explicit fallback marker to any written artifact that
141
+ carries no rule manifest, so a bootstrap-obedient agent always knows to load the rules
142
+ in full. A populated store is unchanged (byte-identical).
143
+ - 49db0e3: Ship `paqad-ai spec freeze` and activate the built-but-dead spec sign-off engine
144
+ (#317). The `src/spec/` freeze machinery (build → evaluate → freeze → write frozen
145
+ sidecar) was fully implemented and tested but had no caller and no instruction naming
146
+ it, so the "spec frozen and signed off before code" promise was enforced by nothing.
147
+ The new `spec freeze <spec-file>` verb wires the existing engine end to end: it prints
148
+ every freeze blocker and exits non-zero (nothing written) when the spec is not
149
+ freezable, and on a clean spec writes the frozen sidecar at `.paqad/specs/<id>.frozen.json`.
150
+ The specification-stage instructions and the feature-development rule now name the
151
+ command so the agent runs it. No freeze logic is reimplemented.
152
+ - 49db0e3: Build the deterministic check runner and stop assuming tests passed (#318). The
153
+ `checks` stage is meant to be 100% deterministic — run format/test/build and block
154
+ on red — but nothing executed the commands: the resolver had no caller and the
155
+ completion backstop hardcoded `code_tests_lint_passed: true`, so a change with
156
+ failing tests could still be reported green by the framework layer.
157
+
158
+ New `paqad-ai checks run` verb resolves the project's mapped commands, executes
159
+ them, and persists one `StructuredTestResult` per command (the shape the
160
+ `code-tests-lint` gate already consumes) to `.paqad/checks/last-run.json`; it exits
161
+ non-zero on any red. The completion backstop now reads that report: it populates
162
+ `structured_test_results`, derives `code_tests_lint_passed` from real execution (no
163
+ longer a hardcoded `true`), and replaces the `code-tests-lint` gate's skipped
164
+ placeholder with the report-driven verdict — a red report blocks the completion
165
+ verdict, a green one passes, and an absent report reads as Inconclusive rather than
166
+ a vacuous green. Deterministic throughout: a command's exit code is the verdict.
167
+
168
+ - 49db0e3: Arm the rule-scripts gate by generating the rule-script map at onboarding (#319).
169
+ paqad's deterministic, no-LLM rule enforcement engine was live but disarmed on every
170
+ fresh project: `rule-script-map.yml` — the map linking rules to their compiled
171
+ scripts — was produced by no code path, so the enforcement seam fast-skipped on the
172
+ missing map and the gate passed by default. And the strictness a team set in
173
+ `feature-development.yaml` (`checks.rule_compliance.mode`) was read from a different
174
+ surface at runtime (`.config`, default `warn`), so a team asking for `strict` silently
175
+ got `warn`.
176
+
177
+ New `paqad-ai rules compile` verb (and `compileRuleScripts`) generates the map from
178
+ the rule tree — embedding stable rule ids and listing every rule via the existing
179
+ analyzer + atomic-writer, carrying over any bound scripts — and the onboarding
180
+ orchestrator now runs it after the rule refresh, so a fresh project is armed. The
181
+ strictness resolver now folds the project's on-disk `feature-development.yaml`
182
+ `rule_compliance.mode` as a real, team-tracked floor (stricter of it and `.config`
183
+ wins; local/env may only raise), and the policy merge no longer silently drops
184
+ `rule_compliance` when a project supplies its own workflow file. No enforcement or
185
+ atomic-apply logic is reimplemented.
186
+
3
187
  ## 1.46.2
4
188
 
5
189
  ### Patch Changes