checkwright 0.21.0 → 0.22.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 (236) hide show
  1. package/README.md +385 -19
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +11 -0
  4. package/lib/common/recipe.sh +8 -11
  5. package/lib/doctor.sh +49 -0
  6. package/lib/init.sh +152 -29
  7. package/package.json +2 -2
  8. package/payload/artifact/targets.list +30 -0
  9. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  11. package/payload/canon-kit/README.md +1 -0
  12. package/payload/canon-kit/SPEC.md +279 -24
  13. package/payload/canon-kit/checks/check-comment-tier.sh +7 -2
  14. package/payload/canon-kit/checks/check-docs-link-convention.sh +11 -4
  15. package/payload/canon-kit/checks/check-payload-claim.sh +133 -0
  16. package/payload/canon-kit/checks/check-prose-enum.sh +1 -1
  17. package/payload/canon-kit/checks/check-spec-pointer.sh +9 -2
  18. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  19. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +26 -3
  20. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  21. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  22. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  23. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  24. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  25. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +5 -3
  26. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  27. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  28. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  29. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  30. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  31. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  32. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  33. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  34. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  35. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  36. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  37. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  38. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +24 -1
  39. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
  40. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  41. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  42. package/payload/canon-kit/lib/spec.sh +22 -12
  43. package/payload/canon-kit/smoke/install.sh +20 -1
  44. package/payload/canon-kit/templates/SPEC-amendment.md +5 -1
  45. package/payload/context-kit/SPEC.md +25 -1
  46. package/payload/context-kit/lib/toolfloor.sh +1 -1
  47. package/payload/context-kit/smoke/install.sh +3 -1
  48. package/payload/delegation-kit/SPEC.md +383 -13
  49. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  50. package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -1
  51. package/payload/delegation-kit/lib/delegation.sh +1 -0
  52. package/payload/delegation-kit/smoke/install.sh +2 -1
  53. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  54. package/payload/delegation-kit/templates/agent-execution.md +103 -12
  55. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  56. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  57. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  58. package/payload/doctrine-kit/DOCTRINE.md +27 -0
  59. package/payload/doctrine-kit/README.md +5 -0
  60. package/payload/doctrine-kit/SPEC.md +62 -3
  61. package/payload/doctrine-kit/bin/install-doctrine.sh +84 -4
  62. package/payload/doctrine-kit/smoke/install.sh +77 -1
  63. package/payload/drift-kit/README.md +3 -2
  64. package/payload/drift-kit/SPEC.md +253 -20
  65. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  66. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  67. package/payload/drift-kit/smoke/install.sh +155 -1
  68. package/payload/drift-kit/templates/economics.md +9 -0
  69. package/payload/drift-kit/templates/kpis.list +6 -1
  70. package/payload/evidence-kit/README.md +20 -6
  71. package/payload/evidence-kit/SPEC.md +355 -17
  72. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  73. package/payload/evidence-kit/checks/check-battery-roster.sh +86 -0
  74. package/payload/evidence-kit/checks/check-producer-liveness.sh +34 -0
  75. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  76. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  77. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  78. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  79. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  80. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  81. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  82. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  83. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  84. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  85. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  86. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  87. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  88. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  89. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  90. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  91. package/payload/evidence-kit/lib/evidence.sh +18 -0
  92. package/payload/evidence-kit/smoke/install.sh +17 -3
  93. package/payload/gate-sdk/README.md +4 -1
  94. package/payload/gate-sdk/SPEC.md +1949 -74
  95. package/payload/gate-sdk/bin/gen-pre-commit.sh +12 -2
  96. package/payload/gate-sdk/bin/run-consumer-smoke.sh +121 -1
  97. package/payload/gate-sdk/bin/run-gate-tests.sh +40 -9
  98. package/payload/gate-sdk/bin/run-gates.sh +31 -2
  99. package/payload/gate-sdk/bin/upgrade-smoke.sh +3 -3
  100. package/payload/gate-sdk/checks/check-action-gh-repo.gate +2 -0
  101. package/payload/gate-sdk/checks/check-action-pinning.gate +2 -0
  102. package/payload/gate-sdk/checks/check-action-run-shell.sh +3 -1
  103. package/payload/gate-sdk/checks/check-core-files.sh +27 -4
  104. package/payload/gate-sdk/checks/check-exec-bit.sh +20 -1
  105. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +106 -0
  106. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +6 -7
  107. package/payload/gate-sdk/checks/check-gate-output.sh +9 -1
  108. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +302 -0
  109. package/payload/gate-sdk/checks/check-graph.sh +4 -5
  110. package/payload/gate-sdk/checks/check-readme-roster.sh +5 -0
  111. package/payload/gate-sdk/checks/check-reads-couples.sh +70 -21
  112. package/payload/gate-sdk/checks/check-template-registry-parity.sh +81 -0
  113. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  114. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  115. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  116. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  117. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  118. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  119. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  120. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  121. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  122. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  123. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  124. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  125. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  126. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  127. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  128. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  129. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  130. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  131. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  132. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  133. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  134. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  135. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  136. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  137. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  138. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  139. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  140. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  141. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  142. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  143. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  144. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  145. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  146. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  147. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  148. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  149. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  150. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  151. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  152. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  153. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  154. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  155. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  156. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  157. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  158. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  159. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  160. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  161. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  162. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  163. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  164. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  165. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +123 -0
  166. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  167. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  168. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  169. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  170. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  171. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  172. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  173. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  174. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  175. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  176. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  177. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  178. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  179. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  180. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  181. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  182. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +41 -1
  183. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  184. package/payload/gate-sdk/lib/consumer-smoke.sh +26 -1
  185. package/payload/gate-sdk/lib/gate.sh +75 -0
  186. package/payload/gate-sdk/lib/inject.sh +21 -1
  187. package/payload/gate-sdk/smoke/install.sh +19 -1
  188. package/payload/guard-kit/README.md +4 -3
  189. package/payload/guard-kit/SPEC.md +88 -10
  190. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  191. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  192. package/payload/guard-kit/lib/guard.sh +1 -0
  193. package/payload/guard-kit/templates/close-triage.md +35 -7
  194. package/payload/guard-kit/templates/guard-config.sh +3 -0
  195. package/payload/lifecycle-kit/README.md +1 -0
  196. package/payload/lifecycle-kit/SPEC.md +575 -29
  197. package/payload/lifecycle-kit/bin/enter-stage.sh +13 -3
  198. package/payload/lifecycle-kit/bin/file-gap.sh +42 -1
  199. package/payload/lifecycle-kit/bin/file-survey.sh +50 -0
  200. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +1 -1
  201. package/payload/lifecycle-kit/checks/check-skill-binding.sh +1 -1
  202. package/payload/lifecycle-kit/checks/check-survey-record.sh +102 -0
  203. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  204. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  205. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +1 -0
  206. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  207. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  208. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  209. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  210. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  211. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  212. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +84 -0
  213. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +94 -0
  214. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  215. package/payload/lifecycle-kit/lib/stages.sh +8 -2
  216. package/payload/lifecycle-kit/smoke/install.sh +17 -1
  217. package/payload/lifecycle-kit/templates/consult.md +73 -0
  218. package/payload/lifecycle-kit/templates/lead.md +103 -7
  219. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  220. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  221. package/payload/lifecycle-kit/templates/stages/close.md +25 -4
  222. package/payload/lifecycle-kit/templates/stages/scope.md +34 -0
  223. package/payload/lifecycle-kit/templates/stages/spec.md +8 -0
  224. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  225. package/payload/queue-kit/README.md +4 -1
  226. package/payload/queue-kit/SPEC.md +230 -6
  227. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  228. package/payload/queue-kit/checks/check-queue-entry-budget.sh +5 -3
  229. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  230. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  231. package/payload/queue-kit/smoke/install.sh +4 -1
  232. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  233. package/payload/site-kit/SPEC.md +41 -27
  234. package/payload/site-kit/smoke/install.sh +9 -1
  235. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  236. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
