looply-cli 0.5.51 → 0.5.53

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 (142) hide show
  1. package/dist/account-connect.d.ts +2 -1
  2. package/dist/account-connect.d.ts.map +1 -1
  3. package/dist/account-connect.js.map +1 -1
  4. package/dist/adaptive-budget.d.ts +6 -0
  5. package/dist/adaptive-budget.d.ts.map +1 -1
  6. package/dist/adaptive-budget.js +9 -0
  7. package/dist/adaptive-budget.js.map +1 -1
  8. package/dist/autonomy-controller.d.ts.map +1 -1
  9. package/dist/autonomy-controller.js +19 -0
  10. package/dist/autonomy-controller.js.map +1 -1
  11. package/dist/base-check-turns.d.ts +38 -0
  12. package/dist/base-check-turns.d.ts.map +1 -0
  13. package/dist/base-check-turns.js +118 -0
  14. package/dist/base-check-turns.js.map +1 -0
  15. package/dist/bin.d.ts.map +1 -1
  16. package/dist/bin.js +32 -2
  17. package/dist/bin.js.map +1 -1
  18. package/dist/branch-delivery.d.ts +48 -1
  19. package/dist/branch-delivery.d.ts.map +1 -1
  20. package/dist/branch-delivery.js +203 -4
  21. package/dist/branch-delivery.js.map +1 -1
  22. package/dist/bug-repro.d.ts +89 -9
  23. package/dist/bug-repro.d.ts.map +1 -1
  24. package/dist/bug-repro.js +242 -14
  25. package/dist/bug-repro.js.map +1 -1
  26. package/dist/checkout-carry.d.ts +31 -0
  27. package/dist/checkout-carry.d.ts.map +1 -1
  28. package/dist/checkout-carry.js +98 -3
  29. package/dist/checkout-carry.js.map +1 -1
  30. package/dist/checkout-deps.d.ts +2 -0
  31. package/dist/checkout-deps.d.ts.map +1 -1
  32. package/dist/checkout-deps.js +2 -0
  33. package/dist/checkout-deps.js.map +1 -1
  34. package/dist/daemon-cmd.d.ts +1 -1
  35. package/dist/daemon-cmd.d.ts.map +1 -1
  36. package/dist/daemon-cmd.js +10 -3
  37. package/dist/daemon-cmd.js.map +1 -1
  38. package/dist/fresh-gates.d.ts.map +1 -1
  39. package/dist/fresh-gates.js +13 -0
  40. package/dist/fresh-gates.js.map +1 -1
  41. package/dist/gate-health.d.ts +2 -0
  42. package/dist/gate-health.d.ts.map +1 -1
  43. package/dist/gate-health.js +41 -4
  44. package/dist/gate-health.js.map +1 -1
  45. package/dist/goal-adaptive.d.ts +45 -3
  46. package/dist/goal-adaptive.d.ts.map +1 -1
  47. package/dist/goal-adaptive.js +104 -16
  48. package/dist/goal-adaptive.js.map +1 -1
  49. package/dist/goal-already-met.d.ts +62 -0
  50. package/dist/goal-already-met.d.ts.map +1 -0
  51. package/dist/goal-already-met.js +95 -0
  52. package/dist/goal-already-met.js.map +1 -0
  53. package/dist/goal-execution-evidence.d.ts +7 -1
  54. package/dist/goal-execution-evidence.d.ts.map +1 -1
  55. package/dist/goal-execution-evidence.js +12 -1
  56. package/dist/goal-execution-evidence.js.map +1 -1
  57. package/dist/goal-gap.d.ts +48 -5
  58. package/dist/goal-gap.d.ts.map +1 -1
  59. package/dist/goal-gap.js +103 -13
  60. package/dist/goal-gap.js.map +1 -1
  61. package/dist/integration-deps.d.ts.map +1 -1
  62. package/dist/integration-deps.js +18 -0
  63. package/dist/integration-deps.js.map +1 -1
  64. package/dist/machine-settings.d.ts +9 -0
  65. package/dist/machine-settings.d.ts.map +1 -1
  66. package/dist/machine-settings.js +35 -2
  67. package/dist/machine-settings.js.map +1 -1
  68. package/dist/output-gist.d.ts +40 -0
  69. package/dist/output-gist.d.ts.map +1 -0
  70. package/dist/output-gist.js +107 -0
  71. package/dist/output-gist.js.map +1 -0
  72. package/dist/plan-recovery.d.ts +14 -3
  73. package/dist/plan-recovery.d.ts.map +1 -1
  74. package/dist/plan-recovery.js +24 -6
  75. package/dist/plan-recovery.js.map +1 -1
  76. package/dist/provider-accounts.d.ts +0 -6
  77. package/dist/provider-accounts.d.ts.map +1 -1
  78. package/dist/provider-accounts.js +0 -6
  79. package/dist/provider-accounts.js.map +1 -1
  80. package/dist/pursuit-ending.d.ts.map +1 -1
  81. package/dist/pursuit-ending.js +11 -0
  82. package/dist/pursuit-ending.js.map +1 -1
  83. package/dist/quarantine-report.d.ts +32 -0
  84. package/dist/quarantine-report.d.ts.map +1 -0
  85. package/dist/quarantine-report.js +75 -0
  86. package/dist/quarantine-report.js.map +1 -0
  87. package/dist/round-runner.d.ts +13 -2
  88. package/dist/round-runner.d.ts.map +1 -1
  89. package/dist/round-runner.js +5 -1
  90. package/dist/round-runner.js.map +1 -1
  91. package/dist/run-cmd.d.ts.map +1 -1
  92. package/dist/run-cmd.js +84 -11
  93. package/dist/run-cmd.js.map +1 -1
  94. package/dist/self-update.d.ts.map +1 -1
  95. package/dist/self-update.js +5 -15
  96. package/dist/self-update.js.map +1 -1
  97. package/dist/serve-cmd.d.ts +9 -0
  98. package/dist/serve-cmd.d.ts.map +1 -1
  99. package/dist/serve-cmd.js +45 -1
  100. package/dist/serve-cmd.js.map +1 -1
  101. package/dist/serve-log.d.ts +52 -0
  102. package/dist/serve-log.d.ts.map +1 -0
  103. package/dist/serve-log.js +146 -0
  104. package/dist/serve-log.js.map +1 -0
  105. package/dist/serve.d.ts +7 -7
  106. package/dist/serve.d.ts.map +1 -1
  107. package/dist/serve.js +11 -15
  108. package/dist/serve.js.map +1 -1
  109. package/dist/server-client.d.ts +14 -2
  110. package/dist/server-client.d.ts.map +1 -1
  111. package/dist/server-client.js +24 -2
  112. package/dist/server-client.js.map +1 -1
  113. package/dist/setup-check-wiring.d.ts +8 -0
  114. package/dist/setup-check-wiring.d.ts.map +1 -1
  115. package/dist/setup-check-wiring.js +78 -22
  116. package/dist/setup-check-wiring.js.map +1 -1
  117. package/dist/setup-check.d.ts +4 -0
  118. package/dist/setup-check.d.ts.map +1 -1
  119. package/dist/setup-check.js +70 -3
  120. package/dist/setup-check.js.map +1 -1
  121. package/dist/steady-log.d.ts +48 -0
  122. package/dist/steady-log.d.ts.map +1 -0
  123. package/dist/steady-log.js +100 -0
  124. package/dist/steady-log.js.map +1 -0
  125. package/dist/verify-cmd.d.ts +0 -2
  126. package/dist/verify-cmd.d.ts.map +1 -1
  127. package/dist/verify-cmd.js +0 -5
  128. package/dist/verify-cmd.js.map +1 -1
  129. package/dist/workspace-builds.d.ts +153 -0
  130. package/dist/workspace-builds.d.ts.map +1 -0
  131. package/dist/workspace-builds.js +347 -0
  132. package/dist/workspace-builds.js.map +1 -0
  133. package/dist/workspace-quarantine.d.ts +36 -2
  134. package/dist/workspace-quarantine.d.ts.map +1 -1
  135. package/dist/workspace-quarantine.js +53 -0
  136. package/dist/workspace-quarantine.js.map +1 -1
  137. package/dist/workspace.d.ts.map +1 -1
  138. package/dist/workspace.js +11 -3
  139. package/dist/workspace.js.map +1 -1
  140. package/package.json +2 -2
  141. package/win/contained-node.cjs +110 -1
  142. package/dist/.src-hash +0 -1
