@aviaratech/ai-delivery 0.3.34 → 0.3.36

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 (301) hide show
  1. package/CONTRIBUTING.md +12 -206
  2. package/README.md +57 -506
  3. package/dist/agent.d.ts +0 -2
  4. package/dist/agent.js +76 -16
  5. package/dist/agent.js.map +7 -1
  6. package/dist/agentReadiness.test.js +73 -67
  7. package/dist/agentReadiness.test.js.map +7 -1
  8. package/dist/boardReconcile.test.js +1746 -0
  9. package/dist/boardReconcile.test.js.map +7 -0
  10. package/dist/build.test.js +130 -0
  11. package/dist/build.test.js.map +7 -0
  12. package/dist/callerErrors.test.js +105 -0
  13. package/dist/callerErrors.test.js.map +7 -0
  14. package/dist/cli.js +406 -485
  15. package/dist/cli.js.map +7 -1
  16. package/dist/cliResult.d.ts +2 -2
  17. package/dist/cliResult.js +42 -25
  18. package/dist/cliResult.js.map +7 -1
  19. package/dist/cliResult.test.js +434 -297
  20. package/dist/cliResult.test.js.map +7 -1
  21. package/dist/config/deliveryConfig.d.ts +320 -14
  22. package/dist/config/deliveryConfig.js +472 -385
  23. package/dist/config/deliveryConfig.js.map +7 -1
  24. package/dist/config/deliveryConfig.test.js +775 -584
  25. package/dist/config/deliveryConfig.test.js.map +7 -1
  26. package/dist/contributorChecks.test.js +1694 -916
  27. package/dist/contributorChecks.test.js.map +7 -1
  28. package/dist/currentConsumer.test.js +819 -737
  29. package/dist/currentConsumer.test.js.map +7 -1
  30. package/dist/currentTrackingScenario.test.js +499 -477
  31. package/dist/currentTrackingScenario.test.js.map +7 -1
  32. package/dist/delivery/common.js +160 -172
  33. package/dist/delivery/common.js.map +7 -1
  34. package/dist/delivery/delivery.test.js +509 -431
  35. package/dist/delivery/delivery.test.js.map +7 -1
  36. package/dist/delivery/evidence.d.ts +2 -2
  37. package/dist/delivery/evidence.js +133 -120
  38. package/dist/delivery/evidence.js.map +7 -1
  39. package/dist/delivery/index.js +7 -2
  40. package/dist/delivery/index.js.map +7 -1
  41. package/dist/delivery/legacy.js +65 -5
  42. package/dist/delivery/legacy.js.map +7 -1
  43. package/dist/delivery/policy.d.ts +10 -10
  44. package/dist/delivery/policy.js +211 -238
  45. package/dist/delivery/policy.js.map +7 -1
  46. package/dist/delivery/stage.d.ts +18 -18
  47. package/dist/delivery/stage.js +220 -235
  48. package/dist/delivery/stage.js.map +7 -1
  49. package/dist/deliveryBoard.d.ts +74 -0
  50. package/dist/deliveryBoard.js +644 -0
  51. package/dist/deliveryBoard.js.map +7 -0
  52. package/dist/deliveryBoard.test.d.ts +1 -0
  53. package/dist/deliveryBoard.test.js +649 -0
  54. package/dist/deliveryBoard.test.js.map +7 -0
  55. package/dist/deliveryHealth.test.js +179 -155
  56. package/dist/deliveryHealth.test.js.map +7 -1
  57. package/dist/dependencyCompatibility.test.js +154 -140
  58. package/dist/dependencyCompatibility.test.js.map +7 -1
  59. package/dist/directoryIndependent.test.js +417 -383
  60. package/dist/directoryIndependent.test.js.map +7 -1
  61. package/dist/dispatch.d.ts +17 -12
  62. package/dist/dispatch.js +330 -322
  63. package/dist/dispatch.js.map +7 -1
  64. package/dist/errors.d.ts +16 -3
  65. package/dist/errors.js +104 -82
  66. package/dist/errors.js.map +7 -1
  67. package/dist/fixtures/deliveryBoardReplay.d.ts +56 -0
  68. package/dist/fixtures/deliveryBoardReplay.js +617 -0
  69. package/dist/fixtures/deliveryBoardReplay.js.map +7 -0
  70. package/dist/fixtures/discovery.d.ts +59 -19
  71. package/dist/fixtures/discovery.js +96 -90
  72. package/dist/fixtures/discovery.js.map +7 -1
  73. package/dist/fixtures/inertEntrypointChild.js +57 -56
  74. package/dist/fixtures/inertEntrypointChild.js.map +7 -1
  75. package/dist/fixtures/inertEntrypoints.d.ts +1 -1
  76. package/dist/fixtures/inertEntrypoints.js +321 -276
  77. package/dist/fixtures/inertEntrypoints.js.map +7 -1
  78. package/dist/fixtures/inertTarget.d.ts +78 -7
  79. package/dist/fixtures/inertTarget.js +769 -691
  80. package/dist/fixtures/inertTarget.js.map +7 -1
  81. package/dist/fixtures/issue63.d.ts +4 -3
  82. package/dist/fixtures/issue63.js +260 -274
  83. package/dist/fixtures/issue63.js.map +7 -1
  84. package/dist/fixtures/issueProjectItems.d.ts +20 -0
  85. package/dist/fixtures/issueProjectItems.js +15 -0
  86. package/dist/fixtures/issueProjectItems.js.map +7 -0
  87. package/dist/fixtures/readView.d.ts +120 -0
  88. package/dist/fixtures/readView.js +172 -0
  89. package/dist/fixtures/readView.js.map +7 -0
  90. package/dist/fixtures/recordedGitHubFlows.d.ts +120 -0
  91. package/dist/fixtures/recordedGitHubFlows.js +109 -0
  92. package/dist/fixtures/recordedGitHubFlows.js.map +7 -0
  93. package/dist/genericCompatibility.test.js +64 -55
  94. package/dist/genericCompatibility.test.js.map +7 -1
  95. package/dist/git.js +73 -67
  96. package/dist/git.js.map +7 -1
  97. package/dist/gitProcess.d.ts +1 -1
  98. package/dist/gitProcess.js +58 -53
  99. package/dist/gitProcess.js.map +7 -1
  100. package/dist/github/client.d.ts +2 -2
  101. package/dist/github/client.js +484 -379
  102. package/dist/github/client.js.map +7 -1
  103. package/dist/github/commandIdentityPolicy.js +44 -51
  104. package/dist/github/commandIdentityPolicy.js.map +7 -1
  105. package/dist/github/discovery.d.ts +3 -0
  106. package/dist/github/discovery.js +197 -201
  107. package/dist/github/discovery.js.map +7 -1
  108. package/dist/github/discovery.test.js +223 -177
  109. package/dist/github/discovery.test.js.map +7 -1
  110. package/dist/github/issueHistory.d.ts +2 -2
  111. package/dist/github/issueHistory.js +117 -125
  112. package/dist/github/issueHistory.js.map +7 -1
  113. package/dist/github/machineAuth.d.ts +1 -1
  114. package/dist/github/machineAuth.js +126 -117
  115. package/dist/github/machineAuth.js.map +7 -1
  116. package/dist/github/machineAuth.test.js +755 -639
  117. package/dist/github/machineAuth.test.js.map +7 -1
  118. package/dist/github/nativeIssueMetadata.js +286 -273
  119. package/dist/github/nativeIssueMetadata.js.map +7 -1
  120. package/dist/github/projectDelivery.d.ts +53 -1
  121. package/dist/github/projectDelivery.js +623 -460
  122. package/dist/github/projectDelivery.js.map +7 -1
  123. package/dist/github/relationships.d.ts +5 -2
  124. package/dist/github/relationships.js +434 -333
  125. package/dist/github/relationships.js.map +7 -1
  126. package/dist/github/repo.d.ts +1 -0
  127. package/dist/github/repo.js +123 -96
  128. package/dist/github/repo.js.map +7 -1
  129. package/dist/index.js +3 -3
  130. package/dist/index.js.map +7 -1
  131. package/dist/issue.d.ts +103 -7
  132. package/dist/issue.js +2104 -1547
  133. package/dist/issue.js.map +7 -1
  134. package/dist/issue63History.test.js +40 -42
  135. package/dist/issue63History.test.js.map +7 -1
  136. package/dist/issue63Routes.test.js +154 -143
  137. package/dist/issue63Routes.test.js.map +7 -1
  138. package/dist/issueBatchUpdate.test.js +1004 -683
  139. package/dist/issueBatchUpdate.test.js.map +7 -1
  140. package/dist/issueBlockerGuard.test.js +262 -226
  141. package/dist/issueBlockerGuard.test.js.map +7 -1
  142. package/dist/issueContract.d.ts +23 -4
  143. package/dist/issueContract.js +416 -395
  144. package/dist/issueContract.js.map +7 -1
  145. package/dist/issueContract.test.d.ts +4 -3
  146. package/dist/issueContract.test.js +358 -321
  147. package/dist/issueContract.test.js.map +7 -1
  148. package/dist/issueDates.test.js +235 -233
  149. package/dist/issueDates.test.js.map +7 -1
  150. package/dist/issueInfoReadback.test.js +304 -190
  151. package/dist/issueInfoReadback.test.js.map +7 -1
  152. package/dist/issueIntake.test.js +1945 -1732
  153. package/dist/issueIntake.test.js.map +7 -1
  154. package/dist/issueJournal.d.ts +40 -19
  155. package/dist/issueJournal.js +229 -138
  156. package/dist/issueJournal.js.map +7 -1
  157. package/dist/issueJournal.test.js +605 -422
  158. package/dist/issueJournal.test.js.map +7 -1
  159. package/dist/issueRollup.test.d.ts +1 -0
  160. package/dist/issueRollup.test.js +476 -0
  161. package/dist/issueRollup.test.js.map +7 -0
  162. package/dist/issueTracking.test.js +1088 -593
  163. package/dist/issueTracking.test.js.map +7 -1
  164. package/dist/issueWriteRecovery.test.d.ts +1 -0
  165. package/dist/issueWriteRecovery.test.js +260 -0
  166. package/dist/issueWriteRecovery.test.js.map +7 -0
  167. package/dist/lifecycle.test.js +112 -441
  168. package/dist/lifecycle.test.js.map +7 -1
  169. package/dist/logger.js +80 -74
  170. package/dist/logger.js.map +7 -1
  171. package/dist/mcp/index.js +116 -90
  172. package/dist/mcp/index.js.map +7 -1
  173. package/dist/mcp/tools.d.ts +790 -220
  174. package/dist/mcp/tools.js +267 -333
  175. package/dist/mcp/tools.js.map +7 -1
  176. package/dist/pluginAuthProbe.js +63 -52
  177. package/dist/pluginAuthProbe.js.map +7 -1
  178. package/dist/pluginAuthProbe.test.js +85 -62
  179. package/dist/pluginAuthProbe.test.js.map +7 -1
  180. package/dist/pluginCredentials.test.js +282 -259
  181. package/dist/pluginCredentials.test.js.map +7 -1
  182. package/dist/pluginDoctor.test.js +653 -588
  183. package/dist/pluginDoctor.test.js.map +7 -1
  184. package/dist/pluginInstaller.d.ts +7 -5
  185. package/dist/pluginInstaller.js +1173 -1231
  186. package/dist/pluginInstaller.js.map +7 -1
  187. package/dist/pluginInstaller.test.js +1822 -1283
  188. package/dist/pluginInstaller.test.js.map +7 -1
  189. package/dist/pluginPackaging.test.js +485 -305
  190. package/dist/pluginPackaging.test.js.map +7 -1
  191. package/dist/pr.d.ts +132 -94
  192. package/dist/pr.js +1521 -1323
  193. package/dist/pr.js.map +7 -1
  194. package/dist/pr.test.js +1678 -632
  195. package/dist/pr.test.js.map +7 -1
  196. package/dist/prAssociation.test.js +2419 -1788
  197. package/dist/prAssociation.test.js.map +7 -1
  198. package/dist/prDispatch.test.js +150 -89
  199. package/dist/prDispatch.test.js.map +7 -1
  200. package/dist/readView.d.ts +183 -0
  201. package/dist/readView.js +217 -0
  202. package/dist/readView.js.map +7 -0
  203. package/dist/readView.test.d.ts +1 -0
  204. package/dist/readView.test.js +119 -0
  205. package/dist/readView.test.js.map +7 -0
  206. package/dist/releaseReconciliation.test.js +267 -288
  207. package/dist/releaseReconciliation.test.js.map +7 -1
  208. package/dist/releaseWorkflow.test.js +2493 -422
  209. package/dist/releaseWorkflow.test.js.map +7 -1
  210. package/dist/review.d.ts +738 -2
  211. package/dist/review.js +601 -348
  212. package/dist/review.js.map +7 -1
  213. package/dist/review.test.js +1218 -812
  214. package/dist/review.test.js.map +7 -1
  215. package/dist/reviewSubmit.test.d.ts +1 -0
  216. package/dist/reviewSubmit.test.js +747 -0
  217. package/dist/reviewSubmit.test.js.map +7 -0
  218. package/dist/services/agentReadinessService.js +42 -37
  219. package/dist/services/agentReadinessService.js.map +7 -1
  220. package/dist/services/blockerGuardService.js +188 -188
  221. package/dist/services/blockerGuardService.js.map +7 -1
  222. package/dist/services/boardReconcileService.d.ts +1204 -0
  223. package/dist/services/boardReconcileService.js +1445 -0
  224. package/dist/services/boardReconcileService.js.map +7 -0
  225. package/dist/services/deliveryAdmission.d.ts +2 -0
  226. package/dist/services/deliveryAdmission.js +129 -152
  227. package/dist/services/deliveryAdmission.js.map +7 -1
  228. package/dist/services/deliveryHealthService.js +197 -199
  229. package/dist/services/deliveryHealthService.js.map +7 -1
  230. package/dist/services/legacyIssueMigration.js +263 -277
  231. package/dist/services/legacyIssueMigration.js.map +7 -1
  232. package/dist/services/worktreeRegistry.d.ts +27 -119
  233. package/dist/services/worktreeRegistry.js +765 -1182
  234. package/dist/services/worktreeRegistry.js.map +7 -1
  235. package/dist/stagedChecks.test.js +396 -194
  236. package/dist/stagedChecks.test.js.map +7 -1
  237. package/dist/start.test.js +99 -95
  238. package/dist/start.test.js.map +7 -1
  239. package/dist/stdoutRegression.test.js +354 -350
  240. package/dist/stdoutRegression.test.js.map +7 -1
  241. package/dist/targetPolicyDiscovery.test.js +141 -143
  242. package/dist/targetPolicyDiscovery.test.js.map +7 -1
  243. package/dist/targetPolicyEntrypoints.test.js +308 -269
  244. package/dist/targetPolicyEntrypoints.test.js.map +7 -1
  245. package/dist/targetPolicyLocal.test.js +580 -1051
  246. package/dist/targetPolicyLocal.test.js.map +7 -1
  247. package/dist/targetPolicyRoutes.test.js +305 -281
  248. package/dist/targetPolicyRoutes.test.js.map +7 -1
  249. package/dist/targetRepositoryExecution.test.d.ts +1 -0
  250. package/dist/targetRepositoryExecution.test.js +463 -0
  251. package/dist/targetRepositoryExecution.test.js.map +7 -0
  252. package/dist/terminalMessages.js +41 -35
  253. package/dist/terminalMessages.js.map +7 -1
  254. package/dist/toolOutput.d.ts +2 -0
  255. package/dist/toolOutput.js +36 -0
  256. package/dist/toolOutput.js.map +7 -0
  257. package/dist/toolOutput.test.d.ts +1 -0
  258. package/dist/toolOutput.test.js +240 -0
  259. package/dist/toolOutput.test.js.map +7 -0
  260. package/dist/utils/atomicJson.js +84 -76
  261. package/dist/utils/atomicJson.js.map +7 -1
  262. package/dist/utils/filesystem.js +15 -18
  263. package/dist/utils/filesystem.js.map +7 -1
  264. package/dist/utils/lockfile.js +68 -71
  265. package/dist/utils/lockfile.js.map +7 -1
  266. package/dist/verification.d.ts +1 -19
  267. package/dist/verification.js +1020 -1929
  268. package/dist/verification.js.map +7 -1
  269. package/dist/verificationGate.test.js +127 -117
  270. package/dist/verificationGate.test.js.map +7 -1
  271. package/dist/version.d.ts +6 -0
  272. package/dist/version.js +24 -10
  273. package/dist/version.js.map +7 -1
  274. package/dist/worktree.d.ts +3 -15
  275. package/dist/worktree.js +97 -177
  276. package/dist/worktree.js.map +7 -1
  277. package/package.json +10 -8
  278. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  279. package/plugins/ai-delivery/README.md +47 -156
  280. package/plugins/ai-delivery/plugin.json +1 -1
  281. package/plugins/ai-delivery/runtime/dist/THIRD-PARTY-NOTICES.md +261 -43
  282. package/plugins/ai-delivery/runtime/dist/cli.js +369 -125
  283. package/plugins/ai-delivery/runtime/package.json +1 -1
  284. package/plugins/ai-delivery/skills/intake-create/SKILL.md +14 -78
  285. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +35 -36
  286. package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +14 -15
  287. package/dist/investigationCompletion.test.js +0 -728
  288. package/dist/investigationCompletion.test.js.map +0 -1
  289. package/dist/setup.d.ts +0 -60
  290. package/dist/setup.js +0 -585
  291. package/dist/setup.js.map +0 -1
  292. package/dist/setup.test.js +0 -3058
  293. package/dist/setup.test.js.map +0 -1
  294. package/dist/worktreeTransition.d.ts +0 -211
  295. package/dist/worktreeTransition.js +0 -1037
  296. package/dist/worktreeTransition.js.map +0 -1
  297. package/dist/worktreeTransition.test.js +0 -1191
  298. package/dist/worktreeTransition.test.js.map +0 -1
  299. /package/dist/{investigationCompletion.test.d.ts → boardReconcile.test.d.ts} +0 -0
  300. /package/dist/{setup.test.d.ts → build.test.d.ts} +0 -0
  301. /package/dist/{worktreeTransition.test.d.ts → callerErrors.test.d.ts} +0 -0
