@akagilnc/pi-workflow-roles 0.1.3572 → 0.1.3621
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 +20239 -10556
- package/dist/analyst-gate-cycles-read.js +387 -0
- package/dist/archivist-record-entry.js +22 -1
- package/dist/audit-escalation.js +6 -0
- package/dist/auditor-soul.js +74 -0
- package/dist/collector-config.js +86 -0
- package/dist/collector-evidence.js +316 -0
- package/dist/collector-github.js +527 -0
- package/dist/collector-ledger.js +853 -0
- package/dist/collector-tool-schemas.js +33 -0
- package/dist/compliance-transport.js +104 -52
- package/dist/diarist-mechanical.js +411 -0
- package/dist/diarist-ticket-resolution.js +177 -0
- package/dist/diarist.js +311 -0
- package/dist/doctor-auditor.js +25 -0
- package/dist/doctor-contracts.js +2 -0
- package/dist/doctor-evidence.js +142 -0
- package/dist/gatekeeper-role.js +104 -81
- package/dist/host-transition-prior-native.js +78 -0
- package/dist/institutional-resolution.js +1 -95
- package/dist/judge-auditor.js +26 -0
- package/dist/ledger-session-read.js +227 -0
- package/dist/merger-git-state.js +78 -0
- package/dist/navigator-attendance.js +15 -7
- package/dist/navigator-public-session.js +170 -0
- package/dist/navigator-session-contracts.js +36 -40
- package/dist/notary-source-run.js +122 -0
- package/dist/package-contracts/auditor-output.js +66 -0
- package/dist/package-contracts/evidence-child-output.js +34 -0
- package/dist/package-contracts/judge-output.js +2 -0
- package/dist/package-contracts/terminating-tools.js +25 -2
- package/dist/package-resources/method-skill.js +254 -0
- package/dist/packaged-role-registry.js +36 -0
- package/dist/pi/durable-principal.js +61 -0
- package/dist/pi/in-process-session.js +25 -6
- package/dist/pi/known-failure.js +52 -0
- package/dist/pi/role-turn-host.js +430 -0
- package/dist/public-cli/auto-resume.js +414 -0
- package/dist/public-cli/cli-errors.js +8 -0
- package/dist/public-cli/cli-io.js +1 -0
- package/dist/public-cli/command-renderer.js +5 -0
- package/dist/public-cli/doctor-run.js +84 -0
- package/dist/public-cli/inspector-run.js +136 -0
- package/dist/public-cli/instruction-seat-run.js +256 -0
- package/dist/public-cli/invocation.js +2225 -0
- package/dist/public-cli/judge-run.js +118 -0
- package/dist/public-cli/load-production-acp-host.js +40 -0
- package/dist/public-cli/main.js +1140 -652
- package/dist/public-cli/notary-run.js +161 -0
- package/dist/public-cli/option-definitions.js +1192 -0
- package/dist/public-cli/post-admission.js +667 -0
- package/dist/public-cli/public-run-credentials.js +49 -0
- package/dist/public-cli/registry.js +4 -1
- package/dist/public-cli/reviewer-dispatch-rejection.js +77 -0
- package/dist/public-cli/run-lifecycle.js +1344 -0
- package/dist/public-cli/seat-ticket-binding.js +113 -0
- package/dist/public-cli/settlement.js +3441 -0
- package/dist/public-cli/terminal.js +135 -0
- package/dist/public-cli/turn-request.js +25 -0
- package/dist/public-role-summons.js +301 -0
- package/dist/receipt-delivery-policy.js +10 -0
- package/dist/reviewer-child-executor.js +80 -8
- package/dist/reviewer-execution-ledger.js +2 -1
- package/dist/run-terminal-artifacts.js +195 -0
- package/dist/run-ticket-number.js +40 -0
- package/dist/session-assistant-usage.js +107 -0
- package/dist/shape-unreadable-failure.js +34 -0
- package/dist/submission-errors.js +3 -0
- package/dist/submission-ledger.js +388 -0
- package/dist/ticket-provenance-contracts.js +115 -0
- package/dist/ticket-provenance.js +340 -0
- package/extensions/role-runtime.ts +7 -0
- package/package.json +1 -1
- package/scripts/build-package.mjs +2 -1
- package/souls/doctor-auditor.md +1 -0
- package/souls/evidence-child.md +1 -0
- package/src/acp-host/production-host.ts +3 -0
- package/src/acp-host/role-envelope.ts +2 -2
- package/src/acp-host/role-turn-host.ts +9 -1
- package/src/analyst-gate-cycles-read.ts +37 -2
- package/src/archivist-record-entry.ts +45 -1
- package/src/audit-escalation.ts +17 -0
- package/src/auditor-role.ts +22 -0
- package/src/auditor-soul.ts +42 -0
- package/src/compliance-transport.ts +177 -66
- package/src/doctor-auditor.ts +10 -14
- package/src/doctor-contracts.ts +1 -0
- package/src/doctor-role.ts +2 -2
- package/src/evidence-child-role.ts +22 -0
- package/src/gatekeeper-pass-envelope.ts +109 -0
- package/src/gatekeeper-role.ts +145 -104
- package/src/host-contracts.ts +9 -1
- package/src/institutional-resolution.ts +8 -163
- package/src/judge-auditor.ts +10 -15
- package/src/judge-role.ts +8 -0
- package/src/navigator-attendance.ts +25 -9
- package/src/navigator-public-session.ts +217 -0
- package/src/navigator-session-contracts.ts +61 -54
- package/src/notary-source-run.ts +3 -1
- package/src/package-contracts/auditor-output.ts +82 -0
- package/src/package-contracts/evidence-child-output.ts +51 -0
- package/src/package-contracts/judge-output.ts +1 -0
- package/src/package-contracts/reviewer-output.ts +2 -2
- package/src/package-contracts/terminating-tools.ts +31 -1
- package/src/packaged-role-registry.ts +43 -0
- package/src/pi/adapter.ts +2 -1
- package/src/pi/in-process-session.ts +38 -12
- package/src/pi/role-turn-host.ts +34 -0
- package/src/public-cli/cli.ts +14 -6
- package/src/public-cli/instruction-seat-run.ts +289 -50
- package/src/public-cli/invocation.ts +66 -25
- package/src/public-cli/option-definitions.ts +61 -0
- package/src/public-cli/post-admission.ts +7 -1
- package/src/public-cli/registry.ts +4 -1
- package/src/public-cli/run-lifecycle.ts +22 -3
- package/src/public-cli/settlement.ts +120 -5
- package/src/public-cli/terminal.ts +2 -0
- package/src/public-role-summons.ts +431 -0
- package/src/receipt-delivery-policy.ts +10 -0
- package/src/reviewer-agent.ts +1 -1
- package/src/reviewer-child-executor.ts +114 -12
- package/src/reviewer-execution-ledger.ts +3 -2
- package/src/role-runtime.ts +158 -17
- package/src/session-assistant-usage.ts +119 -0
- package/src/session-opening-materials.ts +1 -1
- package/src/shape-unreadable-failure.ts +49 -0
- package/src/submission-errors.ts +3 -0
- package/dist/evidence-child-executor.js +0 -829
- package/src/evidence-child-executor.ts +0 -1140
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared LLM ticket binding for public court seats (#635).
|
|
3
|
+
* One path: unbound admission → diarist instruction assertion → bindAdmittedTicketNumber.
|
|
4
|
+
* No CLI --ticket and no attachment frontmatter binding.
|
|
5
|
+
* #637: same-ticket prior-run lookup → resume decision also lives here (shared seam).
|
|
6
|
+
*/
|
|
7
|
+
import { resolveBookKeyFromGit } from "../activation-ledger-git.js";
|
|
8
|
+
import { createGhTicketExistenceChecker, createHermesDiaristTicketResolver, DiaristTicketResolutionError, resolveDiaristTicketFromInstruction, } from "../diarist-ticket-resolution.js";
|
|
9
|
+
import { resolveDiaristGithubOrigin } from "../diarist.js";
|
|
10
|
+
import { bindAdmittedTicketNumber, recordTrueUnboundTicketResolution, } from "./invocation.js";
|
|
11
|
+
import { findLatestRunIdForSeatTicket, } from "./run-lifecycle.js";
|
|
12
|
+
/**
|
|
13
|
+
* Instruction → ticket resolution without admission (#635 / #637).
|
|
14
|
+
* Used to locate a prior same-ticket run before minting a new one.
|
|
15
|
+
* Throws on resolution failure — prefer probeInstructionTicket at seat entry.
|
|
16
|
+
*/
|
|
17
|
+
export async function resolveInstructionTicket(instruction, projectRoot, env = {}) {
|
|
18
|
+
const resolver = createHermesDiaristTicketResolver({
|
|
19
|
+
...(env.packageRoot === undefined ? {} : { packageRoot: env.packageRoot }),
|
|
20
|
+
cwd: projectRoot,
|
|
21
|
+
});
|
|
22
|
+
const checkExistence = createGhTicketExistenceChecker();
|
|
23
|
+
const origin = resolveDiaristGithubOrigin(projectRoot);
|
|
24
|
+
return resolveDiaristTicketFromInstruction({
|
|
25
|
+
instruction,
|
|
26
|
+
origin,
|
|
27
|
+
resolver,
|
|
28
|
+
checkExistence,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Pre-admit probe: resolution success or captured DiaristTicketResolutionError.
|
|
33
|
+
* Other errors still propagate (launch/infrastructure outside this class).
|
|
34
|
+
*/
|
|
35
|
+
export async function probeInstructionTicket(instruction, projectRoot, env = {}) {
|
|
36
|
+
try {
|
|
37
|
+
const resolution = await resolveInstructionTicket(instruction, projectRoot, env);
|
|
38
|
+
return { kind: "resolved", resolution };
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (error instanceof DiaristTicketResolutionError) {
|
|
42
|
+
return { kind: "failed", error };
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/** Ticket number from a successful ticket probe; undefined for unbound/failed. */
|
|
48
|
+
export function ticketNumberFromProbe(probe) {
|
|
49
|
+
if (probe.kind !== "resolved")
|
|
50
|
+
return undefined;
|
|
51
|
+
if (probe.resolution.kind !== "ticket")
|
|
52
|
+
return undefined;
|
|
53
|
+
return probe.resolution.ticketNumber;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Sole disposition of a resolved ticket onto an unbound admission (#635 / #637).
|
|
57
|
+
* Countersign / inspector / resolveSeatTicketBinding share this — no parallel branches.
|
|
58
|
+
*/
|
|
59
|
+
export async function applyTicketResolution(admitted, resolution) {
|
|
60
|
+
if (resolution.kind === "ticket") {
|
|
61
|
+
await bindAdmittedTicketNumber(admitted, resolution.ticketNumber);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
await recordTrueUnboundTicketResolution(admitted);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Apply a pre-admit probe onto an unbound admission.
|
|
69
|
+
* Failed probes rethrow — caller must be inside the controlled-failure boundary
|
|
70
|
+
* (post-admission beforeDispatch), never before admit/markRunning.
|
|
71
|
+
*/
|
|
72
|
+
export async function applyInstructionTicketProbe(admitted, probe) {
|
|
73
|
+
if (probe.kind === "failed")
|
|
74
|
+
throw probe.error;
|
|
75
|
+
await applyTicketResolution(admitted, probe.resolution);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Bind ticketNumber onto an unbound admitted seat via LLM instruction recognition.
|
|
79
|
+
* Already-settled admissions (ticketNumber or durable true-unbound) short-circuit —
|
|
80
|
+
* no re-entry into hermes on auto-resume attempts or manual resume (#635).
|
|
81
|
+
* true-unbound is persisted once; failed verification throws.
|
|
82
|
+
*/
|
|
83
|
+
export async function resolveSeatTicketBinding(admitted, env = {}) {
|
|
84
|
+
if (admitted.ticketNumber !== undefined)
|
|
85
|
+
return undefined;
|
|
86
|
+
if (admitted.ticketResolution === "true-unbound") {
|
|
87
|
+
return { kind: "true-unbound" };
|
|
88
|
+
}
|
|
89
|
+
const resolution = await resolveInstructionTicket(admitted.instruction, admitted.projectRoot, env);
|
|
90
|
+
await applyTicketResolution(admitted, resolution);
|
|
91
|
+
return resolution;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Sole same-ticket → resume decision (#637 / #724).
|
|
95
|
+
* Looks up the latest retained run for seat+ticket; when found, runs resume with
|
|
96
|
+
* this summons' materials. Lookup/resume failures propagate (失败诚实) — never
|
|
97
|
+
* wash into a fresh mint. Returns undefined when the caller declared an explicit
|
|
98
|
+
* fresh summons (`ak-role new`) or when no prior run exists; both mint new.
|
|
99
|
+
* freshSummons is required so no seat can drift back into its own skip branch.
|
|
100
|
+
*/
|
|
101
|
+
export async function tryResumeSameTicketSeatRun(input) {
|
|
102
|
+
if (input.freshSummons === true)
|
|
103
|
+
return undefined;
|
|
104
|
+
const previousRunId = await findLatestRunIdForSeatTicket({
|
|
105
|
+
home: input.home,
|
|
106
|
+
bookKey: resolveBookKeyFromGit(input.projectRoot),
|
|
107
|
+
role: input.role,
|
|
108
|
+
ticketNumber: input.ticketNumber,
|
|
109
|
+
});
|
|
110
|
+
if (previousRunId === undefined)
|
|
111
|
+
return undefined;
|
|
112
|
+
return await input.resume(previousRunId, input.summons);
|
|
113
|
+
}
|