@@ -46,13 +46,38 @@ grep -q '^--- Lag' <<<"$out" || fail "missing Lag section header"
46
46
  grep -q 'Read trend across sessions' <<<"$out" || fail "missing footer"
47
47
 
48
48
  total_rows="$(awk '/^--- Lead/{f=1} /^Read trend/{f=0} f && /^ [^ ]/{c++} END{print c+0}' <<<"$out")"
49
- [[ "$total_rows" -eq "$registered" ]] || fail "expected one row per registered KPI ($registered), got $total_rows"
49
+ [[ "$total_rows" -ge "$registered" ]] || fail "expected at least one row per registered KPI ($registered), got $total_rows"
50
50
 
51
51
  grep -q 'kpi-does-not-exist.*n/a' <<<"$out" || fail "missing plugin did not yield a visible n/a row"
52
52
 
53
53
  awk '/^--- Lag/{f=1;next} /^Read trend/{f=0} f' <<<"$out" | grep -q 'knowledge friction.*n/a' \
54
54
  || fail "kpi-knowledge-friction did not render an n/a row under the Lag section (log absent in the throwaway consumer)"
55
55
 
56
+ # spec: drift-kit/SPEC.md §Testing — the per-plugin contribution probe: the report masks a silent
57
+ # plugin with its own 'n/a (plugin failed)' row, so the floor above cannot see one; a name
58
+ # resolving to no plugin is skipped.
59
+ plugin() {
60
+ DRIFT_KIT_KPIS_FILE="$work/kpis.list" \
61
+ DRIFT_KIT_QUEUE_FILE="$work/TASK-QUEUE.md" \
62
+ DRIFT_KIT_TMP_DIR="$work" \
63
+ DRIFT_KIT_TIMINGS_FILE="$work/no-such-timings.txt" \
64
+ bash "$1"
65
+ }
66
+
67
+ probed=0
68
+ while IFS= read -r kname; do
69
+ [[ -n "$kname" ]] || continue
70
+ kpath="$SMOKE_KIT_ROOT/kpis/$kname.sh"
71
+ [[ -f "$kpath" ]] || continue
72
+ set +e
73
+ pout="$(plugin "$kpath")"; prc=$?
74
+ set -e
75
+ [[ "$prc" -eq 0 ]] || fail "$kname exited $prc standalone — the report would mask it as 'n/a (plugin failed)'"
76
+ [[ -n "$pout" ]] || fail "$kname emitted no row standalone — the report would mask it as 'n/a (plugin failed)', so the row-count floor cannot see it"
77
+ probed=$((probed + 1))
78
+ done < <(grep -Ev '^[[:space:]]*(#|$)' "$work/kpis.list")
79
+ [[ "$probed" -gt 0 ]] || fail "no registered name resolved to a bundled plugin — the per-plugin probe asserted nothing"
80
+
56
81
  set +e
