@akagilnc/pi-workflow-roles 0.1.5462 → 0.1.5478

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 (41) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +42 -55
  3. package/README.zh-CN.md +59 -73
  4. package/THIRD_PARTY_NOTICES.md +4 -7
  5. package/dist/acp-host/description.js +8 -5
  6. package/dist/acp-host/production-host.js +17 -9
  7. package/dist/collector-tool-schemas.js +1 -1
  8. package/dist/headless-host/production-host.js +10 -5
  9. package/dist/host-descriptions.js +8 -3
  10. package/dist/migrate-book-topology.js +10 -5
  11. package/dist/public-cli/main.js +10 -5
  12. package/dist/public-cli/option-definitions.js +1 -1
  13. package/package.json +1 -1
  14. package/packets/fixer-repair.md +3 -1
  15. package/packets/judge-apply.md +7 -16
  16. package/packets/judge-authority.md +7 -17
  17. package/packets/judge-plan.md +7 -18
  18. package/packets/judge-review.md +8 -22
  19. package/packets/judge-submission.md +4 -7
  20. package/resources/collector-bot-handbook.md +2 -2
  21. package/resources/diarist-collect.md +2 -2
  22. package/resources/engine-dispatch.md +2 -2
  23. package/resources/navigator-route-playbook.md +1 -1
  24. package/resources/secretariat-ticket-identity.md +1 -1
  25. package/souls/coder-output-guide.md +3 -3
  26. package/souls/coder.md +2 -3
  27. package/souls/doctor-auditor.md +0 -3
  28. package/souls/fixer-auditor.md +0 -2
  29. package/souls/fixer-output-guide.md +3 -3
  30. package/souls/fixer.md +2 -2
  31. package/souls/gate-output-guide.md +1 -1
  32. package/souls/quality-law.md +2 -0
  33. package/src/acp-host/description.ts +19 -8
  34. package/src/acp-host/production-host.ts +1 -0
  35. package/src/acp-host/role-turn-host.ts +8 -5
  36. package/src/collector-tool-schemas.ts +1 -1
  37. package/src/host-descriptions.ts +8 -3
  38. package/src/package-contracts/gatekeeper-output.ts +1 -1
  39. package/src/package-contracts/navigator-output.ts +1 -1
  40. package/src/package-contracts/terminating-infrastructure.ts +1 -1
  41. package/src/public-cli/option-definitions.ts +1 -1
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## 复杂度即成本
4
4
 
5
+ 施工前核对派单与任务是否违法或缺少授权;事实不成立或需要未授权设计时据理拒绝并给出可核验证据,不猜测施工。
6
+
5
7
  能删除、合并或修改现有机制解决的,不得新增机制。同一业务规则只保留一个权威实现;被替代的代码、测试和兼容路径随改动删除。
6
8
 
7
9
  新增护栏前必须回答三问:故障发生概率多大,后果多重,下游是否已有检测或恢复能力。答不上来,或已有兜底足以承接,不加。同一处反复只增不减,停止补丁,回查根因。
@@ -18,11 +18,17 @@ export type AcpHostDescription = HostIdentityDescription & Readonly<{
18
18
  }>;
19
19
  /**
20
20
  * How the seat model reaches the agent:
21
- * - "argv": passed as the CLI `--model` flag (grok);
22
- * - "set_model": sent as an ACP `session/set_model` RPC with modelId
23
- * `provider:model` (hermes).
21
+ * - "argv": passed as the CLI `--model` flag;
22
+ * - "set_model": sent as an ACP `session/set_model` RPC after session new/load
23
+ * and before prompt. Catalog modelId shape is `setModelId` (host-native).
24
24
  */
25
25
  modelPassing: "argv" | "set_model";
26
+ /**
27
+ * Host-native `session/set_model` modelId form when `modelPassing` is
28
+ * `"set_model"`. hermes catalogs are `provider:model`; grok catalogs are bare
29
+ * model ids. Ignored for `"argv"` hosts.
30
+ */
31
+ setModelId?: "bare" | "provider:model";
26
32
  /**
27
33
  * When set, the production factory ensures a seat profile whose SOUL.md is a
28
34
  * symlink to the packaged role soul, and prefixes argv with `flag <name>`.
@@ -51,14 +57,19 @@ export function acpStdioArgs(
51
57
 
52
58
  /**
53
59
  * The modelId the host addresses the seat model by.
54
- * "argv" hosts address by bare model name; "set_model" hosts address by the
55
- * `provider:model` modelId the ACP catalog exposes (seat provider after host
56
- * alias projection, concatenated — never a package provider map).
60
+ * "argv" hosts use the bare model on the CLI flag. "set_model" hosts use the
61
+ * host-native catalog form in `setModelId` (hermes `provider:model` after seat
62
+ * provider / host-alias projection; grok bare model — never a package map).
57
63
  */
