persona-harness 0.7.0 → 0.8.0-beta.2

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 (263) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.ja.md +2 -2
  3. package/README.ko.md +2 -2
  4. package/README.md +32 -4
  5. package/README.zh-cn.md +2 -2
  6. package/dist/cli/authority-artifact-store.d.ts +20 -0
  7. package/dist/cli/authority-artifact-store.js +176 -0
  8. package/dist/cli/authority-artifact-store.js.map +1 -0
  9. package/dist/cli/authority-command-surface.d.ts +27 -0
  10. package/dist/cli/authority-command-surface.js +109 -0
  11. package/dist/cli/authority-command-surface.js.map +1 -0
  12. package/dist/cli/authority-command.d.ts +18 -0
  13. package/dist/cli/authority-command.js +138 -0
  14. package/dist/cli/authority-command.js.map +1 -0
  15. package/dist/cli/authority-enrollment-schema.d.ts +41 -0
  16. package/dist/cli/authority-enrollment-schema.js +176 -0
  17. package/dist/cli/authority-enrollment-schema.js.map +1 -0
  18. package/dist/cli/authority-enrollment.d.ts +20 -0
  19. package/dist/cli/authority-enrollment.js +115 -0
  20. package/dist/cli/authority-enrollment.js.map +1 -0
  21. package/dist/cli/authority-fetch-worker.d.ts +8 -0
  22. package/dist/cli/authority-fetch-worker.js +83 -0
  23. package/dist/cli/authority-fetch-worker.js.map +1 -0
  24. package/dist/cli/authority-github-readback-worker.d.ts +2 -0
  25. package/dist/cli/authority-github-readback-worker.js +47 -0
  26. package/dist/cli/authority-github-readback-worker.js.map +1 -0
  27. package/dist/cli/authority-github-token.d.ts +3 -0
  28. package/dist/cli/authority-github-token.js +8 -0
  29. package/dist/cli/authority-github-token.js.map +1 -0
  30. package/dist/cli/authority-project-attestation.d.ts +14 -0
  31. package/dist/cli/authority-project-attestation.js +38 -0
  32. package/dist/cli/authority-project-attestation.js.map +1 -0
  33. package/dist/cli/bootstrap-code-nav.d.ts +2 -1
  34. package/dist/cli/bootstrap-code-nav.js +19 -10
  35. package/dist/cli/bootstrap-code-nav.js.map +1 -1
  36. package/dist/cli/bootstrap-codegraph.d.ts +2 -0
  37. package/dist/cli/bootstrap-codegraph.js +18 -9
  38. package/dist/cli/bootstrap-codegraph.js.map +1 -1
  39. package/dist/cli/bootstrap-lsp.d.ts +2 -1
  40. package/dist/cli/bootstrap-lsp.js +19 -10
  41. package/dist/cli/bootstrap-lsp.js.map +1 -1
  42. package/dist/cli/bootstrap-multi-agent.d.ts +2 -1
  43. package/dist/cli/bootstrap-multi-agent.js +25 -17
  44. package/dist/cli/bootstrap-multi-agent.js.map +1 -1
  45. package/dist/cli/bootstrap-strict.d.ts +3 -2
  46. package/dist/cli/bootstrap-strict.js +18 -10
  47. package/dist/cli/bootstrap-strict.js.map +1 -1
  48. package/dist/cli/bootstrap.d.ts +1 -0
  49. package/dist/cli/bootstrap.js +261 -134
  50. package/dist/cli/bootstrap.js.map +1 -1
  51. package/dist/cli/cli-usage.js +4 -0
  52. package/dist/cli/cli-usage.js.map +1 -1
  53. package/dist/cli/cooperative-finish-authority.d.ts +23 -0
  54. package/dist/cli/cooperative-finish-authority.js +73 -0
  55. package/dist/cli/cooperative-finish-authority.js.map +1 -0
  56. package/dist/cli/cooperative-finish-context.d.ts +15 -0
  57. package/dist/cli/cooperative-finish-context.js +26 -0
  58. package/dist/cli/cooperative-finish-context.js.map +1 -0
  59. package/dist/cli/cooperative-gradle-verification.d.ts +35 -0
  60. package/dist/cli/cooperative-gradle-verification.js +206 -0
  61. package/dist/cli/cooperative-gradle-verification.js.map +1 -0
  62. package/dist/cli/cooperative-junit.d.ts +12 -0
  63. package/dist/cli/cooperative-junit.js +276 -0
  64. package/dist/cli/cooperative-junit.js.map +1 -0
  65. package/dist/cli/doctor-inspection.d.ts +16 -0
  66. package/dist/cli/doctor-inspection.js +148 -0
  67. package/dist/cli/doctor-inspection.js.map +1 -0
  68. package/dist/cli/doctor-output.d.ts +3 -0
  69. package/dist/cli/doctor-output.js +158 -0
  70. package/dist/cli/doctor-output.js.map +1 -0
  71. package/dist/cli/doctor-registry-readback.d.ts +13 -0
  72. package/dist/cli/doctor-registry-readback.js +60 -0
  73. package/dist/cli/doctor-registry-readback.js.map +1 -0
  74. package/dist/cli/doctor-registry.d.ts +25 -18
  75. package/dist/cli/doctor-registry.js +157 -68
  76. package/dist/cli/doctor-registry.js.map +1 -1
  77. package/dist/cli/doctor-types.d.ts +72 -0
  78. package/dist/cli/doctor-types.js +2 -0
  79. package/dist/cli/doctor-types.js.map +1 -0
  80. package/dist/cli/doctor.d.ts +4 -54
  81. package/dist/cli/doctor.js +38 -235
  82. package/dist/cli/doctor.js.map +1 -1
  83. package/dist/cli/index.d.ts +2 -0
  84. package/dist/cli/index.js +67 -6
  85. package/dist/cli/index.js.map +1 -1
  86. package/dist/cli/init-transaction.d.ts +2 -0
  87. package/dist/cli/init-transaction.js +9 -5
  88. package/dist/cli/init-transaction.js.map +1 -1
  89. package/dist/cli/init.d.ts +6 -0
  90. package/dist/cli/init.js +63 -1
  91. package/dist/cli/init.js.map +1 -1
  92. package/dist/cli/intake.d.ts +2 -0
  93. package/dist/cli/intake.js +15 -6
  94. package/dist/cli/intake.js.map +1 -1
  95. package/dist/cli/plan-command.js +15 -7
  96. package/dist/cli/plan-command.js.map +1 -1
  97. package/dist/cli/plan-status.js +18 -2
  98. package/dist/cli/plan-status.js.map +1 -1
  99. package/dist/cli/plan.d.ts +3 -0
  100. package/dist/cli/plan.js +46 -31
  101. package/dist/cli/plan.js.map +1 -1
  102. package/dist/cli/policy.d.ts +2 -0
  103. package/dist/cli/policy.js +7 -3
  104. package/dist/cli/policy.js.map +1 -1
  105. package/dist/cli/project-finish-attestation-assessment.d.ts +11 -0
  106. package/dist/cli/project-finish-attestation-assessment.js +75 -0
  107. package/dist/cli/project-finish-attestation-assessment.js.map +1 -0
  108. package/dist/cli/project-finish-attestation-canonical.d.ts +2 -0
  109. package/dist/cli/project-finish-attestation-canonical.js +8 -0
  110. package/dist/cli/project-finish-attestation-canonical.js.map +1 -0
  111. package/dist/cli/project-finish-attestation-evidence.d.ts +8 -0
  112. package/dist/cli/project-finish-attestation-evidence.js +94 -0
  113. package/dist/cli/project-finish-attestation-evidence.js.map +1 -0
  114. package/dist/cli/project-finish-attestation-inputs.d.ts +15 -0
  115. package/dist/cli/project-finish-attestation-inputs.js +148 -0
  116. package/dist/cli/project-finish-attestation-inputs.js.map +1 -0
  117. package/dist/cli/project-finish-attestation-parser.d.ts +2 -0
  118. package/dist/cli/project-finish-attestation-parser.js +96 -0
  119. package/dist/cli/project-finish-attestation-parser.js.map +1 -0
  120. package/dist/cli/project-finish-attestation-policy.d.ts +6 -0
  121. package/dist/cli/project-finish-attestation-policy.js +66 -0
  122. package/dist/cli/project-finish-attestation-policy.js.map +1 -0
  123. package/dist/cli/project-finish-attestation-producer-runner.d.ts +32 -0
  124. package/dist/cli/project-finish-attestation-producer-runner.js +59 -0
  125. package/dist/cli/project-finish-attestation-producer-runner.js.map +1 -0
  126. package/dist/cli/project-finish-attestation-producer.d.ts +26 -0
  127. package/dist/cli/project-finish-attestation-producer.js +95 -0
  128. package/dist/cli/project-finish-attestation-producer.js.map +1 -0
  129. package/dist/cli/project-finish-attestation-receipt-context.d.ts +10 -0
  130. package/dist/cli/project-finish-attestation-receipt-context.js +148 -0
  131. package/dist/cli/project-finish-attestation-receipt-context.js.map +1 -0
  132. package/dist/cli/project-finish-attestation-receipt-execution.d.ts +4 -0
  133. package/dist/cli/project-finish-attestation-receipt-execution.js +87 -0
  134. package/dist/cli/project-finish-attestation-receipt-execution.js.map +1 -0
  135. package/dist/cli/project-finish-attestation-receipt.d.ts +2 -0
  136. package/dist/cli/project-finish-attestation-receipt.js +72 -0
  137. package/dist/cli/project-finish-attestation-receipt.js.map +1 -0
  138. package/dist/cli/project-finish-attestation-source.d.ts +2 -0
  139. package/dist/cli/project-finish-attestation-source.js +72 -0
  140. package/dist/cli/project-finish-attestation-source.js.map +1 -0
  141. package/dist/cli/project-finish-attestation-types.d.ts +128 -0
  142. package/dist/cli/project-finish-attestation-types.js +24 -0
  143. package/dist/cli/project-finish-attestation-types.js.map +1 -0
  144. package/dist/cli/project-finish-attestation-verifier-types.d.ts +39 -0
  145. package/dist/cli/project-finish-attestation-verifier-types.js +9 -0
  146. package/dist/cli/project-finish-attestation-verifier-types.js.map +1 -0
  147. package/dist/cli/project-finish-attestation-verifier.d.ts +11 -0
  148. package/dist/cli/project-finish-attestation-verifier.js +131 -0
  149. package/dist/cli/project-finish-attestation-verifier.js.map +1 -0
  150. package/dist/cli/project-finish-attestation-worker.d.ts +3 -0
  151. package/dist/cli/project-finish-attestation-worker.js +124 -0
  152. package/dist/cli/project-finish-attestation-worker.js.map +1 -0
  153. package/dist/cli/project-finish-trust-readiness.d.ts +7 -0
  154. package/dist/cli/project-finish-trust-readiness.js +29 -0
  155. package/dist/cli/project-finish-trust-readiness.js.map +1 -0
  156. package/dist/cli/report-status.d.ts +3 -0
  157. package/dist/cli/report-status.js +45 -1
  158. package/dist/cli/report-status.js.map +1 -1
  159. package/dist/cli/source-identity.js +19 -4
  160. package/dist/cli/source-identity.js.map +1 -1
  161. package/dist/cli/staged-package-verification-installed.js +21 -0
  162. package/dist/cli/staged-package-verification-installed.js.map +1 -1
  163. package/dist/cli/stdin-text.d.ts +11 -0
  164. package/dist/cli/stdin-text.js +14 -0
  165. package/dist/cli/stdin-text.js.map +1 -1
  166. package/dist/cli/workflow-args.d.ts +2 -0
  167. package/dist/cli/workflow-args.js +30 -8
  168. package/dist/cli/workflow-args.js.map +1 -1
  169. package/dist/cli/workflow-closure-finish.js +44 -0
  170. package/dist/cli/workflow-closure-finish.js.map +1 -1
  171. package/dist/cli/workflow-closure-verification.d.ts +1 -2
  172. package/dist/cli/workflow-closure-verification.js +6 -3
  173. package/dist/cli/workflow-closure-verification.js.map +1 -1
  174. package/dist/cli/workflow-closure.d.ts +3 -1
  175. package/dist/cli/workflow-closure.js +69 -70
  176. package/dist/cli/workflow-closure.js.map +1 -1
  177. package/dist/cli/workflow-command.js +3 -3
  178. package/dist/cli/workflow-command.js.map +1 -1
  179. package/dist/cli/workflow-finish-attestation-types.d.ts +3 -2
  180. package/dist/cli/workflow-finish-attestation-worker.js +16 -2
  181. package/dist/cli/workflow-finish-attestation-worker.js.map +1 -1
  182. package/dist/cli/workflow-finish-attestation.js +9 -0
  183. package/dist/cli/workflow-finish-attestation.js.map +1 -1
  184. package/dist/cli/workflow-finish-authority.d.ts +3 -0
  185. package/dist/cli/workflow-finish-authority.js +88 -19
  186. package/dist/cli/workflow-finish-authority.js.map +1 -1
  187. package/dist/cli/workflow-finish-follow-up.js +50 -0
  188. package/dist/cli/workflow-finish-follow-up.js.map +1 -1
  189. package/dist/cli/workflow-finish-runner.d.ts +2 -1
  190. package/dist/cli/workflow-finish-runner.js +21 -1
  191. package/dist/cli/workflow-finish-runner.js.map +1 -1
  192. package/dist/cli/workflow-loop-state.d.ts +4 -3
  193. package/dist/cli/workflow-loop-state.js +52 -26
  194. package/dist/cli/workflow-loop-state.js.map +1 -1
  195. package/dist/cli/workflow-loop.js +2 -1
  196. package/dist/cli/workflow-loop.js.map +1 -1
  197. package/dist/cli/workflow-output.d.ts +1 -1
  198. package/dist/cli/workflow-output.js +7 -2
  199. package/dist/cli/workflow-output.js.map +1 -1
  200. package/dist/cli/workflow-safe-rendering.d.ts +72 -8
  201. package/dist/cli/workflow-safe-rendering.js +59 -0
  202. package/dist/cli/workflow-safe-rendering.js.map +1 -1
  203. package/dist/cli/workflow-status.d.ts +8 -1
  204. package/dist/cli/workflow-status.js +83 -6
  205. package/dist/cli/workflow-status.js.map +1 -1
  206. package/dist/cli/workflow-verification-decision.d.ts +32 -18
  207. package/dist/cli/workflow-verification-decision.js +40 -26
  208. package/dist/cli/workflow-verification-decision.js.map +1 -1
  209. package/dist/config/harness-config.d.ts +3 -2
  210. package/dist/config/harness-config.js +9 -5
  211. package/dist/config/harness-config.js.map +1 -1
  212. package/dist/config/policy-overlay.d.ts +2 -1
  213. package/dist/config/policy-overlay.js +14 -8
  214. package/dist/config/policy-overlay.js.map +1 -1
  215. package/dist/config/project-profile.d.ts +3 -2
  216. package/dist/config/project-profile.js +16 -7
  217. package/dist/config/project-profile.js.map +1 -1
  218. package/dist/io/bootstrap-write-boundary.d.ts +33 -0
  219. package/dist/io/bootstrap-write-boundary.js +780 -0
  220. package/dist/io/bootstrap-write-boundary.js.map +1 -0
  221. package/dist/io/no-follow-file.d.ts +37 -0
  222. package/dist/io/no-follow-file.js +103 -0
  223. package/dist/io/no-follow-file.js.map +1 -0
  224. package/dist/io/workflow-lifecycle-state.d.ts +23 -0
  225. package/dist/io/workflow-lifecycle-state.js +253 -0
  226. package/dist/io/workflow-lifecycle-state.js.map +1 -0
  227. package/dist/runtime/ralph-loop-state.d.ts +4 -3
  228. package/dist/runtime/ralph-loop-state.js +59 -20
  229. package/dist/runtime/ralph-loop-state.js.map +1 -1
  230. package/dist/runtime/workflow-lifecycle-projection.d.ts +58 -0
  231. package/dist/runtime/workflow-lifecycle-projection.js +186 -0
  232. package/dist/runtime/workflow-lifecycle-projection.js.map +1 -0
  233. package/dist/runtime/workflow-report-status.d.ts +9 -3
  234. package/dist/runtime/workflow-report-status.js +68 -36
  235. package/dist/runtime/workflow-report-status.js.map +1 -1
  236. package/docs/START-HERE.md +18 -2
  237. package/docs/current/README.md +53 -25
  238. package/docs/current/canonical-docs-index.md +13 -1
  239. package/docs/current/consumer-authority-v1-decision.md +180 -0
  240. package/docs/current/docs-inventory.md +44 -38
  241. package/docs/current/java-backend-mvp-install-guide.md +1 -1
  242. package/docs/current/release/README.md +44 -11
  243. package/docs/current/release/consumer-authority-beta.md +115 -0
  244. package/docs/current/release/next-version-readiness.md +10 -2
  245. package/docs/current/release/project-finish-attestation-producer.md +326 -0
  246. package/docs/current/release/project-finish-attestation-verifier.md +99 -0
  247. package/docs/current/release/rc-release-readiness-decision.md +5 -0
  248. package/docs/current/release/v0.8.0-beta.1-release-notes.md +44 -0
  249. package/docs/current/release/v0.8.0-beta.2-release-notes.md +63 -0
  250. package/docs/current/workflow-closure-state-machine-design.md +139 -0
  251. package/docs/current/workflow-state-concurrency.md +20 -6
  252. package/docs/releases/package-index.md +2 -0
  253. package/package.json +13 -2
  254. package/scripts/consumer-authority-artifact-archive.mjs +125 -0
  255. package/scripts/consumer-authority-artifact-error.mjs +6 -0
  256. package/scripts/fetch-consumer-authority-artifact.mjs +294 -0
  257. package/scripts/node-runtime-floor.d.mts +8 -0
  258. package/scripts/node-runtime-floor.mjs +27 -0
  259. package/scripts/project-finish-attestation-sigstore-error.d.mts +19 -0
  260. package/scripts/project-finish-attestation-sigstore-error.mjs +71 -0
  261. package/scripts/read-consumer-authority-github.mjs +231 -0
  262. package/scripts/verify-finish-attestation.mjs +15 -4
  263. package/scripts/verify-project-finish-attestation.mjs +146 -0
