@codyswann/lisa 5.5.0 → 5.7.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 (196) hide show
  1. package/all/copy-overwrite/scripts/lib/automation-provenance-local.mjs +26 -2
  2. package/all/copy-overwrite/scripts/lib/github-attestation-provider.mjs +68 -0
  3. package/all/copy-overwrite/scripts/lib/github-attestation-recovery.mjs +25 -10
  4. package/all/copy-overwrite/scripts/lib/github-attestation-verifier.mjs +4 -1
  5. package/all/copy-overwrite/scripts/lib/npm-update-allocate.mjs +1 -6
  6. package/all/copy-overwrite/scripts/lib/npm-update-authorization.mjs +25 -14
  7. package/all/copy-overwrite/scripts/lib/npm-update-cancel-origin.mjs +45 -11
  8. package/all/copy-overwrite/scripts/lib/npm-update-cancellation-proof.mjs +22 -11
  9. package/all/copy-overwrite/scripts/lib/npm-update-cancellation.mjs +29 -17
  10. package/all/copy-overwrite/scripts/lib/npm-update-controller-factory.mjs +19 -1
  11. package/all/copy-overwrite/scripts/lib/npm-update-gate.mjs +5 -0
  12. package/all/copy-overwrite/scripts/lib/npm-update-gh-requests.mjs +57 -30
  13. package/all/copy-overwrite/scripts/lib/npm-update-helper-inventory.mjs +1 -0
  14. package/all/copy-overwrite/scripts/lib/npm-update-leaf.mjs +6 -1
  15. package/all/copy-overwrite/scripts/lib/npm-update-policy.mjs +38 -0
  16. package/all/copy-overwrite/scripts/lib/npm-update-publication.mjs +21 -3
  17. package/all/copy-overwrite/scripts/lib/npm-update-publish.mjs +13 -1
  18. package/all/copy-overwrite/scripts/lib/npm-update-recovery.mjs +29 -4
  19. package/all/copy-overwrite/scripts/lib/npm-update-supersession.mjs +21 -7
  20. package/all/copy-overwrite/scripts/lib/npm-update-tracker-cancel.mjs +139 -0
  21. package/all/copy-overwrite/scripts/lib/npm-update-tracker-jira.mjs +149 -19
  22. package/all/copy-overwrite/scripts/lib/npm-update-tracker-linear.mjs +72 -17
  23. package/all/copy-overwrite/scripts/lib/npm-update-tracker-wire.mjs +102 -12
  24. package/all/copy-overwrite/scripts/lib/npm-update-tracker.mjs +91 -13
  25. package/all/copy-overwrite/scripts/lisa-automation-provenance.mjs +35 -8
  26. package/all/copy-overwrite/scripts/lisa-npm-updater.mjs +8 -5
  27. package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +45 -26
  28. package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
  29. package/dist/core/lisa-owned-hash-ledger.js +122 -0
  30. package/dist/core/lisa-owned-hash-ledger.js.map +1 -1
  31. package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
  32. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  33. package/dist/core/upstream-evidence-manifest.js +93 -42
  34. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  35. package/package.json +4 -4
  36. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  38. package/plugins/lisa/.codex-plugin/scripts/operator-id-kinds.mjs +17 -4
  39. package/plugins/lisa/.codex-plugin/scripts/ready-queue-order.mjs +62 -5
  40. package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs +75 -38
  41. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +23 -7
  42. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/references/runbook-template.md +1 -1
  43. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-cycle.mjs +4 -3
  44. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-human.mjs +12 -7
  45. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-orphans.mjs +3 -1
  46. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  47. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +4 -3
  48. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +26 -0
  49. package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-needed.mjs +1 -1
  50. package/plugins/lisa/.codex-plugin/skills/lisa-setup-session-manager/SKILL.md +7 -3
  51. package/plugins/lisa/rules/reference/config-resolution.md +3 -2
  52. package/plugins/lisa/scripts/operator-id-kinds.mjs +17 -4
  53. package/plugins/lisa/scripts/ready-queue-order.mjs +62 -5
  54. package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +75 -38
  55. package/plugins/lisa/skills/lisa-session-manager/SKILL.md +23 -7
  56. package/plugins/lisa/skills/lisa-session-manager/references/runbook-template.md +1 -1
  57. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-cycle.mjs +4 -3
  58. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-human.mjs +12 -7
  59. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-orphans.mjs +3 -1
  60. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  61. package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +4 -3
  62. package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +26 -0
  63. package/plugins/lisa/skills/lisa-session-manager/scripts/human-needed.mjs +1 -1
  64. package/plugins/lisa/skills/lisa-setup-session-manager/SKILL.md +7 -3
  65. package/plugins/lisa-agy/plugin.json +1 -1
  66. package/plugins/lisa-agy/scripts/operator-id-kinds.mjs +17 -4
  67. package/plugins/lisa-agy/scripts/ready-queue-order.mjs +62 -5
  68. package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +75 -38
  69. package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +23 -7
  70. package/plugins/lisa-agy/skills/lisa-session-manager/references/runbook-template.md +1 -1
  71. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-cycle.mjs +4 -3
  72. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-human.mjs +12 -7
  73. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-orphans.mjs +3 -1
  74. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  75. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +4 -3
  76. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +26 -0
  77. package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-needed.mjs +1 -1
  78. package/plugins/lisa-agy/skills/lisa-setup-session-manager/SKILL.md +7 -3
  79. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  80. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  81. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  82. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
  85. package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
  86. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  87. package/plugins/lisa-copilot/rules/reference/config-resolution.md +3 -2
  88. package/plugins/lisa-copilot/scripts/operator-id-kinds.mjs +17 -4
  89. package/plugins/lisa-copilot/scripts/ready-queue-order.mjs +62 -5
  90. package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +75 -38
  91. package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +23 -7
  92. package/plugins/lisa-copilot/skills/lisa-session-manager/references/runbook-template.md +1 -1
  93. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-cycle.mjs +4 -3
  94. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-human.mjs +12 -7
  95. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-orphans.mjs +3 -1
  96. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  97. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +4 -3
  98. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +26 -0
  99. package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-needed.mjs +1 -1
  100. package/plugins/lisa-copilot/skills/lisa-setup-session-manager/SKILL.md +7 -3
  101. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +3 -2
  103. package/plugins/lisa-cursor/scripts/operator-id-kinds.mjs +17 -4
  104. package/plugins/lisa-cursor/scripts/ready-queue-order.mjs +62 -5
  105. package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +75 -38
  106. package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +23 -7
  107. package/plugins/lisa-cursor/skills/lisa-session-manager/references/runbook-template.md +1 -1
  108. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-cycle.mjs +4 -3
  109. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-human.mjs +12 -7
  110. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-orphans.mjs +3 -1
  111. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  112. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +4 -3
  113. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +26 -0
  114. package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-needed.mjs +1 -1
  115. package/plugins/lisa-cursor/skills/lisa-setup-session-manager/SKILL.md +7 -3
  116. package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
  118. package/plugins/lisa-devin/rules/reference/config-resolution.md +3 -2
  119. package/plugins/lisa-devin/scripts/operator-id-kinds.mjs +17 -4
  120. package/plugins/lisa-devin/scripts/ready-queue-order.mjs +62 -5
  121. package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +75 -38
  122. package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +23 -7
  123. package/plugins/lisa-devin/skills/lisa-session-manager/references/runbook-template.md +1 -1
  124. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-cycle.mjs +4 -3
  125. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-human.mjs +12 -7
  126. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-orphans.mjs +3 -1
  127. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  128. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +4 -3
  129. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +26 -0
  130. package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-needed.mjs +1 -1
  131. package/plugins/lisa-devin/skills/lisa-setup-session-manager/SKILL.md +7 -3
  132. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  133. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  134. package/plugins/lisa-expo-agy/plugin.json +1 -1
  135. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  136. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  137. package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
  138. package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
  139. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  140. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  141. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  142. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  143. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  144. package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
  145. package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
  146. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  147. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  148. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  149. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  150. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  151. package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
  152. package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
  153. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  154. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  155. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  156. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  157. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  158. package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
  159. package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
  160. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  161. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  162. package/plugins/lisa-rails-agy/plugin.json +1 -1
  163. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  164. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  165. package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
  166. package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
  167. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  168. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  169. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  170. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  171. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  172. package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
  173. package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
  174. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  175. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  176. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  177. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  178. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  179. package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
  180. package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
  181. package/plugins/src/base/rules/reference/config-resolution.md +3 -2
  182. package/plugins/src/base/scripts/operator-id-kinds.mjs +17 -4
  183. package/plugins/src/base/scripts/ready-queue-order.mjs +62 -5
  184. package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +75 -38
  185. package/plugins/src/base/skills/lisa-session-manager/SKILL.md +23 -7
  186. package/plugins/src/base/skills/lisa-session-manager/references/runbook-template.md +1 -1
  187. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-cycle.mjs +4 -3
  188. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-human.mjs +12 -7
  189. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-orphans.mjs +3 -1
  190. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-runtime.mjs +1 -0
  191. package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +4 -3
  192. package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +26 -0
  193. package/plugins/src/base/skills/lisa-session-manager/scripts/human-needed.mjs +1 -1
  194. package/plugins/src/base/skills/lisa-setup-session-manager/SKILL.md +7 -3
  195. package/scripts/two-channel-couplings.json +1 -1
  196. package/typescript/copy-overwrite/.prettierignore +1 -0