57
82
  trend="$(report --trend)"; trc=$?
58
83
  set -e
@@ -202,6 +227,38 @@ ptmiss="$(ptkpi "$work/no-such-price-table.tsv")"
202
227
  [[ "$(grep -c '^lead' <<<"$ptmiss")" -eq 1 ]] || fail "with no table the KPI emits one row, not an expiry row for a table that is not there: $ptmiss"
203
228
  grep -q 'n/a (no price table)' <<<"$ptmiss" || fail "absent price table must degrade fail-visibly: $ptmiss"
204
229
 
230
+ # spec: drift-kit/SPEC.md §Testing — kpi-incident-recurrence over purpose-built queues:
231
+ # the sum across declarations, the highest-count slug, the trend fragment, and the two
232
+ # degradations. Fixture-stable, like kpi-price-table-age: it reads a file the fixture writes.
233
+ irkpi() { DRIFT_KIT_QUEUE_FILE="$1" bash "$SMOKE_KIT_ROOT/kpis/kpi-incident-recurrence.sh" "${2:-}"; }
234
+
235
+ ir_q="$work/recurrence-queue.md"
236
+ cat > "$ir_q" <<'EOF'
237
+ # TASK-QUEUE.md
238
+ ## Iteration: smoke
239
+ ## Deferred
240
+ - **thrice** [design-pending] — a finding re-filed three times.
241
+ recurrence: thrice 2026-08-01 2026-08-02 2026-08-04
242
+ - **once** [design-pending] — a finding re-filed once.
243
+ recurrence: once 2026-08-04
244
+ ## Done
245
+ EOF
246
+ set +e
247
+ irout="$(irkpi "$ir_q")"; irrc=$?
248
+ set -e
249
+ [[ "$irrc" -eq 0 ]] || fail "kpi-incident-recurrence exited $irrc (advisory plugins always exit 0)"
250
+ [[ "$(grep -c '^lag' <<<"$irout")" -eq 1 ]] || fail "kpi-incident-recurrence must emit exactly one lag row: $irout"
251
+ grep -q '4 re-filing(s) recorded' <<<"$irout" || fail "the count must sum dates across every declaration, not count declarations: $irout"
252
+ grep -q 'highest thrice at 3' <<<"$irout" || fail "the highest-count slug row is missing or wrong: $irout"
253
+ [[ "$(irkpi "$ir_q" --trend)" == 'recur 4' ]] || fail "kpi-incident-recurrence --trend not 'recur 4': $(irkpi "$ir_q" --trend)"
254
+
255
+ irnone="$(irkpi "$work/TASK-QUEUE.md")"
256
+ grep -q 'n/a (no recurrence declaration in the queue)' <<<"$irnone" \
257
+ || fail "a queue with no declaration must degrade fail-visibly rather than reporting 0: $irnone"
258
+ [[ -z "$(irkpi "$work/TASK-QUEUE.md" --trend)" ]] || fail "--trend must emit nothing when no declaration exists"
259
+ grep -q 'n/a (no queue file)' <<<"$(irkpi "$work/no-such-queue.md")" \
260
+ || fail "an absent queue file must degrade fail-visibly"
261
+
205
262
  # spec: drift-kit/SPEC.md §Testing — the stage-economics join over a synthetic fixture set:
