@akagilnc/pi-workflow-roles 0.1.5955 → 0.1.6014

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/acp-host/production-host.js +5 -47
  3. package/dist/countersign-contracts.js +2 -22
  4. package/dist/countersign-role.js +0 -8
  5. package/dist/doctor-contracts.js +0 -1
  6. package/dist/gleaner-left-contracts.js +1 -18
  7. package/dist/gleaner-left-role.js +1 -2
  8. package/dist/headless-host/production-host.js +8 -50
  9. package/dist/inspector-role.js +0 -2
  10. package/dist/judge-role.js +1 -7
  11. package/dist/migrate-book-topology.js +0 -16
  12. package/dist/navigator-route-table.js +0 -1
  13. package/dist/notary-contracts.js +1 -16
  14. package/dist/package-contracts/auditor-output.js +1 -2
  15. package/dist/package-contracts/gatekeeper-output.js +0 -4
  16. package/dist/package-contracts/terminating-tools.js +1 -3
  17. package/dist/package-resources/engine-material.js +1 -8
  18. package/dist/pi/role-turn-host.js +0 -3
  19. package/dist/public-cli/cli.js +1 -23
  20. package/dist/public-cli/config.js +0 -4
  21. package/dist/public-cli/invocation.js +0 -4
  22. package/dist/public-cli/main.js +1 -41
  23. package/dist/public-cli/option-definitions.js +0 -8
  24. package/package.json +1 -1
  25. package/scripts/build-package.mjs +0 -1
  26. package/souls/design-law.md +1 -0
  27. package/souls/quality-law.md +2 -1
  28. package/src/countersign-contracts.ts +1 -21
  29. package/src/countersign-role.ts +1 -8
  30. package/src/doctor-contracts.ts +0 -1
  31. package/src/gleaner-left-contracts.ts +0 -17
  32. package/src/gleaner-left-role.ts +0 -2
  33. package/src/inspector-role.ts +1 -3
  34. package/src/judge-role.ts +1 -3
  35. package/src/navigator-route-table.ts +0 -2
  36. package/src/notary-contracts.ts +1 -26
  37. package/src/package-contracts/auditor-output.ts +1 -3
  38. package/src/package-contracts/gatekeeper-output.ts +0 -10
  39. package/src/package-contracts/terminating-tools.ts +2 -4
  40. package/src/package-resources/engine-material.ts +1 -16
  41. package/src/pi/role-turn-host.ts +0 -3
  42. package/src/public-cli/cli.ts +0 -24
  43. package/src/public-cli/config.ts +2 -8
  44. package/src/public-cli/invocation.ts +0 -28
  45. package/src/public-cli/option-definitions.ts +1 -10
  46. package/dist/canonical-json.js +0 -75
  47. package/dist/judge-recording-anti-forge.js +0 -39
  48. package/src/canonical-json.ts +0 -74
  49. package/src/judge-recording-anti-forge.ts +0 -53