package/CONTRIBUTING.md CHANGED
@@ -1,224 +1,30 @@
1
1
  # Contributing to ai-delivery
2
2
 
3
- Use an isolated checkout and controller Node **24.21.0** with npm **11.19.0**.
4
- Node **26.2.0** is a separate public-library consumer prerequisite, not a
5
- CLI/controller replacement. Provision with your existing runtime manager and
6
- read back the actual executables (tool installation is a separate action):
3
+ Use an isolated worktree and follow [repository policy](AGENTS.md) and existing host permissions. Tool installation, hook setup and host activation require separate authorization.
4
+
5
+ The controller requires Node **24.21.0** and npm **11.19.0**. Node **26.2.0** is a distinct public-library consumer prerequisite. With both runtimes already installed:
7
6
 
8
7
  ```sh
9
8
  nvm use 26.2.0
10
9
  export AI_DELIVERY_NODE26_EXECUTABLE="$(node -p 'process.execPath')"
11
10
  nvm use 24.21.0
12
- node -p 'JSON.stringify({version:process.version,execPath:process.execPath})'
11
+ node --version
13
12
  npm --version
14
- "$AI_DELIVERY_NODE26_EXECUTABLE" -p 'JSON.stringify({version:process.version,execPath:process.execPath})'
13
+ "$AI_DELIVERY_NODE26_EXECUTABLE" --version
14
+ # Explicit dependency setup, when missing or incompatible:
15
15
  npm ci --ignore-scripts --no-audit --no-fund
16
- npm run checks
17
16
  ```
