lua-cli 3.36.0 → 3.37.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.
@@ -2279,6 +2279,19 @@ function workflowOrgSlotKey(orgId, kind) {
2279
2279
  __name(workflowOrgSlotKey, "workflowOrgSlotKey");
2280
2280
  __name2(workflowOrgSlotKey, "workflowOrgSlotKey");
2281
2281
  var WORKFLOW_CONNECTION_KEY_RE = /^[a-z][a-z0-9_-]{0,63}$/;
2282
+ var WORKFLOW_JOB_MODEL_SOURCE_LABELS = {
2283
+ stamp: "lease stamp",
2284
+ initData: "run input",
2285
+ default: "placeholder default",
2286
+ node: "node.model",
2287
+ env: "platform default",
2288
+ org: "org default"
2289
+ };
2290
+ function workflowJobModelSourceLabel(source) {
2291
+ return WORKFLOW_JOB_MODEL_SOURCE_LABELS[source];
2292
+ }
2293
+ __name(workflowJobModelSourceLabel, "workflowJobModelSourceLabel");
2294
+ __name2(workflowJobModelSourceLabel, "workflowJobModelSourceLabel");
2282
2295
  function scheduledTimeKey(scheduledTime) {
2283
2296
  return scheduledTime.replace(/[^0-9TZ]/g, "");
2284
2297
  }
@@ -2601,7 +2614,23 @@ var WORKFLOW_AUDIT_EVENTS = [
2601
2614
  * gated and nobody approved it, and conflating the two would make "who approved this run"
2602
2615
  * unanswerable for every run of either kind (§H2 "Audit").
2603
2616
  */
2604
- "workflow.run.autonomy_applied"
2617
+ "workflow.run.autonomy_applied",
2618
+ // --- run budget cap enforcement (Job-tier billing plan D4; BAC-677) ---
2619
+ /**
2620
+ * The audit twin of the `run.budget_exceeded` run event (WJB-B2a): the run overshot its
2621
+ * `budget.maxCredits` on its LAST step and completed anyway, `budget.exceeded: true`. The budget family
2622
+ * already mirrors run events here — `workflow.run.budget_parked` / `workflow.run.budget_raised` are the
2623
+ * twins of `run.budget_parked` / `run.budget_raised` — and an organisation reviewing what it was charged
2624
+ * needs the overshoot in the audit store beside the raise that preceded it, not only in the run's own
2625
+ * event stream.
2626
+ *
2627
+ * Declared with the run event rather than after it because the emitter port
2628
+ * (`WorkflowAuditPort.action`, typed `workflow.run.${string}`) does not check against this tuple: a name
2629
+ * that is NOT declared here is written to the audit store all the same and no compiler says so.
2630
+ * Declaring it is what makes the later emitter checkable. `workflow.run.budget_parked` is likewise
2631
+ * declared and not yet emitted.
2632
+ */
2633
+ "workflow.run.budget_exceeded"
2605
2634
  ];
2606
2635
  var WORKFLOW_AUDIT_METADATA_MAX_BYTES = 4 * 1024;
2607
2636
  function isWorkflowAuditEvent(action) {
@@ -7245,6 +7274,55 @@ function graphHasJobTierStep(envelopeOrGraph) {
7245
7274
  }
7246
7275
  __name(graphHasJobTierStep, "graphHasJobTierStep");
7247
7276
  __name4(graphHasJobTierStep, "graphHasJobTierStep");
7277
+ function jobTierSteps(envelopeOrGraph) {
7278
+ const out = [];
7279
+ if (!envelopeOrGraph || typeof envelopeOrGraph !== "object") return out;
7280
+ const env = envelopeOrGraph;
7281
+ const graph = Array.isArray(envelopeOrGraph) ? envelopeOrGraph : env.definition?.graph ?? [];
7282
+ if (!Array.isArray(graph)) return out;
7283
+ for (const entry of graph) collectJobTierSteps(entry, out);
7284
+ return out;
7285
+ }
7286
+ __name(jobTierSteps, "jobTierSteps");
7287
+ __name4(jobTierSteps, "jobTierSteps");
7288
+ function jobTierStepIds(envelopeOrGraph) {
7289
+ return jobTierSteps(envelopeOrGraph).map((s) => s.stepId);
7290
+ }
7291
+ __name(jobTierStepIds, "jobTierStepIds");
7292
+ __name4(jobTierStepIds, "jobTierStepIds");
7293
+ function collectJobTierSteps(entry, out) {
7294
+ const n2 = armEntry2(entry);
7295
+ if (!n2 || typeof n2 !== "object") return;
7296
+ const node = n2;
7297
+ const ws = node.workspace;
7298
+ if (node.tier === "job" || ws !== void 0 && ws !== "inherit") {
7299
+ const stepId = typeof node.id === "string" && node.id ? node.id : "(unnamed)";
7300
+ const model = typeof node.model === "string" && node.model.trim() ? node.model.trim() : void 0;
7301
+ out.push(model === void 0 ? {
7302
+ stepId
7303
+ } : {
7304
+ stepId,
7305
+ model
7306
+ });
7307
+ }
7308
+ switch (node.type) {
7309
+ case "parallel":
7310
+ if (Array.isArray(node.steps)) for (const s of node.steps) collectJobTierSteps(s, out);
7311
+ return;
7312
+ case "conditional":
7313
+ if (Array.isArray(node.steps)) for (const s of node.steps) collectJobTierSteps(s, out);
7314
+ if (node.otherwise !== void 0) collectJobTierSteps(node.otherwise, out);
7315
+ return;
7316
+ case "foreach":
7317
+ case "loop":
7318
+ collectJobTierSteps(node.step, out);
7319
+ return;
7320
+ default:
7321
+ return;
7322
+ }
7323
+ }
7324
+ __name(collectJobTierSteps, "collectJobTierSteps");
7325
+ __name4(collectJobTierSteps, "collectJobTierSteps");
7248
7326
 
7249
7327
  // src/types/workflow.ts
7250
7328
  function createStep(s) {