@akagilnc/pi-workflow-roles 0.1.4586 → 0.1.4631

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 (63) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +3 -3
  3. package/dist/acp-host/production-host.js +1184 -717
  4. package/dist/activation-ledger-topology.js +0 -4
  5. package/dist/archivist-record-topology.js +27 -35
  6. package/dist/headless-host/description.js +7 -4
  7. package/dist/headless-host/production-host.js +998 -595
  8. package/dist/migrate-book-topology.js +3 -6
  9. package/dist/navigator-attendance.js +146 -241
  10. package/dist/navigator-public-session.js +81 -15
  11. package/dist/package-contracts/navigator-output.js +30 -12
  12. package/dist/pi/role-turn-host.js +0 -3
  13. package/dist/public-cli/auto-resume.js +26 -0
  14. package/dist/public-cli/judge-run.js +2 -2
  15. package/dist/public-cli/main.js +1119 -870
  16. package/dist/public-cli/option-definitions.js +1 -1
  17. package/dist/public-cli/post-admission.js +103 -9
  18. package/dist/public-cli/process-cancel.js +57 -0
  19. package/dist/public-cli/run-lifecycle.js +29 -7
  20. package/dist/public-cli/settlement.js +46 -32
  21. package/dist/public-cli/terminal.js +8 -27
  22. package/dist/public-role-summons.js +22 -4
  23. package/dist/submission-ledger.js +56 -23
  24. package/package.json +1 -1
  25. package/resources/836-deleted-machine-instruction-inventory.md +2 -0
  26. package/resources/navigator-route-playbook.md +9 -0
  27. package/scripts/build-package.mjs +6 -2
  28. package/src/acp-host/role-turn-host.ts +129 -13
  29. package/src/activation-ledger-topology.ts +1 -6
  30. package/src/activation-ledger.ts +5 -236
  31. package/src/analyst-entry.ts +19 -2
  32. package/src/analyst-ledger.ts +111 -6
  33. package/src/archivist-record-entry.ts +1 -1
  34. package/src/headless-host/description.ts +17 -7
  35. package/src/headless-host/role-turn-host.ts +42 -11
  36. package/src/navigator-attendance.ts +290 -425
  37. package/src/navigator-public-session.ts +126 -25
  38. package/src/navigator-role.ts +2 -2
  39. package/src/package-contracts/navigator-output.ts +41 -25
  40. package/src/pi/role-turn-host.ts +0 -3
  41. package/src/public-cli/auto-resume.ts +34 -0
  42. package/src/public-cli/cli.ts +30 -0
  43. package/src/public-cli/coder-run.ts +2 -2
  44. package/src/public-cli/fixer-run.ts +2 -2
  45. package/src/public-cli/judge-run.ts +2 -2
  46. package/src/public-cli/main.ts +25 -3
  47. package/src/public-cli/merger-run.ts +2 -2
  48. package/src/public-cli/option-definitions.ts +1 -1
  49. package/src/public-cli/post-admission.ts +175 -7
  50. package/src/public-cli/process-cancel.ts +75 -0
  51. package/src/public-cli/run-lifecycle.ts +37 -7
  52. package/src/public-cli/settlement.ts +42 -33
  53. package/src/public-cli/terminal.ts +12 -37
  54. package/src/public-role-summons.ts +34 -5
  55. package/src/role-envelope.ts +89 -4
  56. package/src/role-runtime.ts +78 -65
  57. package/src/submission-ledger.ts +63 -21
  58. package/dist/activation-reconciliation.js +0 -61
  59. package/dist/public-cli/command-renderer.js +0 -5
  60. package/dist/public-command-renderer.js +0 -29
  61. package/src/activation-reconciliation.ts +0 -163
  62. package/src/public-cli/command-renderer.ts +0 -9
  63. package/src/public-command-renderer.ts +0 -55