18
17
 
19
- The runner fails before gates for missing, wrong or inaccessible prerequisites.
20
- It resolves existing temporary-directory aliases to their physical paths so
21
- macOS synthetic fixtures do not mistake `/var` or `/tmp` aliases for managed
22
- plugin symlinks; this creates no new destination or host setting.
23
- Local and CI full entry `npm run checks` runs `scripts/current-qualification.mjs`:
24
- the canonical six-gate producer, one actual scripts-disabled pack, then an owned,
25
- credential-free production-only consumer installation of that exact archive.
26
- The producer in `scripts/checks.mjs` runs formatting, native type-aware lint,
27
- strict TypeScript, a **clean single build**, all intended compiled Vitest files
28
- with one worker, and complete dry inventory validation. The immutable
29
- `contributor-checks@1` snapshot records those six gates; its `fullSuccess` means
30
- producer success. Overall `ai-delivery.current-qualification@1` requires the
31
- exact archive, resolved production closure, installed byte/mode checks, CLI,
32
- exports, packaged stdio MCP schemas, skills, actual Node26 library use, and owned
33
- quiescent removal. Its `qualified: true` and exit 0 are full contributor proof.
34
- A producer pass alone reports `artifactQualified: false`.
35
- Source names, compiled names and actual Vitest selection must agree;
36
- deleted/renamed tests cannot survive in stale `dist`. Actual artifact qualification
37
- requires a clean committed source including untracked files. Results must be
38
- outside the checkout. CI retains required jobs `checks` and `secrets` and uploads
39
- partial/final evidence, immutable producer logs, and the actual archive.
40
-
41
- A serial artifact handoff uses `npm run checks:producer -- --results-dir
42
- /an/owned/new/result-directory`. It runs the producer and actual pack once,
43
- retains `contract.json` and `checkpoint.json`, and returns exit **2** with overall
44
- `incomplete` and the consumer omissions. Resume without rebuilding or repacking:
45
-
46
- ```sh
47
- npm run checks:resume -- --resume /owned/original/checkpoint.json --results-dir /owned/new/resume-results
48
- ```
49
-
50
- Resume revalidates clean HEAD/tree, source fingerprint, manifest/lock, all archive
51
- bytes/modes against member SHA256s captured inside the successful producer,
52
- immutable producer digest, six gates, counts, reviewed skips and
53
- pack quiescence before installation and again before completion. A changed or
54
- incomplete checkpoint fails. Consumer launch is supervised and reserves one
55
- checkpoint-wide `consumer-attempt.json` before starting a child. It retains the
56
- command, observed PID/birth identities, logs and owned temporary root during
57
- execution. An unresolved attempt blocks another install even with fresh overall
58
- results storage. After controller loss, `--reconcile-consumer` joins an already
59
- qualified retained receipt only after every observed identity is absent; it
60
- does not launch or kill a process. Missing launch identity, incomplete receipts,
61
- active processes or leftover temporary contents require owner reconciliation.
62
- A completed retained consumer is reused without installation. For an admitted
63
- separate consumer owner, prefer the supervised resume entry. If its independently
64
- supervised invocation retains equivalent launch and cleanup proof, invoke
65
- `node scripts/current-consumer.mjs /owned/original/contract.json
66
- /owned/consumer-result.json --authorize-install` once, then join its retained
67
- result with the same resume command plus `--consumer-result
68
- /owned/consumer-result.json`. That join performs no install, build or pack.
69
- Without `--authorize-install` the helper returns incomplete/exit 2; it cannot
70
- complete overall checks. Immutable receipts are referenced by SHA256 in the
71
- overall result, never inserted back into the producer hash. Do not rerun a
72
- successful producer or pack merely to report or join evidence. Each invocation
73
- needs fresh owned output storage; preserve uncertain/interrupted receipts.
74
-
75
- `npm run checks:fast` runs only format/lint/types. It reports `partial-passed`,
76
- `fullSuccess: false` and omitted build/tests/inventory. `npm test` is a separate
77
- development command, not full-check proof. Every check run prints its results
78
- directory and keeps `result.json`, `result.txt`, per-command logs, toolchain/tree,
79
- selected file/test counts, skips, start/final exit, signals and partial state.
80
- Raw test observations survive a failing command and remain distinct from the
81
- validated proof required for full success.
82
- Select owned storage outside the checkout with `npm run checks -- --results-dir
83
- /an/owned/new/result-directory`. Existing results are never overwritten by a
84
- retry. A lost response or missing CI artifact means completion is **unknown**:
85
- inspect the original result and PID/birth records, prove owned quiescence, then
86
- start a fresh attempt. Abrupt process/service loss can prevent final transport.
18
+ Missing or incompatible prerequisites stop checks; the runner never installs dependencies implicitly.
87
19
 
