looply-cli 0.5.39 → 0.5.48

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 (164) hide show
  1. package/dist/.src-hash +1 -1
  2. package/dist/account-standing.d.ts +23 -0
  3. package/dist/account-standing.d.ts.map +1 -0
  4. package/dist/account-standing.js +41 -0
  5. package/dist/account-standing.js.map +1 -0
  6. package/dist/autonomy-controller.d.ts.map +1 -1
  7. package/dist/autonomy-controller.js +6 -0
  8. package/dist/autonomy-controller.js.map +1 -1
  9. package/dist/autonomy-tick.d.ts.map +1 -1
  10. package/dist/autonomy-tick.js +20 -2
  11. package/dist/autonomy-tick.js.map +1 -1
  12. package/dist/bin.d.ts.map +1 -1
  13. package/dist/bin.js +5 -0
  14. package/dist/bin.js.map +1 -1
  15. package/dist/branch-delivery-wiring.d.ts +56 -1
  16. package/dist/branch-delivery-wiring.d.ts.map +1 -1
  17. package/dist/branch-delivery-wiring.js +135 -26
  18. package/dist/branch-delivery-wiring.js.map +1 -1
  19. package/dist/branch-delivery.d.ts +20 -0
  20. package/dist/branch-delivery.d.ts.map +1 -1
  21. package/dist/branch-delivery.js +78 -6
  22. package/dist/branch-delivery.js.map +1 -1
  23. package/dist/canary-cmd.d.ts +42 -0
  24. package/dist/canary-cmd.d.ts.map +1 -0
  25. package/dist/canary-cmd.js +242 -0
  26. package/dist/canary-cmd.js.map +1 -0
  27. package/dist/canary-wiring.d.ts +31 -0
  28. package/dist/canary-wiring.d.ts.map +1 -0
  29. package/dist/canary-wiring.js +139 -0
  30. package/dist/canary-wiring.js.map +1 -0
  31. package/dist/canary.d.ts +123 -0
  32. package/dist/canary.d.ts.map +1 -0
  33. package/dist/canary.js +259 -0
  34. package/dist/canary.js.map +1 -0
  35. package/dist/checkout-deps.d.ts +6 -0
  36. package/dist/checkout-deps.d.ts.map +1 -1
  37. package/dist/checkout-deps.js +11 -0
  38. package/dist/checkout-deps.js.map +1 -1
  39. package/dist/checkout-leftovers.d.ts.map +1 -1
  40. package/dist/checkout-leftovers.js +28 -21
  41. package/dist/checkout-leftovers.js.map +1 -1
  42. package/dist/coordinator-state.d.ts.map +1 -1
  43. package/dist/coordinator-state.js +6 -4
  44. package/dist/coordinator-state.js.map +1 -1
  45. package/dist/daemon-cmd.d.ts.map +1 -1
  46. package/dist/daemon-cmd.js +76 -1
  47. package/dist/daemon-cmd.js.map +1 -1
  48. package/dist/deliver-cmd.d.ts +11 -0
  49. package/dist/deliver-cmd.d.ts.map +1 -1
  50. package/dist/deliver-cmd.js +23 -0
  51. package/dist/deliver-cmd.js.map +1 -1
  52. package/dist/environment-hold.d.ts +32 -1
  53. package/dist/environment-hold.d.ts.map +1 -1
  54. package/dist/environment-hold.js +52 -5
  55. package/dist/environment-hold.js.map +1 -1
  56. package/dist/feature-report.d.ts +4 -2
  57. package/dist/feature-report.d.ts.map +1 -1
  58. package/dist/feature-report.js +47 -6
  59. package/dist/feature-report.js.map +1 -1
  60. package/dist/gate-health.d.ts +7 -0
  61. package/dist/gate-health.d.ts.map +1 -1
  62. package/dist/gate-health.js +11 -1
  63. package/dist/gate-health.js.map +1 -1
  64. package/dist/git-driver.d.ts +5 -0
  65. package/dist/git-driver.d.ts.map +1 -1
  66. package/dist/git-driver.js +8 -0
  67. package/dist/git-driver.js.map +1 -1
  68. package/dist/goal-adaptive.d.ts +25 -1
  69. package/dist/goal-adaptive.d.ts.map +1 -1
  70. package/dist/goal-adaptive.js +42 -1
  71. package/dist/goal-adaptive.js.map +1 -1
  72. package/dist/goal-compile.d.ts.map +1 -1
  73. package/dist/goal-compile.js +16 -0
  74. package/dist/goal-compile.js.map +1 -1
  75. package/dist/goal-gap.d.ts +35 -3
  76. package/dist/goal-gap.d.ts.map +1 -1
  77. package/dist/goal-gap.js +110 -11
  78. package/dist/goal-gap.js.map +1 -1
  79. package/dist/grant-waiting-wiring.d.ts +17 -1
  80. package/dist/grant-waiting-wiring.d.ts.map +1 -1
  81. package/dist/grant-waiting-wiring.js +29 -2
  82. package/dist/grant-waiting-wiring.js.map +1 -1
  83. package/dist/heroku-cli.d.ts +13 -1
  84. package/dist/heroku-cli.d.ts.map +1 -1
  85. package/dist/heroku-cli.js +15 -0
  86. package/dist/heroku-cli.js.map +1 -1
  87. package/dist/machine-settings.d.ts +11 -0
  88. package/dist/machine-settings.d.ts.map +1 -1
  89. package/dist/machine-settings.js +41 -0
  90. package/dist/machine-settings.js.map +1 -1
  91. package/dist/outcome-audit.d.ts +150 -0
  92. package/dist/outcome-audit.d.ts.map +1 -0
  93. package/dist/outcome-audit.js +310 -0
  94. package/dist/outcome-audit.js.map +1 -0
  95. package/dist/parts-attribution.d.ts +38 -0
  96. package/dist/parts-attribution.d.ts.map +1 -0
  97. package/dist/parts-attribution.js +61 -0
  98. package/dist/parts-attribution.js.map +1 -0
  99. package/dist/project-terminal.d.ts +3 -1
  100. package/dist/project-terminal.d.ts.map +1 -1
  101. package/dist/project-terminal.js +37 -5
  102. package/dist/project-terminal.js.map +1 -1
  103. package/dist/provider-accounts.d.ts +5 -1
  104. package/dist/provider-accounts.d.ts.map +1 -1
  105. package/dist/provider-accounts.js +1 -0
  106. package/dist/provider-accounts.js.map +1 -1
  107. package/dist/pursuit-delivery.d.ts +5 -20
  108. package/dist/pursuit-delivery.d.ts.map +1 -1
  109. package/dist/pursuit-delivery.js +30 -2
  110. package/dist/pursuit-delivery.js.map +1 -1
  111. package/dist/pursuit-ending.d.ts.map +1 -1
  112. package/dist/pursuit-ending.js +10 -0
  113. package/dist/pursuit-ending.js.map +1 -1
  114. package/dist/qa-feedback.d.ts +110 -0
  115. package/dist/qa-feedback.d.ts.map +1 -0
  116. package/dist/qa-feedback.js +353 -0
  117. package/dist/qa-feedback.js.map +1 -0
  118. package/dist/run-cmd.d.ts.map +1 -1
  119. package/dist/run-cmd.js +90 -7
  120. package/dist/run-cmd.js.map +1 -1
  121. package/dist/run-refusal-marks.d.ts +8 -1
  122. package/dist/run-refusal-marks.d.ts.map +1 -1
  123. package/dist/run-refusal-marks.js +14 -1
  124. package/dist/run-refusal-marks.js.map +1 -1
  125. package/dist/self-update.d.ts +440 -0
  126. package/dist/self-update.d.ts.map +1 -0
  127. package/dist/self-update.js +1006 -0
  128. package/dist/self-update.js.map +1 -0
  129. package/dist/serve-cmd.d.ts +32 -1
  130. package/dist/serve-cmd.d.ts.map +1 -1
  131. package/dist/serve-cmd.js +162 -7
  132. package/dist/serve-cmd.js.map +1 -1
  133. package/dist/serve.d.ts.map +1 -1
  134. package/dist/serve.js +3 -0
  135. package/dist/serve.js.map +1 -1
  136. package/dist/server-client.d.ts +32 -1
  137. package/dist/server-client.d.ts.map +1 -1
  138. package/dist/server-client.js +28 -0
  139. package/dist/server-client.js.map +1 -1
  140. package/dist/setup-check-wiring.d.ts +31 -0
  141. package/dist/setup-check-wiring.d.ts.map +1 -0
  142. package/dist/setup-check-wiring.js +195 -0
  143. package/dist/setup-check-wiring.js.map +1 -0
  144. package/dist/setup-check.d.ts +228 -0
  145. package/dist/setup-check.d.ts.map +1 -0
  146. package/dist/setup-check.js +632 -0
  147. package/dist/setup-check.js.map +1 -0
  148. package/dist/signals.d.ts +13 -0
  149. package/dist/signals.d.ts.map +1 -1
  150. package/dist/signals.js +26 -1
  151. package/dist/signals.js.map +1 -1
  152. package/dist/ticket-attachments.d.ts +31 -1
  153. package/dist/ticket-attachments.d.ts.map +1 -1
  154. package/dist/ticket-attachments.js +232 -9
  155. package/dist/ticket-attachments.js.map +1 -1
  156. package/dist/watchdog-wiring.d.ts +151 -0
  157. package/dist/watchdog-wiring.d.ts.map +1 -0
  158. package/dist/watchdog-wiring.js +406 -0
  159. package/dist/watchdog-wiring.js.map +1 -0
  160. package/dist/watchdog.d.ts +124 -0
  161. package/dist/watchdog.d.ts.map +1 -0
  162. package/dist/watchdog.js +444 -0
  163. package/dist/watchdog.js.map +1 -0
  164. package/package.json +4 -4