package/dist/run-cmd.js CHANGED
@@ -29,6 +29,7 @@ const control_file_1 = require("./control-file");
29
29
  const git_driver_1 = require("./git-driver");
30
30
  const untrusted_gate_1 = require("./untrusted-gate");
31
31
  const checkout_deps_1 = require("./checkout-deps");
32
+ const workspace_builds_1 = require("./workspace-builds");
32
33
  const model_transport_1 = require("./model-transport");
33
34
  const agent_envelope_1 = require("./agent-envelope");
34
35
  const provider_limit_1 = require("./provider-limit");
@@ -73,6 +74,7 @@ const planner_timeouts_1 = require("./planner-timeouts");
73
74
  const plan_recovery_1 = require("./plan-recovery");
74
75
  const goal_execution_evidence_1 = require("./goal-execution-evidence");
75
76
  const goal_reproof_1 = require("./goal-reproof");
77
+ const goal_already_met_1 = require("./goal-already-met");
76
78
  const goal_replay_1 = require("./goal-replay");
77
79
  const branch_replay_1 = require("./branch-replay");
78
80
  const run_base_2 = require("./run-base");
@@ -794,6 +796,8 @@ async function runLoop(opts) {
794
796
  ...(withQuarantine ? { quarantineFor: (cmd) => gateQuarantine.get(cmd) ?? null } : {}),
795
797
  substituteFor: (cmd) => gateSubstitute.get(cmd) ?? null,
796
798
  });
