@akagilnc/pi-workflow-roles 0.1.5079 → 0.1.5096
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 +348 -301
- package/dist/atomic-write.js +13 -19
- package/dist/auditor-soul.js +2 -1
- package/dist/doctor-contracts.js +1 -1
- package/dist/gatekeeper-role.js +2 -16
- package/dist/headless-host/production-host.js +380 -333
- package/dist/merger-contracts.js +1 -1
- package/dist/migrate-book-topology.js +18 -14
- package/dist/navigator-attendance.js +28 -143
- package/dist/navigator-invocation-identity.js +2 -0
- package/dist/navigator-public-session.js +13 -1
- package/dist/navigator-work-base.js +113 -0
- package/dist/notary-contracts.js +0 -2
- package/dist/package-contracts/fixer-output.js +1 -1
- package/dist/package-contracts/gatekeeper-output.js +1 -1
- package/dist/package-contracts/navigator-output.js +1 -1
- package/dist/package-contracts/terminating-infrastructure.js +3 -3
- package/dist/packaged-role-registry.js +9 -5
- package/dist/public-cli/countersign-run.js +1 -1
- package/dist/public-cli/invocation.js +6 -3
- package/dist/public-cli/main.js +46 -22
- package/dist/public-cli/settlement.js +20 -1
- package/dist/receipt-delivery-policy.js +9 -2
- package/dist/review-submission.js +3 -3
- package/docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md +9 -0
- package/extensions/role-runtime.ts +0 -27
- package/package.json +2 -1
- package/resources/836-deleted-machine-instruction-inventory.md +3 -3
- package/resources/collector-bot-handbook.md +4 -0
- package/resources/navigator-route-playbook.md +4 -6
- package/scripts/build-package.mjs +4 -0
- package/souls/coder-output-guide.md +1 -0
- package/src/auditor-soul.ts +2 -1
- package/src/collector-role.ts +6 -7
- package/src/collector-tool-schemas.ts +5 -5
- package/src/diarist-role.ts +2 -2
- package/src/doctor-contracts.ts +1 -1
- package/src/gatekeeper-role.ts +1 -18
- package/src/gleaner-left-role.ts +2 -2
- package/src/inspector-role.ts +1 -1
- package/src/judge-role.ts +1 -1
- package/src/merger-contracts.ts +1 -1
- package/src/navigator-attendance.ts +38 -164
- package/src/navigator-invocation-identity.ts +2 -0
- package/src/navigator-public-session.ts +17 -1
- package/src/navigator-role.ts +4 -0
- package/src/navigator-session-contracts.ts +2 -0
- package/src/navigator-work-base.ts +123 -0
- package/src/notary-contracts.ts +0 -4
- package/src/package-contracts/fixer-output.ts +1 -1
- package/src/package-contracts/gatekeeper-output.ts +3 -3
- package/src/package-contracts/navigator-output.ts +1 -1
- package/src/package-contracts/terminating-infrastructure.ts +3 -6
- package/src/packaged-role-registry.ts +5 -1
- package/src/public-cli/countersign-run.ts +1 -1
- package/src/public-cli/invocation.ts +6 -3
- package/src/public-cli/settlement.ts +21 -0
- package/src/receipt-delivery-policy.ts +9 -1
- package/src/review-submission.ts +3 -3
- package/src/reviewer-role.ts +3 -3
- package/src/role-runtime-dependencies.ts +1 -5
- package/src/role-runtime.ts +52 -38
- package/src/secretariat-role.ts +3 -3
- package/src/worker-role.ts +3 -3
package/dist/notary-contracts.js
CHANGED
|
@@ -14,7 +14,6 @@ const NOTARY_TICKET_FLAG = {
|
|
|
14
14
|
type: "string"
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
const NOTARY_FIXED_KICKOFF = "\u7B26\u5B9D\u90CE\u6848\u5377\u5DF2\u53D7\u7406\uFF1B\u6765\u6E90 run \u5B9A\u4F4D\u89C1\u4F1A\u8BDD\u6750\u6599\u3002";
|
|
18
17
|
const notaryOutputSchema = reviewSubmissionSchema;
|
|
19
18
|
function isRecord(value) {
|
|
20
19
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -37,7 +36,6 @@ function validateRecordedNotaryOutput(value) {
|
|
|
37
36
|
return value;
|
|
38
37
|
}
|
|
39
38
|
export {
|
|
40
|
-
NOTARY_FIXED_KICKOFF,
|
|
41
39
|
NOTARY_OUTPUT_TOOL_NAME,
|
|
42
40
|
NOTARY_SOURCE_RUN_FLAG,
|
|
43
41
|
NOTARY_TICKET_FLAG,
|
|
@@ -27,7 +27,7 @@ const refusedClassResultSchema = Type.Object({
|
|
|
27
27
|
});
|
|
28
28
|
const classResultSchema = Type.Union([completedClassResultSchema, refusedClassResultSchema]);
|
|
29
29
|
const completedClassResultsSchema = Type.Array(completedClassResultSchema);
|
|
30
|
-
const FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed
|
|
30
|
+
const FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed\u3002unfinished \u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u65F6\u53EF\u7528\uFF0C\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002";
|
|
31
31
|
const fixerOutputVariants = Type.Union([
|
|
32
32
|
Type.Object({ status: Type.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }),
|
|
33
33
|
Type.Object({ status: Type.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: Type.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), remainingScope: Type.String({ description: "\u4F9D\u6CD5\u4E0D\u80FD\u5B8C\u6210\u7684\u5DE5\u4F5C\u8303\u56F4" }), blocker: Type.Unsafe({ ...blockerSchema, description: "\u5408\u6CD5\u963B\u65AD\u5B8C\u6210\u7684 blocker" }) }),
|
|
@@ -5,7 +5,7 @@ const GATEKEEPER_OUTPUT_TOOL_NAME = "ak_gatekeeper_output";
|
|
|
5
5
|
const gatekeeperDecisionSchema = openToolObject(
|
|
6
6
|
Type.Object({
|
|
7
7
|
status: Type.Unknown({
|
|
8
|
-
description: "dispatch | pass
|
|
8
|
+
description: "dispatch | pass"
|
|
9
9
|
}),
|
|
10
10
|
officer: Type.Unknown({
|
|
11
11
|
description: "status \u4E3A dispatch \u65F6\u4E3A inspector | notary"
|
|
@@ -6,7 +6,7 @@ const navigatorOutputSchema = withTerminatingOutputDeclarations(
|
|
|
6
6
|
openToolObject(
|
|
7
7
|
Type.Object({
|
|
8
8
|
prose: Type.Unknown({
|
|
9
|
-
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002
|
|
9
|
+
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002"
|
|
10
10
|
})
|
|
11
11
|
})
|
|
12
12
|
)
|
|
@@ -4,12 +4,12 @@ const INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY = "diagnostic";
|
|
|
4
4
|
const infrastructureFailureNested = Type.Object(
|
|
5
5
|
{
|
|
6
6
|
[INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY]: Type.Unknown({
|
|
7
|
-
description: "\
|
|
7
|
+
description: "\u57FA\u7840\u8BBE\u65BD\u5931\u8D25\u8BCA\u65AD\u5B57\u7B26\u4E32\u3002"
|
|
8
8
|
})
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
additionalProperties: true,
|
|
12
|
-
description: "\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\
|
|
12
|
+
description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u51FA\u73B0\u3002"
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
infrastructureFailureNested.required = [];
|
|
@@ -25,7 +25,7 @@ function withTerminatingOutputDeclarations(schema) {
|
|
|
25
25
|
...baseProperties ?? {},
|
|
26
26
|
...baseProperties?.ticketNumber === void 0 ? {
|
|
27
27
|
ticketNumber: Type.Unknown({
|
|
28
|
-
description: "\u53EF\u9009\u672C\u7968\u53F7\
|
|
28
|
+
description: "\u53EF\u9009\u672C\u7968\u53F7\u3002\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\u3002"
|
|
29
29
|
})
|
|
30
30
|
} : {},
|
|
31
31
|
[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
|
|
@@ -27,21 +27,24 @@ const NOTARY_SESSION_MATERIALS = [
|
|
|
27
27
|
"souls/notary.md",
|
|
28
28
|
"souls/audit-law.md",
|
|
29
29
|
"souls/ticket-law.md",
|
|
30
|
-
"souls/gate-output-guide.md"
|
|
30
|
+
"souls/gate-output-guide.md",
|
|
31
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
31
32
|
];
|
|
32
33
|
const INSPECTOR_SESSION_MATERIALS = [
|
|
33
34
|
"CLAUDE.md",
|
|
34
35
|
"souls/inspector.md",
|
|
35
36
|
"souls/audit-law.md",
|
|
36
37
|
"souls/quality-law.md",
|
|
37
|
-
"souls/gate-output-guide.md"
|
|
38
|
+
"souls/gate-output-guide.md",
|
|
39
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
38
40
|
];
|
|
39
41
|
const AUDITOR_PUBLIC_SESSION_MATERIALS = [
|
|
40
42
|
"CLAUDE.md",
|
|
41
43
|
"souls/judge-auditor.md",
|
|
42
44
|
"souls/doctor-auditor.md",
|
|
43
45
|
"souls/audit-law.md",
|
|
44
|
-
"souls/quality-law.md"
|
|
46
|
+
"souls/quality-law.md",
|
|
47
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
45
48
|
];
|
|
46
49
|
const PUBLIC_ROLE_RECORDS = [
|
|
47
50
|
{
|
|
@@ -69,7 +72,8 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
69
72
|
"souls/judge.md",
|
|
70
73
|
"souls/audit-law.md",
|
|
71
74
|
"souls/quality-law.md",
|
|
72
|
-
"souls/judge-output-guide.md"
|
|
75
|
+
"souls/judge-output-guide.md",
|
|
76
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
73
77
|
]
|
|
74
78
|
},
|
|
75
79
|
{
|
|
@@ -347,7 +351,7 @@ const PUBLIC_ROLE_RECORDS = [
|
|
|
347
351
|
activationStage: "load-and-install",
|
|
348
352
|
receiptStatusKey: "status",
|
|
349
353
|
// #924: 公用《票面法》三席同装
|
|
350
|
-
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md"]
|
|
354
|
+
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"]
|
|
351
355
|
},
|
|
352
356
|
{
|
|
353
357
|
role: "secretariat",
|
|
@@ -234,7 +234,7 @@ export async function runCountersignCourtDiaristStation(admitted, env, io, after
|
|
|
234
234
|
const completedIndex = afterTicketNumber === undefined ? -1 : refreshTickets.indexOf(afterTicketNumber);
|
|
235
235
|
for (const ticketNumber of refreshTickets.slice(completedIndex + 1)) {
|
|
236
236
|
const outcome = await invokeCourtDiarist({
|
|
237
|
-
instruction:
|
|
237
|
+
instruction: admitted.instruction,
|
|
238
238
|
projectRoot: admitted.projectRoot,
|
|
239
239
|
failureLabel: `ticket #${ticketNumber}`,
|
|
240
240
|
correlationId: admitted.runId,
|
|
@@ -24,7 +24,7 @@ import { validateMergerInput, } from "../merger-contracts.js";
|
|
|
24
24
|
import { sha256Hex } from "../sha256.js";
|
|
25
25
|
import { rehomeUnboundTicketProvenance } from "../ticket-provenance.js";
|
|
26
26
|
import { uuidv7 } from "../uuidv7.js";
|
|
27
|
-
import {
|
|
27
|
+
import {} from "../notary-contracts.js";
|
|
28
28
|
import { NotarySourceRunError, resolveNotarySourceRunLocator, } from "../notary-source-run.js";
|
|
29
29
|
import { appendEngineSessionMaterial, } from "../package-resources/engine-material.js";
|
|
30
30
|
import { CliUsageError } from "./cli-errors.js";
|
|
@@ -1293,13 +1293,16 @@ function admittedTransportPromptKind(admitted) {
|
|
|
1293
1293
|
export function buildInstructionTransportPrompt(admitted, engineMaterial) {
|
|
1294
1294
|
const kind = admittedTransportPromptKind(admitted);
|
|
1295
1295
|
if (kind === "fixed-kickoff") {
|
|
1296
|
-
|
|
1296
|
+
if (admitted.sourceRunPath === undefined || admitted.sourceRunPath.trim() === "") {
|
|
1297
|
+
throw new Error("fixed-kickoff transport prompt is missing the source run pointer");
|
|
1298
|
+
}
|
|
1299
|
+
return appendEngineSessionMaterial([admitted.sourceRunPath], engineMaterial).join("\n");
|
|
1297
1300
|
}
|
|
1298
1301
|
if (kind === "baseline") {
|
|
1299
1302
|
if (admitted.baseRevision === undefined) {
|
|
1300
1303
|
throw new Error("baseline transport prompt is missing the bound revision");
|
|
1301
1304
|
}
|
|
1302
|
-
const lines = [
|
|
1305
|
+
const lines = [admitted.baseRevision];
|
|
1303
1306
|
if (!admitted.instructionEmpty) {
|
|
1304
1307
|
lines.push("", admitted.instruction);
|
|
1305
1308
|
}
|
package/dist/public-cli/main.js
CHANGED
|
@@ -8798,7 +8798,7 @@ function withTerminatingOutputDeclarations(schema) {
|
|
|
8798
8798
|
...baseProperties ?? {},
|
|
8799
8799
|
...baseProperties?.ticketNumber === void 0 ? {
|
|
8800
8800
|
ticketNumber: typebox_exports.Unknown({
|
|
8801
|
-
description: "\u53EF\u9009\u672C\u7968\u53F7\
|
|
8801
|
+
description: "\u53EF\u9009\u672C\u7968\u53F7\u3002\u5C1A\u672A\u7ED1\u5B9A\u65F6\u7531\u89D2\u8272\u5728\u65E2\u6709\u56DE\u6267\u4E2D\u7533\u62A5\u3002"
|
|
8802
8802
|
})
|
|
8803
8803
|
} : {},
|
|
8804
8804
|
[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]: infrastructureFailureDeclarationSchema.properties[INFRASTRUCTURE_FAILURE_DECLARATION_KEY]
|
|
@@ -8819,12 +8819,12 @@ var init_terminating_infrastructure = __esm({
|
|
|
8819
8819
|
infrastructureFailureNested = typebox_exports.Object(
|
|
8820
8820
|
{
|
|
8821
8821
|
[INFRASTRUCTURE_FAILURE_DIAGNOSTIC_KEY]: typebox_exports.Unknown({
|
|
8822
|
-
description: "\
|
|
8822
|
+
description: "\u57FA\u7840\u8BBE\u65BD\u5931\u8D25\u8BCA\u65AD\u5B57\u7B26\u4E32\u3002"
|
|
8823
8823
|
})
|
|
8824
8824
|
},
|
|
8825
8825
|
{
|
|
8826
8826
|
additionalProperties: true,
|
|
8827
|
-
description: "\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\
|
|
8827
|
+
description: "\u4EC5\u57FA\u7840\u8BBE\u65BD\u771F\u5B9E\u5931\u8D25\u65F6\u51FA\u73B0\u3002"
|
|
8828
8828
|
}
|
|
8829
8829
|
);
|
|
8830
8830
|
infrastructureFailureNested.required = [];
|
|
@@ -8849,7 +8849,7 @@ var init_gatekeeper_output = __esm({
|
|
|
8849
8849
|
gatekeeperDecisionSchema = openToolObject(
|
|
8850
8850
|
typebox_exports.Object({
|
|
8851
8851
|
status: typebox_exports.Unknown({
|
|
8852
|
-
description: "dispatch | pass
|
|
8852
|
+
description: "dispatch | pass"
|
|
8853
8853
|
}),
|
|
8854
8854
|
officer: typebox_exports.Unknown({
|
|
8855
8855
|
description: "status \u4E3A dispatch \u65F6\u4E3A inspector | notary"
|
|
@@ -8878,7 +8878,7 @@ var init_navigator_output = __esm({
|
|
|
8878
8878
|
openToolObject(
|
|
8879
8879
|
typebox_exports.Object({
|
|
8880
8880
|
prose: typebox_exports.Unknown({
|
|
8881
|
-
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002
|
|
8881
|
+
description: "\u6E38\u5955\u4F7F\u6563\u6587\u5EFA\u8BAE\uFF0C\u539F\u6837\u5448\u73B0\u3002\u4E0D\u8981\u6C42 candidates/next \u7B49\u7ED3\u6784\u5316\u5B57\u6BB5\u3002"
|
|
8882
8882
|
})
|
|
8883
8883
|
})
|
|
8884
8884
|
)
|
|
@@ -8905,7 +8905,7 @@ var init_review_submission = __esm({
|
|
|
8905
8905
|
typebox_exports.Literal(REVIEW_QUEUE_WORDS[2])
|
|
8906
8906
|
],
|
|
8907
8907
|
{
|
|
8908
|
-
description: "\u5BA1\u6838\
|
|
8908
|
+
description: "\u5BA1\u6838\u5E2D\u672C\u8F6E\u88C1\u51B3\u7684\u5224\u522B\u72B6\u6001\u3002"
|
|
8909
8909
|
}
|
|
8910
8910
|
),
|
|
8911
8911
|
findings: typebox_exports.Optional(typebox_exports.Unknown({ description: "\u5BA1\u6838\u53D1\u73B0\uFF0C\u539F\u6837\u7559\u5B58" })),
|
|
@@ -8975,7 +8975,7 @@ var init_fixer_output = __esm({
|
|
|
8975
8975
|
});
|
|
8976
8976
|
classResultSchema = typebox_exports.Union([completedClassResultSchema, refusedClassResultSchema]);
|
|
8977
8977
|
completedClassResultsSchema = typebox_exports.Array(completedClassResultSchema);
|
|
8978
|
-
FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed
|
|
8978
|
+
FIXER_STATUS_DESCRIPTION = "planned | completed | refused | unfinished | partially_completed\u3002unfinished \u7F3A\u524D\u7F6E\u6216\u8FDD\u5BAA\u7EA6\u675F\u81F4\u672C\u5C40\u672A\u5B8C\u6210\u65F6\u53EF\u7528\uFF0C\u7F3A\u5F85\u51B3 owner \u51B3\u5B9A\u6216\u7B54\u590D\u5C5E\u7F3A\u524D\u7F6E\u3002";
|
|
8979
8979
|
fixerOutputVariants = typebox_exports.Union([
|
|
8980
8980
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }),
|
|
8981
8981
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: FIXER_STATUS_DESCRIPTION }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), remainingScope: typebox_exports.String({ description: "\u4F9D\u6CD5\u4E0D\u80FD\u5B8C\u6210\u7684\u5DE5\u4F5C\u8303\u56F4" }), blocker: typebox_exports.Unsafe({ ...blockerSchema, description: "\u5408\u6CD5\u963B\u65AD\u5B8C\u6210\u7684 blocker" }) }),
|
|
@@ -15032,7 +15032,7 @@ var init_doctor_contracts = __esm({
|
|
|
15032
15032
|
typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), assetEvidence: typebox_exports.Optional(typebox_exports.Object({ targetKey: nonblank, targetKind: typebox_exports.Optional(typebox_exports.Union(assetKinds.map((kind) => typebox_exports.Literal(kind)))), evidenceId: nonblank }, { additionalProperties: true })), ...findingBody }, { additionalProperties: true })
|
|
15033
15033
|
]);
|
|
15034
15034
|
caseIdentity = typebox_exports.Object({ issueNumber: typebox_exports.Optional(typebox_exports.Integer()), runsPath: nonblank }, { additionalProperties: true });
|
|
15035
|
-
DOCTOR_STATUS_DESCRIPTION = "completed | refused
|
|
15035
|
+
DOCTOR_STATUS_DESCRIPTION = "completed | refused\u3002completed \u5141\u8BB8\u7A7A findings\uFF1Brefused \u4EC5\u5F53\u8BC1\u636E\u4E0D\u8DB3\u4EE5\u652F\u6491\u5982\u5B9E\u6848\u8BC1\u8BCD";
|
|
15036
15036
|
doctorSubmissionVariants = typebox_exports.Union([
|
|
15037
15037
|
typebox_exports.Object({
|
|
15038
15038
|
status: typebox_exports.Unknown({ description: DOCTOR_STATUS_DESCRIPTION }),
|
|
@@ -15112,7 +15112,7 @@ var init_merger_contracts = __esm({
|
|
|
15112
15112
|
resolutionScope: typebox_exports.Array(typebox_exports.String(), { description: "\u6750\u6599\uFF1A\u89E3\u6790\u8303\u56F4\u63D0\u793A\uFF1B\u53EF\u7A7A" }),
|
|
15113
15113
|
authorizedChecks: typebox_exports.Array(checkSchema)
|
|
15114
15114
|
}, { additionalProperties: false });
|
|
15115
|
-
MERGER_STATUS_DESCRIPTION = "completed | escalate
|
|
15115
|
+
MERGER_STATUS_DESCRIPTION = "completed | escalate";
|
|
15116
15116
|
mergerOutputVariants = typebox_exports.Union([
|
|
15117
15117
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: typebox_exports.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }), mergeCommitId: typebox_exports.String({ description: "\u5B8C\u6210\u5408\u5E76 commit object ID" }) }, { additionalProperties: false }),
|
|
15118
15118
|
typebox_exports.Object({ status: typebox_exports.Unknown({ description: MERGER_STATUS_DESCRIPTION }), attemptId: typebox_exports.String({ description: "\u5DF2\u53D7\u7406\u5408\u5E76 attempt \u8EAB\u4EFD" }), diagnosis: typebox_exports.String({ description: "\u5408\u5E76\u65E0\u6CD5\u6216\u4E0D\u5E94\u7531\u672C\u5E2D\u5B8C\u6210\u7684\u539F\u56E0\uFF08\u542B\u65E0\u8FDB\u884C\u4E2D\u5408\u5E76\u3001\u65E0\u6D3B\u53EF\u5E72\u3001\u9700\u65B0\u7684\u4EA7\u54C1/\u6743\u529B\u51B3\u5B9A\uFF09" }), report: typebox_exports.String({ description: "\u5982\u5B9E\u7ED3\u679C\u62A5\u544A" }) }, { additionalProperties: false })
|
|
@@ -15133,13 +15133,12 @@ var init_merger_contracts = __esm({
|
|
|
15133
15133
|
});
|
|
15134
15134
|
|
|
15135
15135
|
// src/notary-contracts.ts
|
|
15136
|
-
var NOTARY_OUTPUT_TOOL_NAME
|
|
15136
|
+
var NOTARY_OUTPUT_TOOL_NAME;
|
|
15137
15137
|
var init_notary_contracts = __esm({
|
|
15138
15138
|
"src/notary-contracts.ts"() {
|
|
15139
15139
|
"use strict";
|
|
15140
15140
|
init_review_submission();
|
|
15141
15141
|
NOTARY_OUTPUT_TOOL_NAME = REVIEW_SUBMISSION_OUTPUT_TOOL_NAME;
|
|
15142
|
-
NOTARY_FIXED_KICKOFF = "\u7B26\u5B9D\u90CE\u6848\u5377\u5DF2\u53D7\u7406\uFF1B\u6765\u6E90 run \u5B9A\u4F4D\u89C1\u4F1A\u8BDD\u6750\u6599\u3002";
|
|
15143
15142
|
}
|
|
15144
15143
|
});
|
|
15145
15144
|
|
|
@@ -15523,21 +15522,24 @@ var init_packaged_role_registry = __esm({
|
|
|
15523
15522
|
"souls/notary.md",
|
|
15524
15523
|
"souls/audit-law.md",
|
|
15525
15524
|
"souls/ticket-law.md",
|
|
15526
|
-
"souls/gate-output-guide.md"
|
|
15525
|
+
"souls/gate-output-guide.md",
|
|
15526
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15527
15527
|
];
|
|
15528
15528
|
INSPECTOR_SESSION_MATERIALS = [
|
|
15529
15529
|
"CLAUDE.md",
|
|
15530
15530
|
"souls/inspector.md",
|
|
15531
15531
|
"souls/audit-law.md",
|
|
15532
15532
|
"souls/quality-law.md",
|
|
15533
|
-
"souls/gate-output-guide.md"
|
|
15533
|
+
"souls/gate-output-guide.md",
|
|
15534
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15534
15535
|
];
|
|
15535
15536
|
AUDITOR_PUBLIC_SESSION_MATERIALS = [
|
|
15536
15537
|
"CLAUDE.md",
|
|
15537
15538
|
"souls/judge-auditor.md",
|
|
15538
15539
|
"souls/doctor-auditor.md",
|
|
15539
15540
|
"souls/audit-law.md",
|
|
15540
|
-
"souls/quality-law.md"
|
|
15541
|
+
"souls/quality-law.md",
|
|
15542
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15541
15543
|
];
|
|
15542
15544
|
PUBLIC_ROLE_RECORDS = [
|
|
15543
15545
|
{
|
|
@@ -15565,7 +15567,8 @@ var init_packaged_role_registry = __esm({
|
|
|
15565
15567
|
"souls/judge.md",
|
|
15566
15568
|
"souls/audit-law.md",
|
|
15567
15569
|
"souls/quality-law.md",
|
|
15568
|
-
"souls/judge-output-guide.md"
|
|
15570
|
+
"souls/judge-output-guide.md",
|
|
15571
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
15569
15572
|
]
|
|
15570
15573
|
},
|
|
15571
15574
|
{
|
|
@@ -15843,7 +15846,7 @@ var init_packaged_role_registry = __esm({
|
|
|
15843
15846
|
activationStage: "load-and-install",
|
|
15844
15847
|
receiptStatusKey: "status",
|
|
15845
15848
|
// #924: 公用《票面法》三席同装
|
|
15846
|
-
sessionMaterials: ["CLAUDE.md", "souls/countersign.md", "souls/ticket-law.md", "resources/countersign-ticket-issue.md"]
|
|
15849
|
+
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"]
|
|
15847
15850
|
},
|
|
15848
15851
|
{
|
|
15849
15852
|
role: "secretariat",
|
|
@@ -22725,13 +22728,16 @@ function admittedTransportPromptKind(admitted) {
|
|
|
22725
22728
|
function buildInstructionTransportPrompt(admitted, engineMaterial) {
|
|
22726
22729
|
const kind = admittedTransportPromptKind(admitted);
|
|
22727
22730
|
if (kind === "fixed-kickoff") {
|
|
22728
|
-
|
|
22731
|
+
if (admitted.sourceRunPath === void 0 || admitted.sourceRunPath.trim() === "") {
|
|
22732
|
+
throw new Error("fixed-kickoff transport prompt is missing the source run pointer");
|
|
22733
|
+
}
|
|
22734
|
+
return appendEngineSessionMaterial([admitted.sourceRunPath], engineMaterial).join("\n");
|
|
22729
22735
|
}
|
|
22730
22736
|
if (kind === "baseline") {
|
|
22731
22737
|
if (admitted.baseRevision === void 0) {
|
|
22732
22738
|
throw new Error("baseline transport prompt is missing the bound revision");
|
|
22733
22739
|
}
|
|
22734
|
-
const lines2 = [
|
|
22740
|
+
const lines2 = [admitted.baseRevision];
|
|
22735
22741
|
if (!admitted.instructionEmpty) {
|
|
22736
22742
|
lines2.push("", admitted.instruction);
|
|
22737
22743
|
}
|
|
@@ -23459,9 +23465,10 @@ var init_auditor_soul = __esm({
|
|
|
23459
23465
|
"CLAUDE.md",
|
|
23460
23466
|
"souls/judge-auditor.md",
|
|
23461
23467
|
"souls/audit-law.md",
|
|
23462
|
-
"souls/quality-law.md"
|
|
23468
|
+
"souls/quality-law.md",
|
|
23469
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"
|
|
23463
23470
|
],
|
|
23464
|
-
doctor: ["CLAUDE.md", "souls/doctor-auditor.md"]
|
|
23471
|
+
doctor: ["CLAUDE.md", "souls/doctor-auditor.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"]
|
|
23465
23472
|
};
|
|
23466
23473
|
}
|
|
23467
23474
|
});
|
|
@@ -24510,7 +24517,7 @@ function findLatestDurablePackagedRoleTerminal(entries) {
|
|
|
24510
24517
|
}
|
|
24511
24518
|
return void 0;
|
|
24512
24519
|
}
|
|
24513
|
-
var NAVIGATOR_INVOCATION_ENTRY, NAVIGATOR_INFRASTRUCTURE_FAILURE_KIND, NAVIGATOR_INFRASTRUCTURE_FAILURE_KEYS, PACKAGED_ROLE_OUTPUT_TOOLS;
|
|
24520
|
+
var NAVIGATOR_INVOCATION_ENTRY, NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY, NAVIGATOR_INFRASTRUCTURE_FAILURE_KIND, NAVIGATOR_INFRASTRUCTURE_FAILURE_KEYS, PACKAGED_ROLE_OUTPUT_TOOLS;
|
|
24514
24521
|
var init_navigator_invocation_identity = __esm({
|
|
24515
24522
|
"src/navigator-invocation-identity.ts"() {
|
|
24516
24523
|
"use strict";
|
|
@@ -24518,6 +24525,7 @@ var init_navigator_invocation_identity = __esm({
|
|
|
24518
24525
|
init_uuidv7();
|
|
24519
24526
|
init_work_subject_identity();
|
|
24520
24527
|
NAVIGATOR_INVOCATION_ENTRY = "ak-navigator-invocation";
|
|
24528
|
+
NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY = "ak-navigator-route-playbook-failure";
|
|
24521
24529
|
NAVIGATOR_INFRASTRUCTURE_FAILURE_KIND = "role_infrastructure_failure";
|
|
24522
24530
|
NAVIGATOR_INFRASTRUCTURE_FAILURE_KEYS = [
|
|
24523
24531
|
"kind",
|
|
@@ -25693,7 +25701,23 @@ async function withOptionalGateProjection(base, sessionDirectory, gateContext =
|
|
|
25693
25701
|
}
|
|
25694
25702
|
return attachEngineDetourToolUsage(next, sessionDirectory, gateContext);
|
|
25695
25703
|
}
|
|
25704
|
+
function routePlaybookFailureMessage(entries) {
|
|
25705
|
+
for (let i = entries.length - 1; i >= 0; i -= 1) {
|
|
25706
|
+
const entry = entries[i];
|
|
25707
|
+
if (entry?.type !== "custom" || entry.customType !== NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY) continue;
|
|
25708
|
+
const data = entry.data;
|
|
25709
|
+
if (!isRecord9(data) || typeof data.message !== "string" || data.message.trim() === "") return void 0;
|
|
25710
|
+
return data.message;
|
|
25711
|
+
}
|
|
25712
|
+
return void 0;
|
|
25713
|
+
}
|
|
25696
25714
|
function extractNavigatorFact(entries) {
|
|
25715
|
+
const fact = extractNavigatorAttendanceFact(entries);
|
|
25716
|
+
if (fact.advisoryDiagnostic !== void 0) return fact;
|
|
25717
|
+
const message = routePlaybookFailureMessage(entries);
|
|
25718
|
+
return message === void 0 ? fact : { ...fact, advisoryDiagnostic: message };
|
|
25719
|
+
}
|
|
25720
|
+
function extractNavigatorAttendanceFact(entries) {
|
|
25697
25721
|
const terminal = findLatestDurablePackagedRoleTerminal(entries);
|
|
25698
25722
|
if (terminal === void 0) {
|
|
25699
25723
|
return {
|
|
@@ -28704,7 +28728,7 @@ async function runCountersignCourtDiaristStation(admitted, env, io, afterTicketN
|
|
|
28704
28728
|
for (const ticketNumber of refreshTickets.slice(completedIndex + 1)) {
|
|
28705
28729
|
const outcome = await invokeCourtDiarist(
|
|
28706
28730
|
{
|
|
28707
|
-
instruction:
|
|
28731
|
+
instruction: admitted.instruction,
|
|
28708
28732
|
projectRoot: admitted.projectRoot,
|
|
28709
28733
|
failureLabel: `ticket #${ticketNumber}`,
|
|
28710
28734
|
correlationId: admitted.runId,
|
|
@@ -28,7 +28,7 @@ import { DOCTOR_CANDIDATE_ENTRY_TYPE } from "../dossier-resolution.js";
|
|
|
28
28
|
import { REVIEWER_OUTPUT_TOOL_NAME, } from "../package-contracts/reviewer-output.js";
|
|
29
29
|
import { packagedAuditToolName, packagedDurableOfficerEntry, packagedProjectsTargetBindRejection, packagedRoleAcceptedOutputTool, packagedRoleMetadata, packagedSkipsGateOnInfrastructureStage, } from "../packaged-role-registry.js";
|
|
30
30
|
import { SECRETARIAT_COUNTERSIGN_TERMINAL_FACT_KEY, SECRETARIAT_GATE_OFFICER_ENTRY_TYPE, } from "../secretariat-contracts.js";
|
|
31
|
-
import { classifyPackagedRoleTerminalResult, findLatestDurablePackagedRoleTerminal, hasNavigatorInfrastructureFailureBase, isAcceptedPackagedRoleTerminalResult, isReceiptSettlementBindingClear, NAVIGATOR_INVOCATION_ENTRY, parseInvocationMarkerIdentity, } from "../navigator-invocation-identity.js";
|
|
31
|
+
import { classifyPackagedRoleTerminalResult, findLatestDurablePackagedRoleTerminal, hasNavigatorInfrastructureFailureBase, isAcceptedPackagedRoleTerminalResult, isReceiptSettlementBindingClear, NAVIGATOR_INVOCATION_ENTRY, NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY, parseInvocationMarkerIdentity, } from "../navigator-invocation-identity.js";
|
|
32
32
|
import { NO_RECEIPT_LIFECYCLE_ENTRY_TYPE, RECEIPT_DELIVERY_TURN_LIMIT, noReceiptLifecycleFacts, parseNoReceiptLifecycleFacts, } from "../receipt-delivery-policy.js";
|
|
33
33
|
import { roleRunArtifactsDirectory } from "../role-run-placement.js";
|
|
34
34
|
import { listSeamOwnedUniqueErrorFacePaths, RUN_TERMINAL_ARTIFACT_FILES, RUN_TERMINAL_ERROR_FALLBACK_RELATIVE_PATHS, } from "../run-terminal-artifacts.js";
|
|
@@ -1610,7 +1610,26 @@ async function withOptionalGateProjection(base, sessionDirectory, gateContext =
|
|
|
1610
1610
|
}
|
|
1611
1611
|
return attachEngineDetourToolUsage(next, sessionDirectory, gateContext);
|
|
1612
1612
|
}
|
|
1613
|
+
function routePlaybookFailureMessage(entries) {
|
|
1614
|
+
for (let i = entries.length - 1; i >= 0; i -= 1) {
|
|
1615
|
+
const entry = entries[i];
|
|
1616
|
+
if (entry?.type !== "custom" || entry.customType !== NAVIGATOR_ROUTE_PLAYBOOK_FAILURE_ENTRY)
|
|
1617
|
+
continue;
|
|
1618
|
+
const data = entry.data;
|
|
1619
|
+
if (!isRecord(data) || typeof data.message !== "string" || data.message.trim() === "")
|
|
1620
|
+
return undefined;
|
|
1621
|
+
return data.message;
|
|
1622
|
+
}
|
|
1623
|
+
return undefined;
|
|
1624
|
+
}
|
|
1613
1625
|
export function extractNavigatorFact(entries) {
|
|
1626
|
+
const fact = extractNavigatorAttendanceFact(entries);
|
|
1627
|
+
if (fact.advisoryDiagnostic !== undefined)
|
|
1628
|
+
return fact;
|
|
1629
|
+
const message = routePlaybookFailureMessage(entries);
|
|
1630
|
+
return message === undefined ? fact : { ...fact, advisoryDiagnostic: message };
|
|
1631
|
+
}
|
|
1632
|
+
function extractNavigatorAttendanceFact(entries) {
|
|
1614
1633
|
// Affirmative attendance only. Missing / uncorrelated / unparseable is never no-advice.
|
|
1615
1634
|
// Minimal provenance: latest durable terminal + nearest preceding marker +
|
|
1616
1635
|
// invocationId + post-terminal order. Marker↔terminal cardinality belongs to
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const RECEIPT_DELIVERY_TURN_LIMIT = 2;
|
|
2
|
-
const RECEIPT_DELIVERY_PROMPT = "\u672C\u4F1A\u8BDD\u5C1A\u65E0\u5DF2\u63A5\u53D7\u7684 typed \u56DE\u6267\u3002";
|
|
3
2
|
const NO_RECEIPT_LIFECYCLE_ENTRY_TYPE = "ak-no-receipt-lifecycle";
|
|
4
3
|
function isRecord(value) {
|
|
5
4
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -74,6 +73,15 @@ function createReceiptDeliveryPolicy() {
|
|
|
74
73
|
if (accepted) return "accepted";
|
|
75
74
|
return deliveryTurns < RECEIPT_DELIVERY_TURN_LIMIT ? "request-delivery" : "no-receipt";
|
|
76
75
|
},
|
|
76
|
+
/** Current typed delivery facts. No prose. */
|
|
77
|
+
deliveryState() {
|
|
78
|
+
return {
|
|
79
|
+
terminalToolCalled,
|
|
80
|
+
rejectedReceipts: rejectedReceipts.map((item) => ({ ...item })),
|
|
81
|
+
deliveryTurns,
|
|
82
|
+
acceptedReceipt: false
|
|
83
|
+
};
|
|
84
|
+
},
|
|
77
85
|
facts(binding) {
|
|
78
86
|
return noReceiptLifecycleFacts({ terminalToolCalled, rejectedReceipts: [...rejectedReceipts], deliveryTurns, ...binding });
|
|
79
87
|
}
|
|
@@ -81,7 +89,6 @@ function createReceiptDeliveryPolicy() {
|
|
|
81
89
|
}
|
|
82
90
|
export {
|
|
83
91
|
NO_RECEIPT_LIFECYCLE_ENTRY_TYPE,
|
|
84
|
-
RECEIPT_DELIVERY_PROMPT,
|
|
85
92
|
RECEIPT_DELIVERY_TURN_LIMIT,
|
|
86
93
|
createReceiptDeliveryPolicy,
|
|
87
94
|
noReceiptLifecycleFacts,
|
|
@@ -8,8 +8,8 @@ export const REVIEW_QUEUE_STATUSES = new Set(REVIEW_QUEUE_WORDS);
|
|
|
8
8
|
/**
|
|
9
9
|
* One object root. Codex structured output rejects a root anyOf, and status
|
|
10
10
|
* stays a required three-state enum with no omitted-status failure branch.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* External-dependency failure while the seat can still submit:
|
|
12
|
+
* docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md
|
|
13
13
|
*/
|
|
14
14
|
export const reviewSubmissionSchema = withTerminatingOutputDeclarations(Type.Object({
|
|
15
15
|
status: Type.Union([
|
|
@@ -17,7 +17,7 @@ export const reviewSubmissionSchema = withTerminatingOutputDeclarations(Type.Obj
|
|
|
17
17
|
Type.Literal(REVIEW_QUEUE_WORDS[1]),
|
|
18
18
|
Type.Literal(REVIEW_QUEUE_WORDS[2]),
|
|
19
19
|
], {
|
|
20
|
-
description: "
|
|
20
|
+
description: "审核席本轮裁决的判别状态。",
|
|
21
21
|
}),
|
|
22
22
|
findings: Type.Optional(Type.Unknown({ description: "审核发现,原样留存" })),
|
|
23
23
|
reason: Type.Optional(Type.Unknown({ description: "上呈理由" })),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 交卷 schema 不把格式当拒收权
|
|
2
|
+
|
|
3
|
+
Status: accepted
|
|
4
|
+
|
|
5
|
+
交卷工具 schema 保留字段声明与 description;非审核席维持零 required(含记账位)、顶层开放额外属性的原决定。审核席的判别字段 status 则为三态枚举且必填,没有省略 status 的失败例外。审核席仍能交卷、而完成审核所需的外部依赖发生真实基础设施失败时,status 取上呈值,失败细节写入既有 infrastructureFailure;这不是放行或封驳。执行或宿主已失败、审核席无法交卷时,仍由宿主如实失败终局。
|
|
6
|
+
|
|
7
|
+
包侧收卷:审核席除判别字段外,其余字段不必填、不限制,允许额外属性;声明不是包侧校验授权,包不因格式拒收或判死;判别字段没填或读不出时只说读不出并附收到的值,不在重交提示里另写一套状态名。key 名字不必逐字相同,合不合格由审刑院按是否读得懂来判。
|
|
8
|
+
|
|
9
|
+
宿主生成端:使用宿主原生能力;Codex strict 结构化输出要求根节点为 object、对象关闭额外属性,不能以该出口承诺模型可生成未声明字段。此项宿主缺口如实报告,不另造适配层或出口;生成端的限制不变成包侧拒收权。(#1055。三态枚举必填并撤销无 status 例外:源卷 e4b50c8e-15c7-4c92-9263-959efadb24eb.jsonl,owner uuid ddff7ae0-0b1e-44eb-b80c-96d2a3d3d239、0ddc3a4e-9a53-4565-b1cc-7ba3471d11e5、1707c6ec-ac17-4876-97d1-73b57c734259。根节点须为 object:[Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs))
|
|
@@ -14,14 +14,12 @@ import type { Message } from "@earendil-works/pi-ai";
|
|
|
14
14
|
import {
|
|
15
15
|
registerNavigatorModelCommand,
|
|
16
16
|
resolveNavigatorAuthorityMaterial,
|
|
17
|
-
type NavigatorTargetRole,
|
|
18
17
|
} from "../src/navigator-attendance.ts";
|
|
19
18
|
import { loadNavigatorWorkContext as loadHostNeutralNavigatorWorkContext } from "../src/navigator-work-context.ts";
|
|
20
19
|
export { resolveNavigatorAuthorityMaterial };
|
|
21
20
|
import { JUDGE_OUTPUT_TOOL_NAME } from "../src/package-contracts/judge-output.ts";
|
|
22
21
|
import { readOAuthKeepaliveProviders } from "../src/oauth-keepalive.ts";
|
|
23
22
|
import {
|
|
24
|
-
formatNavigatorRoleHelp,
|
|
25
23
|
type RoleRuntimeDependencies,
|
|
26
24
|
} from "../src/role-runtime.ts";
|
|
27
25
|
import { createRoleRuntimeDependencies } from "../src/role-runtime-dependencies.ts";
|
|
@@ -31,31 +29,6 @@ if (process.env.AK_ROLE_PACKAGE_ROOT === undefined || process.env.AK_ROLE_PACKAG
|
|
|
31
29
|
process.env.AK_ROLE_PACKAGE_ROOT = packageRoot;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
// Cold `pi -e <extension> --help` must cover installed-package process startup under CI load.
|
|
35
|
-
// This bound is process-startup budget only — not settlement-to-visible presentation latency.
|
|
36
|
-
export const NAVIGATOR_LIVE_HELP_TIMEOUT_MS = 30_000;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Subprocess live help (disk-reread via fresh pi -e). Kept for cold-install proofs.
|
|
40
|
-
* Production Navigator prepare must not call this on the post-role grace path — under
|
|
41
|
-
* concurrent CI load each role's pi --help alone can exceed the accepted 3s grace.
|
|
42
|
-
*/
|
|
43
|
-
export async function loadNavigatorRoleHelp(
|
|
44
|
-
pi: Pick<ExtensionAPI, "exec">,
|
|
45
|
-
extensionPath: string,
|
|
46
|
-
cwd: string,
|
|
47
|
-
role: NavigatorTargetRole,
|
|
48
|
-
): Promise<string> {
|
|
49
|
-
const result = await pi.exec("pi", ["--no-extensions", "--no-skills", "--no-prompt-templates", "--no-themes", "--no-context-files", "-e", extensionPath, "--ak-role", role, "--help"], { cwd, timeout: NAVIGATOR_LIVE_HELP_TIMEOUT_MS });
|
|
50
|
-
if (result.killed) {
|
|
51
|
-
throw new Error(`live help unavailable for ${role}: process did not settle`, { cause: result });
|
|
52
|
-
}
|
|
53
|
-
if (result.code !== 0) throw new Error(`live help unavailable for ${role}: process exited with code ${result.code}`, { cause: result });
|
|
54
|
-
return result.stdout || result.stderr;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { formatNavigatorRoleHelp as formatInProcessNavigatorRoleHelp };
|
|
58
|
-
|
|
59
32
|
function projectJudgeTranscriptForAudit(messages: Message[]): Message[] {
|
|
60
33
|
return messages.map((message) => {
|
|
61
34
|
if (message.role !== "assistant") return message;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akagilnc/pi-workflow-roles",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5096",
|
|
4
4
|
"description": "Soul-bound workflow roles for Pi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"schemas",
|
|
37
37
|
"packets",
|
|
38
38
|
"resources",
|
|
39
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md",
|
|
39
40
|
"README.md",
|
|
40
41
|
"LICENSE",
|
|
41
42
|
"THIRD_PARTY_NOTICES.md",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
| `run-lifecycle.ts` A4.1 | `[ak-role:resume-continue]` | 生产码不再含此字面量。结算只跳过空轮与引擎指针续跑。 |
|
|
14
14
|
| `run-lifecycle.ts` A4.2 | `重新读 <path>` | 前轮已删改写。 |
|
|
15
15
|
| `submission-correctable-error.ts` A4.5 | `终局交卷并非本轮唯一工具调用。` | 删。Pi/ACP `deliverSubmissionRejection` 不再注入该句。 |
|
|
16
|
-
| `role-runtime.ts` 催交 | `本会话尚无已接受的 typed 回执。` |
|
|
17
|
-
| `navigator-attendance.ts` early prepare 开场 | `父衙门进行中。请在本宿主会话熟悉下列材料并待命;结算结果送达后,再给出下一步建议。本轮不要提交最终路线建议。` | #959 迁入 `resources/navigator-route-playbook.md
|
|
18
|
-
| `navigator-attendance.ts` settlement feed 开场 | `父衙门结算已送达。请根据下列材料给出下一步建议。` | #959
|
|
16
|
+
| `role-runtime.ts` 催交 | `本会话尚无已接受的 typed 回执。` | #1021 改为递当前 typed delivery 事实,不写催交句。 |
|
|
17
|
+
| `navigator-attendance.ts` early prepare 开场 | `父衙门进行中。请在本宿主会话熟悉下列材料并待命;结算结果送达后,再给出下一步建议。本轮不要提交最终路线建议。` | #959 迁入 `resources/navigator-route-playbook.md`「到场阶段」。#1021 删掉代码指针句「本轮为待命轮。」:待命不调模型,只记到场。 |
|
|
18
|
+
| `navigator-attendance.ts` settlement feed 开场 | `父衙门结算已送达。请根据下列材料给出下一步建议。` | #959 迁入同手册。#1021 删掉代码指针句「本轮为结算投喂轮。」:结算轮只递当前 typed 三态及指针。 |
|
|
19
19
|
|
|
20
20
|
催交句与 2.1–2.3 打回文、重问三句不在删除列。
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
- 官方:https://prod.cursor.com/help/ai-features/bugbot 与 automations 文档
|
|
28
28
|
- 内置 Bugbot 与同账号自定义任务须区分;某任务额度耗尽不推断其他任务失效
|
|
29
29
|
|
|
30
|
+
## 工序
|
|
31
|
+
|
|
32
|
+
判定任务材料后绑定本仓唯一 PR(prNumber,或由 issueNumber 解析到唯一 PR)。已有显式 PR 绑定时不必再绑。多义或无法确定时不猜,交给调用方明确目标。未绑定前不观察。观察把证据存成不可变快照;上下文里的正文只到头部,其余按 evidenceId 开卷。请求发在所引最新快照 HEAD 上;清单外的 requestId 要带上正文。交卷交 findings 指针,不把模板通知当成 finding;没有 finding 就不要编一条。未完成写现场原因,不写成没问题。
|
|
33
|
+
|
|
30
34
|
## 修正规则
|
|
31
35
|
|
|
32
36
|
- 优先引用官方文档;现场差异记入仓库差异条并附 PR/证据指针
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
## 到场阶段(#959 / ADR 0073)
|
|
1
|
+
## 到场阶段(#959 / ADR 0073 / #1021)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
阶段行为说明住本手册。代码不写阶段句,也不把本手册再拼进用户消息。
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
Early 待命轮的输出由执行机制丢弃;最终路线建议只在结算投喂轮给出。
|
|
5
|
+
- **待命**:父衙门进行中时,代码只记到场,不调用模型。这一轮没有输出。
|
|
6
|
+
- **结算**:父衙门结算送达后,用户消息只有该次 typed 三态及指针。Soul 与本手册已在系统提示里。根据这份结算和本手册给出下一步建议。
|
|
9
7
|
|
|
10
8
|
## 宿主轴(与角色命令面)
|
|
11
9
|
|
|
@@ -15,6 +15,10 @@ const entries = [
|
|
|
15
15
|
// (#590: published non-bundle graph must stay closed under its own relative edges).
|
|
16
16
|
"navigator-public-session",
|
|
17
17
|
"navigator-session-contracts",
|
|
18
|
+
// Static import of navigator-attendance and navigator-public-session.
|
|
19
|
+
"navigator-work-base",
|
|
20
|
+
// Static import of navigator-work-base.
|
|
21
|
+
"atomic-write",
|
|
18
22
|
"public-role-summons",
|
|
19
23
|
"pi/in-process-session",
|
|
20
24
|
"activation-ledger-git",
|
package/src/auditor-soul.ts
CHANGED
|
@@ -46,8 +46,9 @@ export const AUDITOR_SESSION_MATERIALS = {
|
|
|
46
46
|
"souls/judge-auditor.md",
|
|
47
47
|
"souls/audit-law.md",
|
|
48
48
|
"souls/quality-law.md",
|
|
49
|
+
"docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md",
|
|
49
50
|
],
|
|
50
|
-
doctor: ["CLAUDE.md", "souls/doctor-auditor.md"],
|
|
51
|
+
doctor: ["CLAUDE.md", "souls/doctor-auditor.md", "docs/adr/0057-schema-narrowing-cuts-the-required-set-not-the-declared-set.md"],
|
|
51
52
|
} as const satisfies Record<
|
|
52
53
|
AuditorSoulRole,
|
|
53
54
|
readonly [string, string, ...(readonly string[])]
|