@@ -364,9 +364,6 @@ export function createPiRoleTurnHost(config) {
364
364
  delete env.AK_ROLE_HOST;
365
365
  else
366
366
  env.AK_ROLE_HOST = request.host.trim();
367
- // #1199: 传召词 is unknown-length body — never argv/env (execve ARG_MAX / E2BIG).
368
- // Typed stdin envelope carries dialogue + optional progress 传召词.
369
- delete env.AK_ROLE_SUMMONS_INSTRUCTION;
370
367
  // #1132: the one effective delivery-request ceiling travels to the child
371
368
  // on its own env so the in-child role runtime and the worker submission
372
369
  // gate count with the same configured number the AK seam resolved. Omit
@@ -17,7 +17,7 @@ import { appendPiSessionCustomEntry } from "../pi/role-turn-host.js";
17
17
  import { openRoleSeatRuntime } from "./role-seat-runtime.js";
18
18
  import { formatHostSelectionFailure, HostSelectionError, } from "./role-turn-host-resolution.js";
19
19
  import { admittedSourceRunPath, parseAnalystArgv, parsePublicSeatArgv, } from "./invocation.js";
20
- import { createTypedOptionConsumer, optionsForOwner, projectCommandHelp, projectOwnerOptions, PUBLIC_NAVIGATOR_HELP_NOTE, PUBLIC_ROLE_OPTION_OWNERS, renderHumanOwnerOptionLines, } from "./option-definitions.js";
20
+ import { createTypedOptionConsumer, optionsForOwner, projectCommandHelp, PUBLIC_NAVIGATOR_HELP_NOTE, PUBLIC_ROLE_OPTION_OWNERS, renderHumanOwnerOptionLines, } from "./option-definitions.js";
21
21
  import { TurnDispatchedFailure } from "./auto-resume.js";
22
22
  import { readSessionDialogue, renderSessionDialogue } from "./dialogue-command.js";
23
23
  import { continueParentAfterChild, presentAuditedOriginalOfUnsettledOfficer, runPublicInstructionSeat, runPublicInstructionSeatResume, } from "./instruction-seat-run.js";
@@ -338,32 +338,10 @@ function loadAndValidateConfig(home, packageRoot) {
338
338
  /** Typed facts used by help presentation — not layout. */
339
339
  export function helpDocument() {
340
340
  return {
341
- executable: "ak-role",
342
341
  capabilities: listHelpCapabilities(),
343
342
  internalEntrypoint: INTERNAL_ROLE_ENTRYPOINT_RELATIVE,
344
- /** #342 structured global options from the sole option table. */
345
- globalOptions: projectOwnerOptions("global"),
346
343
  };
347
344
  }
348
- /** Structured help facts for one public command/role (#342). */
349
- export function helpDocumentForCommand(command) {
350
- if (command === "global") {
351
- return {
352
- command: "global",
353
- kind: "global",
354
- options: projectOwnerOptions("global"),
355
- };
356
- }
357
- if (command in PUBLIC_ROLE_ARGV) {
358
- const owner = command;
359
- return {
360
- command: owner,
361
- kind: owner === "analyst" ? "deterministic" : "role",
362
- options: projectOwnerOptions(owner),
363
- };
364
- }
365
- return undefined;
366
- }
367
345
  /** Append USAGE + EXAMPLES blocks from the sole public help-copy owner. */
368
346
  function appendUsageAndExamples(lines, topic) {
369
347
  const facts = projectCommandHelp(topic);
@@ -20,9 +20,6 @@ import {
20
20
  seatModelOnly
21
21
  } from "./registry.js";
22
22
  import { isEnoent, isRecord } from "../unknown-value.js";
23
- const GATE_OFFICER_SEATS = PUBLIC_ROLE_RECORDS.flatMap(
24
- (record) => "provinceConfig" in record && record.provinceConfig === true ? [record.role] : []
25
- );
26
23
  function isGateOfficerSeat(value) {
27
24
  return packagedProvinceConfig(value);
28
25
  }
@@ -502,7 +499,6 @@ async function loadCredentialProviders(agentDir) {
502
499
  }
503
500
  }
504
501
  export {
505
- GATE_OFFICER_SEATS,
506
502
  buildSeatModelCliArgs,
507
503
  clearPersistentSeatConfig,
508
504
  credentialProvidersFromAuthData,
@@ -433,10 +433,6 @@ function rejectUnlessTicketNumber(raw, message) {
433
433
  throw new CliUsageError(message);
434
434
  return parsed;
435
435
  }
436
- /** Positive ticket number for analyst query-scope face (and shared integer parse). */
437
- export function parsePositiveTicketNumber(raw, flag) {
438
- return rejectUnlessTicketNumber(raw, `${flag} must be a positive integer, got ${raw}`);
439
- }
440
436
  /**
441
437
  * One token scan for public argv.
442
438
  * Callers assign values; `--` still ends flag parsing.
@@ -9404,20 +9404,12 @@ var init_worker_output = __esm({
9404
9404
  }
9405
9405
  });
9406
9406
 
9407
- // src/canonical-json.ts
9408
- var init_canonical_json = __esm({
9409
- "src/canonical-json.ts"() {
9410
- "use strict";
9411
- }
9412
- });
9413
-
9414
9407
  // src/doctor-contracts.ts
9415
9408
  var DOCTOR_OUTPUT_TOOL_NAME, DOCTOR_AUDIT_TOOL_NAME, DOCTOR_OUTPUT_TOOL_DESCRIPTION, DOCTOR_TARGET_KINDS, DOCTOR_DISPOSITIONS, DOCTOR_PRESCRIPTION_KINDS, biteActual, biteNone, DOCTOR_BITE_KINDS, DOCTOR_STATUS_DESCRIPTION, doctorSubmissionObject, doctorSubmissionSchema, doctorEvidenceReadSchema;
9416
9409
  var init_doctor_contracts = __esm({
9417
9410
  "src/doctor-contracts.ts"() {
9418
9411
  "use strict";
9419
9412
  init_build();
9420
- init_canonical_json();
9421
9413
  init_open_tool_schema();
9422
9414
  init_terminating_infrastructure();
9423
9415
  init_unknown_value();
@@ -9559,7 +9551,6 @@ var init_countersign_contracts = __esm({
9559
9551
  "src/countersign-contracts.ts"() {
9560
9552
  "use strict";
9561
9553
  init_review_submission();
9562
- init_unknown_value();
9563
9554
  COUNTERSIGN_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
9564
9555
  }
9565
9556
  });
@@ -9572,7 +9563,6 @@ var init_gleaner_left_contracts = __esm({
9572
9563
  init_build();
9573
9564
  init_open_tool_schema();
9574
9565
  init_terminating_infrastructure();
9575
- init_unknown_value();
9576
9566
  GLEANER_LEFT_OUTPUT_TOOL_NAME = "ak_gleaner_left_output";
9577
9567
  gleanerLeftOutputSchema = withTerminatingOutputDeclarations(
9578
9568
  openToolObject(
@@ -10532,7 +10522,6 @@ var init_host_descriptions = __esm({
10532
10522
  // src/public-cli/config.ts
10533
10523
  var config_exports = {};
10534
10524
  __export(config_exports, {
10535
- GATE_OFFICER_SEATS: () => GATE_OFFICER_SEATS,
10536
10525
  buildSeatModelCliArgs: () => buildSeatModelCliArgs,
10537
10526
  clearPersistentSeatConfig: () => clearPersistentSeatConfig,
10538
10527
  credentialProvidersFromAuthData: () => credentialProvidersFromAuthData,
@@ -11039,7 +11028,6 @@ async function loadCredentialProviders(agentDir) {
11039
11028
  throw error;
11040
11029
  }
11041
11030
  }
11042
- var GATE_OFFICER_SEATS;
11043
11031
  var init_config2 = __esm({
11044
11032
  "src/public-cli/config.ts"() {
11045
11033
  "use strict";
@@ -11049,9 +11037,6 @@ var init_config2 = __esm({
11049
11037
  init_packaged_role_registry();
11050
11038
  init_registry();
11051
11039
  init_unknown_value();
11052
- GATE_OFFICER_SEATS = PUBLIC_ROLE_RECORDS.flatMap(
11053
- (record) => "provinceConfig" in record && record.provinceConfig === true ? [record.role] : []
11054
- );
11055
11040
  }
11056
11041
  });
11057
11042
 
@@ -12932,8 +12917,6 @@ var init_terminating_tools = __esm({
12932
12917
  init_auditor_output();
12933
12918
  init_merger_contracts();
12934
12919
  init_notary_contracts();
12935
- init_countersign_contracts();
12936
- init_gleaner_left_contracts();
12937
12920
  init_inspector_contracts();
12938
12921
  init_diarist_contracts();
12939
12922
  init_secretariat_contracts();
@@ -18353,7 +18336,6 @@ function createPiRoleTurnHost(config) {
18353
18336
  else env.AK_ROLE_INVOCATION_SCOPE = request.invocationScopeId;
18354
18337
  if (request.host === void 0 || request.host.trim() === "") delete env.AK_ROLE_HOST;
18355
18338
  else env.AK_ROLE_HOST = request.host.trim();
18356
- delete env.AK_ROLE_SUMMONS_INSTRUCTION;
18357
18339
  if (request.deliveryRequestLimit === void 0) delete env[RECEIPT_DELIVERY_LIMIT_ENV];
18358
18340
  else env[RECEIPT_DELIVERY_LIMIT_ENV] = String(request.deliveryRequestLimit);
18359
18341
  applyEngineChildEnv(env, request.engine);
@@ -32468,7 +32450,6 @@ __export(cli_exports, {
32468
32450
  buildExplicitInternalActivationArgs: () => buildExplicitInternalActivationArgs,
32469
32451
  commandNeedsProcessCancel: () => commandNeedsProcessCancel,
32470
32452
  helpDocument: () => helpDocument,
32471
- helpDocumentForCommand: () => helpDocumentForCommand,
32472
32453
  projectConfigDisplaySeats: () => projectConfigDisplaySeats,
32473
32454
  projectConfigSeatDisplay: () => projectConfigSeatDisplay,
32474
32455
  resolveInternalRoleEntrypoint: () => resolveInternalRoleEntrypoint,
@@ -32749,31 +32730,10 @@ function loadAndValidateConfig(home, packageRoot2) {
32749
32730
  }
32750
32731
  function helpDocument() {
32751
32732
  return {
32752
- executable: "ak-role",
32753
32733
  capabilities: listHelpCapabilities(),
32754
- internalEntrypoint: INTERNAL_ROLE_ENTRYPOINT_RELATIVE,
32755
- /** #342 structured global options from the sole option table. */
32756
- globalOptions: projectOwnerOptions("global")
32734
+ internalEntrypoint: INTERNAL_ROLE_ENTRYPOINT_RELATIVE
32757
32735
  };
32758
32736
  }
32759
- function helpDocumentForCommand(command) {
32760
- if (command === "global") {
32761
- return {
32762
- command: "global",
32763
- kind: "global",
32764
- options: projectOwnerOptions("global")
32765
- };
32766
- }
32767
- if (command in PUBLIC_ROLE_ARGV) {
32768
- const owner = command;
32769
- return {
32770
- command: owner,
32771
- kind: owner === "analyst" ? "deterministic" : "role",
32772
- options: projectOwnerOptions(owner)
32773
- };
32774
- }
32775
- return void 0;
32776
- }
32777
32737
  function appendUsageAndExamples(lines, topic) {
32778
32738
  const facts = projectCommandHelp(topic);
32779
32739
  if (facts === void 0) return;
@@ -898,14 +898,6 @@ export function projectOwnerOptions(owner) {
898
898
  description: def.description,
899
899
  }));