799
+ /** What Looply built in this checkout, built again before a round's checks when the round changed it. */
800
+ const workspaceBuilds = (0, workspace_builds_1.workspaceRebuilds)(cwd, (0, checkout_deps_1.checkoutDepsFs)(cwd), log);
797
801
  const ledger = new ledger_store_1.LedgerStore(stateDir, ledger_store_1.nodeLedgerFs);
798
802
  const queue = new queue_store_1.QueueStore(stateDir, ledger_store_1.nodeLedgerFs);
799
803
  const evidence = new evidence_cache_1.EvidenceCache(stateDir, ledger_store_1.nodeLedgerFs);
@@ -2656,7 +2660,7 @@ async function runLoop(opts) {
2656
2660
  const boundGoal = opts.goalId === undefined ? undefined : goals.get(opts.goalId);
2657
2661
  const accountScope = {
2658
2662
  projectId: projectId === 'local' ? null : projectId,
2659
- requesterRef: (0, provider_accounts_1.requesterRefOf)(boundGoal),
2663
+ requesterRef: requesterRefOf(boundGoal),
2660
2664
  };
2661
2665
  const withFinalMessage = (invoke, role = 'implementer') => builtIn
2662
2666
  ? (0, agent_envelope_1.unwrapping)((0, provider_limit_1.waitingOutProviderLimits)(invoke, {
@@ -2881,7 +2885,7 @@ async function runLoop(opts) {
2881
2885
  let compileTimedOut = false;
2882
2886
  let checkTimedOut = false;
2883
2887
  // RBB-B-218: the step check's own tier, and whether a pass this run checked nothing in time.
2884
- const verifyKey = binding.kind === 'bound' ? (0, verify_cmd_2.verifyTimeoutKey)(binding.goal.id, binding.goal.version) : null;
2888
+ const verifyKey = binding.kind === 'bound' ? (0, adaptive_budget_1.verifyTimeoutKey)(binding.goal.id, binding.goal.version) : null;
2885
2889
  const verifyTier = (0, verify_cmd_2.verifierTierFor)(verifyKey === null ? 0 : (0, planner_timeouts_1.plannerTimeoutsFor)(projectStateDirPath, verifyKey));
2886
2890
  let verifyTimedOut = false;
2887
2891
  /**
@@ -3619,7 +3623,10 @@ async function runLoop(opts) {
3619
3623
  isAncestor: (a, of) => git.isAncestor(a, of),
3620
3624
  changedPathsBetween: (from, to) => git.changedPathsBetween(from, to),
3621
3625
  runGates: async (paths) => {
3622
- const gate = await (0, gate_1.runGate)({ steps: config.gates, changedPaths: paths, runner: gateRunnerHere(true) });
3626
+ const rebuilt = workspaceBuilds.before();
3627
+ const gate = await (0, gate_1.runGate)({ steps: [...rebuilt, ...config.gates], changedPaths: paths, runner: gateRunnerHere(true) });
3628
+ if (rebuilt.length > 0)
3629
+ workspaceBuilds.after(gate.steps);
3623
3630
  reproofVerdict = gate.verdict;
3624
3631
  return gate.steps;
3625
3632
  },
@@ -3680,13 +3687,55 @@ async function runLoop(opts) {
3680
3687
  ])),
3681
3688
  };
3682
3689
  }
3683
- return confirmed.ok ? { ok: true } : { ok: false, reason: confirmed.because };
3690
+ if (confirmed.ok)
3691
+ return { ok: true };
3692
+ return confirmed.nothingDelivered === true
3693
+ ? { ok: false, reason: confirmed.because, nothingDelivered: true }
3694
+ : { ok: false, reason: confirmed.because };
3684
3695
  },
3696
+ /**
3697
+ * KEY 2 FOR A GOAL THAT HAD NOTHING TO DO (`goal-already-met.ts`): the check's pointers exist here, this
3698
+ * commit is in the remote's base branch, and the gates — run now, with the pointed-at files as the changed
3699
+ * paths — pass every required step. Never asked for a carried commit: that is somebody's delivered work.
3700
+ */
3701
+ ...(judged.kind === 'carried'
3702
+ ? {}
3703
+ : {
3704
+ confirmAlreadyMet: async (head, where) => {
3705
+ const outcome = await (0, goal_already_met_1.confirmAlreadyMet)(head, where, {
3706
+ readFile: (0, bug_repro_1.checkoutReader)(cwd),
3707
+ baseRef: async () => {
3708
+ const local = (await (0, run_base_2.resolveBaseBranch)(git, config.run.baseBranch).catch(() => null))?.ref ?? null;
3709
+ return local === null ? null : (0, parts_attribution_1.originBaseOf)(git, local);
3710
+ },
3711
+ isAncestor: (a, of) => git.isAncestor(a, of),
3712
+ runGates: async (paths) => {
3713
+ log('goal : nothing needed changing — running the gates at the current tree to check the code is sound as it is');
3714
+ const rebuilt = workspaceBuilds.before();
3715
+ const gate = await (0, gate_1.runGate)({ steps: [...rebuilt, ...config.gates], changedPaths: [...paths], runner: gateRunnerHere(true) });
3716
+ if (rebuilt.length > 0)
3717
+ workspaceBuilds.after(gate.steps);
3718
+ return { steps: gate.steps, blocked: gate.verdict === 'blocked' };
3719
+ },
3720
+ requiredSteps: (0, effective_gates_1.deliveryRequired)(config.gates),
3721
+ });
3722
+ log(`goal : ${outcome.ok ? `already in the code (${outcome.where.join(', ')}), and the gates pass as it is` : `not shown to be already in the code — ${outcome.reason}`}`);
3723
+ return outcome.ok
3724
+ ? { ok: true }
3725
+ : outcome.unknown === true
3726
+ ? { ok: false, reason: outcome.reason, unknown: true }
3727
+ : { ok: false, reason: outcome.reason };
3728
+ },
3729
+ }),
3685
3730
  stillAuthoritative: () => freshAuthority(goalId, bound.version, bound.text),
3686
3731
  });
3687
3732
  // M3-2: the adaptive plan's answer is checked and recorded the same way; a plan
3688
3733
  // with every step refused is no decision, not an empty revision.
3689
3734
  let adaptiveChecked = null;
3735
+ // What the goal check said is missing, in the run log — it was written nowhere (`gapLogLines`).
3736
+ if (adaptive.kind === 'planned' || adaptive.kind === 'budget-exhausted')
3737
+ for (const l of (0, goal_adaptive_1.gapLogLines)(adaptive.gaps))
3738
+ log(l);
3690
3739
  if (adaptive.kind === 'planned') {
3691
3740
  const adaptiveAt = await git.headTreeSha().catch(() => null);
3692
3741
  adaptiveChecked = adaptive.steps.ok ? await (0, compile_check_1.checkCompiledPlan)(adaptive.steps.steps, compileReaders, adaptiveAt) : null;
@@ -4193,6 +4242,8 @@ async function runLoop(opts) {
4193
4242
  // just wrote, so it runs inside the boundary with Looply's own runtime
4194
4243
  // rather than as the daemon with the machine's.
4195
4244
  gateRunner: gateRunnerHere(true),
4245
+ // The workspace packages Looply built here, built again when a round changed them (`workspace-builds.ts`).
4246
+ workspaceBuilds,
4196
4247
  // ASKED EVERY ROUND, NEVER CACHED. ~0.6 s against a 45-minute agent
4197
4248
  // ceiling, and asking each time is what makes the three-round bound mean
4198
4249
  // anything — and what lets a machine that recovers mid-run carry on.
@@ -4534,14 +4585,27 @@ async function runLoop(opts) {
4534
4585
  let depsInstalled = false;
4535
4586
  const dependenciesBeforeFirstRound = async () => {
4536
4587
  const plan = (0, checkout_deps_1.dependencyInstallPlan)(config.gates, (0, checkout_deps_1.checkoutDepsFs)(cwd));
4537
- if (plan.length === 0)
4538
- return { ok: true };
4539
- const out = await (0, checkout_deps_1.installDependencies)({ plan, runner: (0, untrusted_gate_1.makeUntrustedGateRunner)(cwd, { network: 'internet-client' }), log });
4540
- if (out.kind === 'failed') {
4541
- log(`deps : ${out.because}`);
4542
- return { ok: false, because: out.because };
4588
+ if (plan.length > 0) {
4589
+ const out = await (0, checkout_deps_1.installDependencies)({ plan, runner: (0, untrusted_gate_1.makeUntrustedGateRunner)(cwd, { network: 'internet-client' }), log });
4590
+ if (out.kind === 'failed') {
4591
+ log(`deps : ${out.because}`);
4592
+ return { ok: false, because: out.because };
4593
+ }
4594
+ depsInstalled = out.kind === 'installed';
4595
+ }
4596
+ /**
4597
+ * THEN THE WORKSPACE'S OWN PACKAGES THE CHECKS IMPORT, built when their entry points are not here
4598
+ * (`workspace-builds.ts`): contained and offline, with the gates' own runner. A failed build is a
4599
+ * machine fault the goal waits on, in the build's own words; a base check said without the build
4600
+ * is not reused (`depsInstalled`), exactly as for an install.
4601
+ */
4602
+ const built = await (0, workspace_builds_1.buildWorkspacePackages)({ plan: (0, workspace_builds_1.workspaceBuildPlan)((0, checkout_deps_1.checkoutDepsFs)(cwd), cwd), runner: (0, untrusted_gate_1.makeUntrustedGateRunner)(cwd), log, checkout: cwd });
4603
+ if (built.kind === 'failed') {
4604
+ log(`build : ${built.because}`);
4605
+ return { ok: false, because: built.because };
4543
4606
  }
4544
- depsInstalled = out.kind === 'installed';
4607
+ if (built.kind === 'built')
4608
+ depsInstalled = true;
4545
4609
  return { ok: true };
4546
4610
  };
4547
4611
  const baseHealthBeforeFirstRound = async () => {
@@ -5170,4 +5234,13 @@ async function runLoop(opts) {
5170
5234
  (0, workspace_1.clearCreationMarker)(stateDir);
5171
5235
  }
5172
5236
  }
5237
+ /**
5238
+ * Who asked for the work a run is bound to (`requestedBy.ref` on its goal), or null — the requester an
5239
+ * account's owners may allow (`provider-accounts.ts`). Read here, in the composition root, so the
5240
+ * account store itself stays goal-blind (`goal-wiring.spec.ts`).
5241
+ */
5242
+ function requesterRefOf(goal) {
5243
+ const ref = goal?.requestedBy?.ref;
5244
+ return typeof ref === 'string' && ref !== '' ? ref : null;
5245
+ }
5173
5246
  //# sourceMappingURL=run-cmd.js.map