@akagilnc/pi-workflow-roles 0.1.3932 → 0.1.3975
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/CLAUDE.md +1 -1
- package/dist/acp-host/production-host.js +2389 -6018
- package/dist/analyst-gate-cycles-read.js +15 -19
- package/dist/audit-escalation.js +16 -46
- package/dist/auditor-dossier-tool.js +7 -62
- package/dist/collector-identity.js +0 -157
- package/dist/collector-ledger.js +2 -42
- package/dist/compliance-transport.js +40 -14
- package/dist/diarist-contracts.js +2 -40
- package/dist/doctor-contracts.js +39 -108
- package/dist/doctor-evidence.js +1 -5
- package/dist/engine-detour-tool.js +1 -1
- package/dist/gatekeeper-role.js +49 -38
- package/dist/headless-host/production-host.js +4814 -8450
- package/dist/host-contracts.js +0 -5
- package/dist/merger-contracts.js +4 -6
- package/dist/navigator-attendance.js +30 -52
- package/dist/navigator-invocation-identity.js +0 -1
- package/dist/navigator-public-session.js +2 -1
- package/dist/notary-contracts.js +4 -10
- package/dist/package-contracts/auditor-output.js +5 -23
- package/dist/package-contracts/fixer-output.js +25 -49
- package/dist/package-contracts/gatekeeper-output.js +3 -13
- package/dist/package-contracts/navigator-output.js +4 -7
- package/dist/package-contracts/reviewer-output.js +1 -95
- package/dist/package-contracts/terminating-tools.js +33 -144
- package/dist/package-contracts/worker-output.js +1 -3
- package/dist/public-cli/auto-resume.js +30 -68
- package/dist/public-cli/case-dossier-delivery.js +5 -17
- package/dist/public-cli/diarist-run.js +9 -4
- package/dist/public-cli/inspector-run.js +2 -8
- package/dist/public-cli/instruction-seat-run.js +3 -7
- package/dist/public-cli/invocation.js +5 -2
- package/dist/public-cli/main.js +6068 -6964
- package/dist/public-cli/notary-run.js +1 -8
- package/dist/public-cli/post-admission.js +314 -113
- package/dist/public-cli/run-lifecycle.js +14 -38
- package/dist/public-cli/settlement.js +209 -390
- package/dist/public-cli/terminal.js +51 -45
- package/dist/public-role-summons.js +1 -12
- package/dist/reviewer-dispatch.js +12 -258
- package/dist/submission-correctable-error.js +0 -12
- package/dist/submission-errors.js +6 -1
- package/dist/submission-ledger.js +125 -168
- package/dist/ticket-provenance-contracts.js +2 -49
- package/dist/ticket-provenance.js +82 -31
- package/extensions/role-runtime.ts +1 -6
- package/package.json +1 -1
- package/resources/836-deleted-machine-instruction-inventory.md +18 -0
- package/src/acp-host/role-turn-host.ts +8 -3
- package/src/analyst-gate-cycles-read.ts +17 -29
- package/src/audit-escalation.ts +20 -50
- package/src/auditor-dossier-tool.ts +5 -103
- package/src/canonical-skill-binding.ts +3 -2
- package/src/collector-identity.ts +0 -179
- package/src/collector-ledger.ts +3 -46
- package/src/collector-role.ts +32 -61
- package/src/collector-tool-schemas.ts +20 -14
- package/src/compliance-transport.ts +55 -17
- package/src/countersign-role.ts +17 -8
- package/src/diarist-contracts.ts +3 -36
- package/src/diarist-role.ts +13 -7
- package/src/diarist.ts +4 -16
- package/src/doctor-contracts.ts +73 -94
- package/src/doctor-evidence.ts +1 -1
- package/src/doctor-role.ts +3 -3
- package/src/engine-detour-tool.ts +4 -1
- package/src/external-host-turn-loop.ts +9 -3
- package/src/gatekeeper-pass-envelope.ts +7 -12
- package/src/gatekeeper-role.ts +56 -50
- package/src/gleaner-left-role.ts +4 -2
- package/src/headless-host/role-turn-host.ts +4 -5
- package/src/host-contracts.ts +3 -8
- package/src/judge-role.ts +19 -13
- package/src/merger-contracts.ts +10 -6
- package/src/merger-role.ts +1 -5
- package/src/navigator-attendance.ts +37 -74
- package/src/navigator-invocation-identity.ts +0 -6
- package/src/navigator-public-session.ts +2 -1
- package/src/notary-contracts.ts +7 -10
- package/src/package-contracts/auditor-output.ts +4 -21
- package/src/package-contracts/fixer-output.ts +34 -52
- package/src/package-contracts/gatekeeper-output.ts +5 -22
- package/src/package-contracts/navigator-output.ts +7 -7
- package/src/package-contracts/reviewer-output.ts +2 -150
- package/src/package-contracts/terminating-tools.ts +32 -147
- package/src/package-contracts/worker-output.ts +0 -1
- package/src/pi/adapter.ts +3 -8
- package/src/public-cli/auto-resume.ts +41 -94
- package/src/public-cli/case-dossier-delivery.ts +5 -15
- package/src/public-cli/countersign-run.ts +14 -6
- package/src/public-cli/diarist-run.ts +11 -9
- package/src/public-cli/inspector-run.ts +2 -18
- package/src/public-cli/instruction-seat-run.ts +3 -17
- package/src/public-cli/invocation.ts +5 -2
- package/src/public-cli/merger-run.ts +1 -1
- package/src/public-cli/notary-run.ts +1 -18
- package/src/public-cli/post-admission.ts +385 -115
- package/src/public-cli/run-lifecycle.ts +13 -44
- package/src/public-cli/settlement.ts +314 -562
- package/src/public-cli/terminal.ts +66 -72
- package/src/public-role-summons.ts +5 -30
- package/src/reviewer-dispatch.ts +29 -331
- package/src/reviewer-role.ts +16 -83
- package/src/role-envelope.ts +16 -24
- package/src/role-runtime-dependencies.ts +1 -6
- package/src/role-runtime.ts +65 -201
- package/src/submission-correctable-error.ts +0 -14
- package/src/submission-errors.ts +6 -1
- package/src/submission-ledger.ts +187 -187
- package/src/ticket-provenance-contracts.ts +4 -60
- package/src/ticket-provenance.ts +98 -32
- package/src/worker-role.ts +35 -36
- package/dist/activation-ledger-session.js +0 -105
- package/dist/activation-ledger.js +0 -139
- package/dist/activation-trace.js +0 -33
- package/dist/atomic-write.js +0 -23
- package/dist/auditor-role.js +0 -12
- package/dist/canonical-skill-binding.js +0 -61
- package/dist/collector-handbook.js +0 -142
- package/dist/collector-receipt.js +0 -107
- package/dist/collector-role.js +0 -566
- package/dist/collector-tool-schemas.js +0 -107
- package/dist/countersign-role.js +0 -28
- package/dist/diarist-role.js +0 -44
- package/dist/diarist.js +0 -66
- package/dist/doctor-role.js +0 -75
- package/dist/fixer-bash-seatbelt.js +0 -13
- package/dist/gatekeeper-pass-envelope.js +0 -77
- package/dist/gleaner-left-role.js +0 -26
- package/dist/inspector-role.js +0 -29
- package/dist/judge-role.js +0 -104
- package/dist/merger-role.js +0 -55
- package/dist/navigator-role.js +0 -12
- package/dist/notary-role.js +0 -134
- package/dist/oauth-keepalive.js +0 -158
- package/dist/pi/adapter.js +0 -223
- package/dist/reviewer-agent.js +0 -122
- package/dist/reviewer-child-executor.js +0 -194
- package/dist/reviewer-construction.js +0 -103
- package/dist/reviewer-execution-ledger.js +0 -166
- package/dist/reviewer-failure-diagnostic.js +0 -17
- package/dist/reviewer-role.js +0 -159
- package/dist/reviewer-scope-prompt.js +0 -21
- package/dist/reviewer-settlement.js +0 -66
- package/dist/reviewer-workspace.js +0 -132
- package/dist/role-runtime.js +0 -1604
- package/dist/stderr-jsonl.js +0 -26
- package/dist/tool-execution-observation.js +0 -141
- package/dist/worker-role.js +0 -345
- package/dist/worker-submission-gates.js +0 -305
- package/src/collector-receipt.ts +0 -140
- package/src/diagnostic-tail.ts +0 -18
- package/src/reviewer-agent.ts +0 -135
- package/src/reviewer-child-executor.ts +0 -252
- package/src/reviewer-construction.ts +0 -195
- package/src/reviewer-execution-ledger.ts +0 -212
- package/src/reviewer-failure-diagnostic.ts +0 -18
- package/src/reviewer-scope-prompt.ts +0 -24
- package/src/reviewer-settlement.ts +0 -74
- package/src/reviewer-workspace.ts +0 -105
- package/src/shape-unreadable-failure.ts +0 -49
|
@@ -26,46 +26,14 @@ export const V1_RESUMABLE_PROVIDERS = ["openai-codex", "xai"];
|
|
|
26
26
|
export const AUTO_RESUME_LIMIT = 2;
|
|
27
27
|
/** Package-owned turn trigger for resume. Not caller instruction and not semantic task content. */
|
|
28
28
|
export const RESUME_TRANSPORT_ENVELOPE = "[ak-role:resume-continue]";
|
|
29
|
-
function resumeRereadInstruction(materialPath, handbook) {
|
|
30
|
-
return handbook
|
|
31
|
-
? `重新读 ${materialPath},再组装外包 argv`
|
|
32
|
-
: `重新读 ${materialPath}`;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Engine-axis resume-only material lines (#736 / ADR 0069·0071).
|
|
36
|
-
* #755 withdrew this rewrite from 审核循环续话; review same-ticket resume stays
|
|
37
|
-
* plain dialogue via resumeTurnRequestProjectionOptions. Outsourcing resume
|
|
38
|
-
* still rewrites neutral handbook/path pointers into 重新读 instructions.
|
|
39
|
-
* First-round delivery is unchanged; never pastes material body.
|
|
40
|
-
*/
|
|
41
|
-
export function instructResumeHandbookRead(prompt, engineMaterial) {
|
|
42
|
-
const handbookPath = engineMaterial?.materialPath;
|
|
43
|
-
return prompt
|
|
44
|
-
.split("\n")
|
|
45
|
-
.map((line) => {
|
|
46
|
-
if (!line.startsWith("- "))
|
|
47
|
-
return line;
|
|
48
|
-
const value = line.slice(2);
|
|
49
|
-
if (handbookPath !== undefined && value === handbookPath) {
|
|
50
|
-
return resumeRereadInstruction(handbookPath, true);
|
|
51
|
-
}
|
|
52
|
-
if (isAbsolute(value))
|
|
53
|
-
return resumeRereadInstruction(value, false);
|
|
54
|
-
return line;
|
|
55
|
-
})
|
|
56
|
-
.join("\n");
|
|
57
|
-
}
|
|
58
29
|
/**
|
|
59
30
|
* Unique continuation-prompt selector for manual/auto engine-axis resume
|
|
60
|
-
* (#471 / #600 / #736).
|
|
61
|
-
*
|
|
62
|
-
* When engine material is present, append structured engine coordinates then
|
|
63
|
-
* rewrite absolute material pointer lines into 重新读 instructions. Zero parse,
|
|
64
|
-
* zero classify, zero narrow. Pointer only — never material body.
|
|
31
|
+
* (#471 / #600 / #736). Message present → those bytes; absent → engine pointers only.
|
|
32
|
+
* #836: no transport-token prompt, no line-by-line 重新读 rewrite.
|
|
65
33
|
*/
|
|
66
34
|
export function selectResumeContinuationPrompt(message, engineMaterial) {
|
|
67
|
-
const
|
|
68
|
-
return
|
|
35
|
+
const lines = message !== undefined ? [message] : [];
|
|
36
|
+
return appendEngineSessionMaterial(lines, engineMaterial).join("\n");
|
|
69
37
|
}
|
|
70
38
|
/**
|
|
71
39
|
* Resume continuation with engine material resolved from the seat env (#600).
|
|
@@ -167,8 +135,16 @@ async function readRoleRunStateDisk(runDirectory) {
|
|
|
167
135
|
try {
|
|
168
136
|
raw = JSON.parse(await readFile(join(runDirectory, RUN_STATE_FILE), "utf8"));
|
|
169
137
|
}
|
|
170
|
-
catch {
|
|
171
|
-
|
|
138
|
+
catch (error) {
|
|
139
|
+
// Only true absence (ENOENT) is a lawful "no run state yet". A real read
|
|
140
|
+
// failure (EISDIR, EACCES, ...) or a JSON.parse SyntaxError on a present
|
|
141
|
+
// file is genuine infrastructure/data damage and must keep its own
|
|
142
|
+
// identity — callers route it through the controlled-failure seam
|
|
143
|
+
// (markRunRunning/markRunResumable/markRunTerminal/recordCurrentCourt)
|
|
144
|
+
// instead of it being relabeled "run state missing" (#836).
|
|
145
|
+
if (errorCodeOf(error) === "ENOENT")
|
|
146
|
+
return undefined;
|
|
147
|
+
throw error;
|
|
172
148
|
}
|
|
173
149
|
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
174
150
|
return undefined;
|