900
900
  }
901
- /** All rejected spelling tokens flattened (for leakage scans). */
902
- export function allRejectedSpellingTokens() {
903
- const out = [];
904
- for (const entry of REJECTED_PUBLIC_SPELLINGS) {
905
- out.push(...entry.spellings);
906
- }
907
- return out;
908
- }
909
901
  /**
910
902
  * Top-level public help short note for Navigator automatic attendance (#639:
911
903
  * attendance is orthogonal to callability — the direct command face lives on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.5955",
3
+ "version": "0.1.6014",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -30,7 +30,6 @@ const entries = [
30
30
  "role-run-placement",
31
31
  // Static import of role-run-placement (safe-positive ticket invariant).
32
32
  "run-ticket-number",
33
- "canonical-json",
34
33
  "compliance-transport",
35
34
  "countersign-contracts",
36
35
  "secretariat-contracts",
@@ -33,6 +33,7 @@
33
33
  * **考虑过的替代方案**:至少一个截然不同、更简单的做法,写明为什么没选——这是最要紧的一节。
34
34
  * 缺点与不做的影响:替这个方案反驳一次(Rust RFC)。
35
35
  * 留待实现:设计定到哪一层、哪些明写留给施工。
36
+ * 运行成本:给某个模型、入口或调用方定了读写范围的,同时写明它一次拿到多少、随使用增长有没有上界、用户要等多久(量级即可);只定能读什么、不定一次给多少的,设计稿不完整。
36
37
 
37
38
  不写:代码、照抄的 schema 或接口定义、需求大全、陛下原话里没有的流程与阶段。问题小而无歧义的,稿子相应短。
38
39
 
@@ -63,9 +63,10 @@ unfinished 只认两因:**缺前置**——处置当下仍缺少已声明的
63
63
 
64
64
  ## 预警参考线
65
65
 
66
- 给审官的触发线,由审官自行判断,不是机械闸。超线不必然有罪,但须专项审视、当事方须给出说明:
66
+ 给审官的触发线,由审官自行判断,不是机械闸。超线不必然有罪,但须专项审视,审完只有两条去处:授权内能改的封驳,改它要动票面或陛下已定范围的上呈;要当事方说明的,封驳让他说明,下一轮核。不留只记一笔、只要回执写明的。
67
67
 
68
68
  - 全量测试墙钟参考尺 120 秒(宿主另有明文终线从宿主);单文件耗时占全量一成以上,同须审视。
69
69
  - 单元测试跑得快;跑得不快的,就不是单元测试——单测过 0.1 秒即算慢。整套构建加测试,本厂线 180 秒(业内老线十分钟是给大项目的)——凿掉的每一分钟,是每条腿每次交卷省下的一分钟。测试耗时占比失衡即先三问再跑:该跑吗?时长合理吗?非全量不可吗?
70
70
  - 单次交卷变更以 200–400 行为宜(生产+测试;纯删除与机械改名不计)——缺陷检出最佳区间即在此,过 400 急坠。超出须逐项证明必要价值,或说明为何不可拆。
71
71
  - 同一处代码短期内反复改写、返工占比持续超约四分之一:系统病,回查根因。
72
+ - 生产运行成本:用户每一步要等多久,每次交给模型、外部服务或返回给调用方的数据有多大,都要说得出量级。数据量随使用时长、累积记录或用户规模增长而没有上界的,须专项审视。
@@ -5,8 +5,7 @@
5
5
  * is defaulted, rewritten, or dropped (ADR 0055).
6
6
  */