package/CHANGELOG.md CHANGED
@@ -8,6 +8,28 @@ preparation alone does not establish stable support or channel state.
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## [0.8.0-beta.1] - 2026-07-24
12
+
13
+ - Prepares the immutable Consumer Authority Beta source candidate for a
14
+ staging-only lifecycle. At candidate creation, no `0.8.0-beta.1` package,
15
+ tag, GitHub release, registry channel, or promotion fact is asserted.
16
+ - Adds the packaged public enrollment/fetch/status boundary for original public
17
+ project finish artifacts. It stays user-scoped, fixed-origin, non-consuming,
18
+ and fail-closed; local receipts, copied JSON, and package-release evidence
19
+ cannot supply consumer authority. GitHub credentials authenticate fixed
20
+ public Actions reads only; they are not identity inputs and are never sent to
21
+ artifact-storage redirects.
22
+ - Makes live Sigstore trust availability observable without weakening
23
+ authority: verification now distinguishes bounded DNS, network, trust-root,
24
+ timeout, signature, certificate, transparency, and malformed-bundle states;
25
+ `ph doctor` reports live network/trust-root readiness through a fixed
26
+ whole-worker deadline and a parent-cleaned temporary cache.
27
+ - Requires the eventual manual staging publish to bind an existing immutable
28
+ `v0.8.0-beta.1` tag to the exact protected-main commit, then records bounded
29
+ registry version, gitHead, SHA-1, SRI, SHA-256, and selected-tag readback.
30
+ The sanitized readback is retained with its Actions artifact digest.
31
+ Exact-artifact provenance remains a separate staged producer/audit gate.
32
+
11
33
  ## [0.7.0] - 2026-07-17