206
263
  # a WORKFLOW-STATE stamp file, a transcript whose basename normalizes to the stamped
207
264
  # session8, and a placeholder price table. Known tokens in, known trend line out.
@@ -345,4 +402,101 @@ EOF
345
402
  || fail "a stamp naming the label did not raise the collision notice"
346
403
  [[ "$(grep -c ' supiter supervision ' "$suplog")" -eq 0 ]] \
347
404
  || fail "the collision did not suppress the supervision row"
405
+
406
+ # spec: drift-kit/SPEC.md §Testing — the fan-out fixture: a three-level tree flat in one subagents dir,
407
+ # whose grandchild is what makes the walk testable. Its own dir/state/log, same reason as above.
408
+ fodir="$work/fo-sessions"; mkdir -p "$fodir/folead0001dead/subagents"
409
+ fosub="$fodir/folead0001dead/subagents"
410
+ cat > "$fodir/folead0001dead.jsonl" <<'EOF'
411
+ {"type":"assistant","message":{"id":"L1","model":"test-model","usage":{"input_tokens":2,"output_tokens":3,"cache_read_input_tokens":4,"cache_creation_input_tokens":5}}}
412
+ EOF
413
+ cat > "$fosub/agent-fostage1feed.jsonl" <<'EOF'
414
+ {"type":"assistant","message":{"id":"S1","model":"test-model","usage":{"input_tokens":10,"output_tokens":20,"cache_read_input_tokens":30,"cache_creation_input_tokens":40}}}
415
+ EOF
416
+ cat > "$fosub/agent-fochild2feed.jsonl" <<'EOF'
417
+ {"type":"assistant","message":{"id":"C1","model":"test-model","usage":{"input_tokens":1,"output_tokens":2,"cache_read_input_tokens":3,"cache_creation_input_tokens":4}}}
418
+ EOF
419
+ cat > "$fosub/agent-fogrand3feed.jsonl" <<'EOF'
420
+ {"type":"assistant","message":{"id":"G1","model":"test-model","usage":{"input_tokens":100,"output_tokens":200,"cache_read_input_tokens":300,"cache_creation_input_tokens":400}}}
421
+ EOF
422
+ # spec: drift-kit/SPEC.md §Testing — the fixture's second same-stage session: no usage of its own, so
423
+ # it anchors without emitting a row and its child must fold rather than replace the first anchor's.
424
+ printf '{"type":"user","message":{"role":"user","content":"no usage here"}}\n' > "$fosub/agent-fostage4feed.jsonl"
425
+ cat > "$fosub/agent-fochild5feed.jsonl" <<'EOF'
426
+ {"type":"assistant","message":{"id":"C5","model":"test-model","usage":{"input_tokens":1000,"output_tokens":2000,"cache_read_input_tokens":3000,"cache_creation_input_tokens":4000}}}
427
+ EOF
428
+ printf '{"agentType":"stage-session","spawnDepth":1}\n' > "$fosub/agent-fostage1feed.meta.json"
429
+ printf '{"agentType":"Explore","parentAgentId":"fostage1feed","spawnDepth":2}\n' > "$fosub/agent-fochild2feed.meta.json"
430
+ printf '{"agentType":"fork","isFork":true,"parentAgentId":"fochild2feed","spawnDepth":3}\n' > "$fosub/agent-fogrand3feed.meta.json"
431
+ printf '{"agentType":"stage-session","spawnDepth":1}\n' > "$fosub/agent-fostage4feed.meta.json"
432
+ printf '{"agentType":"Explore","parentAgentId":"fostage4feed","spawnDepth":2}\n' > "$fosub/agent-fochild5feed.meta.json"
433
+ printf 'foiter build fostage1 2025-01-01\nfoiter build fostage4 2025-01-01\n' > "$work/fo-state.txt"
434
+ folog="$work/fo-log.txt"
435
+ fan() { # $1 = fan-out suffix
436
+ DRIFT_KIT_STATE_FILE="$work/fo-state.txt" \
437
+ DRIFT_KIT_SESSIONS_DIR="$fodir" \
438
+ DRIFT_KIT_PRICE_TABLE="$work/se-prices.tsv" \
439
+ DRIFT_KIT_STAGE_ECONOMICS_LOG="$folog" \
440
+ DRIFT_KIT_FANOUT_SUFFIX="$1" \
441
+ bash "$SMOKE_KIT_ROOT/bin/stage-economics.sh" 2>&1
442
+ }
443
+ set +e
444
+ foout="$(fan '+fanout')"; forc=$?
445
+ set -e
446
+ [[ "$forc" -eq 0 ]] || fail "stage-economics over the fan-out fixture exited $forc"
447
+ [[ "$(grep -c ' foiter build+fanout test-model ' "$folog")" -eq 1 ]] \
448
+ || fail "the three-level fixture did not yield exactly one fan-out row: $foout"
449
+ grep -qE ' foiter build\+fanout test-model in=1101 out=2202 cr=3303 cw=4404 cost=33030\.[0-9]+$' "$folog" \
450
+ || fail "the fan-out row is not the sum over the whole subtree — a walk that stopped at depth 2, or two anchors racing under the dedup key instead of folding: $(cat "$folog")"
451
+ grep -q ' foiter build+fanout 2 anchors ' <<<"$foout" \
452
+ || fail "two anchors sharing one (iteration, stage) did not fold into one row: $foout"
453
+ grep -qE ' foiter build test-model in=10 out=20 cr=30 cw=40 cost=300\.[0-9]+$' "$folog" \
454
+ || fail "the stage row lost its own usage to the subtree (the fold this row exists to refuse): $(cat "$folog")"
455
+ grep -q 'resolved no anchor' <<<"$foout" \
456
+ && fail "an intact meta layer must resolve every dispatched transcript: $foout"
457
+ grep -q 'match no stamp and resolved no anchor' <<<"$foout" \
458
+ && fail "the unstamped bound still counts transcripts the fan-out pass attributed: $foout"
459
+
460
+ : > "$folog"
461
+ fan '-subtree' >/dev/null
462
+ grep -q ' foiter build-subtree test-model ' "$folog" \
463
+ || fail "DRIFT_KIT_FANOUT_SUFFIX did not name the row (the suffix is not a literal)"
464
+
465
+ : > "$folog"
466
+ printf 'foiter build fostage1 2025-01-01\nfoiter build fostage4 2025-01-01\nfoiter build+fanout nostage1 2025-01-01\n' > "$work/fo-state.txt"
467
+ focol="$(fan '+fanout')"
468
+ grep -q 'colliding with DRIFT_KIT_FANOUT_SUFFIX' <<<"$focol" \
469
+ || fail "a stamp whose stage ends in the suffix did not raise the collision notice"
470
+ [[ "$(grep -c 'build+fanout test-model' "$folog")" -eq 0 ]] \
471
+ || fail "the collision did not suppress the fan-out row"
472
+ printf 'foiter build fostage1 2025-01-01\nfoiter build fostage4 2025-01-01\n' > "$work/fo-state.txt"
473
+
474
+ # spec: drift-kit/SPEC.md §Testing — the fan-out fixture's two degradation assertions, neither of
475
+ # which may be dropped for brevity: they are what make the coupling's bound testable, not asserted.
476
+ : > "$folog"; fan '+fanout' >/dev/null
477
+ grep -v 'build+fanout' "$folog" | sort > "$work/fo-intact.txt"
478
+ rm -f "$fosub/agent-fogrand3feed.meta.json"
479
+ : > "$folog"
480
+ fodeg="$(fan '+fanout')"
481
+ grep -q '1 dispatched transcript(s) resolved no anchor' <<<"$fodeg" \
482
+ || fail "a missing meta record must raise the counted unresolved notice: $fodeg"
483
+ grep -q '1 transcript(s) in the sessions dir match no stamp and resolved no anchor' <<<"$fodeg" \
484
+ || fail "an unresolved transcript must fall back into the unstamped bound: $fodeg"
485
+ grep -qE ' foiter build\+fanout test-model in=1001 out=2002 cr=3003 cw=4004 ' "$folog" \
486
+ || fail "the degraded run must still price every resolvable transcript, never guess the unresolved one: $(cat "$folog")"
487
+ grep -v 'build+fanout' "$folog" | sort > "$work/fo-degraded.txt"
488
+ diff -q "$work/fo-intact.txt" "$work/fo-degraded.txt" >/dev/null \
489
+ || fail "a degraded fan-out pass changed a row it does not own: $(diff "$work/fo-intact.txt" "$work/fo-degraded.txt")"
490
+
491
+ # spec: drift-kit/SPEC.md §Testing — the second arm: the whole meta layer gone.
492
+ rm -f "$fosub"/*.meta.json
493
+ : > "$folog"
494
+ fonone="$(fan '+fanout')"
495
+ grep -q 'no dispatch-attribution records beside the transcripts' <<<"$fonone" \
496
+ || fail "an absent meta layer must emit its single notice: $fonone"
497
+ [[ "$(grep -c 'build+fanout' "$folog")" -eq 0 ]] \
498
+ || fail "an absent meta layer must emit no fan-out row at all"
499
+ sort "$folog" > "$work/fo-nometa.txt"
500
+ diff -q "$work/fo-intact.txt" "$work/fo-nometa.txt" >/dev/null \
501
+ || fail "losing the meta layer changed a row it does not own: $(diff "$work/fo-intact.txt" "$work/fo-nometa.txt")"
348
502
  fi
@@ -31,6 +31,15 @@ Compose the narrative from those two surfaces:
31
31
  bullets — never folded into them — and say plainly that per-stage figures
32
32
  exclude it. If the run's caveat named an apportionment key (one lead spanning
33
33
  several iterations), repeat the key so the reader can discount the row.
34
+ - **Fan-out.** A stage that dispatched agents pays for their whole subtree, and
35
+ that subtree bills to its own suffixed row rather than into the stage's own
36
+ (drift-kit/SPEC.md §The stage-economics meter, the fan-out row). Report it as a
37
+ named line item beside that stage's figure — never folded into it — and say
38
+ plainly that a per-stage figure excludes its own fan-out. Where the run's notice
39
+ named an apportionment key or a count of transcripts that resolved no anchor,
40
+ repeat it so the reader can discount the row. Read the row as an **aggregate**:
41
+ it carries no dispatch-type dimension, so a fork's spend and a typed dispatch's
42
+ spend are one total in it — do not report it as the cost of forking.
34
43
  - **Overhead share.** From the overhead meter, state what fraction of the
35
44
  closing session was governance versus task work — the methodology's own cost.
36
45
  - **Posture verdict.** Weigh *<posture: the model posture this iteration ran —
@@ -15,8 +15,13 @@ kpi-settings-local
15
15
  kpi-gate-runtime
16
16
  kpi-overhead
17
17
  kpi-price-table-age
18
+ kpi-queue-net-delta
18
19
 
19
20
  # Lag — weighted low; undercounts by construction. kpi-knowledge-friction reads
20
21
  # drift-kit's knowledge-friction loop (its capture convention + close triage); it
21
- # shows n/a until the log exists. A consumer with a structured lag source adds its own.
22
+ # shows n/a until the log exists. kpi-incident-recurrence reads the queue's
23
+ # recurrence: declarations (queue-kit's grammar, stamped by close's gap-inbox
24
+ # drain); it shows n/a until one exists.
25
+ # A consumer with a structured lag source adds its own.
22
26
  kpi-knowledge-friction
27
+ kpi-incident-recurrence
@@ -7,11 +7,13 @@ contract (`# contract: evidence-manifest v1`) an external verifier can consume,
7
7
  so the kit is adoptable with or without an iteration lifecycle.
8
8
 
9
9
  The gates: `check-evidence-baseline` (baseline grammar, blocking-slug liveness,
10
- scenario coverage) and `check-evidence-manifest` (manifest grammar and, where
11
- lifecycle drives the tree, close-entry green block + validate-stamp coupling).
12
- The `bin/` tools that drive it: `run-validate.sh` (the codified spine that runs
13
- the suites and records evidence) and `diff-baseline.sh` (the situational runtime
14
- diff). See [SPEC.md](SPEC.md) for the full contracts.
10
+ scenario coverage), `check-evidence-manifest` (manifest grammar and, where
11
+ lifecycle drives the tree, close-entry green block + validate-stamp coupling),
12
+ `check-battery-roster` (the runner doc's battery block against the suite roster)
13
+ and `check-producer-liveness` (no stage entry while the producer is still
14
+ running). The `bin/` tools that drive it: `run-validate.sh` (the codified spine
15
+ that runs the suites and records evidence) and `diff-baseline.sh` (the
16
+ situational runtime diff). See [SPEC.md](SPEC.md) for the full contracts.
15
17
 
16
18
  ## Install
17
19
 
@@ -23,6 +25,8 @@ Vendor the kit beside [gate-sdk](../gate-sdk/) (required), then:
23
25
  ```
24
26
  check-evidence-baseline
25
27
  check-evidence-manifest
28
+ check-battery-roster
29
+ check-producer-liveness # entry hook only — never gates.list, see step 6
26
30
  ```
27
31
  <!-- gate-roster:end -->
28
32
 
@@ -46,12 +50,22 @@ Vendor the kit beside [gate-sdk](../gate-sdk/) (required), then:
46
50
  `libtest` for per-test result logs, or your own log-parsing command).
47
51
 
48
52
  4. Record evidence at validate — run `bash evidence-kit/bin/run-validate.sh`; it
49
- runs each suite, diffs the baseline, and appends one evidence line per suite.
53
+ runs each suite, diffs the baseline, and records one evidence line per suite —
54
+ written to the manifest in a single fold once the whole roster has run, so a
55
+ suite needing a clean worktree may sit anywhere in it.
50
56
 
51
57
  5. Optional lifecycle integration — set `LIFECYCLE_KIT_BOUNDARY_TRUNCATE` to the
52
58
  evidence manifest so a new iteration starts from the contract header, and the
53
59
  manifest gate's close-entry and stamp-coupling assertions arm automatically.
54
60
 
61
+ 6. Wire `check-producer-liveness` on `LIFECYCLE_KIT_ENTRY_PREFLIGHT` rather than
62
+ in `gates.list`, its command naming the lock file
63
+ (`<stage>=evidence-kit/checks/check-producer-liveness.sh <lock-file>`),
64
+ at whichever stage entries must not begin while `run-validate`
65
+ is still running. It asks whether a producer is in flight, not whether the
66
+ tree is consistent, so a battery that `run-validate` itself invokes would red
67
+ every run against that run's own lock. See SPEC.md §check-producer-liveness.
68
+
55
69
  ## Test
56
70
 
57
71
  ```bash