88
- The reviewed `SKIP_ALLOWLIST` names only two top-level skips. The setup
89
- interruption helper requires passing recovery parents and its receipt; their
90
- launch is distinct from its top-level skip. Absent
91
- `AI_DELIVERY_REAL_PACKAGE_ARCHIVE` (an explicitly supplied path is forwarded
92
- and must not silently become an absent-input skip), the historical reviewed 0.3.4 archive
93
- qualification remains **unexecuted**. That skip, checkout-sharing consumer tests
94
- and dry inventory are not current production-only tarball or native adoption
95
- proof. The reviewed current-tarball consumer is joined by the maintained full entry;
96
- its installation proof remains distinct from the producer and historical archive. Unexpected skips,
97
- exclusions, unknown statuses, missing proof and zero tests fail full checks.
98
-
99
- Built-in Node/V8 coverage collects executed **observed V8 ranges** in compiled
100
- library/contributor scripts without a new dependency; it is not TypeScript
101
- source line/branch coverage. Startup collection measures compiled library files,
102
- `scripts/build-plugin.mjs`, and native invocations of the two runners by synthetic
103
- Git hooks. The runners' counters measure those native fixture paths; the main
104
- canonical controller and Vitest-transformed imports are not instrumented. Each
105
- result explicitly lists scripts without any raw measurement as unmeasured,
106
- with no derived floors. For measured files, review staged floors five percentage
107
- points below their first baseline using the same Node/V8 graph before
108
- enforcement; retain these instrumentation limits when assessing those floors.
109
- No arbitrary global 100% threshold or metric-only tests are required.
110
-
111
- There is no local total wall-clock deadline. Set an explicit operator-requested
112
- per-command budget with `--command-timeout-ms <milliseconds>` (default 0,
113
- disabled). A timeout is separate from source assertion failure. Cancellation
114
- stops identity-checked owned descendants (including observed separate sessions),
115
- continues discovery from those descendants after the root exits, then uses a
116
- three-second TERM grace before identity-checked KILL and up to one second to
117
- confirm quiescence. Unconfirmed cleanup stays explicit.
118
- Logs are limited to 32 MiB per command and process RSS is sampled against 3 GiB,
119
- not a hard ceiling or model-service measurement. PID/birth observation must work
120
- before launch. CI keeps its existing 15-minute service job limit; interruption
121
- or failed artifact transport requires reconciliation, not a blind retry.
122
-
123
- The optional tracked hook is `scripts/pre-commit.mjs`. It copies the index into
124
- an owned temporary directory, honoring `GIT_INDEX_FILE` (including temporary
125
- indexes supplied by `git commit -a` and path-limited commits), computes the exact staged tree with private
126
- objects, materializes that tree, provisions from its staged lock and invokes
127
- its **staged** six-gate canonical producer. The snapshot hook reports actual
128
- archive/clean-HEAD consumer omissions and `artifactQualified: false`; it does not
129
- install or force an uncommitted index through clean-source qualification. It does not stash, write the original index or
130
- unstaged files, or borrow checkout node_modules. It checks the source index for
131
- drift and removes only its owned snapshot after quiescence; results survive.
132
- Unmerged/submodule/symlink index entries fail explicitly. Opt-in installation
133
- in your own checkout only, after inspecting and preserving any existing hook:
20
+ Run fast checks with an explicit selection for the changed contracts and fresh owned results outside the checkout:
134
21
 