12
34
 
13
35
  - Prepares the immutable `0.7.0` stable source candidate. At candidate
package/README.ja.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/persona-harness?color=369eff&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
12
12
  [![npm downloads](https://img.shields.io/npm/dt/persona-harness?color=ff6b35&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
13
- [![node](https://img.shields.io/badge/node-%3E%3D20-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
13
+ [![node](https://img.shields.io/badge/node-%5E20.17.0%20%7C%7C%20%3E%3D22.9.0-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
14
14
  [![License](https://img.shields.io/badge/license-Apache--2.0-white?labelColor=black&style=flat-square)](./LICENSE)
15
15
 
16
16
  [English](README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | [简体中文](README.zh-cn.md)
@@ -50,7 +50,7 @@ AI エージェントが行う Java/Spring バックエンド作業のための
50
50
 
51
51
  ## インストール
52
52
 
53
- Node.js 20+、Java 21+ / Gradle、そしてプロバイダーが設定済みの OpenCode CLI が必要です。
53
+ Node.js ^20.17.0 || >=22.9.0(Node 21 は未対応)、Java 21+ / Gradle、そしてプロバイダーが設定済みの OpenCode CLI が必要です。
54
54
 
55
55
  ```bash
56
56
  # OpenCode
package/README.ko.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/persona-harness?color=369eff&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
12
12
  [![npm downloads](https://img.shields.io/npm/dt/persona-harness?color=ff6b35&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
13
- [![node](https://img.shields.io/badge/node-%3E%3D20-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
13
+ [![node](https://img.shields.io/badge/node-%5E20.17.0%20%7C%7C%20%3E%3D22.9.0-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
14
14
  [![License](https://img.shields.io/badge/license-Apache--2.0-white?labelColor=black&style=flat-square)](./LICENSE)
15
15
 
16
16
  [English](README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | [简体中文](README.zh-cn.md)
@@ -50,7 +50,7 @@ AI 에이전트가 수행하는 Java/Spring 백엔드 작업을 위한 workflow
50
50
 
51
51
  ## 설치
52
52
 
53
- Node.js 20+, Java 21+ / Gradle, 그리고 프로바이더가 설정된 OpenCode CLI가 필요합니다.
53
+ Node.js ^20.17.0 || >=22.9.0 (Node 21은 지원하지 않음), Java 21+ / Gradle, 그리고 프로바이더가 설정된 OpenCode CLI가 필요합니다.
54
54
 
55
55
  ```bash
56
56
  # OpenCode
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/persona-harness?color=369eff&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
12
12
  [![npm downloads](https://img.shields.io/npm/dt/persona-harness?color=ff6b35&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
13
- [![node](https://img.shields.io/badge/node-%3E%3D20-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
13
+ [![node](https://img.shields.io/badge/node-%5E20.17.0%20%7C%7C%20%3E%3D22.9.0-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
14
14
  [![License](https://img.shields.io/badge/license-Apache--2.0-white?labelColor=black&style=flat-square)](./LICENSE)
15
15
 
16
16
  [English](README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | [简体中文](README.zh-cn.md)
@@ -58,7 +58,7 @@ earned by measurement first — see [MEASURED-CLAIMS](docs/MEASURED-CLAIMS.md).
58
58
 
59
59
  ## Install
60
60
 
61
- Requires Node.js 20+, Java 21+ / Gradle, and the OpenCode CLI with a configured provider.
61
+ Requires Node.js ^20.17.0 || >=22.9.0 (Node 21 is unsupported), Java 21+ / Gradle, and the OpenCode CLI with a configured provider.
62
62
 
63
63
  ```bash
64
64
  # OpenCode
@@ -137,6 +137,7 @@ npx ph workflow check | implement | finish implement | archive <ticket-id>
137
137
  npx ph workflow split README.md && npx ph workflow next # multi-ticket
138
138
  npx ph bearshell --shell 'gradle test' # bounded execution
139
139
  npx ph evidence summary | metrics --json | ab-report --json | pminus-report --json
140
+ npx ph authority status | enroll github <owner/repository> --workflow <path> | fetch github [owner/repository]
140
141
  npx ph review backend-shape
141
142
  ```
142
143
 
@@ -151,13 +152,40 @@ do not change the P0-3 root CLI discovery contract.
151
152
 
152
153
  ## Platform And Host Support
153
154
 
155
+ ### Node runtime floor
156
+
157
+ The packaged CLI and its product-owned Sigstore authority verifiers require
158
+ Node.js ^20.17.0 || >=22.9.0. `ph doctor` reports this range without reflecting
159
+ unsafe runtime input; a lower or malformed runtime blocks CLI authority work
160
+ before verification. Repository source tests use a stricter Vite toolchain
161
+ floor (Node 20.19.0 or Node 22.12.0+), which is distinct from the published
162
+ package engine.
163
+
164
+ On a supported runtime, `ph doctor` makes fixed, read-only npm registry
165
+ readbacks for this installed package version's deprecation field and the
166
+ `latest`, `next`, `staging`, and legacy (`legacy`/`alpha`) channels. Missing,
167
+ malformed, oversized, or unsafe registry data becomes a bounded diagnostic.
168
+ Registry channels never grant Finish authority. External assurance readiness is
169
+ a separate non-consuming inspection and does not move registry or trust state.
170
+ For a public enrolled project, `ph authority enroll github ...` requires an
171
+ interactive confirmation, and `ph authority fetch github` retrieves only a
172
+ matching original public artifact through fixed GitHub policy. Set `GH_TOKEN`
173
+ or `GITHUB_TOKEN` to a credential with Actions read access; the credential
174
+ authenticates fixed GitHub API requests only and cannot supply repository,
175
+ workflow, source, digest, or redirect identity. When more than one repository
176
+ is enrolled, pass the selected enrolled `owner/repository` to `fetch github`.
177
+ Neither command publishes a package, moves a channel, or consumes Finish
178
+ authority.
179
+
154
180
  | Surface | Status | Evidence boundary |
155
181
  | --- | --- | --- |
156
- | Linux + OpenCode | Supported matrix | Node 20, 22, and 24 each run source-built checks plus a fresh local-tarball installed black-box check. |
157
- | macOS + OpenCode | Limited smoke | macOS Node 22 smoke only; this is not a promise of macOS Node 20/24 coverage. |
182
+ | Linux + OpenCode | Product: Node ^20.17.0 || >=22.9.0; source checks: Node 20.19.0 | Required Verify repository runs Linux Node 20.19.0 source-built, packed-tarball, and fresh local-tarball installed checks on pull requests and main pushes. The dispatch-only support matrix retains exact product-floor Linux Node 20.17.0 and 22.9.0 imports plus latest Linux Node 20, 22, and 24 on demand. |
183
+ | macOS + OpenCode | Manual limited smoke | The dispatch-only support matrix retains macOS Node 22 smoke only; this is not a promise of macOS Node 20/24 coverage. |
158
184
  | Windows | Unverified / nonblocking | No Windows matrix job or support claim. Lock identity device/inode behavior and stale-lock/concurrency conclusions are not measured or verified. |
159
185
  | Codex adapter | Planned | No current Codex adapter or Codex product evidence; this is a planned adapter only. |
160
186
 
187
+ Automatic CI boundary: Verify repository is the required Linux Node 20.19.0 PR/main gate. The dispatch-only support matrix is deferred multi-runtime evidence, not a required PR/main gate. It is distinct from the canonical clean-CI builder's main-push signed evidence and the ordinary path-filtered diagnostic selftest.
188
+
161
189
  ## Boundaries & safety
162
190
 
163
191
  Evidence answers one bounded question — *"What did this PH workflow observe for
package/README.zh-cn.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/persona-harness?color=369eff&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
12
12
  [![npm downloads](https://img.shields.io/npm/dt/persona-harness?color=ff6b35&labelColor=black&style=flat-square)](https://www.npmjs.com/package/persona-harness)
13
- [![node](https://img.shields.io/badge/node-%3E%3D20-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
13
+ [![node](https://img.shields.io/badge/node-%5E20.17.0%20%7C%7C%20%3E%3D22.9.0-c4f042?labelColor=black&style=flat-square)](https://nodejs.org)
14
14
  [![License](https://img.shields.io/badge/license-Apache--2.0-white?labelColor=black&style=flat-square)](./LICENSE)
15
15
 
16
16
  [English](README.md) | [한국어](README.ko.md) | [日本語](README.ja.md) | [简体中文](README.zh-cn.md)
@@ -50,7 +50,7 @@
50
50
 
51
51
  ## 安装
52
52
 
53
- 需要 Node.js 20+、Java 21+ / Gradle,以及已配置供应商的 OpenCode CLI。
53
+ 需要 Node.js ^20.17.0 || >=22.9.0(不支持 Node 21)、Java 21+ / Gradle,以及已配置供应商的 OpenCode CLI。
54
54
 
55
55
  ```bash
56
56
  # OpenCode
@@ -0,0 +1,20 @@
1
+ import { type AuthorityEnrollmentStoreOptions } from "./authority-enrollment.js";
2
+ export type AuthorityArtifact = {
3
+ readonly archive: Buffer;
4
+ readonly artifactDigest: string;
5
+ readonly fetchedAt: string;
6
+ readonly repositoryId: number;
7
+ readonly runId: string;
8
+ readonly sourceHead: string;
9
+ };
10
+ export type AuthorityArtifactRead = {
11
+ readonly state: "invalid";
12
+ } | {
13
+ readonly state: "missing";
14
+ } | {
15
+ readonly state: "ready";
16
+ readonly value: AuthorityArtifact;
17
+ };
18
+ export declare function authorityArtifactPath(repositoryId: number, options?: Pick<AuthorityEnrollmentStoreOptions, "storeRoot">): string | undefined;
19
+ export declare function readAuthorityArtifact(repositoryId: number, options?: Pick<AuthorityEnrollmentStoreOptions, "storeRoot">): AuthorityArtifactRead;
20
+ export declare function writeAuthorityArtifact(artifact: AuthorityArtifact, options?: AuthorityEnrollmentStoreOptions): boolean;
@@ -0,0 +1,176 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { closeSync, constants, fsyncSync, mkdirSync, openSync, renameSync, rmSync, writeSync, } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { extractOriginalArtifactMembers } from "../../scripts/consumer-authority-artifact-archive.mjs";
5
+ import { authorityStoreRoot, } from "./authority-enrollment.js";
6
+ import { captureNoFollowDirectory, readNoFollowRegularFile, } from "../io/no-follow-file.js";
7
+ const AUTHORITY_ARTIFACT_SCHEMA = "consumer-authority-original-artifact.1";
8
+ const MAX_ARCHIVE_BYTES = 8 * 1024 * 1024;
9
+ const MAX_STORE_BYTES = 12 * 1024 * 1024;
10
+ export function authorityArtifactPath(repositoryId, options = {}) {
11
+ return isPositiveInteger(repositoryId)
12
+ ? join(authorityStoreRoot(options), `consumer-authority-artifact-${repositoryId}.json`)
13
+ : undefined;
14
+ }
15
+ export function readAuthorityArtifact(repositoryId, options = {}) {
16
+ const path = authorityArtifactPath(repositoryId, options);
17
+ if (path === undefined)
18
+ return { state: "invalid" };
19
+ const root = authorityStoreRoot(options);
20
+ const directory = captureNoFollowDirectory(root);
21
+ if (directory.kind === "absent")
22
+ return { state: "missing" };
23
+ if (directory.kind !== "ready")
24
+ return { state: "invalid" };
25
+ const source = readNoFollowRegularFile(path, MAX_STORE_BYTES, root);
26
+ if (source.kind === "absent")
27
+ return { state: "missing" };
28
+ if (source.kind !== "ready")
29
+ return { state: "invalid" };
30
+ return parseStoredArtifact(source.value.bytes) ?? { state: "invalid" };
31
+ }
32
+ export function writeAuthorityArtifact(artifact, options = {}) {
33
+ if (!isAuthorityArtifact(artifact))
34
+ return false;
35
+ const path = authorityArtifactPath(artifact.repositoryId, options);
36
+ if (path === undefined)
37
+ return false;
38
+ const root = authorityStoreRoot(options);
39
+ const directory = preparePrivateStoreRoot(root);
40
+ if (directory === undefined)
41
+ return false;
42
+ const payload = `${JSON.stringify({
43
+ archiveBase64: artifact.archive.toString("base64"),
44
+ artifactDigest: artifact.artifactDigest,
45
+ fetchedAt: artifact.fetchedAt,
46
+ repositoryId: artifact.repositoryId,
47
+ runId: artifact.runId,
48
+ schemaVersion: AUTHORITY_ARTIFACT_SCHEMA,
49
+ sourceHead: artifact.sourceHead,
50
+ })}\n`;
51
+ return writePrivateStoreFile(root, path, payload, directory);
52
+ }
53
+ function parseStoredArtifact(bytes) {
54
+ try {
55
+ const value = JSON.parse(bytes.toString("utf8"));
56
+ if (!isRecord(value) || !exactKeys(value, [
57
+ "archiveBase64",
58
+ "artifactDigest",
59
+ "fetchedAt",
60
+ "repositoryId",
61
+ "runId",
62
+ "schemaVersion",
63
+ "sourceHead",
64
+ ])) {
65
+ return undefined;
66
+ }
67
+ if (value.schemaVersion !== AUTHORITY_ARTIFACT_SCHEMA
68
+ || typeof value.archiveBase64 !== "string"
69
+ || typeof value.artifactDigest !== "string"
70
+ || typeof value.fetchedAt !== "string"
71
+ || !isPositiveInteger(value.repositoryId)
72
+ || typeof value.runId !== "string"
73
+ || typeof value.sourceHead !== "string") {
74
+ return undefined;
75
+ }
76
+ const archive = Buffer.from(value.archiveBase64, "base64");
77
+ const artifact = {
78
+ archive,
79
+ artifactDigest: value.artifactDigest,
80
+ fetchedAt: value.fetchedAt,
81
+ repositoryId: value.repositoryId,
82
+ runId: value.runId,
83
+ sourceHead: value.sourceHead,
84
+ };
85
+ return isAuthorityArtifact(artifact) ? { state: "ready", value: artifact } : undefined;
86
+ }
87
+ catch {
88
+ return undefined;
89
+ }
90
+ }
91
+ function isAuthorityArtifact(value) {
92
+ if (value.archive.byteLength === 0
93
+ || value.archive.byteLength > MAX_ARCHIVE_BYTES
94
+ || !isDigest(value.artifactDigest)
95
+ || value.artifactDigest !== digest(value.archive)
96
+ || !isTimestamp(value.fetchedAt)
97
+ || !isPositiveInteger(value.repositoryId)
98
+ || !isRunId(value.runId)
99
+ || !isCommit(value.sourceHead)) {
100
+ return false;
101
+ }
102
+ try {
103
+ extractOriginalArtifactMembers(value.archive);
104
+ return true;
105
+ }
106
+ catch {
107
+ return false;
108
+ }
109
+ }
110
+ function preparePrivateStoreRoot(root) {
111
+ try {
112
+ mkdirSync(root, { mode: 0o700, recursive: true });
113
+ }
114
+ catch {
115
+ return undefined;
116
+ }
117
+ const directory = captureNoFollowDirectory(root);
118
+ return directory.kind === "ready" ? directory.value : undefined;
119
+ }
120
+ function writePrivateStoreFile(root, path, payload, before) {
121
+ const temporaryPath = join(root, `.consumer-authority-artifact-${randomUUID()}.tmp`);
122
+ let descriptor;
123
+ try {
124
+ descriptor = openSync(temporaryPath, constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW | constants.O_WRONLY, 0o600);
125
+ writeSync(descriptor, payload, 0, "utf8");
126
+ fsyncSync(descriptor);
127
+ closeSync(descriptor);
128
+ descriptor = undefined;
129
+ const afterWrite = captureNoFollowDirectory(root);
130
+ if (afterWrite.kind !== "ready" || !sameDirectoryLocation(before, afterWrite.value))
131
+ return false;
132
+ renameSync(temporaryPath, path);
133
+ const afterRename = captureNoFollowDirectory(root);
134
+ if (afterRename.kind !== "ready" || !sameDirectoryLocation(before, afterRename.value))
135
+ return false;
136
+ const source = readNoFollowRegularFile(path, MAX_STORE_BYTES, root);
137
+ return source.kind === "ready" && source.value.bytes.toString("utf8") === payload;
138
+ }
139
+ catch {
140
+ return false;
141
+ }
142
+ finally {
143
+ if (descriptor !== undefined)
144
+ closeSync(descriptor);
145
+ rmSync(temporaryPath, { force: true });
146
+ }
147
+ }
148
+ function exactKeys(value, keys) {
149
+ const actual = Object.keys(value).sort();
150
+ return actual.length === keys.length && actual.every((key, index) => key === keys[index]);
151
+ }
152
+ function isRecord(value) {
153
+ return typeof value === "object" && value !== null && !Array.isArray(value);
154
+ }
155
+ function isPositiveInteger(value) {
156
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
157
+ }
158
+ function isRunId(value) {
159
+ return /^[1-9][0-9]{0,18}$/u.test(value);
160
+ }
161
+ function isCommit(value) {
162
+ return /^[a-f0-9]{40}$/iu.test(value);
163
+ }
164
+ function isTimestamp(value) {
165
+ return Number.isFinite(Date.parse(value));
166
+ }
167
+ function isDigest(value) {
168
+ return /^sha256:[a-f0-9]{64}$/iu.test(value);
169
+ }
170
+ function digest(bytes) {
171
+ return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
172
+ }
173
+ function sameDirectoryLocation(left, right) {
174
+ return left.dev === right.dev && left.ino === right.ino && left.mode === right.mode;
175
+ }
176
+ //# sourceMappingURL=authority-artifact-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authority-artifact-store.js","sourceRoot":"","sources":["../../src/cli/authority-artifact-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,UAAU,EACV,MAAM,EACN,SAAS,GACV,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAA;AACtG,OAAO,EACL,kBAAkB,GAEnB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GAExB,MAAM,yBAAyB,CAAA;AAEhC,MAAM,yBAAyB,GAAG,wCAAiD,CAAA;AACnF,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;AACzC,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAgBxC,MAAM,UAAU,qBAAqB,CACnC,YAAoB,EACpB,UAA8D,EAAE;IAEhE,OAAO,iBAAiB,CAAC,YAAY,CAAC;QACpC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,+BAA+B,YAAY,OAAO,CAAC;QACvF,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,YAAoB,EACpB,UAA8D,EAAE;IAEhE,MAAM,IAAI,GAAG,qBAAqB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACzD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;IACnD,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAA;IACxC,MAAM,SAAS,GAAG,wBAAwB,CAAC,I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,KAAa;IAC7B,OAAO,yBAAyB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC9C,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;AACrE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAA0B,EAAE,KAA2B;IACpF,OAAO,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAA;AACrF,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { CliRunResult } from "./bearshell.js";
2
+ export type AuthorityStatus = {
3
+ readonly authorityEligible: boolean;
4
+ readonly consumptionState: "consumed" | "not-applicable" | "unconsumed";
5
+ readonly enrollment: "available" | "unavailable";
6
+ readonly githubAuthentication: "available" | "unavailable";
7
+ readonly next: "authority-enroll-github" | "authority-fetch-github" | "github-authenticate" | "workflow-finish";
8
+ readonly state: "authentication-unavailable" | "enrollment-unavailable" | "missing" | "trusted";
9
+ };
10
+ export type AuthorityFetchArgs = {
11
+ readonly json: boolean;
12
+ readonly repositorySlug?: string;
13
+ };
14
+ export declare function authorityUsage(invocationName?: string): string;
15
+ export declare function parseReadOnlyArgs(args: readonly string[]): {
16
+ readonly json: boolean;
17
+ } | undefined;
18
+ export declare function parseFetchArgs(args: readonly string[]): AuthorityFetchArgs | undefined;
19
+ export declare function parseEnrollmentArgs(args: readonly string[]): {
20
+ readonly repositorySlug: string;
21
+ readonly workflowPath: string;
22
+ } | undefined;
23
+ export declare function textStatus(summary: AuthorityStatus, explain: boolean): CliRunResult;
24
+ export declare function jsonStatus(summary: AuthorityStatus): CliRunResult;
25
+ export declare function invalidAuthorityCommand(invocationName: string): CliRunResult;
26
+ export declare function blockedFetch(json: boolean, state: string, next?: AuthorityStatus["next"]): CliRunResult;
27
+ export declare function githubAuthenticationRequired(): CliRunResult;
@@ -0,0 +1,109 @@
1
+ import { authorityEnrollmentFromReadback } from "./authority-enrollment.js";
2
+ export function authorityUsage(invocationName = "ph") {
3
+ return [
4
+ `Usage: ${invocationName} authority <status|explain|enroll|fetch> [args...]`,
5
+ "",
6
+ "Commands:",
7
+ " status [--json] Inspect non-consuming external authority readiness.",
8
+ " explain [--json] Explain the bounded next authority step.",
9
+ " enroll github <owner/repository> --workflow <path>",
10
+ " Interactively enroll a public GitHub workflow pin.",
11
+ " fetch github [owner/repository] [--json]",
12
+ " Fetch matching original public evidence without consuming it.",
13
+ ].join("\n");
14
+ }
15
+ export function parseReadOnlyArgs(args) {
16
+ return args.length === 0 ? { json: false } : args.length === 1 && args[0] === "--json" ? { json: true } : undefined;
17
+ }
18
+ export function parseFetchArgs(args) {
19
+ if (args.length === 1 && args[0] === "github")
20
+ return { json: false };
21
+ if (args.length === 2 && args[0] === "github" && args[1] === "--json")
22
+ return { json: true };
23
+ const repositorySlug = args[1];
24
+ if (args[0] !== "github" || !isPublicRepositorySlug(repositorySlug))
25
+ return undefined;
26
+ if (args.length === 2)
27
+ return { json: false, repositorySlug };
28
+ return args.length === 3 && args[2] === "--json" ? { json: true, repositorySlug } : undefined;
29
+ }
30
+ export function parseEnrollmentArgs(args) {
31
+ if (args.length !== 4 || args[0] !== "github" || args[2] !== "--workflow")
32
+ return undefined;
33
+ const repositorySlug = args[1];
34
+ const workflowPath = args[3];
35
+ const enrollment = authorityEnrollmentFromReadback({
36
+ callerWorkflowPath: workflowPath,
37
+ repositoryId: 1,
38
+ repositorySlug: repositorySlug ?? "",
39
+ reusableWorkflowSha: "a".repeat(40),
40
+ });
41
+ return enrollment === undefined || repositorySlug === undefined
42
+ ? undefined
43
+ : { repositorySlug, workflowPath: enrollment.callerWorkflowPath };
44
+ }
45
+ export function textStatus(summary, explain) {
46
+ const state = summary.state === "trusted" ? "TRUSTED" : "BLOCKED";
47
+ return {
48
+ status: summary.authorityEligible ? 0 : 1,
49
+ stdout: [
50
+ `Enrollment: ${summary.enrollment}`,
51
+ `GitHub authentication: ${summary.githubAuthentication}`,
52
+ `External authority: ${state}`,
53
+ `Consumption: ${summary.consumptionState}`,
54
+ `Next: ${nextText(summary.next, explain)}`,
55
+ ].join("\n") + "\n",
56
+ stderr: "",
57
+ };
58
+ }
59
+ export function jsonStatus(summary) {
60
+ return {
61
+ status: summary.authorityEligible ? 0 : 1,
62
+ stdout: `${JSON.stringify({ schemaVersion: "consumer-authority-status.1", ...summary })}\n`,
63
+ stderr: "",
64
+ };
65
+ }
66
+ export function invalidAuthorityCommand(invocationName) {
67
+ return { status: 1, stdout: "", stderr: `${authorityUsage(invocationName)}\n` };
68
+ }
69
+ export function blockedFetch(json, state, next = "authority-fetch-github") {
70
+ return {
71
+ status: 1,
72
+ stdout: json
73
+ ? `${JSON.stringify({
74
+ authorityEligible: false,
75
+ consumptionState: "not-applicable",
76
+ next,
77
+ schemaVersion: "consumer-authority-fetch.1",
78
+ state,
79
+ })}\n`
80
+ : `Consumer authority fetch: BLOCKED (${state}). No evidence was retained or consumed.\n`,
81
+ stderr: "",
82
+ };
83
+ }
84
+ export function githubAuthenticationRequired() {
85
+ return {
86
+ status: 1,
87
+ stdout: "",
88
+ stderr: "GitHub authentication is required. Set GH_TOKEN or GITHUB_TOKEN to a credential with Actions read access for the public repository.\n",
89
+ };
90
+ }
91
+ function nextText(next, explain) {
92
+ if (next === "github-authenticate")
93
+ return explain
94
+ ? "Set GH_TOKEN or GITHUB_TOKEN to a credential with Actions read access for the enrolled public repository."
95
+ : "github-authenticate";
96
+ if (next === "authority-enroll-github")
97
+ return explain ? "Enroll a public GitHub workflow through an interactive confirmation." : "authority-enroll-github";
98
+ if (next === "authority-fetch-github")
99
+ return explain ? "Fetch matching original public evidence without consuming it." : "authority-fetch-github";
100
+ return explain ? "Run workflow finish; only Finish may consume external authority." : "workflow-finish";
101
+ }
102
+ function isPublicRepositorySlug(value) {
103
+ return typeof value === "string"
104
+ && value.length > 0
105
+ && value.length <= 256
106
+ && /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(value)
107
+ && !value.split("/").some((part) => part === "." || part === "..");
108
+ }
109
+ //# sourceMappingURL=authority-command-surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authority-command-surface.js","sourceRoot":"","sources":["../../src/cli/authority-command-surface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;AAiB3E,MAAM,UAAU,cAAc,CAAC,cAAc,GAAG,IAAI;IAClD,OAAO;QACL,UAAU,cAAc,oDAAoD;QAC5E,EAAE;QACF,WAAW;QACX,+FAA+F;QAC/F,oFAAoF;QACpF,sDAAsD;QACtD,6FAA6F;QAC7F,4CAA4C;QAC5C,wGAAwG;KACzG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAuB;IACvD,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACrH,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAuB;IACpD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;IACrE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;QAAE,OAAO,EAAE,I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Aa,EAAE,4BAA4B;gBAC3C,KAAK;aACN,CAAC,IAAI;YACN,CAAC,CAAC,sCAAsC,KAAK,4CAA4C;QAC3F,MAAM,EAAE,EAAE;KACX,CAAA;AACH,CAAC;AAED,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,uIAAuI;KAChJ,CAAA;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,IAA6B,EAAE,OAAgB;IAC/D,IAAI,IAAI,KAAK,qBAAqB;QAAE,OAAO,OAAO;YAChD,CAAC,CAAC,2GAA2G;YAC7G,CAAC,CAAC,qBAAqB,CAAA;IACzB,IAAI,IAAI,KAAK,yBAAyB;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,sEAAsE,CAAC,CAAC,CAAC,yBAAyB,CAAA;IAC3J,IAAI,IAAI,KAAK,wBAAwB;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,+DAA+D,CAAC,CAAC,CAAC,wBAAwB,CAAA;IAClJ,OAAO,OAAO,CAAC,CAAC,CAAC,kEAAkE,CAAC,CAAC,CAAC,iBAAiB,CAAA;AACzG,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAc;IAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ;WAC3B,KAAK,CAAC,MAAM,GAAG,CAAC;WAChB,KAAK,CAAC,MAAM,IAAI,GAAG;WACnB,qCAAqC,CAAC,IAAI,CAAC,KAAK,CAAC;WACjD,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,CAAA;AACtE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { type AuthorityArtifact } from "./authority-artifact-store.js";
2
+ import { type AuthorityEnrollment, type AuthorityEnrollmentReadback, type AuthorityEnrollmentStoreOptions } from "./authority-enrollment.js";
3
+ import { type AuthorityStatus } from "./authority-command-surface.js";
4
+ import { type ProjectFinishAttestationVerifierAssessment } from "./project-finish-attestation-verifier.js";
5
+ import type { CliRunResult } from "./bearshell.js";
6
+ type AuthorityCommandOptions = AuthorityEnrollmentStoreOptions & {
7
+ readonly artifactFetch?: (projectDir: string, enrollment: AuthorityEnrollment) => AuthorityArtifact | undefined;
8
+ readonly artifactInspector?: (projectDir: string, enrollment: AuthorityEnrollment, archive: Buffer, now: Date) => ProjectFinishAttestationVerifierAssessment;
9
+ readonly confirmEnrollment?: boolean;
10
+ readonly enrollmentReadback?: (repositorySlug: string, workflowPath: string) => AuthorityEnrollmentReadback | undefined;
11
+ readonly githubToken?: string;
12
+ readonly projectDir?: string;
13
+ };
14
+ export { authorityUsage } from "./authority-command-surface.js";
15
+ export { authorityEnrollmentFromReadback, readAuthorityEnrollment, } from "./authority-enrollment.js";
16
+ export type { AuthorityStatus } from "./authority-command-surface.js";
17
+ export declare function runAuthorityCommand(args: readonly string[], options?: AuthorityCommandOptions, invocationName?: string): CliRunResult;
18
+ export declare function readAuthorityStatus(options?: AuthorityCommandOptions): AuthorityStatus;