@akagilnc/pi-workflow-roles 0.1.2107 → 0.1.2114

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.
@@ -14336,6 +14336,9 @@ function listHelpCapabilities() {
14336
14336
  );
14337
14337
  return [...support, ...roles, ...deterministic];
14338
14338
  }
14339
+ function isPublicCallableRole(value) {
14340
+ return PUBLIC_CALLABLE_ROLES.includes(value);
14341
+ }
14339
14342
  function isPublicConfigurableSeat(value) {
14340
14343
  return PUBLIC_CONFIGURABLE_SEATS.includes(value);
14341
14344
  }
@@ -14440,12 +14443,9 @@ function setPersistentSeatConfig(config, seat, selection) {
14440
14443
  };
14441
14444
  }
14442
14445
  function isEngineAxisSeat(seat) {
14443
- return seat === "judge" || seat === "reviewer";
14446
+ return isPublicCallableRole(seat);
14444
14447
  }
14445
14448
  function setPersistentSeatEngine(config, seat, engine) {
14446
- if (!isEngineAxisSeat(seat)) {
14447
- throw new Error(`engine axis is judge+reviewer only; refused seat ${seat}`);
14448
- }
14449
14449
  const previous = config.seats[seat];
14450
14450
  if (previous === void 0) {
14451
14451
  throw new Error(
@@ -14477,7 +14477,7 @@ function validatePublicCliConfigEngines(config, _packageRoot) {
14477
14477
  if (row?.engine === void 0) continue;
14478
14478
  if (!isEngineAxisSeat(seat)) {
14479
14479
  throw new Error(
14480
- `config seat ${seat} engine is not allowed; engine axis is judge+reviewer only`
14480
+ `config seat ${seat} cannot persist engine: no independent activation path; storing would be silently ineffective`
14481
14481
  );
14482
14482
  }
14483
14483
  try {
@@ -15909,8 +15909,8 @@ var init_option_definitions = __esm({
15909
15909
  repeatable: false,
15910
15910
  form: "option",
15911
15911
  description: {
15912
- en: "Optional Judge/Reviewer labor engine for this invocation (owner pool-directive name; packaged notes attached when present; judge+reviewer only).",
15913
- zh: "\u672C\u8C03\u7528\u53EF\u9009 Judge/Reviewer \u52B3\u52A8\u5F15\u64CE\uFF08\u6C60\u4EE4\u540D\u5B57\uFF1B\u6709\u5305\u5185\u8C03\u6CD5\u7B14\u8BB0\u5219\u9644\u5377\uFF1B\u4EC5 Judge+Reviewer\uFF09\u3002"
15912
+ en: "Optional labor engine for this invocation (owner pool-directive name; packaged notes attached when present; any role).",
15913
+ zh: "\u672C\u8C03\u7528\u53EF\u9009\u52B3\u52A8\u5F15\u64CE\uFF08\u6C60\u4EE4\u540D\u5B57\uFF1B\u6709\u5305\u5185\u8C03\u6CD5\u7B14\u8BB0\u5219\u9644\u5377\uFF1B\u5168\u90E8\u89D2\u8272\u53EF\u7528\uFF09\u3002"
15914
15914
  }
15915
15915
  },
15916
15916
  {
@@ -16776,7 +16776,7 @@ async function admitCoderInvocation(options) {
16776
16776
  ...ticketFields
16777
16777
  };
16778
16778
  }
16779
- function buildCoderTransportPrompt(admitted) {
16779
+ function buildCoderTransportPrompt(admitted, engineMaterial) {
16780
16780
  const lines = [admitted.instruction];
16781
16781
  if (admitted.attachments.length > 0) {
16782
16782
  lines.push("");
@@ -16785,7 +16785,7 @@ function buildCoderTransportPrompt(admitted) {
16785
16785
  lines.push(`- ${attachment.frozenPath}`);
16786
16786
  }
16787
16787
  }
16788
- return lines.join("\n");
16788
+ return appendEngineSessionMaterial(lines, engineMaterial).join("\n");
16789
16789
  }
16790
16790
  async function admitFixerInvocation(options) {
16791
16791
  if (options.project !== void 0) {
@@ -16893,7 +16893,7 @@ async function admitFixerInvocation(options) {
16893
16893
  ...ticketFields
16894
16894
  };
16895
16895
  }
16896
- function buildFixerTransportPrompt(admitted) {
16896
+ function buildFixerTransportPrompt(admitted, engineMaterial) {
16897
16897
  const lines = [admitted.instruction];
16898
16898
  if (admitted.attachments.length > 0) {
16899
16899
  lines.push("");
@@ -16902,7 +16902,7 @@ function buildFixerTransportPrompt(admitted) {
16902
16902
  lines.push(`- ${attachment.frozenPath}`);
16903
16903
  }
16904
16904
  }
16905
- return lines.join("\n");
16905
+ return appendEngineSessionMaterial(lines, engineMaterial).join("\n");
16906
16906
  }
16907
16907
  function parsePositivePrOption(raw) {
16908
16908
  if (raw === void 0 || raw.trim() === "") throw new CliUsageError("--pr requires a positive pull request number");
@@ -17133,8 +17133,8 @@ async function admitCollectorInvocation(options) {
17133
17133
  ...ticketFields
17134
17134
  };
17135
17135
  }
17136
- function buildCollectorTransportPrompt(_admitted) {
17137
- return COLLECTOR_FIXED_KICKOFF;
17136
+ function buildCollectorTransportPrompt(_admitted, engineMaterial) {
17137
+ return appendEngineSessionMaterial([COLLECTOR_FIXED_KICKOFF], engineMaterial).join("\n");
17138
17138
  }
17139
17139
  function parseDoctorIssueNumber(raw) {
17140
17140
  const trimmed = raw.trim();
@@ -17360,7 +17360,7 @@ async function admitDoctorInvocation(options) {
17360
17360
  ...ticketFields
17361
17361
  };
17362
17362
  }
17363
- function buildDoctorTransportPrompt(admitted) {
17363
+ function buildDoctorTransportPrompt(admitted, engineMaterial) {
17364
17364
  const lines = [admitted.instructionEmpty ? "" : admitted.instruction];
17365
17365
  if (admitted.attachments.length > 0) {
17366
17366
  lines.push("");
@@ -17369,7 +17369,7 @@ function buildDoctorTransportPrompt(admitted) {
17369
17369
  lines.push(`- ${attachment.frozenPath}`);
17370
17370
  }
17371
17371
  }
17372
- return lines.join("\n");
17372
+ return appendEngineSessionMaterial(lines, engineMaterial).join("\n");
17373
17373
  }
17374
17374
  function parseReviewerArgv(args) {
17375
17375
  const attachmentPaths = [];
@@ -17672,7 +17672,7 @@ async function admitMergerInvocation(options) {
17672
17672
  ...ticketFields
17673
17673
  };
17674
17674
  }
17675
- function buildMergerTransportPrompt(admitted) {
17675
+ function buildMergerTransportPrompt(admitted, engineMaterial) {
17676
17676
  const lines = [
17677
17677
  `/skill:resolving-merge-conflicts ${admitted.instruction}`
17678
17678
  ];
@@ -17683,7 +17683,7 @@ function buildMergerTransportPrompt(admitted) {
17683
17683
  lines.push(`- ${attachment.frozenPath}`);
17684
17684
  }
17685
17685
  }
17686
- return lines.join("\n");
17686
+ return appendEngineSessionMaterial(lines, engineMaterial).join("\n");
17687
17687
  }
17688
17688
  function parseTaishiTicketNumber(raw, flag = "--ticket") {
17689
17689
  const trimmed = raw.trim();
@@ -18204,6 +18204,24 @@ var init_explicit_internal = __esm({
18204
18204
  }
18205
18205
  });
18206
18206
 
18207
+ // src/engine-detour.ts
18208
+ function applyEngineChildEnv(childEnv, engine) {
18209
+ delete childEnv[AK_ROLE_ENGINE_ENV];
18210
+ if (engine !== void 0 && engine.trim() !== "") {
18211
+ childEnv[AK_ROLE_ENGINE_ENV] = engine.trim();
18212
+ } else {
18213
+ childEnv[AK_ROLE_ENGINE_ENV] = void 0;
18214
+ }
18215
+ }
18216
+ var ENGINE_DETOUR_TOOL_NAME, AK_ROLE_ENGINE_ENV;
18217
+ var init_engine_detour = __esm({
18218
+ "src/engine-detour.ts"() {
18219
+ "use strict";
18220
+ ENGINE_DETOUR_TOOL_NAME = "ak_engine_detour";
18221
+ AK_ROLE_ENGINE_ENV = "AK_ROLE_ENGINE";
18222
+ }
18223
+ });
18224
+
18207
18225
  // src/package-resources/method-skill.ts
18208
18226
  import { createHash as createHash3 } from "node:crypto";
18209
18227
  import { readFile as readFile6, realpath as realpath4 } from "node:fs/promises";
@@ -19149,16 +19167,6 @@ var init_auditor_dossier_tool = __esm({
19149
19167
  }
19150
19168
  });
19151
19169
 
19152
- // src/engine-detour.ts
19153
- var ENGINE_DETOUR_TOOL_NAME, AK_ROLE_ENGINE_ENV;
19154
- var init_engine_detour = __esm({
19155
- "src/engine-detour.ts"() {
19156
- "use strict";
19157
- ENGINE_DETOUR_TOOL_NAME = "ak_engine_detour";
19158
- AK_ROLE_ENGINE_ENV = "AK_ROLE_ENGINE";
19159
- }
19160
- });
19161
-
19162
19170
  // src/engine-labor-fallback.ts
19163
19171
  function buildEngineLaborFallbackField(input) {
19164
19172
  return Object.freeze({
@@ -22381,7 +22389,10 @@ var init_settlement = __esm({
22381
22389
  import { writeFile as writeFile6 } from "node:fs/promises";
22382
22390
  import { join as join12 } from "node:path";
22383
22391
  function buildCoderActivationExtraArgs(admitted, options) {
22384
- const prompt = buildCoderTransportPrompt(admitted);
22392
+ const prompt = buildCoderTransportPrompt(
22393
+ admitted,
22394
+ engineSessionMaterialFromOptions(options)
22395
+ );
22385
22396
  const skillArgs = admitted.phase === "apply" ? [
22386
22397
  "--skill",
22387
22398
  resolvePackagedMethodSkillPath(options.packageRoot, "tdd")
@@ -22486,7 +22497,7 @@ async function presentControlledFailure2(admitted, failureInput, io) {
22486
22497
  };
22487
22498
  }
22488
22499
  async function dispatchAdmittedCoder(input) {
22489
- const { admitted, env, io, extraArgs, lease, methodProvenance } = input;
22500
+ const { admitted, env, io, extraArgs, lease, methodProvenance, effectiveEngine } = input;
22490
22501
  try {
22491
22502
  const missingCredential = missingCredentialPreDispatchFailure(
22492
22503
  env.model,
@@ -22499,7 +22510,7 @@ async function dispatchAdmittedCoder(input) {
22499
22510
  io
22500
22511
  );
22501
22512
  }
22502
- await markRunRunning(admitted.runDirectory, env.model);
22513
+ await markRunRunning(admitted.runDirectory, env.model, effectiveEngine);
22503
22514
  await clearTypedProviderHttpObservation(admitted.runDirectory);
22504
22515
  const childEnv = {
22505
22516
  ...process.env,
@@ -22507,6 +22518,7 @@ async function dispatchAdmittedCoder(input) {
22507
22518
  PI_CODING_AGENT_DIR: env.agentDir,
22508
22519
  AK_ROLE_RUN_DIR: admitted.runDirectory
22509
22520
  };
22521
+ applyEngineChildEnv(childEnv, env.engine);
22510
22522
  const correlationId = admitted.correlationId ?? env.correlationId;
22511
22523
  if (correlationId !== void 0 && correlationId.trim() !== "") {
22512
22524
  childEnv.AK_CORRELATION_ID = correlationId;
@@ -22652,6 +22664,7 @@ async function runPublicCoder(argv, env, io, parseCoderArgv2) {
22652
22664
  const extraArgs = buildCoderActivationExtraArgs(admitted, {
22653
22665
  packageRoot: env.packageRoot,
22654
22666
  ...env.model === void 0 ? {} : { model: env.model },
22667
+ ...env.engine === void 0 ? {} : { engine: env.engine },
22655
22668
  ...env.extraPiArgs === void 0 ? {} : { extraPiArgs: env.extraPiArgs }
22656
22669
  });
22657
22670
  return await dispatchAdmittedCoder({
@@ -22663,7 +22676,8 @@ async function runPublicCoder(argv, env, io, parseCoderArgv2) {
22663
22676
  io,
22664
22677
  extraArgs,
22665
22678
  lease,
22666
- ...methodProvenance === void 0 ? {} : { methodProvenance }
22679
+ ...methodProvenance === void 0 ? {} : { methodProvenance },
22680
+ ...env.engine === void 0 ? {} : { effectiveEngine: env.engine }
22667
22681
  });
22668
22682
  }
22669
22683
  async function runPublicCoderResume(argv, env, io) {
@@ -22746,6 +22760,8 @@ async function runPublicCoderResume(argv, env, io) {
22746
22760
  var init_coder_run = __esm({
22747
22761
  "src/public-cli/coder-run.ts"() {
22748
22762
  "use strict";
22763
+ init_engine_detour();
22764
+ init_engine_material();
22749
22765
  init_method_skill();
22750
22766
  init_explicit_internal();
22751
22767
  init_cli_errors();
@@ -22761,7 +22777,10 @@ var init_coder_run = __esm({
22761
22777
  import { writeFile as writeFile7 } from "node:fs/promises";
22762
22778
  import { join as join13 } from "node:path";
22763
22779
  function buildCollectorActivationExtraArgs(admitted, options = {}) {
22764
- const prompt = buildCollectorTransportPrompt(admitted);
22780
+ const prompt = buildCollectorTransportPrompt(
22781
+ admitted,
22782
+ engineSessionMaterialFromOptions(options)
22783
+ );
22765
22784
  return [
22766
22785
  "--no-skills",
22767
22786
  "--no-prompt-templates",
@@ -22809,7 +22828,7 @@ async function presentControlledFailure3(admitted, failureInput, io) {
22809
22828
  };
22810
22829
  }
22811
22830
  async function dispatchAdmittedCollector(input) {
22812
- const { admitted, env, io, extraArgs, lease } = input;
22831
+ const { admitted, env, io, extraArgs, lease, effectiveEngine } = input;
22813
22832
  try {
22814
22833
  const missingCredential = missingCredentialPreDispatchFailure(
22815
22834
  env.model,
@@ -22822,7 +22841,7 @@ async function dispatchAdmittedCollector(input) {
22822
22841
  io
22823
22842
  );
22824
22843
  }
22825
- await markRunRunning(admitted.runDirectory, env.model);
22844
+ await markRunRunning(admitted.runDirectory, env.model, effectiveEngine);
22826
22845
  await clearTypedProviderHttpObservation(admitted.runDirectory);
22827
22846
  const childEnv = {
22828
22847
  ...process.env,
@@ -22830,6 +22849,7 @@ async function dispatchAdmittedCollector(input) {
22830
22849
  PI_CODING_AGENT_DIR: env.agentDir,
22831
22850
  AK_ROLE_RUN_DIR: admitted.runDirectory
22832
22851
  };
22852
+ applyEngineChildEnv(childEnv, env.engine);
22833
22853
  const correlationId = admitted.correlationId ?? env.correlationId;
22834
22854
  if (correlationId !== void 0 && correlationId.trim() !== "") {
22835
22855
  childEnv.AK_CORRELATION_ID = correlationId;
@@ -22957,7 +22977,9 @@ async function runPublicCollector(argv, env, io, parseCollectorArgv2) {
22957
22977
  throw error;
22958
22978
  }
22959
22979
  const extraArgs = buildCollectorActivationExtraArgs(admitted, {
22980
+ packageRoot: env.packageRoot,
22960
22981
  ...env.model === void 0 ? {} : { model: env.model },
22982
+ ...env.engine === void 0 ? {} : { engine: env.engine },
22961
22983
  ...env.extraPiArgs === void 0 ? {} : { extraPiArgs: env.extraPiArgs }
22962
22984
  });
22963
22985
  return await dispatchAdmittedCollector({
@@ -22968,12 +22990,15 @@ async function runPublicCollector(argv, env, io, parseCollectorArgv2) {
22968
22990
  },
22969
22991
  io,
22970
22992
  extraArgs,
22971
- lease
22993
+ lease,
22994
+ ...env.engine === void 0 ? {} : { effectiveEngine: env.engine }
22972
22995
  });
22973
22996
  }
22974
22997
  var init_collector_run = __esm({
22975
22998
  "src/public-cli/collector-run.ts"() {
22976
22999
  "use strict";
23000
+ init_engine_detour();
23001
+ init_engine_material();
22977
23002
  init_explicit_internal();
22978
23003
  init_cli_errors();
22979
23004
  init_invocation();
@@ -22988,7 +23013,10 @@ var init_collector_run = __esm({
22988
23013
  import { writeFile as writeFile8 } from "node:fs/promises";
22989
23014
  import { join as join14 } from "node:path";
22990
23015
  function buildDoctorActivationExtraArgs(admitted, options = {}) {
22991
- const prompt = buildDoctorTransportPrompt(admitted);
23016
+ const prompt = buildDoctorTransportPrompt(
23017
+ admitted,
23018
+ engineSessionMaterialFromOptions(options)
23019
+ );
22992
23020
  return [
22993
23021
  "--no-skills",
22994
23022
  "--no-prompt-templates",
@@ -23030,7 +23058,7 @@ async function presentControlledFailure4(admitted, failureInput, io) {
23030
23058
  };
23031
23059
  }
23032
23060
  async function dispatchAdmittedDoctor(input) {
23033
- const { admitted, env, io, extraArgs, lease } = input;
23061
+ const { admitted, env, io, extraArgs, lease, effectiveEngine } = input;
23034
23062
  try {
23035
23063
  const missingCredential = missingCredentialPreDispatchFailure(
23036
23064
  env.model,
@@ -23043,7 +23071,7 @@ async function dispatchAdmittedDoctor(input) {
23043
23071
  io
23044
23072
  );
23045
23073
  }
23046
- await markRunRunning(admitted.runDirectory, env.model);
23074
+ await markRunRunning(admitted.runDirectory, env.model, effectiveEngine);
23047
23075
  await clearTypedProviderHttpObservation(admitted.runDirectory);
23048
23076
  const childEnv = {
23049
23077
  ...process.env,
@@ -23051,6 +23079,7 @@ async function dispatchAdmittedDoctor(input) {
23051
23079
  PI_CODING_AGENT_DIR: env.agentDir,
23052
23080
  AK_ROLE_RUN_DIR: admitted.runDirectory
23053
23081
  };
23082
+ applyEngineChildEnv(childEnv, env.engine);
23054
23083
  if (env.correlationId !== void 0 && env.correlationId.trim() !== "") {
23055
23084
  childEnv.AK_CORRELATION_ID = env.correlationId;
23056
23085
  }
@@ -23183,7 +23212,9 @@ async function runPublicDoctor(argv, env, io, parseDoctorArgv2) {
23183
23212
  throw error;
23184
23213
  }
23185
23214
  const extraArgs = buildDoctorActivationExtraArgs(admitted, {
23215
+ packageRoot: env.packageRoot,
23186
23216
  ...env.model === void 0 ? {} : { model: env.model },
23217
+ ...env.engine === void 0 ? {} : { engine: env.engine },
23187
23218
  ...env.extraPiArgs === void 0 ? {} : { extraPiArgs: env.extraPiArgs }
23188
23219
  });
23189
23220
  return await dispatchAdmittedDoctor({
@@ -23191,12 +23222,15 @@ async function runPublicDoctor(argv, env, io, parseDoctorArgv2) {
23191
23222
  env,
23192
23223
  io,
23193
23224
  extraArgs,
23194
- lease
23225
+ lease,
23226
+ ...env.engine === void 0 ? {} : { effectiveEngine: env.engine }
23195
23227
  });
23196
23228
  }
23197
23229
  var init_doctor_run = __esm({
23198
23230
  "src/public-cli/doctor-run.ts"() {
23199
23231
  "use strict";
23232
+ init_engine_detour();
23233
+ init_engine_material();
23200
23234
  init_explicit_internal();
23201
23235
  init_cli_errors();
23202
23236
  init_invocation();
@@ -23211,7 +23245,10 @@ var init_doctor_run = __esm({
23211
23245
  import { writeFile as writeFile9 } from "node:fs/promises";
23212
23246
  import { join as join15 } from "node:path";
23213
23247
  function buildFixerActivationExtraArgs(admitted, options) {
23214
- const prompt = buildFixerTransportPrompt(admitted);
23248
+ const prompt = buildFixerTransportPrompt(
23249
+ admitted,
23250
+ engineSessionMaterialFromOptions(options)
23251
+ );
23215
23252
  const diagnosisSkillPath = resolvePackagedMethodSkillPath(
23216
23253
  options.packageRoot,
23217
23254
  "diagnosing-bugs"
@@ -23325,7 +23362,7 @@ async function presentControlledFailure5(admitted, failureInput, io) {
23325
23362
  };
23326
23363
  }
23327
23364
  async function dispatchAdmittedFixer(input) {
23328
- const { admitted, env, io, extraArgs, lease, methodMaterial } = input;
23365
+ const { admitted, env, io, extraArgs, lease, methodMaterial, effectiveEngine } = input;
23329
23366
  try {
23330
23367
  const missingCredential = missingCredentialPreDispatchFailure(
23331
23368
  env.model,
@@ -23338,7 +23375,7 @@ async function dispatchAdmittedFixer(input) {
23338
23375
  io
23339
23376
  );
23340
23377
  }
23341
- await markRunRunning(admitted.runDirectory, env.model);
23378
+ await markRunRunning(admitted.runDirectory, env.model, effectiveEngine);
23342
23379
  await clearTypedProviderHttpObservation(admitted.runDirectory);
23343
23380
  const childEnv = {
23344
23381
  ...process.env,
@@ -23346,6 +23383,7 @@ async function dispatchAdmittedFixer(input) {
23346
23383
  PI_CODING_AGENT_DIR: env.agentDir,
23347
23384
  AK_ROLE_RUN_DIR: admitted.runDirectory
23348
23385
  };
23386
+ applyEngineChildEnv(childEnv, env.engine);
23349
23387
  const correlationId = admitted.correlationId ?? env.correlationId;
23350
23388
  if (correlationId !== void 0 && correlationId.trim() !== "") {
23351
23389
  childEnv.AK_CORRELATION_ID = correlationId;
@@ -23507,6 +23545,7 @@ async function runPublicFixer(argv, env, io, parseFixerArgv2) {
23507
23545
  const extraArgs = buildFixerActivationExtraArgs(admitted, {
23508
23546
  packageRoot: env.packageRoot,
23509
23547
  ...env.model === void 0 ? {} : { model: env.model },
23548
+ ...env.engine === void 0 ? {} : { engine: env.engine },
23510
23549
  ...env.extraPiArgs === void 0 ? {} : { extraPiArgs: env.extraPiArgs }
23511
23550
  });
23512
23551
  return await dispatchAdmittedFixer({
@@ -23518,7 +23557,9 @@ async function runPublicFixer(argv, env, io, parseFixerArgv2) {
23518
23557
  io,
23519
23558
  extraArgs,
23520
23559
  lease,
23521
- methodMaterial
23560
+ methodMaterial,
23561
+ // #391: only initial Fixer dispatch records mechanical engine provenance.
23562
+ ...env.engine === void 0 ? {} : { effectiveEngine: env.engine }
23522
23563
  });
23523
23564
  }
23524
23565
  async function runPublicFixerResume(argv, env, io) {
@@ -23594,6 +23635,8 @@ async function runPublicFixerResume(argv, env, io) {
23594
23635
  var init_fixer_run = __esm({
23595
23636
  "src/public-cli/fixer-run.ts"() {
23596
23637
  "use strict";
23638
+ init_engine_detour();
23639
+ init_engine_material();
23597
23640
  init_method_skill();
23598
23641
  init_explicit_internal();
23599
23642
  init_cli_errors();
@@ -23724,12 +23767,7 @@ async function dispatchAdmittedJudge(input) {
23724
23767
  // and role-runtime can record typed provider HTTP observations.
23725
23768
  AK_ROLE_RUN_DIR: admitted.runDirectory
23726
23769
  };
23727
- delete childEnv[AK_ROLE_ENGINE_ENV];
23728
- if (env.engine !== void 0 && env.engine.trim() !== "") {
23729
- childEnv[AK_ROLE_ENGINE_ENV] = env.engine.trim();
23730
- } else {
23731
- childEnv[AK_ROLE_ENGINE_ENV] = void 0;
23732
- }
23770
+ applyEngineChildEnv(childEnv, env.engine);
23733
23771
  const correlationId = admitted.correlationId ?? env.correlationId;
23734
23772
  if (correlationId !== void 0 && correlationId.trim() !== "") {
23735
23773
  childEnv.AK_CORRELATION_ID = correlationId;
@@ -23957,7 +23995,10 @@ var init_judge_run = __esm({
23957
23995
  import { mkdir as mkdir4, writeFile as writeFile11 } from "node:fs/promises";
23958
23996
  import { join as join17, resolve as resolve6 } from "node:path";
23959
23997
  function buildMergerActivationExtraArgs(admitted, options) {
23960
- const prompt = buildMergerTransportPrompt(admitted);
23998
+ const prompt = buildMergerTransportPrompt(
23999
+ admitted,
24000
+ engineSessionMaterialFromOptions(options)
24001
+ );
23961
24002
  const skillPath = resolvePackagedMethodSkillPath(
23962
24003
  options.packageRoot,
23963
24004
  "resolving-merge-conflicts"
@@ -24060,7 +24101,7 @@ async function presentControlledFailure7(admitted, failureInput, io) {
24060
24101
  };
24061
24102
  }
24062
24103
  async function dispatchAdmittedMerger(input) {
24063
- const { admitted, env, io, extraArgs, lease, methodMaterial } = input;
24104
+ const { admitted, env, io, extraArgs, lease, methodMaterial, effectiveEngine } = input;
24064
24105
  try {
24065
24106
  const missingCredential = missingCredentialPreDispatchFailure(
24066
24107
  env.model,
@@ -24073,7 +24114,7 @@ async function dispatchAdmittedMerger(input) {
24073
24114
  io
24074
24115
  );
24075
24116
  }
24076
- await markRunRunning(admitted.runDirectory, env.model);
24117
+ await markRunRunning(admitted.runDirectory, env.model, effectiveEngine);
24077
24118
  await clearTypedProviderHttpObservation(admitted.runDirectory);
24078
24119
  const childEnv = {
24079
24120
  ...process.env,
@@ -24081,6 +24122,7 @@ async function dispatchAdmittedMerger(input) {
24081
24122
  PI_CODING_AGENT_DIR: env.agentDir,
24082
24123
  AK_ROLE_RUN_DIR: admitted.runDirectory
24083
24124
  };
24125
+ applyEngineChildEnv(childEnv, env.engine);
24084
24126
  const correlationId = admitted.correlationId ?? env.correlationId;
24085
24127
  if (correlationId !== void 0 && correlationId.trim() !== "") {
24086
24128
  childEnv.AK_CORRELATION_ID = correlationId;
@@ -24312,6 +24354,7 @@ async function runPublicMerger(argv, env, io, parseMergerArgv2) {
24312
24354
  const extraArgs = buildMergerActivationExtraArgs(admitted, {
24313
24355
  packageRoot: env.packageRoot,
24314
24356
  ...env.model === void 0 ? {} : { model: env.model },
24357
+ ...env.engine === void 0 ? {} : { engine: env.engine },
24315
24358
  ...env.extraPiArgs === void 0 ? {} : { extraPiArgs: env.extraPiArgs }
24316
24359
  });
24317
24360
  return await dispatchAdmittedMerger({
@@ -24323,7 +24366,8 @@ async function runPublicMerger(argv, env, io, parseMergerArgv2) {
24323
24366
  io,
24324
24367
  extraArgs,
24325
24368
  lease,
24326
- methodMaterial
24369
+ methodMaterial,
24370
+ ...env.engine === void 0 ? {} : { effectiveEngine: env.engine }
24327
24371
  });
24328
24372
  }
24329
24373
  async function runPublicMergerResume(argv, env, io) {
@@ -24402,6 +24446,8 @@ var init_merger_run = __esm({
24402
24446
  "use strict";
24403
24447
  init_activation_ledger_topology();
24404
24448
  init_sitian_role_run_coordinates();
24449
+ init_engine_detour();
24450
+ init_engine_material();
24405
24451
  init_method_skill();
24406
24452
  init_uuidv7();
24407
24453
  init_explicit_internal();
@@ -24554,12 +24600,7 @@ async function dispatchAdmittedReviewer(input) {
24554
24600
  PI_CODING_AGENT_DIR: env.agentDir,
24555
24601
  AK_ROLE_RUN_DIR: admitted.runDirectory
24556
24602
  };
24557
- delete childEnv[AK_ROLE_ENGINE_ENV];
24558
- if (env.engine !== void 0 && env.engine.trim() !== "") {
24559
- childEnv[AK_ROLE_ENGINE_ENV] = env.engine.trim();
24560
- } else {
24561
- childEnv[AK_ROLE_ENGINE_ENV] = void 0;
24562
- }
24603
+ applyEngineChildEnv(childEnv, env.engine);
24563
24604
  const correlationId = admitted.correlationId ?? env.correlationId;
24564
24605
  if (correlationId !== void 0 && correlationId.trim() !== "") {
24565
24606
  childEnv.AK_CORRELATION_ID = correlationId;
@@ -27036,6 +27077,19 @@ function requireLegalEngineName(name) {
27036
27077
  );
27037
27078
  }
27038
27079
  }
27080
+ function requireEngineAxisSeat(seat, verb) {
27081
+ if (seat === AUTOMATIC_NAVIGATOR_SEAT) {
27082
+ throw new CliUsageError(
27083
+ `config ${verb} refuses navigator: no independent activation path; storing would be silently ineffective`
27084
+ );
27085
+ }
27086
+ if (!isEngineAxisSeat(seat)) {
27087
+ throw new CliUsageError(`unknown engine-axis seat: ${seat}`);
27088
+ }
27089
+ }
27090
+ function projectSeatEngine(seat) {
27091
+ return seat.engine === void 0 ? {} : { engine: seat.engine };
27092
+ }
27039
27093
  function loadAndValidateConfig(home, packageRoot2) {
27040
27094
  return loadPublicCliConfig(home).then((config) => {
27041
27095
  try {
@@ -27107,7 +27161,7 @@ function renderHelp() {
27107
27161
  "",
27108
27162
  "Role options: ak-role help <command>",
27109
27163
  "Persistent config: ak-role config set <seat> <provider/model[:thinking]>",
27110
- "Persistent engine (judge|reviewer): ak-role config set-engine <seat> <name> | unset-engine <seat>",
27164
+ "Persistent engine (callable roles): ak-role config set-engine <seat> <name> | unset-engine <seat>",
27111
27165
  "Effective seats: ak-role roles"
27112
27166
  );
27113
27167
  return `${lines.join("\n")}
@@ -27212,19 +27266,12 @@ async function runConfigCommand(args, home, packageRoot2, io) {
27212
27266
  if (args[0] === "set-engine") {
27213
27267
  if (args.length !== 3) {
27214
27268
  throw new CliUsageError(
27215
- "usage: ak-role config set-engine <judge|reviewer> <name>"
27269
+ "usage: ak-role config set-engine <seat> <name>"
27216
27270
  );
27217
27271
  }
27218
27272
  const seat = args[1];
27219
27273
  const name = args[2];
27220
- if (!isPublicConfigurableSeat(seat)) {
27221
- throw new CliUsageError(`unknown configurable seat: ${seat}`);
27222
- }
27223
- if (!isEngineAxisSeat(seat)) {
27224
- throw new CliUsageError(
27225
- `engine axis is judge+reviewer only; refused seat ${seat}`
27226
- );
27227
- }
27274
+ requireEngineAxisSeat(seat, "set-engine");
27228
27275
  requireLegalEngineName(name);
27229
27276
  let config = await loadAndValidateConfig(home, packageRoot2);
27230
27277
  try {
@@ -27242,18 +27289,11 @@ async function runConfigCommand(args, home, packageRoot2, io) {
27242
27289
  if (args[0] === "unset-engine") {
27243
27290
  if (args.length !== 2) {
27244
27291
  throw new CliUsageError(
27245
- "usage: ak-role config unset-engine <judge|reviewer>"
27292
+ "usage: ak-role config unset-engine <seat>"
27246
27293
  );
27247
27294
  }
27248
27295
  const seat = args[1];
27249
- if (!isPublicConfigurableSeat(seat)) {
27250
- throw new CliUsageError(`unknown configurable seat: ${seat}`);
27251
- }
27252
- if (!isEngineAxisSeat(seat)) {
27253
- throw new CliUsageError(
27254
- `engine axis is judge+reviewer only; refused seat ${seat}`
27255
- );
27256
- }
27296
+ requireEngineAxisSeat(seat, "unset-engine");
27257
27297
  let config = await loadAndValidateConfig(home, packageRoot2);
27258
27298
  try {
27259
27299
  config = setPersistentSeatEngine(config, seat, void 0);
@@ -27277,9 +27317,9 @@ async function runAkRole(argv, env) {
27277
27317
  const parsed = parseArgv(argv);
27278
27318
  if (parsed.engine !== void 0) {
27279
27319
  requireLegalEngineName(parsed.engine);
27280
- if (!parsed.help && parsed.command !== void 0 && parsed.command !== "help" && !isEngineAxisSeat(parsed.command)) {
27320
+ if (!parsed.help && parsed.command !== void 0 && parsed.command !== "help" && !isPublicCallableRole(parsed.command)) {
27281
27321
  throw new CliUsageError(
27282
- `engine axis is judge+reviewer only; refused command ${parsed.command}`
27322
+ `engine axis is role commands only; refused command ${parsed.command}`
27283
27323
  );
27284
27324
  }
27285
27325
  }
@@ -27473,7 +27513,7 @@ async function runAkRole(argv, env) {
27473
27513
  ...env.correlationId === void 0 ? {} : { correlationId: env.correlationId },
27474
27514
  ...env.piRunner === void 0 ? {} : { piRunner: env.piRunner },
27475
27515
  ...seat.selection === void 0 ? {} : { model: seat.selection },
27476
- ...seat.engine === void 0 ? {} : { engine: seat.engine },
27516
+ ...projectSeatEngine(seat),
27477
27517
  ...env.judgeExtraPiArgs === void 0 ? {} : { extraPiArgs: env.judgeExtraPiArgs },
27478
27518
  ...env.judgeTimeoutMs === void 0 ? {} : { timeoutMs: env.judgeTimeoutMs },
27479
27519
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId }
@@ -27508,6 +27548,7 @@ async function runAkRole(argv, env) {
27508
27548
  ...env.correlationId === void 0 ? {} : { correlationId: env.correlationId },
27509
27549
  ...env.piRunner === void 0 ? {} : { piRunner: env.piRunner },
27510
27550
  ...seat.selection === void 0 ? {} : { model: seat.selection },
27551
+ ...projectSeatEngine(seat),
27511
27552
  ...env.coderExtraPiArgs === void 0 ? {} : { extraPiArgs: env.coderExtraPiArgs },
27512
27553
  ...env.coderTimeoutMs === void 0 ? {} : { timeoutMs: env.coderTimeoutMs },
27513
27554
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId }
@@ -27542,6 +27583,7 @@ async function runAkRole(argv, env) {
27542
27583
  ...env.correlationId === void 0 ? {} : { correlationId: env.correlationId },
27543
27584
  ...env.piRunner === void 0 ? {} : { piRunner: env.piRunner },
27544
27585
  ...seat.selection === void 0 ? {} : { model: seat.selection },
27586
+ ...projectSeatEngine(seat),
27545
27587
  ...env.fixerExtraPiArgs === void 0 ? {} : { extraPiArgs: env.fixerExtraPiArgs },
27546
27588
  ...env.fixerTimeoutMs === void 0 ? {} : { timeoutMs: env.fixerTimeoutMs },
27547
27589
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId }
@@ -27576,6 +27618,7 @@ async function runAkRole(argv, env) {
27576
27618
  ...env.correlationId === void 0 ? {} : { correlationId: env.correlationId },
27577
27619
  ...env.piRunner === void 0 ? {} : { piRunner: env.piRunner },
27578
27620
  ...seat.selection === void 0 ? {} : { model: seat.selection },
27621
+ ...projectSeatEngine(seat),
27579
27622
  ...env.collectorExtraPiArgs === void 0 ? {} : { extraPiArgs: env.collectorExtraPiArgs },
27580
27623
  ...env.collectorTimeoutMs === void 0 ? {} : { timeoutMs: env.collectorTimeoutMs },
27581
27624
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId }
@@ -27610,7 +27653,7 @@ async function runAkRole(argv, env) {
27610
27653
  ...env.correlationId === void 0 ? {} : { correlationId: env.correlationId },
27611
27654
  ...env.piRunner === void 0 ? {} : { piRunner: env.piRunner },
27612
27655
  ...seat.selection === void 0 ? {} : { model: seat.selection },
27613
- ...seat.engine === void 0 ? {} : { engine: seat.engine },
27656
+ ...projectSeatEngine(seat),
27614
27657
  ...env.reviewerExtraPiArgs === void 0 ? {} : { extraPiArgs: env.reviewerExtraPiArgs },
27615
27658
  ...env.reviewerTimeoutMs === void 0 ? {} : { timeoutMs: env.reviewerTimeoutMs },
27616
27659
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId }
@@ -27645,6 +27688,7 @@ async function runAkRole(argv, env) {
27645
27688
  ...env.correlationId === void 0 ? {} : { correlationId: env.correlationId },
27646
27689
  ...env.piRunner === void 0 ? {} : { piRunner: env.piRunner },
27647
27690
  ...seat.selection === void 0 ? {} : { model: seat.selection },
27691
+ ...projectSeatEngine(seat),
27648
27692
  ...env.doctorExtraPiArgs === void 0 ? {} : { extraPiArgs: env.doctorExtraPiArgs },
27649
27693
  ...env.doctorTimeoutMs === void 0 ? {} : { timeoutMs: env.doctorTimeoutMs },
27650
27694
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId }
@@ -27679,6 +27723,7 @@ async function runAkRole(argv, env) {
27679
27723
  ...env.correlationId === void 0 ? {} : { correlationId: env.correlationId },
27680
27724
  ...env.piRunner === void 0 ? {} : { piRunner: env.piRunner },
27681
27725
  ...seat.selection === void 0 ? {} : { model: seat.selection },
27726
+ ...projectSeatEngine(seat),
27682
27727
  ...env.mergerExtraPiArgs === void 0 ? {} : { extraPiArgs: env.mergerExtraPiArgs },
27683
27728
  ...env.mergerTimeoutMs === void 0 ? {} : { timeoutMs: env.mergerTimeoutMs },
27684
27729
  ...env.createRunId === void 0 ? {} : { createRunId: env.createRunId }
package/package.json CHANGED
@@ -1,11 +1,25 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.2107",
3
+ "version": "0.1.2114",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
- "pi-package"
8
+ "pi-package",
9
+ "ai-agents",
10
+ "agents",
11
+ "agentic",
12
+ "multi-agent",
13
+ "agent-framework",
14
+ "agent-orchestration",
15
+ "ai-governance",
16
+ "human-in-the-loop",
17
+ "claude-code",
18
+ "codex",
19
+ "code-review",
20
+ "llm",
21
+ "ai",
22
+ "typescript"
9
23
  ],
10
24
  "bin": {
11
25
  "ak-role": "dist/public-cli/main.js"