@akagilnc/pi-workflow-roles 0.1.4586 → 0.1.4620

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 (47) hide show
  1. package/README.md +2 -2
  2. package/README.zh-CN.md +2 -2
  3. package/dist/acp-host/production-host.js +951 -497
  4. package/dist/archivist-record-topology.js +27 -35
  5. package/dist/headless-host/description.js +7 -4
  6. package/dist/headless-host/production-host.js +783 -393
  7. package/dist/migrate-book-topology.js +3 -6
  8. package/dist/navigator-attendance.js +146 -241
  9. package/dist/navigator-public-session.js +81 -15
  10. package/dist/package-contracts/navigator-output.js +30 -12
  11. package/dist/public-cli/judge-run.js +2 -2
  12. package/dist/public-cli/main.js +69 -94
  13. package/dist/public-cli/option-definitions.js +1 -1
  14. package/dist/public-cli/post-admission.js +2 -2
  15. package/dist/public-cli/run-lifecycle.js +29 -7
  16. package/dist/public-cli/settlement.js +46 -32
  17. package/dist/public-cli/terminal.js +8 -27
  18. package/dist/public-role-summons.js +22 -4
  19. package/dist/submission-ledger.js +56 -23
  20. package/package.json +1 -1
  21. package/resources/836-deleted-machine-instruction-inventory.md +2 -0
  22. package/resources/navigator-route-playbook.md +9 -0
  23. package/scripts/build-package.mjs +6 -1
  24. package/src/acp-host/role-turn-host.ts +129 -13
  25. package/src/headless-host/description.ts +17 -7
  26. package/src/headless-host/role-turn-host.ts +42 -11
  27. package/src/navigator-attendance.ts +290 -425
  28. package/src/navigator-public-session.ts +126 -25
  29. package/src/navigator-role.ts +2 -2
  30. package/src/package-contracts/navigator-output.ts +41 -25
  31. package/src/public-cli/coder-run.ts +2 -2
  32. package/src/public-cli/fixer-run.ts +2 -2
  33. package/src/public-cli/judge-run.ts +2 -2
  34. package/src/public-cli/merger-run.ts +2 -2
  35. package/src/public-cli/option-definitions.ts +1 -1
  36. package/src/public-cli/post-admission.ts +2 -1
  37. package/src/public-cli/run-lifecycle.ts +37 -7
  38. package/src/public-cli/settlement.ts +42 -33
  39. package/src/public-cli/terminal.ts +12 -37
  40. package/src/public-role-summons.ts +34 -5
  41. package/src/role-envelope.ts +89 -4
  42. package/src/role-runtime.ts +74 -14
  43. package/src/submission-ledger.ts +63 -21
  44. package/dist/public-cli/command-renderer.js +0 -5
  45. package/dist/public-command-renderer.js +0 -29
  46. package/src/public-cli/command-renderer.ts +0 -9
  47. package/src/public-command-renderer.ts +0 -55
@@ -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);