@akagilnc/pi-workflow-roles 0.1.1918 → 0.1.2004
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/evidence-child-executor.js +12 -6
- package/dist/package-contracts/reviewer-output.js +16 -0
- package/dist/public-cli/main.js +2520 -72
- package/dist/reviewer-construction.js +46 -6
- package/dist/reviewer-dispatch.js +64 -1
- package/dist/reviewer-execution-ledger.js +2 -1
- package/dist/reviewer-pinned-git.js +33 -0
- package/package.json +1 -1
- package/src/atomic-write.ts +26 -0
- package/src/evidence-child-executor.ts +13 -6
- package/src/ledger-session-read.ts +260 -0
- package/src/package-contracts/reviewer-output.ts +19 -0
- package/src/public-cli/cli.ts +24 -0
- package/src/public-cli/invocation.ts +398 -2
- package/src/public-cli/main.ts +21 -2
- package/src/public-cli/registry.ts +18 -1
- package/src/public-cli/reviewer-run.ts +12 -0
- package/src/public-cli/run-lifecycle.ts +22 -1
- package/src/public-cli/settlement.ts +17 -0
- package/src/public-cli/taishi-run.ts +235 -0
- package/src/reviewer-construction.ts +64 -7
- package/src/reviewer-dispatch.ts +81 -2
- package/src/reviewer-execution-ledger.ts +2 -1
- package/src/reviewer-pinned-git.ts +43 -0
- package/src/reviewer-role.ts +143 -132
- package/src/reviewer-settlement.ts +4 -0
- package/src/role-runtime.ts +186 -3
- package/src/run-terminal-artifacts.ts +231 -0
- package/src/taishi-cohort.ts +232 -0
- package/src/taishi-entry.ts +429 -0
- package/src/taishi-index.ts +269 -0
- package/src/taishi-ledger.ts +466 -0
- package/src/taishi-median.ts +15 -0
- package/src/taishi-metric-families/acceptance-success-rework.ts +346 -0
- package/src/taishi-metric-families/b2-frame-buckets-actions.ts +274 -0
- package/src/taishi-metric-families/leg-wall-clock.ts +90 -0
- package/src/taishi-metric-families/round-timeline.ts +201 -0
- package/src/taishi-metric-families.ts +36 -0
- package/src/taishi-metric-family.ts +41 -0
- package/src/taishi-model-groups.ts +198 -0
- package/src/taishi-page.ts +320 -0
- package/src/ticket-trajectory.ts +9 -62
|
@@ -9,9 +9,19 @@ import { join } from "node:path";
|
|
|
9
9
|
import { createAssistantMessageEventStream, InMemoryCredentialStore, } from "@earendil-works/pi-ai";
|
|
10
10
|
import { AUDITOR_COMPLIANCE_FAILURE_ENTRY_TYPE, AUDITOR_PARENT_ATTEMPT_BINDING_ENTRY_TYPE, prepareComplianceDispatch, } from "./compliance-transport.js";
|
|
11
11
|
import { wrapPackageOwnedToolDefinition } from "./package-owned-tool-idle.js";
|
|
12
|
-
import { createStreamIdleGuard, isStreamIdleTimeoutError } from "./stream-idle-guard.js";
|
|
13
12
|
import { createReceiptDeliveryPolicy, NO_RECEIPT_LIFECYCLE_ENTRY_TYPE, RECEIPT_DELIVERY_PROMPT } from "./receipt-delivery-policy.js";
|
|
13
|
+
import { REVIEWER_VERIFICATION_BOUNDARY } from "./reviewer-construction.js";
|
|
14
|
+
import { createStreamIdleGuard, isStreamIdleTimeoutError } from "./stream-idle-guard.js";
|
|
14
15
|
import { hasUpstreamErrorTestimony, isNonSuccessHttpStatus, projectConfirmedRemotePayload, } from "./upstream-error-testimony.js";
|
|
16
|
+
/** Package-owned system prompt for Reviewer Standards/Spec evidence children (private carrier). */
|
|
17
|
+
function buildEvidenceChildSystemPrompt() {
|
|
18
|
+
return [
|
|
19
|
+
"Work only in the supplied workspace.",
|
|
20
|
+
"Use the available evidence tools to investigate. Do not commit, push, or mutate remotes.",
|
|
21
|
+
REVIEWER_VERIFICATION_BOUNDARY,
|
|
22
|
+
"Return one substantive non-blank report.",
|
|
23
|
+
].join("\n");
|
|
24
|
+
}
|
|
15
25
|
// ── shared constants / types ──────────────────────────────────────────────
|
|
16
26
|
export const AUDITOR_TURN_LIMIT = 32;
|
|
17
27
|
export const DEFAULT_COMPLIANCE_IDLE_MAX_RETRIES = 2;
|
|
@@ -450,11 +460,7 @@ export async function executeEvidenceChild(workspace, prompt, context, options =
|
|
|
450
460
|
model: inherited.model,
|
|
451
461
|
thinkingLevel: context.thinkingLevel ?? "off",
|
|
452
462
|
modelRuntime: inherited.runtime,
|
|
453
|
-
systemPrompt:
|
|
454
|
-
"Work only in the supplied workspace.",
|
|
455
|
-
"Use the available evidence tools to investigate. Do not commit, push, or mutate remotes.",
|
|
456
|
-
"Return one substantive non-blank report.",
|
|
457
|
-
].join("\n"),
|
|
463
|
+
systemPrompt: buildEvidenceChildSystemPrompt(),
|
|
458
464
|
sessionManager: createRecordSession({
|
|
459
465
|
cwd: workspace,
|
|
460
466
|
kind: "evidence-children",
|
|
@@ -68,6 +68,22 @@ export function validateRuntimeReviewerReceipt(output) {
|
|
|
68
68
|
if (status === "failed" && report !== undefined)
|
|
69
69
|
throw new Error("Failed Reviewer outcome cannot bind a report");
|
|
70
70
|
}
|
|
71
|
+
// One read inside the existing accepted-leg consistency cycle — not a second validator.
|
|
72
|
+
// launched ⇔ Standards+Spec; skipped-missing ⇔ Standards only.
|
|
73
|
+
const specDisposition = read(output, "specDisposition");
|
|
74
|
+
if (specDisposition === "launched") {
|
|
75
|
+
if (expectedAxes.length !== 2 || expectedAxes[0] !== "standards" || expectedAxes[1] !== "spec") {
|
|
76
|
+
throw new Error("Reviewer specDisposition launched requires Standards+Spec accepted legs");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else if (specDisposition === "skipped-missing") {
|
|
80
|
+
if (expectedAxes.length !== 1 || expectedAxes[0] !== "standards") {
|
|
81
|
+
throw new Error("Reviewer specDisposition skipped-missing requires Standards-only accepted legs");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else if (specDisposition !== undefined) {
|
|
85
|
+
throw new Error("Invalid Reviewer specDisposition");
|
|
86
|
+
}
|
|
71
87
|
}
|
|
72
88
|
return output;
|
|
73
89
|
}
|