@@ -57,9 +57,6 @@ function resolveActivationLedgerHomeForPath(path) {
57
57
  function activationBookDirectory(ledgerHome, bookKey) {
58
58
  return join(ledgerHome, "books", bookKey);
59
59
  }
60
- function activationWaitingLedgerPath(ledgerHome, bookKey) {
61
- return join(activationBookDirectory(ledgerHome, bookKey), "waiting.jsonl");
62
- }
63
60
  function pathContainedIn(root, candidate) {
64
61
  const rel = relative(root, candidate);
65
62
  return rel !== "" && rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);
@@ -256,7 +253,6 @@ function assertLedgerFileInsideHome(ledgerPath, ledgerHome) {
256
253
  export {
257
254
  ActivationLedgerError,
258
255
  activationBookDirectory,
259
- activationWaitingLedgerPath,
260
256
  assertLedgerFileInsideHome,
261
257
  ensureRealDirectoryTree,
262
258
  errnoCode,
@@ -1,40 +1,32 @@
1
- /**
2
- * Pure archivist record placement topology (ADR 0048 / 0065 / dossier-topology).
3
- * No SessionManager / pi-coding-agent — cold public-bin and ledger discovery
4
- * may import this without pulling open-session runtime into the graph.
5
- *
6
- * Navigator work-subject is the sole book-top subject partition (#852):
7
- * books/<book>/navigator/<work-subject-digest>/. Callers must not re-hash
8
- * subject or re-join book/navigator/digest themselves.
9
- */
10
1
  import { createHash } from "node:crypto";
11
2
  import { join } from "node:path";
12
3
  import { resolveBookKeyFromGit } from "./activation-ledger-git.js";
13
- import { activationBookDirectory, resolveActivationLedgerHome, tryHomeFromAkRolesPath, } from "./activation-ledger-topology.js";
14
- /** Book-top partition for cross-ticket navigator route-memory (dossier-topology). */
15
- export const NAVIGATOR_RECORD_KIND = "navigator";
16
- /**
17
- * Sole navigator work-subject placement under the ledger book.
18
- * Returns ledgerHome and nest once so createRecordSessionOpen does not re-branch
19
- * parent/home. Work-subject key shape is sha256(subject) hex truncated to 32
20
- * (#852 out of scope — shape unchanged).
21
- *
22
- * parentSessionFile contributes home only when tryHomeFromAkRolesPath succeeds;
23
- * otherwise the explicit home (from HostContext.runDirectory) is kept. Never
24
- * invents a second home via passwd/env fallback from a foreign parent path.
25
- */
26
- export function resolveNavigatorWorkSubjectPlacement(input) {
27
- let ledgerHome;
28
- if (input.parentSessionFile !== undefined && input.parentSessionFile.length > 0) {
29
- const fromParent = tryHomeFromAkRolesPath(input.parentSessionFile);
30
- if (fromParent !== undefined && fromParent.length > 0) {
31
- ledgerHome = resolveActivationLedgerHome(fromParent);
32
- }
4
+ import {
5
+ activationBookDirectory,
6
+ resolveActivationLedgerHome,
7
+ tryHomeFromAkRolesPath
8
+ } from "./activation-ledger-topology.js";
9
+ const NAVIGATOR_RECORD_KIND = "navigator";
10
+ function resolveNavigatorWorkSubjectPlacement(input) {
11
+ let ledgerHome;
12
+ if (input.parentSessionFile !== void 0 && input.parentSessionFile.length > 0) {
13
+ const fromParent = tryHomeFromAkRolesPath(input.parentSessionFile);
14
+ if (fromParent !== void 0 && fromParent.length > 0) {
15
+ ledgerHome = resolveActivationLedgerHome(fromParent);
33
16
  }
34
- ledgerHome ??= resolveActivationLedgerHome(input.home);
35
- const digest = createHash("sha256").update(input.subject).digest("hex").slice(0, 32);
36
- return {
37
- ledgerHome,
38
- sessionDir: join(activationBookDirectory(ledgerHome, resolveBookKeyFromGit(input.cwd)), NAVIGATOR_RECORD_KIND, digest),
39
- };
17
+ }
18
+ ledgerHome ??= resolveActivationLedgerHome(input.home);
19
+ const digest = createHash("sha256").update(input.subject).digest("hex").slice(0, 32);
20
+ return {
21
+ ledgerHome,
22
+ sessionDir: join(
23
+ activationBookDirectory(ledgerHome, resolveBookKeyFromGit(input.cwd)),
24
+ NAVIGATOR_RECORD_KIND,
25
+ digest
26
+ )
27
+ };
40
28
  }
29
+ export {
30
+ NAVIGATOR_RECORD_KIND,
31
+ resolveNavigatorWorkSubjectPlacement
32
+ };
@@ -27,9 +27,10 @@ export function headlessTurnArgs(options) {
27
27
  ...description.fixedArgs,
28
28
  description.systemPromptFlag,
29
29
  options.systemPromptPath,
30
- description.jsonSchemaFlag,
31
- JSON.stringify(options.jsonSchema),
32
30
  ];
31
+ if (options.jsonSchema !== undefined) {
32
+ args.push(description.jsonSchemaFlag, JSON.stringify(options.jsonSchema));
33
+ }
33
34
  if (options.pluginDir)
34
35
  args.push("--plugin-dir", options.pluginDir);
35
36
  if (options.mcpConfigPath !== undefined && options.mcpConfigPath !== "") {
@@ -69,7 +70,7 @@ function codexTomlStringTable(entries) {
69
70
  * Free-form JSON leaf for Type.Unknown under Codex strict transport.
70
71
  * Strict rejects bare untyped nodes and root-level additionalProperties:true;
71
72
  * a $defs anyOf of JSON values (with nested additionalProperties as $ref)
72
- * is accepted and keeps array/object receipts expressible (navigator candidates).
73
+ * is accepted and keeps array/object receipts expressible.
73
74
  * Package code still does not validate or reject the receipt against schema.
74
75
  */
75
76
  const CODEX_JSON_VALUE_DEF = "codexJsonValue";
@@ -335,7 +336,9 @@ export function codexTurnArgs(options) {
335
336
  }
336
337
  }
337
338
  args.push("-c", `model_instructions_file=${codexTomlString(options.systemPromptPath)}`);
338
- args.push("--output-schema", options.outputSchemaPath);
339
+ if (options.outputSchemaPath !== undefined) {
340
+ args.push("--output-schema", options.outputSchemaPath);
341
+ }
339
342
  args.push(...codexMcpConfigArgs(options.mcpServers));
340
343
  if (options.model !== undefined && options.model !== "") {
341
344
  args.push("-m", options.model);