135
22
  ```sh
136
- # Do not run on an operator host without explicit operator approval.
137
- hook_path="$(git rev-parse --git-path hooks/pre-commit)"
138
- test ! -e "$hook_path"
139
- printf '%s\n' '#!/bin/sh' 'exec node scripts/pre-commit.mjs' > "$hook_path"
140
- chmod +x "$hook_path"
23
+ npm run checks:fast -- --test-file dist/contributorChecks.test.js --test-file dist/stagedChecks.test.js --results-dir /owned/new/local-results
141
24
  ```
142
25
 
143
- The hook needs the pinned controller/npm PATH and exported actual Node26 path.
144
- Synthetic fixtures prove partial staging, additions, deletions and lockfile
145
- isolation without operator hook installation. Command environments are
146
- allowlisted: credential references, NODE_PATH and ambient NODE_OPTIONS are not
147
- forwarded. Synthetic tests do not mutate live issues. Review the complete
148
- retained inventory; never commit credentials, host configuration, receipts,
149
- logs or repository-specific policy. The separate TruffleHog job scans changed
150
- Git history without release credentials.
151
-
152
- The `Publish npm package` workflow is manual, runs only from `main`, and uses
153
- the `npm-publish` environment. Before enabling it, the repository owner must:
154
-
155
- 1. Confirm the confidentiality review covers the exact source ref and built
156
- archive. Confirm the MIT license and the exact package repository URL.
157
- 2. Protect `main` with counted independent pull request approval, stale-review
158
- dismissal, strict required `checks` and `secrets` jobs, administrator
159
- enforcement and no force pushes or deletion. Restrict `npm-publish`
160
- deployments to the `main` branch. Once the exact guarded workflow and
161
- environment transition have independent acceptance, the repository owner
162
- may remove the environment's repeated human reviewer requirement under
163
- explicit release authority. Preserve all other protection rules and the npm
164
- trusted-publisher binding; diagnose unexpected settings before changing them.
165
- 3. For a new npm package name, have the package owner establish it with a
166
- separately authorized and reviewed initial version before configuring
167
- trusted publishing. npm cannot bind a trusted publisher before the package
168
- exists. Use the protected OIDC workflow for subsequent releases; do not add
169
- npm credentials to Actions or substitute a token-based workflow.
170
- 4. Register `@aviaratech/ai-delivery` with npm trusted publishing for GitHub
171
- organization `aviaratech`, repository `ai-delivery`, workflow filename
172
- `release.yml`, and environment name `npm-publish`. Enable direct `npm publish`
173
- for that trusted publisher. The npm environment restriction must match the
174
- protected GitHub environment in the workflow.
175
- 5. Independently review the exact protected `main` source head, stable package
176
- version, actual built archive, complete inventory and confidentiality scan.
177
- Dispatch the workflow on `main` with `reviewed_source_sha`, `package_version`
178
- and `archive_sha256` from that accepted candidate. Missing or mismatched
179
- inputs fail closed. The package job checks, scans and retains its qualified archive without OIDC
180
- permission; only the publish job receives `id-token: write`. The package job
181
- runs full checks once with results outside the checkout, then
182
- `scripts/release-artifact.mjs select` validates the successful source-bound
183
- producer/pack/consumer joins and owned cleanup before copying that exact
184
- archive and original receipt bytes into the uploaded artifact. It performs
185
- no subsequent build or production pack. Missing, incomplete or mismatched
186
- receipts fail before upload. The publish job checks the portable receipt and
187
- downloaded archive against the accepted source/version/digest, compares an inert repack
188
- byte for byte, and rejects observed protected-main or required-check drift
189
- before passing the verified tarball path directly to `npm publish` through the
190
- existing trusted publisher. The inert repack is a byte comparison only;
191
- its output never becomes the upload or publication source. Receipt hashes
192
- preserve evidence integrity; reviewed workflow source and its actual execution
193
- remain necessary provenance. Inputs are passed
194
- as environment values, never interpolated into shell commands.
195
-
196
- Release dispatch remains an explicit action by the authorized delivery owner;
197
- it does not run on every commit or need a scheduler. Runs serialize through the
198
- `npm-publish` concurrency group. The workflow publishes only an unused stable
199
- version newer than registry `latest`. An occupied version is accepted only when
200
- its actual archive bytes, integrity, provenance metadata and `latest` tag match
201
- the reviewed candidate; it never republishes or retags that version. Registry
202
- errors and conflicting occupied versions fail closed.
203
-
204
- npm provenance is generated automatically by trusted publishing only when both
205
- repository and package are public. A release has not occurred merely because
206
- the workflow exists; verify actual registry archive bytes and cryptographic
207
- provenance against the accepted source and artifact after the job finishes. The
208
- workflow checks registry bytes, integrity, provenance metadata and `latest`
209
- after publication, including a failed or ambiguous publish command, and never
210
- automatically retries publication. Read the registry before any explicit retry.
211
- Metadata presence alone does not verify a provenance signature or source identity.
26
+ Choose files deliberately. Add `--build-plugin` only when selected contracts require the bundle. Real-install/archive cases belong to qualification. Do not run the full local suite per change. See [runner options](scripts/checks.mjs) and the [optional staged hook](scripts/pre-commit.mjs).
212
27
 
