bpmax-cli 0.2.1-beta.65 → 0.2.1-beta.66

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.
package/dist/bin.js CHANGED
@@ -501,7 +501,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
501
501
  // package.json
502
502
  var package_default = {
503
503
  name: "bpmax-cli",
504
- version: "0.2.1-beta.65",
504
+ version: "0.2.1-beta.66",
505
505
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
506
506
  type: "module",
507
507
  bin: {
@@ -27391,8 +27391,8 @@ async function abandonTestSuiteRun(options) {
27391
27391
  const manifest = await readExecutionManifest(manifestPath, true);
27392
27392
  const reason = String(options.reason || "").trim();
27393
27393
  if (!reason) fail("abandon requires a non-empty reason", { rule_id: "test_suite.run.abandon_reason_required", path: manifestPath });
27394
- if (manifest.result !== "running" || !manifest.mutation_attempt_guard) {
27395
- fail("only a running manifest with an unresolved mutation attempt can be abandoned", {
27394
+ if (manifest.result !== "running") {
27395
+ fail("only a running manifest can be abandoned", {
27396
27396
  rule_id: "test_suite.run.abandon_not_allowed",
27397
27397
  path: manifestPath
27398
27398
  });
@@ -27414,10 +27414,10 @@ async function abandonTestSuiteRun(options) {
27414
27414
  kind: "bpmax_e2e_run_abandonment_receipt",
27415
27415
  run_id: manifest.run_id,
27416
27416
  scenario_id: manifest.scenario_id,
27417
- case_id: guard.case_id,
27418
- case_step_id: guard.case_step_id,
27419
- mutation_attempt_id: guard.mutation_attempt_id,
27420
- mutation_state: "abandoned_unknown",
27417
+ case_id: guard?.case_id ?? manifest.current_case_id ?? null,
27418
+ case_step_id: guard?.case_step_id ?? manifest.current_step_id ?? null,
27419
+ mutation_attempt_id: guard?.mutation_attempt_id ?? null,
27420
+ mutation_state: guard ? "abandoned_unknown" : "not_attempted",
27421
27421
  reason,
27422
27422
  operator,
27423
27423
  original_mutation_guard: guard,
@@ -27428,12 +27428,12 @@ async function abandonTestSuiteRun(options) {
27428
27428
  await writeAtomicText(receipt, receiptText);
27429
27429
  const receiptSha256 = createHash11("sha256").update(receiptText).digest("hex");
27430
27430
  manifest.abandoned_mutation = {
27431
- state: "abandoned_unknown",
27431
+ state: guard ? "abandoned_unknown" : "not_attempted",
27432
27432
  reason,
27433
27433
  operator,
27434
27434
  receipt,
27435
27435
  receipt_sha256: receiptSha256,
27436
- mutation_attempt_id: guard.mutation_attempt_id,
27436
+ ...guard?.mutation_attempt_id ? { mutation_attempt_id: guard.mutation_attempt_id } : {},
27437
27437
  abandoned_at: abandonedAt
27438
27438
  };
27439
27439
  manifest.mutation_attempt_guard = void 0;
@@ -27452,7 +27452,7 @@ async function abandonTestSuiteRun(options) {
27452
27452
  return {
27453
27453
  ok: true,
27454
27454
  status: "abandoned",
27455
- mutation_state: "abandoned_unknown",
27455
+ mutation_state: guard ? "abandoned_unknown" : "not_attempted",
27456
27456
  manifest: manifestPath,
27457
27457
  receipt,
27458
27458
  receipt_sha256: receiptSha256,
@@ -32971,14 +32971,22 @@ async function executeE2eScenarioUnlocked(options, dependencies = DEFAULT_DEPEND
32971
32971
  automation: automationFile,
32972
32972
  allowAutomationChange: hasCheckpoint && options.resume
32973
32973
  });
32974
- const plan = await readJsonFile2(planFile);
32974
+ const runDir = path19.dirname(manifest);
32975
+ const snapshotCandidate = path19.join(runDir, "plan.snapshot.json");
32976
+ let planSnapshotFile = hasCheckpoint ? void 0 : snapshotCandidate;
32977
+ if (!hasCheckpoint) {
32978
+ await writeAtomicJson3(snapshotCandidate, JSON.parse(await readFile17(planFile, "utf8")));
32979
+ planSnapshotFile = snapshotCandidate;
32980
+ }
32981
+ const planSource = hasCheckpoint ? (await loadOperationState(checkpoint)).plan_snapshot_file || planFile : planSnapshotFile || planFile;
32982
+ const plan = await readJsonFile2(planSource);
32975
32983
  const automation = await loadBrowserAutomation(automationFile);
32976
32984
  const scenario = String(plan.scenario || automation.scenario || "");
32977
32985
  if (!scenario) throw new Error("e2e.scenario.scenario_missing: scenario plan or automation.json must declare scenario");
32978
32986
  if (automation.scenario && automation.scenario !== scenario) {
32979
32987
  throw new Error(`e2e.scenario.automation_mismatch: automation scenario ${automation.scenario} does not match plan ${scenario}`);
32980
32988
  }
32981
- const planHash = await fileSha256(planFile);
32989
+ const planHash = await fileSha256(planSource);
32982
32990
  const automationHash = await fileSha256(automationFile);
32983
32991
  let runState = await dependencies.nextTestSuiteRunStep(manifest, options.profile);
32984
32992
  let execution = executionRecord(runState);
@@ -33001,6 +33009,7 @@ async function executeE2eScenarioUnlocked(options, dependencies = DEFAULT_DEPEND
33001
33009
  run_id: String(execution.run_id || path19.basename(path19.dirname(manifest))),
33002
33010
  scenario,
33003
33011
  plan_file: planFile,
33012
+ plan_snapshot_file: planSource,
33004
33013
  plan_sha256: planHash,
33005
33014
  automation_file: automationFile,
33006
33015
  automation_sha256: automationHash,
@@ -33387,6 +33396,26 @@ async function executeE2eScenarioUnlocked(options, dependencies = DEFAULT_DEPEND
33387
33396
  await saveOperationState(checkpoint, operation);
33388
33397
  return pausedResult(operation, checkpoint);
33389
33398
  }
33399
+ const actor = String(step.actor || "").trim();
33400
+ if (actor) {
33401
+ const actorIdentity = executionSteps(execution).find((item) => item.runner === "identity" && String(item.actor || "").trim() === actor && item.status === "pass");
33402
+ if (!actorIdentity) {
33403
+ operation.status = "paused_external_action";
33404
+ operation.pause = {
33405
+ kind: "identity_binding_required",
33406
+ message: `browser_action ${stepKey} declares actor=${actor} but no completed identity lease is bound to that actor.`,
33407
+ repair_scope: stepKey,
33408
+ script_change_required: false,
33409
+ external_action: {
33410
+ kind: "identity_binding_required",
33411
+ actor,
33412
+ instruction: "Complete the reviewed runner=identity mock step for this actor in the same Playwright run, then resume. Actor labels never impersonate a user."
33413
+ }
33414
+ };
33415
+ await saveOperationState(checkpoint, operation);
33416
+ return pausedResult(operation, checkpoint);
33417
+ }
33418
+ }
33390
33419
  let result;
33391
33420
  try {
33392
33421
  result = await dependencies.runBrowserAutomation({