@akagilnc/pi-workflow-roles 0.1.5864 → 0.1.5877
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.
- package/dist/acp-host/production-host.js +79 -11
- package/dist/audited-run-identity.js +4 -3
- package/dist/auditor-soul.js +3 -1
- package/dist/diarist-contracts.js +4 -3
- package/dist/headless-host/production-host.js +79 -11
- package/dist/migrate-book-topology.js +16 -5
- package/dist/notary-role.js +10 -2
- package/dist/packaged-role-registry.js +3 -1
- package/dist/public-cli/cli.js +7 -0
- package/dist/public-cli/dialogue-command.js +37 -0
- package/dist/public-cli/main.js +209 -6
- package/dist/public-cli/option-definitions.js +8 -0
- package/dist/public-cli/registry.js +2 -1
- package/dist/role-runtime.js +5 -2
- package/dist/role-submission-declarations.js +1 -1
- package/dist/ticket-provenance.js +1 -1
- package/package.json +1 -1
- package/resources/collector-bot-handbook.md +1 -1
- package/resources/diarist-collect.md +4 -3
- package/src/audited-run-identity.ts +5 -4
- package/src/auditor-soul.ts +3 -1
- package/src/diarist-contracts.ts +7 -4
- package/src/notary-role.ts +14 -2
- package/src/packaged-role-registry.ts +3 -1
- package/src/public-cli/cli.ts +7 -0
- package/src/public-cli/dialogue-command.ts +53 -0
- package/src/public-cli/option-definitions.ts +9 -0
- package/src/public-cli/registry.ts +1 -0
- package/src/role-runtime.ts +5 -1
- package/src/role-submission-declarations.ts +1 -1
- package/src/ticket-provenance.ts +1 -1
|
@@ -2237,7 +2237,7 @@ function projectDiaristTicketSessions(value) {
|
|
|
2237
2237
|
}
|
|
2238
2238
|
return Array.from(perTicket, ([ticketNumber, sessions]) => ({ ticketNumber, sessions }));
|
|
2239
2239
|
}
|
|
2240
|
-
var DIARIST_OUTPUT_TOOL_NAME, DIARIST_SESSIONS_DESCRIPTION, diaristOutputSchema;
|
|
2240
|
+
var DIARIST_OUTPUT_TOOL_NAME, DIARIST_BOUND_ENDPOINTS, DIARIST_SESSIONS_DESCRIPTION, diaristOutputSchema;
|
|
2241
2241
|
var init_diarist_contracts = __esm({
|
|
2242
2242
|
"src/diarist-contracts.ts"() {
|
|
2243
2243
|
"use strict";
|
|
@@ -2247,7 +2247,8 @@ var init_diarist_contracts = __esm({
|
|
|
2247
2247
|
init_run_ticket_number();
|
|
2248
2248
|
init_unknown_value();
|
|
2249
2249
|
DIARIST_OUTPUT_TOOL_NAME = "ak_diarist_output";
|
|
2250
|
-
|
|
2250
|
+
DIARIST_BOUND_ENDPOINTS = "\u8D77\u70B9\u4E0E\u7EC8\u70B9\u5404\u5199 id \u6216 line\uFF0C\u4E8C\u9009\u4E00\uFF1Aid\uFF1D\u4F1A\u8BDD\u5377\u91CC\u90A3\u4E00\u884C JSON \u7684 uuid \u5B57\u6BB5\u503C\uFF08\u6CA1\u6709 uuid \u53D6 id\uFF1B\u9876\u5C42\u90FD\u6CA1\u6709\u518D\u53D6 message \u6216 payload \u91CC\u7684 uuid / id\uFF09\uFF0C\u540C\u4E00 id \u51FA\u73B0\u591A\u6B21\u65F6\u53D6\u7B2C\u4E00\u6B21\u51FA\u73B0\u7684\u90A3\u4E00\u884C\uFF1Bline\uFF1D\u90A3\u4E00\u884C\u5728\u6587\u4EF6\u91CC\u4ECE 1 \u6570\u8D77\u7684\u884C\u53F7\u3002\u4E24\u7AEF\u90FD\u542B\u5728\u533A\u95F4\u5185\u3002";
|
|
2251
|
+
DIARIST_SESSIONS_DESCRIPTION = `\u5BF9\u8BDD\u8FB9\u754C\u3002\u6BCF\u5377\u542B path\uFF08\u4F1A\u8BDD\u5377\u7EDD\u5BF9\u6216\u53EF\u8BFB\u8DEF\u5F84\uFF09\u4E0E ranges\uFF08\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF09\u3002\u6BCF\u6BB5\u533A\u95F4\u542B from / to\uFF1B${DIARIST_BOUND_ENDPOINTS}\u533A\u95F4\u91CC\u53EA\u6709\u8BF4\u8BDD\u4EBA\u7684\u539F\u6587\u8FDB\u5F55\uFF1A\u7528\u6237\u4E0E\u52A9\u624B\u6D88\u606F\u91CC\u7684\u6587\u672C\u3001\u771F\u4EBA\u7ECF\u961F\u5217\u7684\u63D2\u8BDD\uFF1B\u601D\u8003\u3001\u5DE5\u5177\u8C03\u7528\u3001\u5DE5\u5177\u7ED3\u679C\u548C\u673A\u5668\u901A\u77E5\u4E0D\u8FDB\u5F55\uFF0C\u533A\u95F4\u53EF\u4EE5\u76F4\u63A5\u8DE8\u8FC7\u5B83\u4EEC\uFF0C\u4E0D\u5FC5\u62C6\u6BB5\u3002\u6BCF\u6B21\u4EA4\u5377\u7684\u8FB9\u754C\u7167\u6295\u5F71\u8FFD\u52A0\u8FDB\u672C\u7968\u8D77\u5C45\u5F55\uFF0C\u4E0D\u53BB\u91CD\uFF0C\u4E5F\u4E0D\u6539\u5DF2\u6709\u7684\u5F55\u3002\u7A7A\u5217\u8868\uFF1D\u672C\u8F6E\u65E0\u5BF9\u8BDD\u53EF\u5212\u3002\u7AEF\u70B9\u65E0\u6CD5\u6307\u540D\u65F6\u8D70 reask\uFF0C\u4E0D\u4E2D\u6B62\u3002`;
|
|
2251
2252
|
diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
2252
2253
|
openToolObject(
|
|
2253
2254
|
Type13.Object({
|
|
@@ -2260,7 +2261,7 @@ var init_diarist_contracts = __esm({
|
|
|
2260
2261
|
})
|
|
2261
2262
|
),
|
|
2262
2263
|
reason: Type13.Unknown({
|
|
2263
|
-
description: "status \u4E3A escalate \u65F6\uFF1A\
|
|
2264
|
+
description: "status \u4E3A escalate \u65F6\uFF1A\u4E0A\u5448\u7684\u539F\u56E0"
|
|
2264
2265
|
}),
|
|
2265
2266
|
sessions: Type13.Optional(Type13.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
|
|
2266
2267
|
ticketSessions: Type13.Unknown({
|
|
@@ -2512,6 +2513,7 @@ var init_packaged_role_registry = __esm({
|
|
|
2512
2513
|
"souls/notary.md",
|
|
2513
2514
|
"souls/audit-law.md",
|
|
2514
2515
|
"souls/ticket-law.md",
|
|
2516
|
+
"souls/quality-law.md",
|
|
2515
2517
|
"souls/gate-output-guide.md",
|
|
2516
2518
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
2517
2519
|
];
|
|
@@ -2527,6 +2529,7 @@ var init_packaged_role_registry = __esm({
|
|
|
2527
2529
|
"CLAUDE.md",
|
|
2528
2530
|
"souls/judge-auditor.md",
|
|
2529
2531
|
"souls/doctor-auditor.md",
|
|
2532
|
+
"souls/judge.md",
|
|
2530
2533
|
"souls/audit-law.md",
|
|
2531
2534
|
"souls/quality-law.md",
|
|
2532
2535
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
@@ -2778,7 +2781,7 @@ var init_packaged_role_registry = __esm({
|
|
|
2778
2781
|
activationStage: "load-and-install",
|
|
2779
2782
|
receiptStatusKey: "status",
|
|
2780
2783
|
// #924: 公用《票面法》三席同装
|
|
2781
|
-
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
2784
|
+
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "souls/audit-law.md", "souls/quality-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
2782
2785
|
},
|
|
2783
2786
|
{
|
|
2784
2787
|
role: "secretariat",
|
|
@@ -3222,7 +3225,7 @@ var init_role_submission_declarations = __esm({
|
|
|
3222
3225
|
},
|
|
3223
3226
|
diarist: {
|
|
3224
3227
|
label: "\u8D77\u5C45\u90CE\u8F93\u51FA",
|
|
3225
|
-
description: "\u8D77\u5C45\u90CE\u4EA4\u5355\u7968 sessions \u6216\u591A\u7968\u9010\u7968 ticketSessions \u8FB9\u754C\
|
|
3228
|
+
description: "\u8D77\u5C45\u90CE\u4EA4\u5355\u7968 sessions \u6216\u591A\u7968\u9010\u7968 ticketSessions \u8FB9\u754C\uFF0C\u6216 escalate\u3002",
|
|
3226
3229
|
promptSnippet: "\u8D77\u5C45\u90CE\u4EA4\u8FB9\u754C",
|
|
3227
3230
|
parameters: diaristOutputSchema
|
|
3228
3231
|
}
|
|
@@ -5594,7 +5597,8 @@ var init_registry = __esm({
|
|
|
5594
5597
|
"help",
|
|
5595
5598
|
"resume",
|
|
5596
5599
|
"new",
|
|
5597
|
-
"setup"
|
|
5600
|
+
"setup",
|
|
5601
|
+
"dialogue"
|
|
5598
5602
|
];
|
|
5599
5603
|
PUBLIC_DETERMINISTIC_COMMANDS = ["analyst"];
|
|
5600
5604
|
}
|
|
@@ -6661,6 +6665,14 @@ var init_option_definitions = __esm({
|
|
|
6661
6665
|
"ak-role new notary --source-run 01abc\u2026@countersign",
|
|
6662
6666
|
"ak-role --host grok-build new inspector --attach ./change.patch"
|
|
6663
6667
|
]
|
|
6668
|
+
},
|
|
6669
|
+
dialogue: {
|
|
6670
|
+
command: "dialogue",
|
|
6671
|
+
summary: "Print what a diary range projects from a session volume, one JSON object per line: speaker lines {line, id, speaker: owner|runner, text} and unparsable lines {line, raw}. line and id are what a range endpoint names; a repeated id is shown on its first line only, where it resolves. Same authorized session roots as the projection.",
|
|
6672
|
+
usage: ["ak-role dialogue <session.jsonl>"],
|
|
6673
|
+
examples: [
|
|
6674
|
+
"ak-role dialogue ~/.claude/projects/-Users-me-repo/0b1c\u2026.jsonl > /tmp/dialogue.jsonl"
|
|
6675
|
+
]
|
|
6664
6676
|
}
|
|
6665
6677
|
};
|
|
6666
6678
|
PUBLIC_COMMAND_HELP = {
|
|
@@ -12389,6 +12401,7 @@ var init_auditor_soul = __esm({
|
|
|
12389
12401
|
judge: [
|
|
12390
12402
|
"CLAUDE.md",
|
|
12391
12403
|
"souls/judge-auditor.md",
|
|
12404
|
+
"souls/judge.md",
|
|
12392
12405
|
"souls/audit-law.md",
|
|
12393
12406
|
"souls/quality-law.md",
|
|
12394
12407
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
@@ -15794,6 +15807,44 @@ var init_instruction_seat_run = __esm({
|
|
|
15794
15807
|
}
|
|
15795
15808
|
});
|
|
15796
15809
|
|
|
15810
|
+
// src/public-cli/dialogue-command.ts
|
|
15811
|
+
async function readSessionDialogue(path, home) {
|
|
15812
|
+
assertDialogueSessionSourcePath(path, home);
|
|
15813
|
+
const sessionLines = await readLedgerSessionJsonlLines(path);
|
|
15814
|
+
const dialogue = adaptSessionDialogue(sessionLines.map((entry) => entry.row));
|
|
15815
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
15816
|
+
const out = [];
|
|
15817
|
+
sessionLines.forEach((entry, index) => {
|
|
15818
|
+
if (entry.row === void 0) {
|
|
15819
|
+
out.push({ line: entry.line, raw: entry.raw });
|
|
15820
|
+
return;
|
|
15821
|
+
}
|
|
15822
|
+
for (const event of dialogue[index] ?? []) {
|
|
15823
|
+
const firstId = event.id !== void 0 && !seenIds.has(event.id);
|
|
15824
|
+
if (event.id !== void 0) seenIds.add(event.id);
|
|
15825
|
+
out.push({
|
|
15826
|
+
line: entry.line,
|
|
15827
|
+
...firstId ? { id: event.id } : {},
|
|
15828
|
+
speaker: event.speaker,
|
|
15829
|
+
text: event.text
|
|
15830
|
+
});
|
|
15831
|
+
}
|
|
15832
|
+
});
|
|
15833
|
+
return out;
|
|
15834
|
+
}
|
|
15835
|
+
function renderSessionDialogue(lines) {
|
|
15836
|
+
return lines.map((line2) => `${JSON.stringify(line2)}
|
|
15837
|
+
`).join("");
|
|
15838
|
+
}
|
|
15839
|
+
var init_dialogue_command = __esm({
|
|
15840
|
+
"src/public-cli/dialogue-command.ts"() {
|
|
15841
|
+
"use strict";
|
|
15842
|
+
init_ledger_session_read();
|
|
15843
|
+
init_session_dialogue();
|
|
15844
|
+
init_ticket_provenance();
|
|
15845
|
+
}
|
|
15846
|
+
});
|
|
15847
|
+
|
|
15797
15848
|
// src/analyst-book-key.ts
|
|
15798
15849
|
import { statSync as statSync6 } from "node:fs";
|
|
15799
15850
|
import { isAbsolute as isAbsolute7 } from "node:path";
|
|
@@ -18929,6 +18980,11 @@ async function runAkRole(argv, env) {
|
|
|
18929
18980
|
return { exitCode: 0 };
|
|
18930
18981
|
}
|
|
18931
18982
|
const home = resolveHome(env);
|
|
18983
|
+
if (parsed.command === "dialogue") {
|
|
18984
|
+
if (parsed.args.length !== 1) throw new CliUsageError("usage: ak-role dialogue <session.jsonl>");
|
|
18985
|
+
io.stdout(renderSessionDialogue(await readSessionDialogue(parsed.args[0], home)));
|
|
18986
|
+
return { exitCode: 0 };
|
|
18987
|
+
}
|
|
18932
18988
|
if (parsed.command === "roles") {
|
|
18933
18989
|
if (parsed.args.length > 0) {
|
|
18934
18990
|
throw new CliUsageError("roles takes no arguments");
|
|
@@ -19119,6 +19175,7 @@ var init_cli = __esm({
|
|
|
19119
19175
|
init_invocation();
|
|
19120
19176
|
init_option_definitions();
|
|
19121
19177
|
init_auto_resume();
|
|
19178
|
+
init_dialogue_command();
|
|
19122
19179
|
init_instruction_seat_run();
|
|
19123
19180
|
init_countersign_run();
|
|
19124
19181
|
init_analyst_run();
|
|
@@ -21503,14 +21560,14 @@ init_run_ticket_number();
|
|
|
21503
21560
|
// src/audited-run-identity.ts
|
|
21504
21561
|
init_role_run_placement();
|
|
21505
21562
|
import { basename as basename14 } from "node:path";
|
|
21506
|
-
var AUDITED_RUN_IDENTITY_KIND = "audited-run
|
|
21563
|
+
var AUDITED_RUN_IDENTITY_KIND = "audited-run";
|
|
21507
21564
|
function auditedRunIdentityFromDirectory(runDirectory) {
|
|
21508
21565
|
const parsed = parseRunLeaf(basename14(runDirectory));
|
|
21509
21566
|
if (parsed === void 0) return void 0;
|
|
21510
21567
|
return formatRunLeaf(parsed.runId, parsed.role);
|
|
21511
21568
|
}
|
|
21512
21569
|
function auditedRunIdentityMaterial(identity) {
|
|
21513
|
-
return { kind: AUDITED_RUN_IDENTITY_KIND, identity };
|
|
21570
|
+
return { kind: AUDITED_RUN_IDENTITY_KIND, auditedRun: identity };
|
|
21514
21571
|
}
|
|
21515
21572
|
function auditedRunIdentityFromParts(runId, role) {
|
|
21516
21573
|
return formatRunLeaf(runId, role);
|
|
@@ -21550,11 +21607,16 @@ function projectNotaryBoundFromFlags(getFlag) {
|
|
|
21550
21607
|
};
|
|
21551
21608
|
}
|
|
21552
21609
|
function assembleNotaryAgentStartPrompt(input) {
|
|
21610
|
+
const audited = input.audited === void 0 ? "" : `
|
|
21611
|
+
|
|
21612
|
+
<audited_seat_soul seat="${input.audited.seat}">
|
|
21613
|
+
${input.audited.soul}
|
|
21614
|
+
</audited_seat_soul>`;
|
|
21553
21615
|
return `${input.baseSystemPrompt}
|
|
21554
21616
|
|
|
21555
21617
|
<notary_soul>
|
|
21556
21618
|
${input.soul}
|
|
21557
|
-
</notary_soul
|
|
21619
|
+
</notary_soul>${audited}`;
|
|
21558
21620
|
}
|
|
21559
21621
|
function createNotaryRoleRuntime(pi, dependencies, host) {
|
|
21560
21622
|
let activation;
|
|
@@ -21576,9 +21638,11 @@ function createNotaryRoleRuntime(pi, dependencies, host) {
|
|
|
21576
21638
|
const soul = (await dependencies.loadSoul()).trim();
|
|
21577
21639
|
if (soul.length === 0) throw new Error("Notary soul is empty");
|
|
21578
21640
|
const sourceRun = await dependencies.loadSourceRunLocator(path);
|
|
21641
|
+
const auditedSoul = (await dependencies.loadAuditedSoul(sourceRun.role))?.trim();
|
|
21579
21642
|
activation = {
|
|
21580
21643
|
soul,
|
|
21581
21644
|
sourceRun,
|
|
21645
|
+
...auditedSoul === void 0 || auditedSoul === "" ? {} : { auditedSoul },
|
|
21582
21646
|
...admitted?.ticketNumber === void 0 ? {} : { ticketNumber: admitted.ticketNumber }
|
|
21583
21647
|
};
|
|
21584
21648
|
if (!registered) {
|
|
@@ -21593,7 +21657,8 @@ function createNotaryRoleRuntime(pi, dependencies, host) {
|
|
|
21593
21657
|
return {
|
|
21594
21658
|
systemPrompt: assembleNotaryAgentStartPrompt({
|
|
21595
21659
|
baseSystemPrompt: event.systemPrompt,
|
|
21596
|
-
soul: activation.soul
|
|
21660
|
+
soul: activation.soul,
|
|
21661
|
+
...activation.auditedSoul === void 0 ? {} : { audited: { seat: activation.sourceRun.role, soul: activation.auditedSoul } }
|
|
21597
21662
|
}),
|
|
21598
21663
|
readingMaterial: projectNotaryAuditedRunIdentity({
|
|
21599
21664
|
sourceRun: activation.sourceRun
|
|
@@ -22792,7 +22857,7 @@ function readDiaristRunCoordinates(ctx) {
|
|
|
22792
22857
|
...bound === void 0 ? {} : { boundTicketNumber: bound }
|
|
22793
22858
|
};
|
|
22794
22859
|
}
|
|
22795
|
-
var DIARIST_BOUNDS_REASK =
|
|
22860
|
+
var DIARIST_BOUNDS_REASK = `\u8FB9\u754C\u65E0\u6CD5\u4F7F\u7528\u3002\u591A\u7968\u8BF7\u9010\u7968\u91CD\u4EA4 ticketSessions\uFF0C\u5355\u7968\u91CD\u4EA4 sessions\uFF1B\u6BCF\u5377 path + ranges\u3002${DIARIST_BOUND_ENDPOINTS}`;
|
|
22796
22861
|
function createDiaristRoleRuntime(roleHost, dependencies, hostActions) {
|
|
22797
22862
|
return createFiledOfficerRuntime(
|
|
22798
22863
|
roleHost,
|
|
@@ -23254,6 +23319,9 @@ function createRoleRuntimeExtension(dependencies, deliveryRequestLimit) {
|
|
|
23254
23319
|
async loadSourceRunLocator(path) {
|
|
23255
23320
|
if (!dependencies.loadNotarySourceRun) throw new Error("Notary runtime dependencies are not configured");
|
|
23256
23321
|
return dependencies.loadNotarySourceRun(path);
|
|
23322
|
+
},
|
|
23323
|
+
async loadAuditedSoul(role) {
|
|
23324
|
+
return packagedRoleMetadata(role) === void 0 ? void 0 : requireRoleSoul(role);
|
|
23257
23325
|
}
|
|
23258
23326
|
}, hostActions);
|
|
23259
23327
|
const countersign = createCountersignRoleRuntime(roleHost, {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared audited-run identity for review-officer startup materials (#1166 / ADR 0087).
|
|
3
|
-
* Value form is `<runId>@<席>` only — no directory path.
|
|
3
|
+
* Value form is `<runId>@<席>` only — no directory path. The field is named
|
|
4
|
+
* `auditedRun` so the reader sees it names the run under review, not itself.
|
|
4
5
|
*/
|
|
5
6
|
import { basename } from "node:path";
|
|
6
7
|
import { formatRunLeaf, parseRunLeaf } from "./role-run-placement.js";
|
|
7
|
-
export const AUDITED_RUN_IDENTITY_KIND = "audited-run
|
|
8
|
+
export const AUDITED_RUN_IDENTITY_KIND = "audited-run";
|
|
8
9
|
/** Identity leaf from a run directory basename; undefined when the leaf is not `runId@role`. */
|
|
9
10
|
export function auditedRunIdentityFromDirectory(runDirectory) {
|
|
10
11
|
const parsed = parseRunLeaf(basename(runDirectory));
|
|
@@ -13,7 +14,7 @@ export function auditedRunIdentityFromDirectory(runDirectory) {
|
|
|
13
14
|
return formatRunLeaf(parsed.runId, parsed.role);
|
|
14
15
|
}
|
|
15
16
|
export function auditedRunIdentityMaterial(identity) {
|
|
16
|
-
return { kind: AUDITED_RUN_IDENTITY_KIND, identity };
|
|
17
|
+
return { kind: AUDITED_RUN_IDENTITY_KIND, auditedRun: identity };
|
|
17
18
|
}
|
|
18
19
|
/** Identity from locator fields already in hand (notary source-run). */
|
|
19
20
|
export function auditedRunIdentityFromParts(runId, role) {
|
package/dist/auditor-soul.js
CHANGED
|
@@ -31,7 +31,8 @@ function auditorSoulRelativePath(role) {
|
|
|
31
31
|
return `souls/${role}-auditor.md`;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* #470 auditor session materials. Judge carries
|
|
34
|
+
* #470 auditor session materials. Judge carries the audited judge Soul + audit-law +
|
|
35
|
+
* quality-law (verdicts cite judge.md; audit-law makes the auditor check the cited line); doctor does
|
|
35
36
|
* not (御批四: 参审席 = 大理寺主会话 + 其审计席; 太医线不动).
|
|
36
37
|
* Reviewer auditor roster removed with #495 S6 gate retirement.
|
|
37
38
|
* #675 owner: no generic auditor.md — subject selects this table.
|
|
@@ -40,6 +41,7 @@ export const AUDITOR_SESSION_MATERIALS = {
|
|
|
40
41
|
judge: [
|
|
41
42
|
"CLAUDE.md",
|
|
42
43
|
"souls/judge-auditor.md",
|
|
44
|
+
"souls/judge.md",
|
|
43
45
|
"souls/audit-law.md",
|
|
44
46
|
"souls/quality-law.md",
|
|
45
47
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public 起居郎 (diarist) terminating receipt contracts — ADR 0075 `diarist-is-role` / #901.
|
|
3
|
-
* Lawful explicit releases: completed (入录) | escalate (
|
|
3
|
+
* Lawful explicit releases: completed (入录) | escalate (无法正常署时上呈,见 Soul).
|
|
4
4
|
* Machine facts about the volume come from the mechanical reproject seam, never
|
|
5
5
|
* from model self-report (锚定宪法); this module owns the receipt shape only.
|
|
6
6
|
*
|
|
@@ -65,7 +65,8 @@ export function projectDiaristTicketSessions(value) {
|
|
|
65
65
|
* sessions / ticketSessions 是投影所读的边界:卷路径或端点读不出时走既有 reask,不中止本轮。
|
|
66
66
|
* 声明只留字段名和语义说明,不留类型、嵌套、长度、必填。
|
|
67
67
|
*/
|
|
68
|
-
const
|
|
68
|
+
export const DIARIST_BOUND_ENDPOINTS = "起点与终点各写 id 或 line,二选一:id=会话卷里那一行 JSON 的 uuid 字段值(没有 uuid 取 id;顶层都没有再取 message 或 payload 里的 uuid / id),同一 id 出现多次时取第一次出现的那一行;line=那一行在文件里从 1 数起的行号。两端都含在区间内。";
|
|
69
|
+
const DIARIST_SESSIONS_DESCRIPTION = `对话边界。每卷含 path(会话卷绝对或可读路径)与 ranges(本卷本轮各区间)。每段区间含 from / to;${DIARIST_BOUND_ENDPOINTS}区间里只有说话人的原文进录:用户与助手消息里的文本、真人经队列的插话;思考、工具调用、工具结果和机器通知不进录,区间可以直接跨过它们,不必拆段。每次交卷的边界照投影追加进本票起居录,不去重,也不改已有的录。空列表=本轮无对话可划。端点无法指名时走 reask,不中止。`;
|
|
69
70
|
export const diaristOutputSchema = withTerminatingOutputDeclarations(openToolObject(Type.Object({
|
|
70
71
|
status: Type.Unknown({
|
|
71
72
|
description: "completed | escalate",
|
|
@@ -74,7 +75,7 @@ export const diaristOutputSchema = withTerminatingOutputDeclarations(openToolObj
|
|
|
74
75
|
description: "本庭对象票号(正整数)或 null/省略=真无票;下游走 typed 键;认不出用 status=escalate,不洗成无录。机械层不重判。",
|
|
75
76
|
})),
|
|
76
77
|
reason: Type.Unknown({
|
|
77
|
-
description: "status 为 escalate
|
|
78
|
+
description: "status 为 escalate 时:上呈的原因",
|
|
78
79
|
}),
|
|
79
80
|
sessions: Type.Optional(Type.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
|
|
80
81
|
ticketSessions: Type.Unknown({
|
|
@@ -2107,7 +2107,7 @@ function projectDiaristTicketSessions(value) {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
return Array.from(perTicket, ([ticketNumber, sessions]) => ({ ticketNumber, sessions }));
|
|
2109
2109
|
}
|
|
2110
|
-
var DIARIST_OUTPUT_TOOL_NAME, DIARIST_SESSIONS_DESCRIPTION, diaristOutputSchema;
|
|
2110
|
+
var DIARIST_OUTPUT_TOOL_NAME, DIARIST_BOUND_ENDPOINTS, DIARIST_SESSIONS_DESCRIPTION, diaristOutputSchema;
|
|
2111
2111
|
var init_diarist_contracts = __esm({
|
|
2112
2112
|
"src/diarist-contracts.ts"() {
|
|
2113
2113
|
"use strict";
|
|
@@ -2117,7 +2117,8 @@ var init_diarist_contracts = __esm({
|
|
|
2117
2117
|
init_run_ticket_number();
|
|
2118
2118
|
init_unknown_value();
|
|
2119
2119
|
DIARIST_OUTPUT_TOOL_NAME = "ak_diarist_output";
|
|
2120
|
-
|
|
2120
|
+
DIARIST_BOUND_ENDPOINTS = "\u8D77\u70B9\u4E0E\u7EC8\u70B9\u5404\u5199 id \u6216 line\uFF0C\u4E8C\u9009\u4E00\uFF1Aid\uFF1D\u4F1A\u8BDD\u5377\u91CC\u90A3\u4E00\u884C JSON \u7684 uuid \u5B57\u6BB5\u503C\uFF08\u6CA1\u6709 uuid \u53D6 id\uFF1B\u9876\u5C42\u90FD\u6CA1\u6709\u518D\u53D6 message \u6216 payload \u91CC\u7684 uuid / id\uFF09\uFF0C\u540C\u4E00 id \u51FA\u73B0\u591A\u6B21\u65F6\u53D6\u7B2C\u4E00\u6B21\u51FA\u73B0\u7684\u90A3\u4E00\u884C\uFF1Bline\uFF1D\u90A3\u4E00\u884C\u5728\u6587\u4EF6\u91CC\u4ECE 1 \u6570\u8D77\u7684\u884C\u53F7\u3002\u4E24\u7AEF\u90FD\u542B\u5728\u533A\u95F4\u5185\u3002";
|
|
2121
|
+
DIARIST_SESSIONS_DESCRIPTION = `\u5BF9\u8BDD\u8FB9\u754C\u3002\u6BCF\u5377\u542B path\uFF08\u4F1A\u8BDD\u5377\u7EDD\u5BF9\u6216\u53EF\u8BFB\u8DEF\u5F84\uFF09\u4E0E ranges\uFF08\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF09\u3002\u6BCF\u6BB5\u533A\u95F4\u542B from / to\uFF1B${DIARIST_BOUND_ENDPOINTS}\u533A\u95F4\u91CC\u53EA\u6709\u8BF4\u8BDD\u4EBA\u7684\u539F\u6587\u8FDB\u5F55\uFF1A\u7528\u6237\u4E0E\u52A9\u624B\u6D88\u606F\u91CC\u7684\u6587\u672C\u3001\u771F\u4EBA\u7ECF\u961F\u5217\u7684\u63D2\u8BDD\uFF1B\u601D\u8003\u3001\u5DE5\u5177\u8C03\u7528\u3001\u5DE5\u5177\u7ED3\u679C\u548C\u673A\u5668\u901A\u77E5\u4E0D\u8FDB\u5F55\uFF0C\u533A\u95F4\u53EF\u4EE5\u76F4\u63A5\u8DE8\u8FC7\u5B83\u4EEC\uFF0C\u4E0D\u5FC5\u62C6\u6BB5\u3002\u6BCF\u6B21\u4EA4\u5377\u7684\u8FB9\u754C\u7167\u6295\u5F71\u8FFD\u52A0\u8FDB\u672C\u7968\u8D77\u5C45\u5F55\uFF0C\u4E0D\u53BB\u91CD\uFF0C\u4E5F\u4E0D\u6539\u5DF2\u6709\u7684\u5F55\u3002\u7A7A\u5217\u8868\uFF1D\u672C\u8F6E\u65E0\u5BF9\u8BDD\u53EF\u5212\u3002\u7AEF\u70B9\u65E0\u6CD5\u6307\u540D\u65F6\u8D70 reask\uFF0C\u4E0D\u4E2D\u6B62\u3002`;
|
|
2121
2122
|
diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
2122
2123
|
openToolObject(
|
|
2123
2124
|
Type13.Object({
|
|
@@ -2130,7 +2131,7 @@ var init_diarist_contracts = __esm({
|
|
|
2130
2131
|
})
|
|
2131
2132
|
),
|
|
2132
2133
|
reason: Type13.Unknown({
|
|
2133
|
-
description: "status \u4E3A escalate \u65F6\uFF1A\
|
|
2134
|
+
description: "status \u4E3A escalate \u65F6\uFF1A\u4E0A\u5448\u7684\u539F\u56E0"
|
|
2134
2135
|
}),
|
|
2135
2136
|
sessions: Type13.Optional(Type13.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
|
|
2136
2137
|
ticketSessions: Type13.Unknown({
|
|
@@ -2382,6 +2383,7 @@ var init_packaged_role_registry = __esm({
|
|
|
2382
2383
|
"souls/notary.md",
|
|
2383
2384
|
"souls/audit-law.md",
|
|
2384
2385
|
"souls/ticket-law.md",
|
|
2386
|
+
"souls/quality-law.md",
|
|
2385
2387
|
"souls/gate-output-guide.md",
|
|
2386
2388
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
2387
2389
|
];
|
|
@@ -2397,6 +2399,7 @@ var init_packaged_role_registry = __esm({
|
|
|
2397
2399
|
"CLAUDE.md",
|
|
2398
2400
|
"souls/judge-auditor.md",
|
|
2399
2401
|
"souls/doctor-auditor.md",
|
|
2402
|
+
"souls/judge.md",
|
|
2400
2403
|
"souls/audit-law.md",
|
|
2401
2404
|
"souls/quality-law.md",
|
|
2402
2405
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
@@ -2648,7 +2651,7 @@ var init_packaged_role_registry = __esm({
|
|
|
2648
2651
|
activationStage: "load-and-install",
|
|
2649
2652
|
receiptStatusKey: "status",
|
|
2650
2653
|
// #924: 公用《票面法》三席同装
|
|
2651
|
-
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
2654
|
+
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "souls/audit-law.md", "souls/quality-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
2652
2655
|
},
|
|
2653
2656
|
{
|
|
2654
2657
|
role: "secretariat",
|
|
@@ -4485,7 +4488,7 @@ var init_role_submission_declarations = __esm({
|
|
|
4485
4488
|
},
|
|
4486
4489
|
diarist: {
|
|
4487
4490
|
label: "\u8D77\u5C45\u90CE\u8F93\u51FA",
|
|
4488
|
-
description: "\u8D77\u5C45\u90CE\u4EA4\u5355\u7968 sessions \u6216\u591A\u7968\u9010\u7968 ticketSessions \u8FB9\u754C\
|
|
4491
|
+
description: "\u8D77\u5C45\u90CE\u4EA4\u5355\u7968 sessions \u6216\u591A\u7968\u9010\u7968 ticketSessions \u8FB9\u754C\uFF0C\u6216 escalate\u3002",
|
|
4489
4492
|
promptSnippet: "\u8D77\u5C45\u90CE\u4EA4\u8FB9\u754C",
|
|
4490
4493
|
parameters: diaristOutputSchema
|
|
4491
4494
|
}
|
|
@@ -4903,7 +4906,8 @@ var init_registry = __esm({
|
|
|
4903
4906
|
"help",
|
|
4904
4907
|
"resume",
|
|
4905
4908
|
"new",
|
|
4906
|
-
"setup"
|
|
4909
|
+
"setup",
|
|
4910
|
+
"dialogue"
|
|
4907
4911
|
];
|
|
4908
4912
|
PUBLIC_DETERMINISTIC_COMMANDS = ["analyst"];
|
|
4909
4913
|
}
|
|
@@ -7895,6 +7899,14 @@ var init_option_definitions = __esm({
|
|
|
7895
7899
|
"ak-role new notary --source-run 01abc\u2026@countersign",
|
|
7896
7900
|
"ak-role --host grok-build new inspector --attach ./change.patch"
|
|
7897
7901
|
]
|
|
7902
|
+
},
|
|
7903
|
+
dialogue: {
|
|
7904
|
+
command: "dialogue",
|
|
7905
|
+
summary: "Print what a diary range projects from a session volume, one JSON object per line: speaker lines {line, id, speaker: owner|runner, text} and unparsable lines {line, raw}. line and id are what a range endpoint names; a repeated id is shown on its first line only, where it resolves. Same authorized session roots as the projection.",
|
|
7906
|
+
usage: ["ak-role dialogue <session.jsonl>"],
|
|
7907
|
+
examples: [
|
|
7908
|
+
"ak-role dialogue ~/.claude/projects/-Users-me-repo/0b1c\u2026.jsonl > /tmp/dialogue.jsonl"
|
|
7909
|
+
]
|
|
7898
7910
|
}
|
|
7899
7911
|
};
|
|
7900
7912
|
PUBLIC_COMMAND_HELP = {
|
|
@@ -13736,6 +13748,7 @@ var init_auditor_soul = __esm({
|
|
|
13736
13748
|
judge: [
|
|
13737
13749
|
"CLAUDE.md",
|
|
13738
13750
|
"souls/judge-auditor.md",
|
|
13751
|
+
"souls/judge.md",
|
|
13739
13752
|
"souls/audit-law.md",
|
|
13740
13753
|
"souls/quality-law.md",
|
|
13741
13754
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
@@ -17141,6 +17154,44 @@ var init_instruction_seat_run = __esm({
|
|
|
17141
17154
|
}
|
|
17142
17155
|
});
|
|
17143
17156
|
|
|
17157
|
+
// src/public-cli/dialogue-command.ts
|
|
17158
|
+
async function readSessionDialogue(path, home) {
|
|
17159
|
+
assertDialogueSessionSourcePath(path, home);
|
|
17160
|
+
const sessionLines = await readLedgerSessionJsonlLines(path);
|
|
17161
|
+
const dialogue = adaptSessionDialogue(sessionLines.map((entry) => entry.row));
|
|
17162
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
17163
|
+
const out = [];
|
|
17164
|
+
sessionLines.forEach((entry, index) => {
|
|
17165
|
+
if (entry.row === void 0) {
|
|
17166
|
+
out.push({ line: entry.line, raw: entry.raw });
|
|
17167
|
+
return;
|
|
17168
|
+
}
|
|
17169
|
+
for (const event of dialogue[index] ?? []) {
|
|
17170
|
+
const firstId = event.id !== void 0 && !seenIds.has(event.id);
|
|
17171
|
+
if (event.id !== void 0) seenIds.add(event.id);
|
|
17172
|
+
out.push({
|
|
17173
|
+
line: entry.line,
|
|
17174
|
+
...firstId ? { id: event.id } : {},
|
|
17175
|
+
speaker: event.speaker,
|
|
17176
|
+
text: event.text
|
|
17177
|
+
});
|
|
17178
|
+
}
|
|
17179
|
+
});
|
|
17180
|
+
return out;
|
|
17181
|
+
}
|
|
17182
|
+
function renderSessionDialogue(lines) {
|
|
17183
|
+
return lines.map((line2) => `${JSON.stringify(line2)}
|
|
17184
|
+
`).join("");
|
|
17185
|
+
}
|
|
17186
|
+
var init_dialogue_command = __esm({
|
|
17187
|
+
"src/public-cli/dialogue-command.ts"() {
|
|
17188
|
+
"use strict";
|
|
17189
|
+
init_ledger_session_read();
|
|
17190
|
+
init_session_dialogue();
|
|
17191
|
+
init_ticket_provenance();
|
|
17192
|
+
}
|
|
17193
|
+
});
|
|
17194
|
+
|
|
17144
17195
|
// src/analyst-book-key.ts
|
|
17145
17196
|
import { statSync as statSync6 } from "node:fs";
|
|
17146
17197
|
import { isAbsolute as isAbsolute8 } from "node:path";
|
|
@@ -20276,6 +20327,11 @@ async function runAkRole(argv, env) {
|
|
|
20276
20327
|
return { exitCode: 0 };
|
|
20277
20328
|
}
|
|
20278
20329
|
const home = resolveHome(env);
|
|
20330
|
+
if (parsed.command === "dialogue") {
|
|
20331
|
+
if (parsed.args.length !== 1) throw new CliUsageError("usage: ak-role dialogue <session.jsonl>");
|
|
20332
|
+
io.stdout(renderSessionDialogue(await readSessionDialogue(parsed.args[0], home)));
|
|
20333
|
+
return { exitCode: 0 };
|
|
20334
|
+
}
|
|
20279
20335
|
if (parsed.command === "roles") {
|
|
20280
20336
|
if (parsed.args.length > 0) {
|
|
20281
20337
|
throw new CliUsageError("roles takes no arguments");
|
|
@@ -20466,6 +20522,7 @@ var init_cli = __esm({
|
|
|
20466
20522
|
init_invocation();
|
|
20467
20523
|
init_option_definitions();
|
|
20468
20524
|
init_auto_resume();
|
|
20525
|
+
init_dialogue_command();
|
|
20469
20526
|
init_instruction_seat_run();
|
|
20470
20527
|
init_countersign_run();
|
|
20471
20528
|
init_analyst_run();
|
|
@@ -21649,14 +21706,14 @@ init_run_ticket_number();
|
|
|
21649
21706
|
// src/audited-run-identity.ts
|
|
21650
21707
|
init_role_run_placement();
|
|
21651
21708
|
import { basename as basename14 } from "node:path";
|
|
21652
|
-
var AUDITED_RUN_IDENTITY_KIND = "audited-run
|
|
21709
|
+
var AUDITED_RUN_IDENTITY_KIND = "audited-run";
|
|
21653
21710
|
function auditedRunIdentityFromDirectory(runDirectory) {
|
|
21654
21711
|
const parsed = parseRunLeaf(basename14(runDirectory));
|
|
21655
21712
|
if (parsed === void 0) return void 0;
|
|
21656
21713
|
return formatRunLeaf(parsed.runId, parsed.role);
|
|
21657
21714
|
}
|
|
21658
21715
|
function auditedRunIdentityMaterial(identity) {
|
|
21659
|
-
return { kind: AUDITED_RUN_IDENTITY_KIND, identity };
|
|
21716
|
+
return { kind: AUDITED_RUN_IDENTITY_KIND, auditedRun: identity };
|
|
21660
21717
|
}
|
|
21661
21718
|
function auditedRunIdentityFromParts(runId, role) {
|
|
21662
21719
|
return formatRunLeaf(runId, role);
|
|
@@ -21696,11 +21753,16 @@ function projectNotaryBoundFromFlags(getFlag) {
|
|
|
21696
21753
|
};
|
|
21697
21754
|
}
|
|
21698
21755
|
function assembleNotaryAgentStartPrompt(input) {
|
|
21756
|
+
const audited = input.audited === void 0 ? "" : `
|
|
21757
|
+
|
|
21758
|
+
<audited_seat_soul seat="${input.audited.seat}">
|
|
21759
|
+
${input.audited.soul}
|
|
21760
|
+
</audited_seat_soul>`;
|
|
21699
21761
|
return `${input.baseSystemPrompt}
|
|
21700
21762
|
|
|
21701
21763
|
<notary_soul>
|
|
21702
21764
|
${input.soul}
|
|
21703
|
-
</notary_soul
|
|
21765
|
+
</notary_soul>${audited}`;
|
|
21704
21766
|
}
|
|
21705
21767
|
function createNotaryRoleRuntime(pi, dependencies, host) {
|
|
21706
21768
|
let activation;
|
|
@@ -21722,9 +21784,11 @@ function createNotaryRoleRuntime(pi, dependencies, host) {
|
|
|
21722
21784
|
const soul = (await dependencies.loadSoul()).trim();
|
|
21723
21785
|
if (soul.length === 0) throw new Error("Notary soul is empty");
|
|
21724
21786
|
const sourceRun = await dependencies.loadSourceRunLocator(path);
|
|
21787
|
+
const auditedSoul = (await dependencies.loadAuditedSoul(sourceRun.role))?.trim();
|
|
21725
21788
|
activation = {
|
|
21726
21789
|
soul,
|
|
21727
21790
|
sourceRun,
|
|
21791
|
+
...auditedSoul === void 0 || auditedSoul === "" ? {} : { auditedSoul },
|
|
21728
21792
|
...admitted?.ticketNumber === void 0 ? {} : { ticketNumber: admitted.ticketNumber }
|
|
21729
21793
|
};
|
|
21730
21794
|
if (!registered) {
|
|
@@ -21739,7 +21803,8 @@ function createNotaryRoleRuntime(pi, dependencies, host) {
|
|
|
21739
21803
|
return {
|
|
21740
21804
|
systemPrompt: assembleNotaryAgentStartPrompt({
|
|
21741
21805
|
baseSystemPrompt: event.systemPrompt,
|
|
21742
|
-
soul: activation.soul
|
|
21806
|
+
soul: activation.soul,
|
|
21807
|
+
...activation.auditedSoul === void 0 ? {} : { audited: { seat: activation.sourceRun.role, soul: activation.auditedSoul } }
|
|
21743
21808
|
}),
|
|
21744
21809
|
readingMaterial: projectNotaryAuditedRunIdentity({
|
|
21745
21810
|
sourceRun: activation.sourceRun
|
|
@@ -22759,7 +22824,7 @@ function readDiaristRunCoordinates(ctx) {
|
|
|
22759
22824
|
...bound === void 0 ? {} : { boundTicketNumber: bound }
|
|
22760
22825
|
};
|
|
22761
22826
|
}
|
|
22762
|
-
var DIARIST_BOUNDS_REASK =
|
|
22827
|
+
var DIARIST_BOUNDS_REASK = `\u8FB9\u754C\u65E0\u6CD5\u4F7F\u7528\u3002\u591A\u7968\u8BF7\u9010\u7968\u91CD\u4EA4 ticketSessions\uFF0C\u5355\u7968\u91CD\u4EA4 sessions\uFF1B\u6BCF\u5377 path + ranges\u3002${DIARIST_BOUND_ENDPOINTS}`;
|
|
22763
22828
|
function createDiaristRoleRuntime(roleHost, dependencies, hostActions) {
|
|
22764
22829
|
return createFiledOfficerRuntime(
|
|
22765
22830
|
roleHost,
|
|
@@ -23221,6 +23286,9 @@ function createRoleRuntimeExtension(dependencies, deliveryRequestLimit) {
|
|
|
23221
23286
|
async loadSourceRunLocator(path) {
|
|
23222
23287
|
if (!dependencies.loadNotarySourceRun) throw new Error("Notary runtime dependencies are not configured");
|
|
23223
23288
|
return dependencies.loadNotarySourceRun(path);
|
|
23289
|
+
},
|
|
23290
|
+
async loadAuditedSoul(role) {
|
|
23291
|
+
return packagedRoleMetadata(role) === void 0 ? void 0 : requireRoleSoul(role);
|
|
23224
23292
|
}
|
|
23225
23293
|
}, hostActions);
|
|
23226
23294
|
const countersign = createCountersignRoleRuntime(roleHost, {
|
|
@@ -9126,7 +9126,7 @@ var init_ticket_provenance_contracts = __esm({
|
|
|
9126
9126
|
});
|
|
9127
9127
|
|
|
9128
9128
|
// src/diarist-contracts.ts
|
|
9129
|
-
var DIARIST_OUTPUT_TOOL_NAME, DIARIST_SESSIONS_DESCRIPTION, diaristOutputSchema;
|
|
9129
|
+
var DIARIST_OUTPUT_TOOL_NAME, DIARIST_BOUND_ENDPOINTS, DIARIST_SESSIONS_DESCRIPTION, diaristOutputSchema;
|
|
9130
9130
|
var init_diarist_contracts = __esm({
|
|
9131
9131
|
"src/diarist-contracts.ts"() {
|
|
9132
9132
|
"use strict";
|
|
@@ -9137,7 +9137,8 @@ var init_diarist_contracts = __esm({
|
|
|
9137
9137
|
init_run_ticket_number();
|
|
9138
9138
|
init_unknown_value();
|
|
9139
9139
|
DIARIST_OUTPUT_TOOL_NAME = "ak_diarist_output";
|
|
9140
|
-
|
|
9140
|
+
DIARIST_BOUND_ENDPOINTS = "\u8D77\u70B9\u4E0E\u7EC8\u70B9\u5404\u5199 id \u6216 line\uFF0C\u4E8C\u9009\u4E00\uFF1Aid\uFF1D\u4F1A\u8BDD\u5377\u91CC\u90A3\u4E00\u884C JSON \u7684 uuid \u5B57\u6BB5\u503C\uFF08\u6CA1\u6709 uuid \u53D6 id\uFF1B\u9876\u5C42\u90FD\u6CA1\u6709\u518D\u53D6 message \u6216 payload \u91CC\u7684 uuid / id\uFF09\uFF0C\u540C\u4E00 id \u51FA\u73B0\u591A\u6B21\u65F6\u53D6\u7B2C\u4E00\u6B21\u51FA\u73B0\u7684\u90A3\u4E00\u884C\uFF1Bline\uFF1D\u90A3\u4E00\u884C\u5728\u6587\u4EF6\u91CC\u4ECE 1 \u6570\u8D77\u7684\u884C\u53F7\u3002\u4E24\u7AEF\u90FD\u542B\u5728\u533A\u95F4\u5185\u3002";
|
|
9141
|
+
DIARIST_SESSIONS_DESCRIPTION = `\u5BF9\u8BDD\u8FB9\u754C\u3002\u6BCF\u5377\u542B path\uFF08\u4F1A\u8BDD\u5377\u7EDD\u5BF9\u6216\u53EF\u8BFB\u8DEF\u5F84\uFF09\u4E0E ranges\uFF08\u672C\u5377\u672C\u8F6E\u5404\u533A\u95F4\uFF09\u3002\u6BCF\u6BB5\u533A\u95F4\u542B from / to\uFF1B${DIARIST_BOUND_ENDPOINTS}\u533A\u95F4\u91CC\u53EA\u6709\u8BF4\u8BDD\u4EBA\u7684\u539F\u6587\u8FDB\u5F55\uFF1A\u7528\u6237\u4E0E\u52A9\u624B\u6D88\u606F\u91CC\u7684\u6587\u672C\u3001\u771F\u4EBA\u7ECF\u961F\u5217\u7684\u63D2\u8BDD\uFF1B\u601D\u8003\u3001\u5DE5\u5177\u8C03\u7528\u3001\u5DE5\u5177\u7ED3\u679C\u548C\u673A\u5668\u901A\u77E5\u4E0D\u8FDB\u5F55\uFF0C\u533A\u95F4\u53EF\u4EE5\u76F4\u63A5\u8DE8\u8FC7\u5B83\u4EEC\uFF0C\u4E0D\u5FC5\u62C6\u6BB5\u3002\u6BCF\u6B21\u4EA4\u5377\u7684\u8FB9\u754C\u7167\u6295\u5F71\u8FFD\u52A0\u8FDB\u672C\u7968\u8D77\u5C45\u5F55\uFF0C\u4E0D\u53BB\u91CD\uFF0C\u4E5F\u4E0D\u6539\u5DF2\u6709\u7684\u5F55\u3002\u7A7A\u5217\u8868\uFF1D\u672C\u8F6E\u65E0\u5BF9\u8BDD\u53EF\u5212\u3002\u7AEF\u70B9\u65E0\u6CD5\u6307\u540D\u65F6\u8D70 reask\uFF0C\u4E0D\u4E2D\u6B62\u3002`;
|
|
9141
9142
|
diaristOutputSchema = withTerminatingOutputDeclarations(
|
|
9142
9143
|
openToolObject(
|
|
9143
9144
|
typebox_exports.Object({
|
|
@@ -9150,7 +9151,7 @@ var init_diarist_contracts = __esm({
|
|
|
9150
9151
|
})
|
|
9151
9152
|
),
|
|
9152
9153
|
reason: typebox_exports.Unknown({
|
|
9153
|
-
description: "status \u4E3A escalate \u65F6\uFF1A\
|
|
9154
|
+
description: "status \u4E3A escalate \u65F6\uFF1A\u4E0A\u5448\u7684\u539F\u56E0"
|
|
9154
9155
|
}),
|
|
9155
9156
|
sessions: typebox_exports.Optional(typebox_exports.Unknown({ description: DIARIST_SESSIONS_DESCRIPTION })),
|
|
9156
9157
|
ticketSessions: typebox_exports.Unknown({
|
|
@@ -9242,6 +9243,7 @@ var init_packaged_role_registry = __esm({
|
|
|
9242
9243
|
"souls/notary.md",
|
|
9243
9244
|
"souls/audit-law.md",
|
|
9244
9245
|
"souls/ticket-law.md",
|
|
9246
|
+
"souls/quality-law.md",
|
|
9245
9247
|
"souls/gate-output-guide.md",
|
|
9246
9248
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
9247
9249
|
];
|
|
@@ -9257,6 +9259,7 @@ var init_packaged_role_registry = __esm({
|
|
|
9257
9259
|
"CLAUDE.md",
|
|
9258
9260
|
"souls/judge-auditor.md",
|
|
9259
9261
|
"souls/doctor-auditor.md",
|
|
9262
|
+
"souls/judge.md",
|
|
9260
9263
|
"souls/audit-law.md",
|
|
9261
9264
|
"souls/quality-law.md",
|
|
9262
9265
|
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
@@ -9508,7 +9511,7 @@ var init_packaged_role_registry = __esm({
|
|
|
9508
9511
|
activationStage: "load-and-install",
|
|
9509
9512
|
receiptStatusKey: "status",
|
|
9510
9513
|
// #924: 公用《票面法》三席同装
|
|
9511
|
-
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
9514
|
+
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "souls/audit-law.md", "souls/quality-law.md", "resources/countersign-ticket-issue.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
9512
9515
|
},
|
|
9513
9516
|
{
|
|
9514
9517
|
role: "secretariat",
|
|
@@ -9840,7 +9843,7 @@ var init_role_submission_declarations = __esm({
|
|
|
9840
9843
|
},
|
|
9841
9844
|
diarist: {
|
|
9842
9845
|
label: "\u8D77\u5C45\u90CE\u8F93\u51FA",
|
|
9843
|
-
description: "\u8D77\u5C45\u90CE\u4EA4\u5355\u7968 sessions \u6216\u591A\u7968\u9010\u7968 ticketSessions \u8FB9\u754C\
|
|
9846
|
+
description: "\u8D77\u5C45\u90CE\u4EA4\u5355\u7968 sessions \u6216\u591A\u7968\u9010\u7968 ticketSessions \u8FB9\u754C\uFF0C\u6216 escalate\u3002",
|
|
9844
9847
|
promptSnippet: "\u8D77\u5C45\u90CE\u4EA4\u8FB9\u754C",
|
|
9845
9848
|
parameters: diaristOutputSchema
|
|
9846
9849
|
}
|
|
@@ -11258,6 +11261,14 @@ var init_option_definitions = __esm({
|
|
|
11258
11261
|
"ak-role new notary --source-run 01abc\u2026@countersign",
|
|
11259
11262
|
"ak-role --host grok-build new inspector --attach ./change.patch"
|
|
11260
11263
|
]
|
|
11264
|
+
},
|
|
11265
|
+
dialogue: {
|
|
11266
|
+
command: "dialogue",
|
|
11267
|
+
summary: "Print what a diary range projects from a session volume, one JSON object per line: speaker lines {line, id, speaker: owner|runner, text} and unparsable lines {line, raw}. line and id are what a range endpoint names; a repeated id is shown on its first line only, where it resolves. Same authorized session roots as the projection.",
|
|
11268
|
+
usage: ["ak-role dialogue <session.jsonl>"],
|
|
11269
|
+
examples: [
|
|
11270
|
+
"ak-role dialogue ~/.claude/projects/-Users-me-repo/0b1c\u2026.jsonl > /tmp/dialogue.jsonl"
|
|
11271
|
+
]
|
|
11261
11272
|
}
|
|
11262
11273
|
};
|
|
11263
11274
|
PUBLIC_COMMAND_HELP = {
|