7
7
 
8
- import { REVIEW_QUEUE_STATUSES, REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "./review-submission.ts";
9
- import { isRecord } from "./unknown-value.ts";
8
+ import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "./review-submission.ts";
10
9
 
11
10
  export const COUNTERSIGN_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
12
11
 
@@ -24,22 +23,3 @@ export type CountersignVerdict =
24
23
  note?: string;
25
24
  evidence?: unknown;
26
25
  };
27
-
28
- export function validateRecordedCountersignOutput(verdict: unknown): CountersignVerdict {
29
- if (!isRecord(verdict)) {
30
- throw new Error("Countersign verdict has no execution discriminator");
31
- }
32
- let status: unknown;
33
- try {
34
- status = (verdict as Record<string, unknown>).status;
35
- } catch {
36
- throw new Error("Countersign verdict has no execution discriminator");
37
- }
38
- if (typeof status !== "string") {
39
- throw new Error("Countersign verdict has no execution discriminator");
40
- }
41
- if (REVIEW_QUEUE_STATUSES.has(status)) {
42
- return verdict as CountersignVerdict;
43
- }
44
- throw new Error("Countersign verdict has no execution discriminator");
45
- }
@@ -1,10 +1,5 @@
1
- import { reviewSubmissionSchema } from "./review-submission.ts";
2
1
  import { roleSubmissionDeclaration } from "./role-submission-declarations.ts";