@@ -93,7 +93,13 @@ function originalBun(descriptor) {
93
93
  }
94
94
 
95
95
  /** Match complete message and Git metadata before any network/proof acceptance. */
96
- export function localDescriptor(descriptor, messageBytes, reference, policy) {
96
+ export function localDescriptor(
97
+ descriptor,
98
+ messageBytes,
99
+ reference,
100
+ policy,
101
+ tracker = "github"
102
+ ) {
97
103
  // Parsing never supplies the signed digest. Reject malformed UTF8 only on
98
104
  // this present-proof path; preserve any BOM as part of the actual message.
99
105
  const message = new TextDecoder("utf-8", {
@@ -120,9 +126,15 @@ export function localDescriptor(descriptor, messageBytes, reference, policy) {
120
126
  ].every(value => typeof value === "string" && HEX.test(value)),
121
127
  "invalid descriptor digest"
122
128
  );
129
+ // A Jira/Linear claim id is an opaque tracker comment id (the adapter proves the
130
+ // comment itself); only an explicit Jira/Linear tracker relaxes GitHub's decimal grammar. The committed tracker,
131
+ // read from HEAD, decides which grammar applies (#4873).
123
132
  requireProof(
124
133
  typeof descriptor.claimCommentId === "string" &&
125
- /^[1-9]\d*$/.test(descriptor.claimCommentId),
134
+ (["jira", "linear"].includes(tracker)
135
+ ? /^[A-Za-z0-9-]{1,64}$/
136
+ : /^[1-9]\d*$/
137
+ ).test(descriptor.claimCommentId),
126
138
  "invalid claim reference"
127
139
  );
128
140
  requireProof(
@@ -231,6 +243,18 @@ export function resolverTimeoutMs(env = process.env) {
231
243
 
232
244
  /** Reuse the shipped resolver and retain current canonical lifecycle requirements. */
233
245
  export function canonicalContext(message, config, policy, descriptor) {
246
+ // A Jira/Linear item is bound offline here: the hooks hold no tracker credential,
247
+ // and the publisher proves the live claim through its adapter (#4873).
248
+ if (["jira", "linear"].includes(config.tracker)) {
249
+ const vendor = resolveWorkItemContext(message, { config });
250
+ requireProof(
251
+ vendor.provider === config.tracker &&
252
+ vendor.ref === descriptor.workItem &&
253
+ descriptor.queue === policy.repository,
254
+ "canonical tracker scope differs"
255
+ );
256
+ return vendor;
257
+ }
234
258
  const context = resolveWorkItemContext(message, {
235
259
  config,
236
260
  requireLive: true,
@@ -110,6 +110,21 @@ function providerOrigin(policy, descriptor, historical, execute) {
110
110
  };
111
111
  }
112
112
 
113
+ /**
114
+ * Historical origin without the GitHub claim read: a Jira/Linear claim is proved
115
+ * by its tracker adapter, which supplies the claim time separately (#4873).
116
+ */
117
+ export function verifyHistoricalRun(
118
+ policy,
119
+ descriptor,
120
+ execute = boundedSpawnSync
121
+ ) {
122
+ const read = endpoint =>
123
+ ghJson(policy, [API, HOST_FLAG, PUBLIC_HOST, endpoint], execute);
124
+ repositoryState(read, policy, descriptor.parent, targetBranch(descriptor));
125
+ return runState(read, policy, descriptor, true);
126
+ }
127
+
113
128
  /** Prove the trusted human remains assignable using the actual documented status. */
114
129
  export function verifyAssignable(
115
130
  policy,
@@ -204,6 +219,28 @@ export function verifyStaleOriginProvider(
204
219
  };
205
220
  }
206
221
 
222
+ /**
223
+ * The repository and historical-run half of stale-origin authority, for a Jira
224
+ * or Linear host whose claim is proved by its own tracker adapter (#4873).
225
+ */
226
+ export function verifyStaleOriginRun(
227
+ policy,
228
+ descriptor,
229
+ currentParent,
230
+ execute = boundedSpawnSync
231
+ ) {
232
+ requireProof(
233
+ typeof currentParent === "string" &&
234
+ /^[a-f0-9]{40}$/.test(currentParent) &&
235
+ currentParent !== descriptor.parent,
236
+ "cancellation requires a distinct current parent"
237
+ );
238
+ const read = endpoint =>
239
+ ghJson(policy, [API, HOST_FLAG, PUBLIC_HOST, endpoint], execute);
240
+ repositoryState(read, policy, currentParent, targetBranch(descriptor));
241
+ return runState(read, policy, descriptor, true);
242
+ }
243
+
207
244
  /** Fresh permission checks its own invocation and the exact observed destination. */
208
245
  export function verifyRecoveryProvider(
209
246
  policy,
@@ -219,6 +256,33 @@ export function verifyRecoveryProvider(
219
256
  );
220
257
  const read = endpoint =>
221
258
  ghJson(policy, [API, HOST_FLAG, PUBLIC_HOST, endpoint], execute);
259
+ recoveryLeaf(read, policy, descriptor, recovery, maintainer);
260
+ recoveryDestination(read, policy, descriptor, recovery);
261
+ }
262
+
263
+ /**
264
+ * The code-host half of fresh recovery for a Jira/Linear host: its own live run
265
+ * and the exact observed destination. The leaf body, owner and claim live on the
266
+ * tracker and are proved by the adapter (#4873).
267
+ */
268
+ export function verifyRecoveryDestination(
269
+ policy,
270
+ descriptor,
271
+ recovery,
272
+ execute = boundedSpawnSync
273
+ ) {
274
+ verifyCurrentRun(
275
+ policy,
276
+ { ...descriptor, runId: recovery.runId, runAttempt: recovery.runAttempt },
277
+ execute
278
+ );
279
+ const read = endpoint =>
280
+ ghJson(policy, [API, HOST_FLAG, PUBLIC_HOST, endpoint], execute);
281
+ recoveryDestination(read, policy, descriptor, recovery);
282
+ }
283
+
284
+ /** The GitHub leaf is unchanged and owned by the one trusted maintainer. */
285
+ function recoveryLeaf(read, policy, descriptor, recovery, maintainer) {
222
286
  const number = descriptor.workItem.slice(
223
287
  descriptor.workItem.lastIndexOf("#") + 1
224
288
  );
@@ -233,6 +297,10 @@ export function verifyRecoveryProvider(
233
297
  issue.assignees[0].type === "User",
234
298
  "current recovery leaf or owner differs"
235
299
  );
300
+ }
301
+
302
+ /** The recovery branch and PR are exactly the observed ones, or absent. */
303
+ function recoveryDestination(read, policy, descriptor, recovery) {
236
304
  const refs = read(
237
305
  `repos/${policy.repository}/git/matching-refs/heads/${recovery.branch}`
238
306
  );
@@ -4,7 +4,9 @@
4
4
  /** Fixed historical-origin and fresh-recovery roles preserve ordinary v1 authority. */
5
5
  import {
6
6
  verifyHistoricalProvider,
7
+ verifyHistoricalRun,
7
8
  verifyRecoveryProvider,
9
+ verifyRecoveryDestination,
8
10
  verifyAssignable,
9
11
  } from "./github-attestation-provider.mjs";
10
12
  import { boundedSpawnSync } from "./bounded-spawn.mjs";
@@ -53,9 +55,11 @@ export function assertHistoricalAttestation(
53
55
  "descriptor.json"
54
56
  );
55
57
  const chronology = observedRunChronology(run, now);
56
- const claimed = Date.parse(claim.created_at);
58
+ // Only a Jira/Linear hook passes null: its claim time is proved by the adapter
59
+ // in the credentialed checkpoint and publish phases instead (#4873).
60
+ const claimed = claim === null ? -Infinity : Date.parse(claim.created_at);
57
61
  requireProof(
58
- chronology && Number.isFinite(claimed),
62
+ chronology && (claim === null || Number.isFinite(claimed)),
59
63
  "missing/invalid historical provider chronology"
60
64
  );
61
65
  const { start, end } = chronology;
@@ -281,8 +285,16 @@ export function verifyRecoveryOrigin(
281
285
  "recovery replayed into different current invocation"
282
286
  );
283
287
  });
288
+ // Jira/Linear (`scope.tracker`): the code host proves repository, runs and
289
+ // destination; the adapter proves claim, leaf body and owner (#4873).
290
+ const vendor = scope.tracker === true;
284
291
  const origin = withProvenancePhase("historical-provider", () =>
285
- verifyHistoricalProvider(policy, descriptor, execute)
292
+ vendor
293
+ ? {
294
+ run: verifyHistoricalRun(policy, descriptor, execute),
295
+ claim: scope.claim ?? null,
296
+ }
297
+ : verifyHistoricalProvider(policy, descriptor, execute)
286
298
  );
287
299
  withProvenancePhase("historical-signature", () =>
288
300
  verifyHistoricalDescriptor(
@@ -305,14 +317,17 @@ export function verifyRecoveryOrigin(
305
317
  )
306
318
  );
307
319
  withProvenancePhase("recovery-provider", () =>
308
- verifyRecoveryProvider(
309
- policy,
310
- descriptor,
311
- recovery,
312
- scope.maintainer,
313
- execute
314
- )
320
+ vendor
321
+ ? verifyRecoveryDestination(policy, descriptor, recovery, execute)
322
+ : verifyRecoveryProvider(
323
+ policy,
324
+ descriptor,
325
+ recovery,
326
+ scope.maintainer,
327
+ execute
328
+ )
315
329
  );
330
+ if (vendor) return;
316
331
  withProvenancePhase("assignable", () =>
317
332
  verifyAssignable(policy, scope.maintainer, execute)
318
333
  );
@@ -278,4 +278,7 @@ export function verifyDescriptorAttestation(
278
278
  }
279
279
 
280
280
  // Compatibility exports retain ordinary callers without top-level provider work.
281
- export { verifyCurrentProvider } from "./github-attestation-provider.mjs";
281
+ export {
282
+ verifyCurrentProvider,
283
+ verifyCurrentRun,
284
+ } from "./github-attestation-provider.mjs";
@@ -16,11 +16,7 @@ import { sha256 } from "./github-attestation-verifier.mjs";
16
16
  import { registryVersion } from "./npm-update-npm.mjs";
17
17
  import { discoverSupersession } from "./npm-update-supersession.mjs";
18
18
  import { canonicalJson } from "../lisa-automation-provenance.mjs";
19
- import {
20
- trackerOf,
21
- trackerFor,
22
- refuseUnlessGithub,
23
- } from "./npm-update-tracker.mjs";
19
+ import { trackerOf, trackerFor } from "./npm-update-tracker.mjs";
24
20
  import {
25
21
  buildDraft,
26
22
  qualityGates,
@@ -96,7 +92,6 @@ export async function discoverPrior(api, proposal, context) {
96
92
  );
97
93
  if (!found.total_count) return { status: "new" };
98
94
  if (context && (found.total_count > 1 || found.items[0].state === "closed")) {
99
- refuseUnlessGithub(context.config, "supersession");
100
95
  return discoverSupersession(api, proposal, found.items, context);
101
96
  }
102
97
  const issue = await tracker.issue(found.items[0].number);
@@ -15,11 +15,12 @@ export { destinationSnapshot } from "./npm-update-publication.mjs";
15
15
  import { persistCheckpoint, recoveryRecord } from "./npm-update-recovery.mjs";
16
16
  export { recoveryRecord } from "./npm-update-recovery.mjs";
17
17
  import { verifyCurrentProvider } from "./github-attestation-verifier.mjs";
18
- import { verifyHistoricalProvider } from "./github-attestation-provider.mjs";
19
18
  import {
20
- refuseUnlessGithub,
21
- verifySignedWorkItem,
22
- } from "./npm-update-tracker.mjs";
19
+ verifyHistoricalProvider,
20
+ verifyHistoricalRun,
21
+ verifyCurrentRun,
22
+ } from "./github-attestation-provider.mjs";
23
+ import { verifySignedWorkItem } from "./npm-update-tracker.mjs";
23
24
  import {
24
25
  verifyHistoricalDescriptor,
25
26
  predictedCommit,
@@ -46,7 +47,8 @@ async function restoredOrigin(
46
47
  proposal,
47
48
  allocation,
48
49
  policy,
49
- config
50
+ config,
51
+ api
50
52
  ) {
51
53
  const origin = allocation.origin;
52
54
  const preview = origin.payload.preview;
@@ -78,10 +80,16 @@ async function restoredOrigin(
78
80
  mode: 0o600,
79
81
  flag: "wx",
80
82
  });
81
- const historical = verifyHistoricalProvider(
82
- config.automationProvenance,
83
- preview.descriptor
84
- );
83
+ // A Jira/Linear claim and its time are proved by the adapter (#4873).
84
+ const historical = api.tracker
85
+ ? {
86
+ run: verifyHistoricalRun(
87
+ config.automationProvenance,
88
+ preview.descriptor
89
+ ),
90
+ claim: await api.tracker.proveClaim(preview.descriptor),
91
+ }
92
+ : verifyHistoricalProvider(config.automationProvenance, preview.descriptor);
85
93
  verifyHistoricalDescriptor(
86
94
  config.automationProvenance,
87
95
  preview.descriptor,
@@ -111,14 +119,19 @@ async function recoveryPreview({
111
119
  proposal,
112
120
  allocation,
113
121
  policy,
114
- config
122
+ config,
123
+ api
115
124
  );
116
125
  if (!allocation.origin.complete) {
117
- verifyCurrentProvider(api.policy, {
126
+ const current = {
118
127
  ...preview.descriptor,
119
128
  runId: process.env.GITHUB_RUN_ID,
120
129
  runAttempt: process.env.GITHUB_RUN_ATTEMPT,
121
- });
130
+ };
131
+ if (api.tracker) {
132
+ verifyCurrentRun(api.policy, current);
133
+ await api.tracker.proveClaim(preview.descriptor);
134
+ } else verifyCurrentProvider(api.policy, current);
122
135
  await persistCheckpoint(
123
136
  api,
124
137
  original.number,
@@ -201,8 +214,6 @@ export async function prepareAuthorization({
201
214
  let proposal = suppliedProposal;
202
215
  if (allocation.status === "stale-outstanding")
203
216
  return { mode: allocation.status, allocation };
204
- // Resuming a signed origin re-verifies the claim's GitHub chronology (#4873).
205
- if (allocation.origin) refuseUnlessGithub(config, "signed-origin recovery");
206
217
  const restored =
207
218
  allocation.origin?.payload.proposal ??
208
219
  allocation.originalProposal ??
@@ -26,7 +26,11 @@ import {
26
26
  qualityGates,
27
27
  } from "./npm-update-leaf.mjs";
28
28
  import { sha256 } from "./github-attestation-verifier.mjs";
29
- import { verifyStaleOriginProvider } from "./github-attestation-provider.mjs";
29
+ import {
30
+ verifyStaleOriginProvider,
31
+ verifyStaleOriginRun,
32
+ } from "./github-attestation-provider.mjs";
33
+ import { managedActor, allocationWorkItem } from "./npm-update-tracker.mjs";
30
34
  import {
31
35
  observedRunChronology,
32
36
  verifyHistoricalDescriptor,
@@ -107,7 +111,9 @@ export function assertOriginTransport(
107
111
  digest,
108
112
  policy,
109
113
  run,
110
- now = Date.now()
114
+ now = Date.now(),
115
+ managed = user =>
116
+ user?.type === "Bot" && String(user.id) === policy.claimActorId
111
117
  ) {
112
118
  const chronology = observedRunChronology(run, now);
113
119
  required(chronology, "invalid original transport chronology");
@@ -121,8 +127,8 @@ export function assertOriginTransport(
121
127
  for (const comment of selected) {
122
128
  const posted = Date.parse(comment.created_at);
123
129
  required(
124
- comment.user?.type === "Bot" &&
125
- String(comment.user.id) === policy.claimActorId &&
130
+ // GitHub: the configured Bot. Jira/Linear: the declared automation account (#4873).
131
+ managed(comment.user) &&
126
132
  comment.updated_at === comment.created_at &&
127
133
  Number.isFinite(posted) &&
128
134
  posted >= start - 60_000 &&
@@ -152,7 +158,13 @@ async function inspectOrigin(api, issue, payload, oldConfig, current) {
152
158
  canonicalJson(allocation.evidence) === canonicalJson(evidence) &&
153
159
  canonicalJson(allocation.draft) === canonicalJson(draft) &&
154
160
  allocation.number === issue.number &&
155
- allocation.workItem === `${policy.repository}#${issue.number}`,
161
+ allocation.workItem ===
162
+ allocationWorkItem(
163
+ api,
164
+ current.config,
165
+ policy.repository,
166
+ issue.number
167
+ ),
156
168
  "original allocation differs"
157
169
  );
158
170
  // The current qualified classifier checks present holds; historical config only supplies the original draft.
@@ -165,8 +177,7 @@ async function inspectOrigin(api, issue, payload, oldConfig, current) {
165
177
  state.claims.length === 1 &&
166
178
  String(state.claims[0].id) === allocation.claimCommentId &&
167
179
  sha256(state.claims[0].body) === allocation.claimSha256 &&
168
- String(state.claims[0].user?.id) === api.policy.claimActorId &&
169
- state.claims[0].user?.type === "Bot",
180
+ (await managedActor(api))(state.claims[0].user),
170
181
  "original managed claim changed"
171
182
  );
172
183
  qualityGates(
@@ -207,7 +218,15 @@ export function originalDescriptor(checkpoint, old, allocation, authority) {
207
218
  }
208
219
 
209
220
  /** The original fixed signing purpose and native transport chronology remain mandatory. */
210
- async function verifyOriginalSubject(checkpoint, authority, d, issue, parent) {
221
+ async function verifyOriginalSubject(
222
+ api,
223
+ checkpoint,
224
+ authority,
225
+ d,
226
+ issue,
227
+ parent
228
+ ) {
229
+ const managed = await managedActor(api);
211
230
  await withPrivateRoot(async root => {
212
231
  const paths = {
213
232
  descriptor: join(root, "descriptor.json"),
@@ -222,12 +241,20 @@ async function verifyOriginalSubject(checkpoint, authority, d, issue, parent) {
222
241
  mode: 0o600,
223
242
  flag: "wx",
224
243
  });
225
- const observed = verifyStaleOriginProvider(authority, d, parent);
244
+ // A Jira/Linear claim is re-proved by its adapter; GitHub keeps its comment read.
245
+ const observed = api.tracker
246
+ ? {
247
+ run: verifyStaleOriginRun(authority, d, parent),
248
+ claim: await api.tracker.proveClaim(d),
249
+ }
250
+ : verifyStaleOriginProvider(authority, d, parent);
226
251
  assertOriginTransport(
227
252
  issue.comments,
228
253
  checkpoint.digest,
229
254
  authority,
230
- observed.run
255
+ observed.run,
256
+ Date.now(),
257
+ managed
231
258
  );
232
259
  verifyHistoricalDescriptor(
233
260
  authority,
@@ -304,6 +331,13 @@ export async function authenticateStaleOrigin({
304
331
  inspected.allocation,
305
332
  authority
306
333
  );
307
- await verifyOriginalSubject(checkpoint, authority, d, issue, proposal.parent);
334
+ await verifyOriginalSubject(
335
+ api,
336
+ checkpoint,
337
+ authority,
338
+ d,
339
+ issue,
340
+ proposal.parent
341
+ );
308
342
  return { ...inspected, checkpoint, oldConfig, descriptor: d };
309
343
  }
@@ -16,6 +16,7 @@ import {
16
16
  targetField,
17
17
  } from "./automation-provenance-contract.mjs";
18
18
  import { observedRunChronology } from "./github-attestation-recovery.mjs";
19
+ import { cancelOperatorOf } from "./npm-update-policy.mjs";
19
20
  import {
20
21
  verifiedRole,
21
22
  matchSigningTime,
@@ -115,6 +116,13 @@ export function assertManualCancellation(
115
116
  return String(actor.id);
116
117
  }
117
118
 
119
+ /** A Jira/Linear record names its work item by key (#4873); a GitHub one by repository#number. */
120
+ const VENDOR_ITEM = /^[A-Z][A-Z0-9]{1,9}-[1-9]\d*$/;
121
+ const VENDOR_ID = /^[A-Za-z0-9-]{1,64}$/;
122
+ function vendorRecord(value) {
123
+ return VENDOR_ITEM.test(value.workItem);
124
+ }
125
+
118
126
  /** The closed subject preserves one stale origin and one exact replacement, with no published destination. */
119
127
  export function validateCancellation(value, expected) {
120
128
  // Only a non-main target is recorded; the final canonical comparison binds it.
@@ -136,19 +144,21 @@ export function validateCancellation(value, expected) {
136
144
  value.oldParent !== value.parent &&
137
145
  value.oldProposalKey !== value.proposalKey &&
138
146
  typeof value.workItem === "string" &&
139
- value.workItem.startsWith(`${value.repository}#`) &&
140
- DECIMAL.test(value.workItem.slice(value.repository.length + 1)),
147
+ (vendorRecord(value) ||
148
+ (value.workItem.startsWith(`${value.repository}#`) &&
149
+ DECIMAL.test(value.workItem.slice(value.repository.length + 1)))),
141
150
  "invalid stale cancellation scope"
142
151
  );
152
+ // A Jira/Linear claim id is an opaque tracker comment id; the adapter proves the comment (#4873).
153
+ required(
154
+ typeof value.claimCommentId === "string" &&
155
+ (vendorRecord(value)
156
+ ? VENDOR_ID.test(value.claimCommentId)
157
+ : DECIMAL.test(value.claimCommentId)),
158
+ "invalid stale cancellation claim"
159
+ );
143
160
  required(
144
- [
145
- "repositoryId",
146
- "ownerId",
147
- "claimCommentId",
148
- "operatorId",
149
- "runId",
150
- "runAttempt",
151
- ].every(
161
+ ["repositoryId", "ownerId", "operatorId", "runId", "runAttempt"].every(
152
162
  key => typeof value[key] === "string" && DECIMAL.test(value[key])
153
163
  ) &&
154
164
  [
@@ -237,7 +247,8 @@ export function cancellationRecord(
237
247
  leafBodySha256: sha256(origin.allocation.draft.body),
238
248
  policySha256: sha256(canonicalJson(authority)),
239
249
  npmPolicySha256: proposal.policySha256,
240
- maintainer: proposalPolicy(config, proposal).maintainer,
250
+ // The GitHub login that authorized the cancel; on Jira/Linear the declared cancelOperator.
251
+ maintainer: cancelOperatorOf(config, proposalPolicy(config, proposal)),
241
252
  operatorId,
242
253
  runId: invocation.runId,
243
254
  runAttempt: invocation.runAttempt,
@@ -12,6 +12,8 @@ import {
12
12
  policyTarget,
13
13
  } from "./npm-update-contract.mjs";
14
14
  import { proposalPolicy } from "./automation-provenance-contract.mjs";
15
+ import { cancelOperatorOf } from "./npm-update-policy.mjs";
16
+ import { trackerOf, assertManagedClosure } from "./npm-update-tracker.mjs";
15
17
  import { readBytes, readJson, writeJson } from "./npm-update-process.mjs";
16
18
  import { assertHostedGate } from "./npm-update-hosted-gate.mjs";
17
19
  import { sha256 } from "./github-attestation-verifier.mjs";
@@ -75,14 +77,16 @@ async function manualAuthority(api, proposal, config, request) {
75
77
  const run = await api.request(
76
78
  `repos/${proposal.repository}/actions/runs/${invocation.runId}/attempts/${invocation.runAttempt}`
77
79
  );
80
+ // GitHub: the maintainer's login. Jira/Linear: the declared GitHub cancelOperator (#4873).
81
+ const operator = cancelOperatorOf(config, policy);
78
82
  const permission = await api.request(
79
- `repos/${proposal.repository}/collaborators/${policy.maintainer}/permission`
83
+ `repos/${proposal.repository}/collaborators/${operator}/permission`
80
84
  );
81
85
  const operatorId = assertManualCancellation(
82
86
  run,
83
87
  permission,
84
88
  api.policy,
85
- policy.maintainer,
89
+ operator,
86
90
  proposal,
87
91
  request,
88
92
  invocation
@@ -109,7 +113,7 @@ async function cancellationState(context) {
109
113
  manualAuthority(api, proposal, config, request)
110
114
  );
111
115
  const prior = await discoverPrior(api, proposal, { cwd, config });
112
- const issue = await api.issue(request.number);
116
+ const issue = await trackerOf(api).issue(request.number);
113
117
  const origin = await withStage("cancel-origin", () =>
114
118
  authenticateStaleOrigin({ api, cwd, issue, proposal, config })
115
119
  );
@@ -228,8 +232,14 @@ export async function finalizeCancellation(context) {
228
232
  };
229
233
  if (!current.recorded)
230
234
  await withStage("cancel-checkpoint", () =>
231
- persistCheckpoint(api, request.number, payload, digest, () =>
232
- authorizeCancellation(context, record, paths, state)
235
+ persistCheckpoint(
236
+ api,
237
+ request.number,
238
+ payload,
239
+ digest,
240
+ () => authorizeCancellation(context, record, paths, state),
241
+ // Only a Jira/Linear host routes the checkpoint through its adapter.
242
+ api.tracker ? context.config : undefined
233
243
  )
234
244
  );
235
245
  const issue = (await authorizeCancellation(context, record, paths, state))
@@ -241,20 +251,22 @@ export async function finalizeCancellation(context) {
241
251
  );
242
252
  if (issue.state === "open")
243
253
  await withStage("cancel-close", () =>
244
- api.request(
245
- `repos/${proposal.repository}/issues/${request.number}`,
246
- "PATCH",
247
- { state: "closed", state_reason: "not_planned" }
248
- )
254
+ api.tracker
255
+ ? api.tracker.cancel(request.number)
256
+ : api.request(
257
+ `repos/${proposal.repository}/issues/${request.number}`,
258
+ "PATCH",
259
+ { state: "closed", state_reason: "not_planned" }
260
+ )
249
261
  );
250
- const closed = await api.issue(request.number);
262
+ const closed = await trackerOf(api).issue(request.number);
251
263
  required(
252
- closed.state === "closed" &&
253
- closed.state_reason === "not_planned" &&
254
- closed.closed_by?.type === "Bot" &&
255
- String(closed.closed_by.id) === api.policy.claimActorId &&
256
- closed.body === issue.body &&
257
- closed.title === issue.title,
264
+ closed.body === issue.body && closed.title === issue.title,
265
+ "cancellation closure readback differs"
266
+ );
267
+ await assertManagedClosure(
268
+ api,
269
+ closed,
258
270
  "cancellation closure readback differs"
259
271
  );
260
272
  await api.main(proposal.parent, proposal.target);
@@ -33,11 +33,21 @@ export function controllerSubject(context, phase, pr, proofs = []) {
33
33
  const { config, policy, proposal, allocation } = context;
34
34
  const descriptor = context.descriptor ?? context.preview?.descriptor;
35
35
  leafRoles(config, policy.repository, policyTarget(policy));
36
+ const vendor = config.tracker === "jira" || config.tracker === "linear";
37
+ const prefix = vendor
38
+ ? `${String(
39
+ config.tracker === "jira"
40
+ ? config.jira?.project
41
+ : config.linear?.teamKey
42
+ )
43
+ .trim()
44
+ .toUpperCase()}-`
45
+ : `${policy.repository}#`;
36
46
  required(
37
47
  proposal.repository === policy.repository &&
38
48
  Number.isSafeInteger(allocation.number) &&
39
49
  allocation.number > 0 &&
40
- allocation.workItem === `${policy.repository}#${allocation.number}` &&
50
+ allocation.workItem === `${prefix}${allocation.number}` &&
41
51
  descriptor?.parent === proposal.parent &&
42
52
  descriptor.workItem === allocation.workItem &&
43
53
  descriptor.claimCommentId === allocation.claimCommentId,
@@ -72,6 +82,8 @@ export function controllerSubject(context, phase, pr, proofs = []) {
72
82
  pr: pr === null ? null : { number: String(pr.number), url: pr.html_url },
73
83
  proofs,
74
84
  ...targetField(proposal),
85
+ // Only a Jira/Linear subject names its key, so a GitHub subject keeps its exact shape (#4873).
86
+ ...(vendor ? { workItem: allocation.workItem } : {}),
75
87
  };
76
88
  createGhRequests(subject);
77
89
  return subject;
@@ -211,6 +223,12 @@ function canonicalRecipe(context, authority) {
211
223
  GH_HOST: "github.com",
212
224
  GITHUB_REPOSITORY: context.policy.repository,
213
225
  GIT_TERMINAL_PROMPT: "0",
226
+ // A Jira/Linear item is bound offline: this broker holds no tracker
227
+ // credential by design, and the claim is proved by the adapter at
228
+ // checkpoint and again before publication (#4873).
229
+ ...(["jira", "linear"].includes(context.config.tracker)
230
+ ? { LISA_WORK_ITEM_VERIFY: "trailer" }
231
+ : {}),
214
232
  },
215
233
  };
216
234
  }
@@ -293,6 +293,11 @@ export async function gateProposal(context) {
293
293
  GIT_COMMITTER_EMAIL: MAIL,
294
294
  GIT_AUTHOR_DATE: `${preview.epoch} +0000`,
295
295
  GIT_COMMITTER_DATE: `${preview.epoch} +0000`,
296
+ // The gate holds no Jira/Linear credential (dependency code runs here),
297
+ // so the hooks bind that key offline; the adapter proves the claim (#4873).
298
+ ...(["jira", "linear"].includes(context.config?.tracker)
299
+ ? { LISA_WORK_ITEM_VERIFY: "trailer" }
300
+ : {}),
296
301
  };
297
302
  const branch = await withStage("gate-stage", () =>
298
303
  stageProposal(scoped, env)