package/dist/run-cmd.js CHANGED
@@ -77,7 +77,9 @@ const goal_replay_1 = require("./goal-replay");
77
77
  const branch_replay_1 = require("./branch-replay");
78
78
  const run_base_2 = require("./run-base");
79
79
  const round_records_1 = require("./round-records");
80
+ const parts_attribution_1 = require("./parts-attribution");
80
81
  const goal_gap_1 = require("./goal-gap");
82
+ const qa_feedback_1 = require("./qa-feedback");
81
83
  const adaptive_budget_1 = require("./adaptive-budget");
82
84
  const visual_proof_run_1 = require("./visual-proof-run");
83
85
  const bug_repro_1 = require("./bug-repro");
@@ -3527,7 +3529,24 @@ async function runLoop(opts) {
3527
3529
  // A reproduced bug is met only when its test passes at this tree, run by the machine (`bug-repro.ts`).
3528
3530
  // The ticket's images are named to the check too (LOO-B-2).
3529
3531
  const seen = { ...i, goalText: (0, ticket_attachments_1.withAttachments)(i.goalText, cwd, `${bound.id}@${bound.version}`) };
3530
- const gap = await (0, goal_gap_1.evaluateGoalGap)(screenshots.length > 0 ? { ...seen, screenshots } : seen, { invoke: planAgent, timeoutMs: adaptiveBudget.checkMs });
3532
+ /**
3533
+ * A SEND-BACK'S PROOFS are checked against this work's own changes (`qa-feedback.ts`): the files changed
3534
+ * from the merge base with the base branch to HEAD, read at this tree. Read only for a send-back; null
3535
+ * when the base or the diff could not be read (then a cited file must at least exist and hold the line).
3536
+ */
3537
+ const qaProof = (0, qa_feedback_1.qaFeedbackOf)(bound.text) === null
3538
+ ? undefined
3539
+ : {
3540
+ changedFiles: await (async () => {
3541
+ const base = (await (0, run_base_2.resolveBaseBranch)(git, config.run.baseBranch).catch(() => null))?.ref ?? null;
3542
+ const head = await git.headSha().catch(() => null);
3543
+ const from = base === null || head === null ? null : await git.mergeBase(base, head);
3544
+ return from === null || head === null ? null : await git.changedPathsBetween(from, head).catch(() => null);
3545
+ })(),
3546
+ readFile: (0, bug_repro_1.checkoutReader)(cwd),
3547
+ };
3548
+ const proofDeps = qaProof === undefined ? {} : { qaProof };
3549
+ const gap = await (0, goal_gap_1.evaluateGoalGap)(screenshots.length > 0 ? { ...seen, screenshots } : seen, Object.assign(proofDeps, { invoke: planAgent, timeoutMs: adaptiveBudget.checkMs }));
3531
3550
  if (!gap.ok && gap.timedOut === true)
3532
3551
  checkTimedOut = true;
3533
3552
  return (0, bug_repro_1.evaluateWithReproduction)(gap, reproFor(goalId, bound.version), {
@@ -3715,6 +3734,10 @@ async function runLoop(opts) {
3715
3734
  */
3716
3735
  await recordDelivery(scope, bound.version);
3717
3736
  }
3737
+ // A bundle met in part delivers too: its "delivery" claim names the delivered commit, so a goal that builds on
3738
+ // it (the blocked ticket's answer, a dependent) is cut from that commit, not the branch tip (`cutPointFor`).
3739
+ if (adaptive.kind === 'partly-met')
3740
+ await recordDelivery(scope, bound.version);
3718
3741
  if (adaptive.kind === 'planned') {
3719
3742
  const at = Date.now();
3720
3743
  const next = adaptive.revision;
@@ -3936,7 +3959,48 @@ async function runLoop(opts) {
3936
3959
  ? { runId: deliveringRunId, sha: deliveringSha, checks: Object.fromEntries(key2Saw.checks) }
3937
3960
  : undefined;
3938
3961
  // A split goal (RBB-B-209) delivers what this repository holds too, when its evidence held.
3939
- const delivery = said.terminal && (said.code === 'goal_satisfied' || said.code === 'sibling_change_required') ? deliveryNow() : undefined;
3962
+ const delivered = said.terminal && (said.code === 'goal_satisfied' || said.code === 'sibling_change_required' || said.code === 'goal_partly_met') ? deliveryNow() : undefined;
3963
+ // A bundle met in part names which tickets this delivery is for (core `goal-parts.ts`).
3964
+ // 🔴 And whether an open ticket's work rides along: the plan steps of ANY revision or version whose commits the
3965
+ // delivered commit holds (`keptPartTitles`), by the ticket key each title starts with (`partsHeldBy`). Unknown
3966
+ // attribution holds it — review, never merged.
3967
+ const keptTitles = async () => {
3968
+ if (binding.kind !== 'bound')
3969
+ return null;
3970
+ if (deliveringSha === null)
3971
+ return null;
3972
+ const records = await (0, round_records_1.readRoundRecords)(stateDir, ledger_store_1.nodeLedgerFs).catch(() => null);
3973
+ // What the delivered commit adds on top of the base and the goals it declares it builds on (their delivered
3974
+ // commit, else their run branch). Anything git cannot answer is unknown. ORIGIN's base, not a local one that
3975
+ // may be ahead of it: a commit only local main has is not in what the pull request merges into.
3976
+ const localBase = (await (0, run_base_2.resolveBaseBranch)(git, config.run.baseBranch).catch(() => null))?.ref ?? null;
3977
+ const base = localBase === null ? null : await (0, parts_attribution_1.originBaseOf)(git, localBase);
3978
+ const claims = (0, lane_claims_1.readLaneClaims)(cwd);
3979
+ const depTips = (binding.goal.dependsOn ?? []).flatMap((d) => {
3980
+ const mine = claims.filter((c) => c.goalId === d);
3981
+ const delivery = [...mine].reverse().find((c) => c.kind === 'delivery');
3982
+ const branchClaim = [...mine].reverse().find((c) => c.kind === 'claims');
3983
+ return delivery !== undefined ? [delivery.commitSha] : branchClaim !== undefined ? [branchClaim.branch] : [];
3984
+ });
3985
+ const commits = base === null ? null : await git.commitsNotIn(deliveringSha, [base, ...depTips]).catch(() => null);
3986
+ return (0, parts_attribution_1.keptPartTitles)({
3987
+ items: queue.list(),
3988
+ delivered: key2Saw === null ? [] : [...key2Saw.delivered],
3989
+ rounds: records !== null && records.ok ? records.rounds : null,
3990
+ commits,
3991
+ aliases: (0, goal_replay_1.replayedAs)(projectStateDirPath, binding.goal.id),
3992
+ });
3993
+ };
3994
+ const kept = delivered !== undefined && adaptive.kind === 'partly-met' ? await keptTitles() : null;
3995
+ // Not knowable → held on every open ticket.
3996
+ const heldBy = delivered === undefined || adaptive.kind !== 'partly-met'
3997
+ ? null
3998
+ : kept === null
3999
+ ? adaptive.parts.filter((p) => !p.met).map((p) => p.ref)
4000
+ : (0, core_4.partsHeldBy)(adaptive.parts, kept);
4001
+ const delivery = delivered !== undefined && adaptive.kind === 'partly-met'
4002
+ ? { ...delivered, parts: adaptive.parts, ...(heldBy === null ? {} : { partsHeldBy: heldBy }) }
4003
+ : delivered;
3940
4004
  await releaseHold();
3941
4005
  // The branch the controller will ask the lane about: the one that delivered (F20).
3942
4006
  const refusedOn = deliveredOn;
@@ -4485,11 +4549,20 @@ async function runLoop(opts) {
4485
4549
  let record;
4486
4550
  try {
4487
4551
  const treeSha = await git.headTreeSha();
4488
- const key = (0, gate_health_1.baseHealthKey)(treeSha, steps, daemon_cmd_1.CLI_VERSION);
4552
+ /**
4553
+ * 🔴 THE INSTALLED VERSION, NOT `CLI_VERSION` (a constant '0.1.0' that never moves): keyed on that,
4554
+ * a new Looply reused the old one's answer — the very thing the version in the key is for.
4555
+ * The setup check (`setup-check.ts`) keys its record the same way, so the first goal reuses it.
4556
+ */
4557
+ const key = (0, gate_health_1.baseHealthKey)(treeSha, steps, (0, daemon_cmd_1.installedCliVersion)());
4489
4558
  record = (0, gate_health_1.readBaseHealth)(projectStateDirPath);
4490
- // Dependencies installed this run: what any earlier check of this base said was said without them.
4491
- if (!depsInstalled && (0, gate_health_1.reusable)(record, key, Date.now())) {
4492
- log(`base : the checks on this base were ${record.state} at ${record.checkedAt}`);
4559
+ /**
4560
+ * Dependencies installed this run: what an earlier check of this base said was said without them —
4561
+ * unless it, too, ran with them installed AND found the base healthy (the setup check's throwaway
4562
+ * checkout does). A quarantined or red answer is never carried across an install: this run decides.
4563
+ */
4564
+ if ((!depsInstalled || (record?.withDependencies === true && record.state === 'healthy')) && (0, gate_health_1.reusable)(record, key, Date.now())) {
4565
+ log(`base : the checks on this base were ${record.state} at ${record.checkedAt}${record.by === 'setup' ? ' (checked when the repository was set up)' : ''}`);
4493
4566
  }
4494
4567
  else {
4495
4568
  log('base : running the checks on the unchanged base before the first round');
@@ -4506,7 +4579,17 @@ async function runLoop(opts) {
4506
4579
  log(`base : the full output of the red "${step}" run is kept at ${at}`);
4507
4580
  },
4508
4581
  });
4509
- record = { version: 1, key, treeSha, baseSha: await git.headSha(), checkedAt: new Date().toISOString(), state: checked.state, steps: checked.steps };
4582
+ record = {
4583
+ version: 1,
4584
+ key,
4585
+ treeSha,
4586
+ baseSha: await git.headSha(),
4587
+ checkedAt: new Date().toISOString(),
4588
+ state: checked.state,
4589
+ steps: checked.steps,
4590
+ ...(depsInstalled ? { withDependencies: true } : {}),
4591
+ by: 'run',
4592
+ };
4510
4593
  try {
4511
4594
  (0, gate_health_1.writeBaseHealth)(projectStateDirPath, record);
4512
4595
  }