@akagilnc/pi-workflow-roles 0.1.5368 → 0.1.5375
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 +719 -776
- package/dist/activation-ledger-git.js +2 -2
- package/dist/activation-ledger-topology.js +1 -7
- package/dist/analyst-entry.js +4 -8
- package/dist/analyst-gate-cycles-read.js +3 -11
- package/dist/analyst-index.js +3 -9
- package/dist/analyst-ledger.js +1 -11
- package/dist/analyst-metric-families/acceptance-success-rework.js +1 -3
- package/dist/analyst-metric-families/round-timeline.js +1 -3
- package/dist/analyst-page.js +2 -2
- package/dist/archivist-record-topology.js +2 -2
- package/dist/audit-escalation.js +2 -1
- package/dist/auditor-soul.js +2 -1
- package/dist/collector-config.js +6 -8
- package/dist/compliance-transport.js +2 -1
- package/dist/countersign-contracts.js +2 -1
- package/dist/diarist-contracts.js +3 -2
- package/dist/doctor-contracts.js +1 -3
- package/dist/doctor-evidence.js +7 -8
- package/dist/dossier-resolution.js +1 -3
- package/dist/engine-detour-usage.js +1 -3
- package/dist/gatekeeper-role.js +2 -9
- package/dist/gleaner-left-contracts.js +2 -1
- package/dist/headless-host/description.js +14 -17
- package/dist/headless-host/production-host.js +721 -780
- package/dist/host-session-record.js +3 -2
- package/dist/inspector-contracts.js +2 -1
- package/dist/ledger-session-read.js +1 -3
- package/dist/merger-contracts.js +9 -9
- package/dist/migrate-book-topology.js +348 -314
- package/dist/navigator-attendance.js +9 -11
- package/dist/navigator-invocation-identity.js +3 -2
- package/dist/navigator-public-session.js +3 -5
- package/dist/navigator-session-contracts.js +8 -10
- package/dist/navigator-work-base.js +5 -8
- package/dist/notary-contracts.js +3 -5
- package/dist/package-contracts/auditor-output.js +1 -3
- package/dist/package-contracts/fixer-packet.js +3 -6
- package/dist/package-contracts/gatekeeper-output.js +1 -3
- package/dist/package-contracts/navigator-output.js +8 -8
- package/dist/package-contracts/terminating-infrastructure.js +5 -9
- package/dist/package-contracts/terminating-tools.js +4 -3
- package/dist/public-cli/analyst-run.js +3 -2
- package/dist/public-cli/auto-resume.js +3 -8
- package/dist/public-cli/cli.js +9 -8
- package/dist/public-cli/config.js +8 -11
- package/dist/public-cli/countersign-run.js +1 -3
- package/dist/public-cli/host-providers.js +7 -14
- package/dist/public-cli/instruction-seat-run.js +4 -3
- package/dist/public-cli/invocation.js +9 -8
- package/dist/public-cli/main.js +1531 -1567
- package/dist/public-cli/post-admission.js +4 -3
- package/dist/public-cli/run-lifecycle.js +14 -26
- package/dist/public-cli/settlement.js +10 -26
- package/dist/public-role-summons.js +3 -2
- package/dist/receipt-delivery-policy.js +1 -3
- package/dist/role-run-placement.js +3 -5
- package/dist/role-run-relocation.js +12 -19
- package/dist/run-terminal-artifacts.js +1 -11
- package/dist/run-ticket-number.js +2 -4
- package/dist/session-assistant-usage.js +2 -1
- package/dist/session-dialogue.js +1 -14
- package/dist/sitian-reader.js +2 -4
- package/dist/submission-correctable-error.js +2 -1
- package/dist/submission-errors.js +2 -1
- package/dist/submission-gate.js +2 -1
- package/dist/submission-ledger.js +4 -5
- package/dist/ticket-provenance-contracts.js +1 -3
- package/dist/ticket-provenance.js +2 -1
- package/dist/typed-provider-http.js +4 -7
- package/dist/unknown-value.js +28 -0
- package/dist/user-dialogue-stdin.js +2 -1
- package/package.json +1 -1
- package/src/acp-host/role-turn-host.ts +4 -2
- package/src/activation-ledger-git.ts +3 -2
- package/src/activation-ledger-topology.ts +4 -12
- package/src/analyst-entry.ts +3 -11
- package/src/analyst-gate-cycles-read.ts +3 -15
- package/src/analyst-index.ts +3 -13
- package/src/analyst-ledger.ts +2 -16
- package/src/analyst-metric-families/acceptance-success-rework.ts +2 -4
- package/src/analyst-metric-families/round-timeline.ts +2 -4
- package/src/analyst-page.ts +2 -2
- package/src/archivist-record-topology.ts +2 -2
- package/src/audit-escalation.ts +2 -1
- package/src/auditor-soul.ts +3 -1
- package/src/book-topology-migration-placement.ts +5 -16
- package/src/book-topology-migrators-t11.ts +16 -15
- package/src/book-topology-mixed-volume-migrators.ts +3 -6
- package/src/book-topology-record-class-migrators.ts +7 -10
- package/src/book-topology-runs-migrator.ts +4 -3
- package/src/collector-config.ts +7 -9
- package/src/compliance-transport.ts +2 -1
- package/src/countersign-contracts.ts +2 -1
- package/src/diarist-contracts.ts +3 -2
- package/src/doctor-contracts.ts +3 -1
- package/src/doctor-evidence.ts +8 -7
- package/src/doctor-role.ts +4 -2
- package/src/dossier-resolution.ts +2 -4
- package/src/engine-detour-tool.ts +0 -2
- package/src/engine-detour-usage.ts +2 -4
- package/src/external-host-turn-loop.ts +3 -1
- package/src/factory-board.ts +1 -8
- package/src/gatekeeper-role.ts +2 -10
- package/src/gleaner-left-contracts.ts +3 -1
- package/src/headless-host/description.ts +15 -18
- package/src/headless-host/role-turn-host.ts +10 -9
- package/src/host-session-record.ts +4 -2
- package/src/inspector-contracts.ts +2 -1
- package/src/ledger-session-read.ts +2 -5
- package/src/merger-contracts.ts +10 -9
- package/src/navigator-attendance.ts +10 -12
- package/src/navigator-invocation-identity.ts +3 -2
- package/src/navigator-public-session.ts +4 -6
- package/src/navigator-session-contracts.ts +8 -11
- package/src/navigator-work-base.ts +5 -8
- package/src/navigator-work-context.ts +2 -1
- package/src/notary-contracts.ts +4 -6
- package/src/oauth-keepalive.ts +5 -18
- package/src/package-contracts/auditor-output.ts +2 -4
- package/src/package-contracts/fixer-packet.ts +4 -6
- package/src/package-contracts/gatekeeper-output.ts +2 -4
- package/src/package-contracts/judge-output.ts +0 -1
- package/src/package-contracts/navigator-output.ts +8 -8
- package/src/package-contracts/terminating-infrastructure.ts +6 -20
- package/src/package-contracts/terminating-tools.ts +8 -12
- package/src/pi/adapter.ts +0 -1
- package/src/pi/role-turn-host.ts +0 -1
- package/src/public-cli/analyst-run.ts +4 -2
- package/src/public-cli/auto-resume.ts +4 -11
- package/src/public-cli/cli.ts +10 -10
- package/src/public-cli/config.ts +8 -27
- package/src/public-cli/countersign-run.ts +2 -4
- package/src/public-cli/host-providers.ts +10 -27
- package/src/public-cli/instruction-seat-run.ts +5 -3
- package/src/public-cli/invocation.ts +11 -10
- package/src/public-cli/post-admission.ts +5 -3
- package/src/public-cli/run-lifecycle.ts +20 -41
- package/src/public-cli/settlement.ts +11 -33
- package/src/public-role-summons.ts +4 -3
- package/src/receipt-delivery-policy.ts +1 -4
- package/src/reviewer-role.ts +0 -1
- package/src/role-envelope.ts +5 -3
- package/src/role-run-placement.ts +4 -10
- package/src/role-run-relocation.ts +13 -23
- package/src/role-runtime.ts +9 -15
- package/src/run-terminal-artifacts.ts +2 -16
- package/src/run-ticket-number.ts +4 -10
- package/src/session-assistant-usage.ts +3 -1
- package/src/session-dialogue.ts +1 -4
- package/src/session-identity.ts +0 -1
- package/src/sitian-reader.ts +2 -4
- package/src/submission-correctable-error.ts +3 -1
- package/src/submission-errors.ts +2 -1
- package/src/submission-gate.ts +3 -1
- package/src/submission-ledger.ts +5 -6
- package/src/ticket-provenance-contracts.ts +1 -4
- package/src/ticket-provenance.ts +3 -1
- package/src/ticket-snapshot.ts +2 -4
- package/src/ticket-trajectory.ts +1 -8
- package/src/typed-provider-http.ts +5 -15
- package/src/unknown-value.ts +34 -0
- package/src/user-dialogue-stdin.ts +3 -1
- package/src/worker-role.ts +2 -5
- package/src/worker-submission-gates.ts +5 -7
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { readFileSync } from "node:fs";
|
|
12
12
|
import { join } from "node:path";
|
|
13
|
+
import { isEnoent, isRecord } from "../unknown-value.js";
|
|
13
14
|
export function hostProvidersPath(home) {
|
|
14
15
|
if (typeof home !== "string" || home.trim() === "") {
|
|
15
16
|
throw new Error("home must be explicitly provided");
|
|
@@ -21,7 +22,7 @@ export function hermesProviderModelsCachePath(home) {
|
|
|
21
22
|
return join(home, ".hermes", "provider_models_cache.json");
|
|
22
23
|
}
|
|
23
24
|
export function parseHostProvidersTable(value) {
|
|
24
|
-
if (
|
|
25
|
+
if (!isRecord(value)) {
|
|
25
26
|
throw new Error("host-providers.json must be an object");
|
|
26
27
|
}
|
|
27
28
|
const out = {};
|
|
@@ -29,9 +30,7 @@ export function parseHostProvidersTable(value) {
|
|
|
29
30
|
if (host.trim() === "") {
|
|
30
31
|
throw new Error("host-providers.json host key must be non-empty");
|
|
31
32
|
}
|
|
32
|
-
if (byProvider
|
|
33
|
-
typeof byProvider !== "object" ||
|
|
34
|
-
Array.isArray(byProvider)) {
|
|
33
|
+
if (!isRecord(byProvider)) {
|
|
35
34
|
throw new Error(`host-providers.json[${host}] must be an object`);
|
|
36
35
|
}
|
|
37
36
|
const providers = {};
|
|
@@ -61,11 +60,8 @@ export function loadHostProvidersTable(home) {
|
|
|
61
60
|
return parseHostProvidersTable(JSON.parse(raw));
|
|
62
61
|
}
|
|
63
62
|
catch (error) {
|
|
64
|
-
if (error
|
|
65
|
-
"code" in error &&
|
|
66
|
-
error.code === "ENOENT") {
|
|
63
|
+
if (isEnoent(error))
|
|
67
64
|
return {};
|
|
68
|
-
}
|
|
69
65
|
throw error;
|
|
70
66
|
}
|
|
71
67
|
}
|
|
@@ -86,20 +82,17 @@ export function listHermesProvidersForModel(home, seatModel) {
|
|
|
86
82
|
text = readFileSync(path, "utf8");
|
|
87
83
|
}
|
|
88
84
|
catch (error) {
|
|
89
|
-
if (error
|
|
90
|
-
"code" in error &&
|
|
91
|
-
error.code === "ENOENT") {
|
|
85
|
+
if (isEnoent(error))
|
|
92
86
|
return [];
|
|
93
|
-
}
|
|
94
87
|
throw error;
|
|
95
88
|
}
|
|
96
89
|
const raw = JSON.parse(text);
|
|
97
|
-
if (
|
|
90
|
+
if (!isRecord(raw)) {
|
|
98
91
|
throw new Error(`hermes provider_models_cache.json must be an object: ${path}`);
|
|
99
92
|
}
|
|
100
93
|
const found = [];
|
|
101
94
|
for (const [provider, entry] of Object.entries(raw)) {
|
|
102
|
-
if (
|
|
95
|
+
if (!isRecord(entry)) {
|
|
103
96
|
continue;
|
|
104
97
|
}
|
|
105
98
|
const models = entry.models;
|
|
@@ -34,6 +34,7 @@ import { warnMissingMethodSkills } from "./machine-method-skills.js";
|
|
|
34
34
|
import { formatTerminalResult, isLawfulTypedTerminalOutcome, } from "./terminal.js";
|
|
35
35
|
import { admittedSeatTurnDetails, projectPublicTurnAxes, projectRoleTurnRequest, requiredMethodSkills, } from "./turn-request.js";
|
|
36
36
|
import { invokeCourtDiarist, latestPayloadEscalated, } from "./countersign-run.js";
|
|
37
|
+
import { isRecord, errorText } from "../unknown-value.js";
|
|
37
38
|
const AUDITED_ROLES = new Set(["judge", "fixer", "coder", "secretariat", "countersign", "doctor"]);
|
|
38
39
|
const SECRETARIAT_STATUS_REASK = "secretariatStatus 不是 converged、escalate 之一。请重新交卷,secretariatStatus 写明其一。";
|
|
39
40
|
const COUNTERSIGN_STATUS_REASK = "status 不是 converged、continue、escalate 三态之一。请重新交卷,status 写明其一。";
|
|
@@ -74,7 +75,7 @@ function unreadablePostSubmissionStatus(admitted, terminal) {
|
|
|
74
75
|
if (route === undefined)
|
|
75
76
|
return undefined;
|
|
76
77
|
const payload = terminal.roleOutcome.payloads?.at(-1);
|
|
77
|
-
const status =
|
|
78
|
+
const status = isRecord(payload)
|
|
78
79
|
? payload.status
|
|
79
80
|
: undefined;
|
|
80
81
|
return typeof status === "string" && route.statuses.has(status)
|
|
@@ -484,7 +485,7 @@ export async function runPublicInstructionSeat(argv, env, io, role, parseArgv) {
|
|
|
484
485
|
auditorTicket = await readBoardTicketNumber(resolved.runDirectory);
|
|
485
486
|
}
|
|
486
487
|
catch (error) {
|
|
487
|
-
presentStructuralRejection(new CliUsageError(
|
|
488
|
+
presentStructuralRejection(new CliUsageError(errorText(error)), io);
|
|
488
489
|
return { exitCode: 2 };
|
|
489
490
|
}
|
|
490
491
|
if (auditorSource === undefined)
|
|
@@ -785,7 +786,7 @@ async function auditSubmittedRole(turn, env, io, passedOfficer, passedReceipt, p
|
|
|
785
786
|
const accepted = turn.terminal.roleOutcome.payloads?.at(-1);
|
|
786
787
|
if (accepted === undefined)
|
|
787
788
|
throw new Error("accepted submission has no payload");
|
|
788
|
-
const record =
|
|
789
|
+
const record = isRecord(accepted)
|
|
789
790
|
? accepted : undefined;
|
|
790
791
|
const status = admitted.role === "secretariat" ? record?.secretariatStatus : record?.status;
|
|
791
792
|
if (admitted.role === "secretariat" && status !== "converged" && status !== "escalate") {
|
|
@@ -27,6 +27,7 @@ import { NotarySourceRunError, resolveNotarySourceRunLocator, } from "../notary-
|
|
|
27
27
|
import { appendEngineSessionMaterial, } from "../package-resources/engine-material.js";
|
|
28
28
|
import { CliUsageError } from "./cli-errors.js";
|
|
29
29
|
import { REJECTED_PUBLIC_SPELLINGS, createTypedOptionConsumer, evaluateAnalystModeOptionContract, optionsForOwner, resolveAnalystMode, } from "./option-definitions.js";
|
|
30
|
+
import { errorText, isRecord } from "../unknown-value.js";
|
|
30
31
|
/** Issue a principal from the single authoritative role-run placement. */
|
|
31
32
|
export function issueAdmissionPlacement(authority, request) {
|
|
32
33
|
const ledgerHome = resolveActivationLedgerHome(request.home);
|
|
@@ -880,7 +881,7 @@ export async function admitPublicRole(role, parsed, env, override) {
|
|
|
880
881
|
repository = parseCollectorRepository(parsed.repo);
|
|
881
882
|
}
|
|
882
883
|
catch (error) {
|
|
883
|
-
const detail =
|
|
884
|
+
const detail = errorText(error);
|
|
884
885
|
throw new CliUsageError(detail, { cause: error });
|
|
885
886
|
}
|
|
886
887
|
}
|
|
@@ -895,7 +896,7 @@ export async function admitPublicRole(role, parsed, env, override) {
|
|
|
895
896
|
manifestCanonicalJson = manifest.canonicalJson;
|
|
896
897
|
}
|
|
897
898
|
catch (error) {
|
|
898
|
-
throw new CliUsageError(
|
|
899
|
+
throw new CliUsageError(errorText(error), { cause: error });
|
|
899
900
|
}
|
|
900
901
|
}
|
|
901
902
|
const manifestDigest = manifest.digest;
|
|
@@ -948,7 +949,7 @@ export async function admitPublicRole(role, parsed, env, override) {
|
|
|
948
949
|
catch (error) {
|
|
949
950
|
if (error instanceof CliUsageError)
|
|
950
951
|
throw error;
|
|
951
|
-
const detail =
|
|
952
|
+
const detail = errorText(error);
|
|
952
953
|
throw new CliUsageError(detail, { cause: error });
|
|
953
954
|
}
|
|
954
955
|
if (parsed.runs === undefined) {
|
|
@@ -966,7 +967,7 @@ export async function admitPublicRole(role, parsed, env, override) {
|
|
|
966
967
|
catch (error) {
|
|
967
968
|
if (error instanceof CliUsageError)
|
|
968
969
|
throw error;
|
|
969
|
-
const detail =
|
|
970
|
+
const detail = errorText(error);
|
|
970
971
|
throw new CliUsageError(`doctor case could not be constructed from retained evidence: ${detail}`, { cause: error });
|
|
971
972
|
}
|
|
972
973
|
frozenAttachments = await freezeAttachments(attachmentPaths, placed.attachmentsDirectory);
|
|
@@ -1322,7 +1323,7 @@ export async function materializeCountersignInvocation(admitted, options) {
|
|
|
1322
1323
|
export async function loadAdmittedJudgeRequest(runDirectory) {
|
|
1323
1324
|
try {
|
|
1324
1325
|
const raw = JSON.parse(await readFile(join(runDirectory, "admitted-request.json"), "utf8"));
|
|
1325
|
-
if (
|
|
1326
|
+
if (!isRecord(raw))
|
|
1326
1327
|
return undefined;
|
|
1327
1328
|
const record = raw;
|
|
1328
1329
|
if (!packagedPublicInstructionSubject(record.role))
|
|
@@ -1354,7 +1355,7 @@ function parsePositivePrOption(raw) {
|
|
|
1354
1355
|
return parseCollectorPrNumber(raw);
|
|
1355
1356
|
}
|
|
1356
1357
|
catch (error) {
|
|
1357
|
-
throw new CliUsageError(
|
|
1358
|
+
throw new CliUsageError(errorText(error), { cause: error });
|
|
1358
1359
|
}
|
|
1359
1360
|
}
|
|
1360
1361
|
function parseRepoOption(raw) {
|
|
@@ -1396,7 +1397,7 @@ export function resolveGitHubRemoteRepository(projectRoot) {
|
|
|
1396
1397
|
return parseCollectorRepository(ownerRepo);
|
|
1397
1398
|
}
|
|
1398
1399
|
catch (error) {
|
|
1399
|
-
const detail =
|
|
1400
|
+
const detail = errorText(error);
|
|
1400
1401
|
throw new CliUsageError(detail, { cause: error });
|
|
1401
1402
|
}
|
|
1402
1403
|
}
|
|
@@ -1456,7 +1457,7 @@ export async function resolveDoctorCaseRunsPath(options) {
|
|
|
1456
1457
|
real = await realpath(resolved);
|
|
1457
1458
|
}
|
|
1458
1459
|
catch (error) {
|
|
1459
|
-
const detail =
|
|
1460
|
+
const detail = errorText(error);
|
|
1460
1461
|
throw new CliUsageError(`doctor --runs is not a readable retained runs root: ${detail}`, { cause: error });
|
|
1461
1462
|
}
|
|
1462
1463
|
const normalized = real.split(sep).join("/");
|