213
- Expected version/archive 404s, missing provenance metadata or package-index entries,
214
- and a lagging stable `latest` tag receive paced read-only reconciliation for up to
215
- five minutes inside the existing ten-minute publish job. Requests retain a
216
- 30-second limit, shortened to the remaining reconciliation allowance, with bounded
217
- response bodies and pending-state output. Conflicting evidence, a newer `latest`
218
- tag and authentication/service errors fail immediately. Exhausted reconciliation
219
- or an ambiguous publish result requires read-only qualification of the original
220
- invocation; it never triggers another publication or retag.
28
+ Existing [GitHub CI](.github/workflows/ci.yml) runs `npm run checks`. Merge requires current independent review and green required `checks`/`secrets` on the candidate and current base; local results cannot replace them. Inspect retained results and prove owned quiescence before retrying uncertain operations.
221
29
 
222
- Any packaged-file edit, including this guide, changes the release candidate.
223
- Preserve previously accepted archives as evidence and independently qualify a
224
- new exact source/archive before dispatching; never substitute it silently.
30
+ Fast/focused success never qualifies a package. [Qualification](scripts/current-qualification.mjs) and [publication](.github/workflows/release.yml) are separate, explicitly authorized stages. Publication consumes independently accepted source/version/archive and the original successful artifact. Preserve confidentiality, archive, cleanup and host-policy gates; never substitute later reruns or silently replace accepted archives. Any packaged-file edit, including this guide, changes the candidate and requires independent qualification before release.