58
64
  export function acpModelId(
59
- modelPassing: AcpHostDescription["modelPassing"],
65
+ description: {
66
+ readonly modelPassing: AcpHostDescription["modelPassing"];
67
+ readonly setModelId?: AcpHostDescription["setModelId"] | undefined;
68
+ },
60
69
  model?: { readonly model?: string; readonly provider?: string },
61
70
  ): string | undefined {
62
71
  if (model?.model === undefined) return undefined;
63
- return modelPassing === "set_model" ? `${model.provider}:${model.model}` : model.model;
72
+ if (description.modelPassing !== "set_model") return model.model;
73
+ const form = description.setModelId ?? "provider:model";
74
+ return form === "bare" ? model.model : `${model.provider}:${model.model}`;
64
75
  }
@@ -63,6 +63,7 @@ export function createProductionAcpRoleTurnHost(options: ProductionAcpHostOption
63
63
  hostName,
64
64
  sessionIdentity: createSessionIdentityAuthority(principalAuthority, description.sessionBindingFile),
65
65
  modelPassing: description.modelPassing,
66
+ ...(description.setModelId === undefined ? {} : { setModelId: description.setModelId }),
66
67
  roleRuntimeDependencies: createRoleRuntimeDependencies(packageRoot),
67
68
  async connect(request) {
68
69
  const seatProfile = description.seatProfileSoul;
@@ -98,10 +98,13 @@ export type AcpRoleTurnHostConfig = Readonly<{
98
98
  hostName: string;
99
99
  /**
100
100
  * How the seat model reaches the agent: "set_model" sends an ACP
101
- * `session/set_model` RPC with modelId `provider:model` once the session
102
- * exists (new or loaded); "argv" leaves it to the connect argv (--model).
101
+ * `session/set_model` RPC once the session exists (new or loaded); "argv"
102
+ * leaves it to the connect argv (--model). Catalog modelId shape is
103
+ * `setModelId` (host-native).
103
104
  */
104
105
  modelPassing: AcpHostDescription["modelPassing"];
106
+ /** Host-native set_model catalog id; see AcpHostDescription.setModelId. */
107
+ setModelId?: AcpHostDescription["setModelId"];
105
108
  connect(request: RoleTurnRequest): Promise<AcpConnection>;
106
109
  prepare(request: RoleTurnRequest): Promise<PreparedRoleTurn>;
107
110
  }>;
@@ -296,7 +299,7 @@ export function createAcpRoleTurnHost(config: AcpRoleTurnHostConfig): RoleTurnHo
296
299
  : undefined;
297
300
  if (request.model !== undefined && availableModels !== undefined && !availableModels.some((entry) =>
298
301
  typeof entry === "object" && entry !== null
299
- && (entry as { modelId?: unknown }).modelId === acpModelId(config.modelPassing, request.model))) {
302
+ && (entry as { modelId?: unknown }).modelId === acpModelId(config, request.model))) {
300
303
  outcome = failure("activation", "AcpHostModelMismatch", "host-model-mismatch", {
301
304
  provider: request.model.provider,
302
305
  model: request.model.model,
@@ -354,11 +357,11 @@ export function createAcpRoleTurnHost(config: AcpRoleTurnHostConfig): RoleTurnHo
354
357
  }
355
358
 
356
359
  if (sessionReady) {
357
- // set_model seat provider:model (#778); may rebuild agent — re-bind via loadSession.
360
+ // set_model host-native catalog id (#778 / #1146); may rebuild agent — re-bind via loadSession.
358
361
  if (config.modelPassing === "set_model" && request.model !== undefined && sessionId !== undefined) {
359
362
  await rpc("session/set_model", {
360
363
  sessionId,
361
- modelId: acpModelId(config.modelPassing, request.model),
364
+ modelId: acpModelId(config, request.model),
362
365
  });
363
366
  sessionId = await loadSession(sessionId);
364
367
  }
@@ -4,7 +4,7 @@ import { withTerminatingOutputDeclarations } from "./package-contracts/terminati
4
4
 
5
5
  /**
6
6
  * #1088: LLM gathers evidence via host CLI and submits the receipt.
7
- * Field declarations guide the model — host must not pure-shape-reject (第 0 条 / ADR 0057).
7
+ * Field declarations guide the model — host must not pure-shape-reject (仓内 CLAUDE.md 开篇 / ADR 0057).
8
8
  * Presence of `groups` remains the Collector terminal discriminator for settlement/analyst.
9
9
  */
10
10
  export const collectorOutputBaseSchema = openToolObject(
@@ -32,15 +32,19 @@ export const DEFAULT_ROLE_TURN_HOST = "pi" as const;
32
32
  export type HostFamily = "acp" | "headless";
33
33
 
34
34
  export const HOST_DESCRIPTIONS: Readonly<Record<string, AcpHostDescription>> = Object.freeze({
35
- /** Operator home `~/.grok`, native session/load resume, `agent [--model X] stdio`. */
35
+ /**
36
+ * Operator home `~/.grok`, native session/load resume, `agent stdio`.
37
+ * Model arrives as ACP `session/set_model` with bare modelId (grok catalog);
38
+ * argv `--model` is ignored by current grok (#1146 probe).
39
+ */
36
40
  "grok-build": Object.freeze({
37
41
  binaryFromHome: Object.freeze([".grok", "bin", "grok"]),
38
42
  argv: Object.freeze({
39
43
  prefix: Object.freeze(["agent"]),
40
44
  suffix: Object.freeze(["stdio"]),
41
- modelFlag: "--model",
42
45
  }),
43
- modelPassing: "argv",
46
+ modelPassing: "set_model",
47
+ setModelId: "bare",
44
48
  sessionBindingFile: "grok-acp-session.json",
45
49
  }),
46
50
  /**
@@ -58,6 +62,7 @@ export const HOST_DESCRIPTIONS: Readonly<Record<string, AcpHostDescription>> = O
58
62
  thinkingFlag: "--reasoning",
59
63
  }),
60
64
  modelPassing: "set_model",
65
+ setModelId: "provider:model",
61
66
  sessionBindingFile: "hermes-acp-session.json",
62
67
  seatProfileSoul: Object.freeze({
63
68
  flag: "-p",
@@ -42,7 +42,7 @@ function asStringArray(value: unknown): readonly string[] {
42
42
 
43
43
  /**
44
44
  * Project one explicit Gatekeeper decision.
45
- * No throw on shape — ADR 0055 / 第 0 条: already-submitted params are retained as-is;
45
+ * No throw on shape — ADR 0055 / 仓内 CLAUDE.md 开篇: already-submitted params are retained as-is;
46
46
  * public-terminal projects non-usable releases via typed failure cause.
47
47
  */
48
48
  /** #836: no field drop — original object is the receipt. */
@@ -29,7 +29,7 @@ export type NavigatorAdvice = { readonly prose: string };
29
29
  * Project one Navigator advice receipt as prose.
30
30
  * Accepts { prose }, a bare string, or any object — objects stringify as the
31
31
  * prose body so historical / free-form submissions still present. Shape is not
32
- * an admission gate (ADR 0055 / 第 0 条 / #959).
32
+ * an admission gate (ADR 0055 / 仓内 CLAUDE.md 开篇 / #959).
33
33
  */
34
34
  export function projectLawfulNavigatorOutput(value: unknown): NavigatorAdvice | undefined {
35
35
  if (value === undefined || value === null) return undefined;
@@ -22,7 +22,7 @@ export const INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic" as const;
22
22
  /**
23
23
  * Shared declaration fragment for model guidance (#541 / #676 C / ADR 0057).
24
24
  * Nested field declarations + descriptions only — host must not pure-shape-reject
25
- * the envelope (第 0 条). Runtime `failOnInfrastructureFailureDeclaration` still
25
+ * the envelope (仓内 CLAUDE.md 开篇). Runtime `failOnInfrastructureFailureDeclaration` still
26
26
  * recognizes a real non-empty diagnostic string as the failure declaration.
27
27
  * No required/minLength/type host gates on the declaration fragment.
28
28
  */
@@ -1236,7 +1236,7 @@ const ROLE_COMMAND_HELP = {
1236
1236
  },
1237
1237
  notary: {
1238
1238
  command: "notary",
1239
- summary: "Direct Notary document check (quote fidelity + ticket alignment); zero prompt/attachment.",
1239
+ summary: "Direct Notary summons; duties: souls/notary.md. Zero prompt/attachment.",
1240
1240
  usage: ["ak-role notary --source-run <runId@role|path> [options]"],
1241
1241
  examples: [
1242
1242
  "ak-role notary --source-run 01a034f1-75bf-71a6-bcf5-d1299145b1a5@judge",