@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,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared public-run credential seam: one owner for missing selected-provider
|
|
3
|
+
* detection, typed failure construction, pre-dispatch fail-closed payload, and
|
|
4
|
+
* post-run credential annotation. Role runners supply model/credential facts only.
|
|
5
|
+
*/
|
|
6
|
+
import { missingPublicProviderCredential, } from "./config.js";
|
|
7
|
+
/**
|
|
8
|
+
* Production-owned provider failure when the selected public seat provider has
|
|
9
|
+
* no configured credential. Cause/identity come from CredentialProviders, not
|
|
10
|
+
* stderr wording. Runner-supplied knownFailure still wins over this annotation.
|
|
11
|
+
*/
|
|
12
|
+
export function knownFailureForMissingProviderCredential(model, credentials) {
|
|
13
|
+
if (model === undefined || credentials === undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
// Only the public credential catalog is fail-closed here; offline/test providers
|
|
16
|
+
// are not represented in auth.json shape and must not be washed into MissingProviderCredential.
|
|
17
|
+
if (model.provider !== "openai-codex" && model.provider !== "xai")
|
|
18
|
+
return undefined;
|
|
19
|
+
if (!missingPublicProviderCredential(model.provider, credentials)) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
cause: "provider",
|
|
24
|
+
identity: {
|
|
25
|
+
name: "MissingProviderCredential",
|
|
26
|
+
code: model.provider,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function missingCredentialPreDispatchFailure(model, credentials) {
|
|
31
|
+
const knownFailure = knownFailureForMissingProviderCredential(model, credentials);
|
|
32
|
+
if (knownFailure === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
return {
|
|
35
|
+
timedOut: false,
|
|
36
|
+
code: 1,
|
|
37
|
+
stderr: `Missing credential for provider ${String(knownFailure.identity?.code ?? "unknown")}`,
|
|
38
|
+
knownFailure,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Post-run credential annotation for the shared evidence-priority chain.
|
|
43
|
+
* Only annotates nonzero/timeout exits; never invents a credential failure on success.
|
|
44
|
+
*/
|
|
45
|
+
export function postRunMissingCredentialFailure(result, model, credentials) {
|
|
46
|
+
if (!(result.timedOut || result.code !== 0))
|
|
47
|
+
return undefined;
|
|
48
|
+
return knownFailureForMissingProviderCredential(model, credentials);
|
|
49
|
+
}
|
|
@@ -59,13 +59,16 @@ const STARTUP_CANDIDATES = {
|
|
|
59
59
|
// #620: subordinate officers inherit gatekeeper; no package startup model.
|
|
60
60
|
notary: [],
|
|
61
61
|
// #453/#620/#639: gatekeeper callable but no package startup model — caller
|
|
62
|
-
// configures it or
|
|
62
|
+
// configures it or inherits on the province path.
|
|
63
63
|
gatekeeper: [],
|
|
64
64
|
inspector: [],
|
|
65
65
|
navigator: [
|
|
66
66
|
{ provider: "openai-codex", model: "gpt-5.6-luna", thinking: "medium" },
|
|
67
67
|
{ provider: "xai", model: "grok-4.5", thinking: "high" }
|
|
68
68
|
],
|
|
69
|
+
// #675: auditor / evidence-child public seats — no package startup; caller configures.
|
|
70
|
+
auditor: [],
|
|
71
|
+
"evidence-child": [],
|
|
69
72
|
// #708 `diarist-seat-default`: owner-set initial value; changed in the seat
|
|
70
73
|
// table like any other seat. No engine axis, package-default host.
|
|
71
74
|
diarist: [{ provider: "xai", model: "grok-4.5", thinking: "medium" }]
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable Reviewer-rejection child→parent page under AK_ROLE_RUN_DIR.
|
|
3
|
+
* Stays in public-cli (AK artifact owner); role-runtime imports this neighbor.
|
|
4
|
+
*/
|
|
5
|
+
import { writeFileSync } from "node:fs";
|
|
6
|
+
import { readFile, unlink } from "node:fs/promises";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { REVIEWER_PREFLIGHT_VIOLATIONS, } from "../reviewer-dispatch.js";
|
|
9
|
+
const REVIEWER_DISPATCH_REJECTION_FILE = "typed-known-failure.json";
|
|
10
|
+
function isReviewerPreflightViolation(value) {
|
|
11
|
+
return (typeof value === "string" &&
|
|
12
|
+
REVIEWER_PREFLIGHT_VIOLATIONS.includes(value));
|
|
13
|
+
}
|
|
14
|
+
function reviewerDispatchRejectionPath(runDirectory) {
|
|
15
|
+
return join(runDirectory, REVIEWER_DISPATCH_REJECTION_FILE);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Clear any prior attempt's Reviewer rejection page so resume/retry cannot
|
|
19
|
+
* inherit a stale knownFailure.details.
|
|
20
|
+
*/
|
|
21
|
+
export async function clearReviewerDispatchRejection(runDirectory) {
|
|
22
|
+
try {
|
|
23
|
+
await unlink(reviewerDispatchRejectionPath(runDirectory));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
if (error instanceof Error &&
|
|
27
|
+
"code" in error &&
|
|
28
|
+
error.code === "ENOENT") {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Synchronous durable write for Reviewer dispatch rejection (child process exit is sync).
|
|
36
|
+
* Parent public CLI recovers via readReviewerDispatchRejection into knownFailure.
|
|
37
|
+
*/
|
|
38
|
+
export function recordReviewerDispatchRejectionSync(runDirectory, rejection) {
|
|
39
|
+
writeFileSync(reviewerDispatchRejectionPath(runDirectory), `${JSON.stringify(rejection)}\n`, "utf8");
|
|
40
|
+
}
|
|
41
|
+
/** Recover a child-written Reviewer dispatch rejection through a fixed mapping. */
|
|
42
|
+
export async function readReviewerDispatchRejection(runDirectory) {
|
|
43
|
+
let raw;
|
|
44
|
+
try {
|
|
45
|
+
raw = await readFile(reviewerDispatchRejectionPath(runDirectory), "utf8");
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (error instanceof Error &&
|
|
49
|
+
"code" in error &&
|
|
50
|
+
error.code === "ENOENT") {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
const parsed = JSON.parse(raw);
|
|
56
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
57
|
+
const error = new Error("Reviewer dispatch rejection page must be a JSON object");
|
|
58
|
+
error.name = "ReviewerDispatchRejectionContractError";
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
const record = parsed;
|
|
62
|
+
if (typeof record.diagnostic !== "string" ||
|
|
63
|
+
record.diagnostic.trim() === "" ||
|
|
64
|
+
!Array.isArray(record.violations) ||
|
|
65
|
+
record.violations.length === 0 ||
|
|
66
|
+
record.violations.some((value) => !isReviewerPreflightViolation(value))) {
|
|
67
|
+
const error = new Error("Reviewer dispatch rejection page has unusable required fields");
|
|
68
|
+
error.name = "ReviewerDispatchRejectionContractError";
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
cause: "activation",
|
|
73
|
+
diagnostic: record.diagnostic,
|
|
74
|
+
identity: { name: "ReviewerDispatchRejectionError" },
|
|
75
|
+
details: { violations: Object.freeze([...record.violations]) },
|
|
76
|
+
};
|
|
77
|
+
}
|