3
- import {
4
- COUNTERSIGN_OUTPUT_TOOL_NAME,
5
- validateRecordedCountersignOutput,
6
- type CountersignVerdict,
7
- } from "./countersign-contracts.ts";
2
+ import type { CountersignVerdict } from "./countersign-contracts.ts";
8
3
 
9
4
  export { COUNTERSIGN_OUTPUT_TOOL_NAME } from "./countersign-contracts.ts";
10
5
  export type { CountersignVerdict };
@@ -13,8 +8,6 @@ export type { CountersignVerdict };
13
8
  // no code branches on their length or nested presence. `status` alone is the
14
9
  // machine discriminator the queue reads.
15
10
  // #1055: the three-state field is an enum+required host generation constraint.
16
- /** 给事中票庭审读五问的交卷形状(ADR 0074);形状指引,非 schema 闸。 */
17
- export const countersignVerdictSchema = reviewSubmissionSchema;
18
11
  export type CountersignVerdictParameters = import("./review-submission.ts").ReviewSubmission;
19
12
 
20
13
  export type CountersignRuntimeDependencies = {
@@ -1,5 +1,4 @@
1
1
  import { Type } from "typebox";
2
- import { canonicalJson } from "./canonical-json.ts";
3
2
  import { openToolObject } from "./open-tool-schema.ts";
4
3
  import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.ts";
5
4
 
@@ -8,7 +8,6 @@ import { Type } from "typebox";
8
8
 
9
9
  import { openToolObject } from "./open-tool-schema.ts";
10
10
  import { withTerminatingOutputDeclarations } from "./package-contracts/terminating-infrastructure.ts";
11
- import { isRecord } from "./unknown-value.ts";
12
11
 
13
12
  export const GLEANER_LEFT_OUTPUT_TOOL_NAME = "ak_gleaner_left_output";
14
13
 
@@ -52,19 +51,3 @@ export type GleanerLeftOutput = {
52
51
  readonly status: "completed";
53
52
  readonly findings: readonly GleanerLeftFinding[];
54
53
  };
55
-
56
- export function validateRecordedGleanerLeftOutput(value: unknown): GleanerLeftOutput {
57
- if (!isRecord(value)) {
58
- throw new Error("Gleaner-left output has no execution discriminator");
59
- }
60
- let status: unknown;
61
- try {
62
- status = (value as Record<string, unknown>).status;
63
- } catch {
64
- throw new Error("Gleaner-left output has no execution discriminator");
65
- }
66
- if (status === "completed") {
67
- return value as GleanerLeftOutput;
68
- }
69
- throw new Error("Gleaner-left output has no execution discriminator");
70
- }
@@ -3,7 +3,6 @@ import type { Static } from "typebox";
3
3
  import {
4
4
  GLEANER_LEFT_OUTPUT_TOOL_NAME,
5
5
  gleanerLeftOutputSchema,
6
- validateRecordedGleanerLeftOutput,
7
6
  type GleanerLeftOutput,
8
7
  } from "./gleaner-left-contracts.ts";
9
8
  import { roleSubmissionDeclaration } from "./role-submission-declarations.ts";
@@ -13,7 +12,6 @@ export {
13
12
  gleanerLeftOutputSchema,
14
13
  } from "./gleaner-left-contracts.ts";
15
14
  export type { GleanerLeftOutput };
16
- export { validateRecordedGleanerLeftOutput };
17
15
 
18
16
  export type GleanerLeftOutputParameters = Static<typeof gleanerLeftOutputSchema>;
19
17
 
@@ -15,9 +15,7 @@ export type { InspectorOutput };
15
15
  export { validateRecordedInspectorOutput };
16
16
 
17
17
  /** 台院事后察举交卷形状。 */
18
- export const inspectorOutputSchema = inspectorSubmissionSchema;
19
-
20
- export type InspectorOutputParameters = Static<typeof inspectorOutputSchema>;
18
+ export type InspectorOutputParameters = Static<typeof inspectorSubmissionSchema>;
21
19
 
22
20
  export type InspectorRuntimeDependencies = {
23
21
  loadSoul(): Promise<string>;
package/src/judge-role.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type RoleHost } from "./host-contracts.ts";
2
- import { REVIEW_QUEUE_STATUSES, reviewSubmissionSchema, type ReviewQueueWord } from "./review-submission.ts";
2
+ import { REVIEW_QUEUE_STATUSES, type ReviewQueueWord } from "./review-submission.ts";
3
3
  import { registerFiledSubmissionTool } from "./filed-submission.ts";
4
4
  import { roleSubmissionDeclaration } from "./role-submission-declarations.ts";
5
5
  import { type GatekeeperSubject } from "./gatekeeper-role.ts";
@@ -110,8 +110,6 @@ export async function runJudgeGates(input: {
110
110
  // content — 符宝郎/审刑院 read the raw receipt, no code branches on their length
111
111
  // or nested presence. `status` alone is the machine discriminator the
112
112
  // queue reads to pick converged/continue/escalate (below).
113
- // The shared open schema preserves role-specific prose without adding another contract.
114
- export const judgeVerdictSchema = reviewSubmissionSchema;
115
113
 
116
114
  export type JudgeRoleDependencies = {
117
115
  loadSoul(): Promise<string>;
@@ -17,8 +17,6 @@ import type { ReviewerIntent } from "./package-contracts/reviewer-output.ts";
17
17
  import type { CoderOutput } from "./package-contracts/worker-output.ts";
18
18
  import type { ReviewQueueWord } from "./review-submission.ts";
19
19
 
20
- export const NAVIGATOR_ADVICE_MAX_CHARS = 20;
21
-
22
20
  const DISPOSE_BY_VERDICT = "按判词处置";
23
21
  const ESCALATE_TO_OWNER = "呈陛下裁决";
24
22
  const DISPATCH_WORKER = "派将作监开工";
@@ -3,7 +3,7 @@
3
3
  * Lawful explicit releases: converged | continue | escalate.
4
4
  * No usable result is infrastructure failure via public settlement, not a judgment status (#475).
5
5
  */
6
- import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME, notaryReviewSubmissionSchema } from "./review-submission.ts";
6
+ import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "./review-submission.ts";
7
7
 
8
8
  import { isRecord } from "./unknown-value.ts";
9
9
 
@@ -25,9 +25,6 @@ export const NOTARY_TICKET_FLAG = {
25
25
  },
26
26
  } as const;
27
27
 
28
- /** #1195: generation-required clauses; package still records missing tables as-is. */
29
- export const notaryOutputSchema = notaryReviewSubmissionSchema;
30
-
31
28
  export type NotarySourceRunLocator = {
32
29
  readonly runDirectory: string;
33
30
  readonly runId: string;
@@ -44,28 +41,6 @@ export type NotaryOutput =
44
41
  readonly findings?: unknown;
45
42
  };
46
43
 
47
- /**
48
- * Recognize one lawful explicit Notary release (converged | continue | escalate).
49
- * #753: no field rewrite — submitted params retained as-is (no disposition forge,
50
- * no findings array rewrite). Recognition only for recording/settlement callers.
51
- */
52
- export function projectLawfulNotaryOutput(value: unknown): NotaryOutput | undefined {
53
- // #836: no field drop
54
- return (isRecord(value))
55
- ? (value as NotaryOutput)
56
- : undefined;
57
- }
58
-
59
- /** Retain submitted Notary params as-is for the failure channel (no shape rewrite). */
60
- export function retainNotarySubmission(value: unknown): unknown {
61
- if (value === undefined) return { missing: "arguments" as const };
62
- try {
63
- return structuredClone(value);
64
- } catch {
65
- return value;
66
- }
67
- }
68
-
69
44
  /**
70
45
  * Settlement/recording path: only lawful recorded converged/continue/escalate.
71
46
  * Does not gate role admission — callers must not use this to reject a submission.
@@ -2,14 +2,12 @@
2
2
  * Public Auditor (审刑院) terminating receipt contracts (#675 / #754).
3
3
  * Lawful explicit releases: converged | continue | escalate.
4
4
  */
5
- import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME, reviewSubmissionSchema } from "../review-submission.ts";
5
+ import { REVIEW_SUBMISSION_OUTPUT_TOOL_NAME } from "../review-submission.ts";
6
6
 
7
7
  import { isRecord } from "../unknown-value.ts";
8
8
 
9
9
  export const AUDITOR_OUTPUT_TOOL_NAME: string = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
10
10
 
11
- export const auditorOutputSchema = reviewSubmissionSchema;
12
-
13
11
  export type AuditorOutput =
14
12
  | { readonly status: "converged" }
15
13
  | { readonly status: "continue"; readonly violations?: unknown }
@@ -40,16 +40,6 @@ function asStringArray(value: unknown): readonly string[] {
40
40
  return value.filter((item): item is string => typeof item === "string");
41
41
  }
42
42
 
43
- /**
44
- * Project one explicit Gatekeeper decision.
45
- * No throw on shape — ADR 0055 / 仓内 CLAUDE.md 开篇: already-submitted params are retained as-is;
46
- * public-terminal projects non-usable releases via typed failure cause.
47
- */
48
- /** #836: no field drop — original object is the receipt. */
49
- export function projectLawfulGatekeeperOutput(value: unknown): GatekeeperDirectOutput | undefined {
50
- return isRecord(value) ? (value as GatekeeperDirectOutput) : undefined;
51
- }
52
-
53
43
  /** #836: no status allowlist rejection — pass object through. */
54
44
  export function validateRecordedGatekeeperOutput(value: unknown): GatekeeperDirectOutput {
55
45
  if (!isRecord(value)) throw new Error("Gatekeeper output is not an object");
@@ -24,8 +24,8 @@ import { NAVIGATOR_OUTPUT_TOOL_NAME, validateRecordedNavigatorOutput, type Navig
24
24
  import { AUDITOR_OUTPUT_TOOL_NAME, validateRecordedAuditorOutput, type AuditorOutput } from "./auditor-output.ts";
25
25
  import { MERGER_OUTPUT_TOOL_NAME, validateMergerOutput, type MergerOutput } from "../merger-contracts.ts";
26
26
  import { NOTARY_OUTPUT_TOOL_NAME, validateRecordedNotaryOutput, type NotaryOutput } from "../notary-contracts.ts";
27
- import { COUNTERSIGN_OUTPUT_TOOL_NAME, validateRecordedCountersignOutput, type CountersignVerdict } from "../countersign-contracts.ts";
28
- import { GLEANER_LEFT_OUTPUT_TOOL_NAME, validateRecordedGleanerLeftOutput, type GleanerLeftOutput } from "../gleaner-left-contracts.ts";
27
+ import type { CountersignVerdict } from "../countersign-contracts.ts";
28
+ import type { GleanerLeftOutput } from "../gleaner-left-contracts.ts";
29
29
  import { INSPECTOR_OUTPUT_TOOL_NAME, validateRecordedInspectorOutput, type InspectorOutput } from "../inspector-contracts.ts";
30
30
  import { DIARIST_OUTPUT_TOOL_NAME, validateRecordedDiaristOutput, type DiaristOutput } from "../diarist-contracts.ts";
31
31
  import { SECRETARIAT_OUTPUT_TOOL_NAME, type SecretariatVerdict } from "../secretariat-contracts.ts";
@@ -51,8 +51,6 @@ export {
51
51
  validateRecordedDoctorOutput,
52
52
  validateMergerOutput,
53
53
  validateRecordedNotaryOutput,
54
- validateRecordedCountersignOutput,
55
- validateRecordedGleanerLeftOutput,
56
54
  validateRecordedInspectorOutput,
57
55
  validateRecordedGatekeeperOutput,
58
56
  validateRecordedNavigatorOutput,
@@ -5,7 +5,7 @@
5
5
  * Only path-safety syntax is checked at real I/O seams.
6
6
  * Delivery is startup readingMaterial (handbook bodies), never the transport prompt.
7
7
  */
8
- import { existsSync, readdirSync, readFileSync } from "node:fs";
8
+ import { existsSync, readFileSync } from "node:fs";
9
9
  import { join } from "node:path";
10
10
 
11
11
  const ENGINE_MATERIAL_RELATIVE_ROOT = "resources/engines" as const;
@@ -65,21 +65,6 @@ export function resolveEngineDispatchMaterialPath(packageRoot: string): string {
65
65
  return join(packageRoot, ENGINE_DISPATCH_RELATIVE_PATH);
66
66
  }
67
67
 
68
- /**
69
- * Enumerate packaged engine notes stems (discovery only — not a legal-name gate).
70
- * Only `*.md` stems that pass name syntax are listed.
71
- */
72
- export function listEngineMaterialNames(packageRoot: string): readonly string[] {
73
- const dir = resolveEngineMaterialDirectory(packageRoot);
74
- if (!existsSync(dir)) return Object.freeze([]);
75
- const names = readdirSync(dir)
76
- .filter((entry) => entry.endsWith(".md"))
77
- .map((entry) => entry.slice(0, -".md".length))
78
- .filter((stem) => isEngineNameSyntax(stem))
79
- .sort();
80
- return Object.freeze([...names]);
81
- }
82
-
83
68
  /**
84
69
  * Build the packaged notes path for a syntax-legal engine name.
85
70
  * Does not require the file to exist (material is optional data).
@@ -460,9 +460,6 @@ export function createPiRoleTurnHost(config: PiRoleTurnHostConfig): RoleTurnHost
460
460
  // Selected host axis (#537 / ADR 0082): omit must not inherit a parent env value.
461
461
  if (request.host === undefined || request.host.trim() === "") delete env.AK_ROLE_HOST;
462
462
  else env.AK_ROLE_HOST = request.host.trim();
463
- // #1199: 传召词 is unknown-length body — never argv/env (execve ARG_MAX / E2BIG).
464
- // Typed stdin envelope carries dialogue + optional progress 传召词.
465
- delete env.AK_ROLE_SUMMONS_INSTRUCTION;
466
463
  // #1132: the one effective delivery-request ceiling travels to the child
467
464
  // on its own env so the in-child role runtime and the worker submission
468
465
  // gate count with the same configured number the AK seam resolved. Omit
@@ -70,7 +70,6 @@ import {
70
70
  createTypedOptionConsumer,
71
71
  optionsForOwner,
72
72
  projectCommandHelp,
73
- projectOwnerOptions,
74
73
  PUBLIC_NAVIGATOR_HELP_NOTE,
75
74
  PUBLIC_ROLE_OPTION_OWNERS,
76
75
  renderHumanOwnerOptionLines,
@@ -604,34 +603,11 @@ function loadAndValidateConfig(
604
603
  /** Typed facts used by help presentation — not layout. */
605
604
  export function helpDocument() {
606
605
  return {
607
- executable: "ak-role",
608
606
  capabilities: listHelpCapabilities(),
609
607
  internalEntrypoint: INTERNAL_ROLE_ENTRYPOINT_RELATIVE,
610
- /** #342 structured global options from the sole option table. */
611
- globalOptions: projectOwnerOptions("global"),
612
608
  };
613
609
  }
614
610
 
615
- /** Structured help facts for one public command/role (#342). */
616
- export function helpDocumentForCommand(command: string) {
617
- if (command === "global") {
618
- return {
619
- command: "global" as const,
620
- kind: "global" as const,
621
- options: projectOwnerOptions("global"),
622
- };
623
- }
624
- if (command in PUBLIC_ROLE_ARGV) {
625
- const owner = command as keyof typeof PUBLIC_ROLE_ARGV;
626
- return {
627
- command: owner,
628
- kind: owner === "analyst" ? ("deterministic" as const) : ("role" as const),
629
- options: projectOwnerOptions(owner),
630
- };
631
- }
632
- return undefined;
633
- }
634
-
635
611
  /** Append USAGE + EXAMPLES blocks from the sole public help-copy owner. */
636
612
  function appendUsageAndExamples(
637
613
  lines: string[],
@@ -29,18 +29,12 @@ import {
29
29
  } from "./registry.ts";
30
30
  import { isEnoent, isRecord } from "../unknown-value.ts";
31
31
 
32
- /** Province officers that may carry a persistent model override (#453). Registry order. */
33
- type ProvinceConfigRole = Extract<
32
+ /** Province officers that may carry a persistent model override (#453). */
33
+ export type GateOfficerSeat = Extract<
34
34
  (typeof PUBLIC_ROLE_RECORDS)[number],
35
35
  { readonly provinceConfig: true }
36
36
  >["role"];
37
37
 
38
- export const GATE_OFFICER_SEATS: readonly ProvinceConfigRole[] = PUBLIC_ROLE_RECORDS.flatMap(
39
- (record) => ("provinceConfig" in record && record.provinceConfig === true ? [record.role] : []),
40
- );
41
-
42
- export type GateOfficerSeat = (typeof GATE_OFFICER_SEATS)[number];
43
-
44
38
  export function isGateOfficerSeat(value: string): value is GateOfficerSeat {
45
39
  return packagedProvinceConfig(value);
46
40
  }
@@ -846,17 +846,6 @@ function rejectUnlessTicketNumber(raw: string, message: string): number {
846
846
  return parsed;
847
847
  }
848
848
 
849
- /** Positive ticket number for analyst query-scope face (and shared integer parse). */
850
- export function parsePositiveTicketNumber(
851
- raw: string,
852
- flag: string,
853
- ): number {
854
- return rejectUnlessTicketNumber(
855
- raw,
856
- `${flag} must be a positive integer, got ${raw}`,
857
- );
858
- }
859
-
860
849
  /**
861
850
  * One token scan for public argv.
862
851
  * Callers assign values; `--` still ends flag parsing.
@@ -2066,23 +2055,6 @@ export async function materializeCountersignInvocation(
2066
2055
  );
2067
2056
  }
2068
2057
 
2069
- export type AdmitFixerInvocationOptions = {
2070
- home: string;
2071
- principalAuthority: DurablePrincipalAuthority;
2072
- cwd: string;
2073
- phase: FixerPhase;
2074
- instruction: string;
2075
- attachmentPaths: readonly string[];
2076
- /** Optional caller --prerequisites path as-is (#1168). */
2077
- prerequisitesPath?: string;
2078
- project?: string;
2079
- createRunId?: () => string;
2080
- /** Effective model for this invocation — written onto the state.jsonl invocation row. */
2081
- model?: InvocationEffectiveModel;
2082
- /** Typed ticket already on this summons. Placement uses it; code does not infer one. */
2083
- assertedTicketNumber?: number;
2084
- };
2085
-
2086
2058
  function parsePositivePrOption(raw: string | undefined): number {
2087
2059
  if (raw === undefined || raw.trim() === "") throw new CliUsageError("--pr requires a positive pull request number");
2088
2060
  try { return parseCollectorPrNumber(raw); } catch (error) { throw new CliUsageError(errorText(error), { cause: error }); }