owlrunkit 0.17.2 → 0.18.1
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/CHANGELOG.md +64 -0
- package/README.md +117 -14
- package/docs/architecture/OWLCODA_RUNKIT_017_AGENT_NATIVE_PRODUCT_DEFINITION.md +2 -3
- package/docs/architecture/OWLCODA_RUNKIT_018_PROJECT_DRIVER_PRODUCT_DEFINITION.md +165 -0
- package/docs/architecture/OWLCODA_RUNKIT_USAGE_MODE_SELECTION_PRODUCT_DECISION_20260811.md +142 -0
- package/integrations/codex/skills/owlcoda-runkit/SKILL.md +127 -23
- package/integrations/codex/skills/owlcoda-runkit/assets/templates/config.json +3 -3
- package/package.json +2 -2
- package/packages/attest/distribution-manifest-v1.json +10 -0
- package/packages/attest/src/quick.mjs +10 -0
- package/registry-release-policy-v1.json +5 -5
- package/sbom.spdx.json +5 -5
- package/scripts/runkit-contract/assurance-router.mjs +28 -20
- package/scripts/runkit-contract/core-contract.mjs +7 -1
- package/scripts/runkit-contract/inspect-presentation.mjs +38 -5
- package/scripts/runkit-contract/install-codex-skill.mjs +60 -1
- package/scripts/runkit-contract/onboarding-doctor.mjs +19 -1
- package/scripts/runkit-contract/profile-onboarding.mjs +597 -22
- package/scripts/runkit-contract/project-cli-resolver.mjs +6 -0
- package/scripts/runkit-contract/quick-attest.mjs +1 -0
- package/scripts/runkit-contract/quick-metrics.mjs +43 -5
- package/scripts/runkit-contract/quick-verify.mjs +15 -4
- package/scripts/runkit-contract/runkit-cli.mjs +747 -20
- package/scripts/runkit-contract/schemas/profile-reconcile-plan-v1.schema.json +105 -0
- package/scripts/runkit-contract/schemas/profile-reconcile-receipt-v1.schema.json +60 -0
- package/scripts/runkit-contract/schemas/team-project-event-v1.schema.json +16 -1
- package/scripts/runkit-contract/schemas/team-project-status-v1.schema.json +34 -1
- package/scripts/runkit-contract/schemas/team-project-successor-receipt-v1.schema.json +204 -0
- package/scripts/runkit-contract/schemas/usage-mode-recommendation-v1.schema.json +136 -0
- package/scripts/runkit-contract/team-project-successor.mjs +1176 -0
- package/scripts/runkit-contract/team-project.mjs +1082 -43
- package/scripts/runkit-contract/templates/assurance-request.json +6 -0
- package/scripts/runkit-contract/usage-mode.mjs +229 -0
|
@@ -6,9 +6,40 @@ import {
|
|
|
6
6
|
} from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
decodeUtf8Strict,
|
|
11
|
+
parseJsonStrict,
|
|
12
|
+
readFileBytesBounded,
|
|
13
|
+
} from "../../packages/attest/src/formal.mjs";
|
|
14
|
+
import { quickSnapshotFingerprintValid } from "../../packages/attest/src/quick-receipt-contract.mjs";
|
|
15
|
+
import {
|
|
16
|
+
attestQuickReceipt,
|
|
17
|
+
validQuickReceiptShape,
|
|
18
|
+
} from "./quick-attest.mjs";
|
|
10
19
|
import { quickReceiptRoot } from "./quick-receipt.mjs";
|
|
11
20
|
|
|
21
|
+
const INVALID_ATTESTATION_ISSUES = new Set([
|
|
22
|
+
"attestation_material_missing",
|
|
23
|
+
"receipt_material_hash_mismatch",
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
function readHistoricalReceipt(receiptPath) {
|
|
27
|
+
const { bytes } = readFileBytesBounded(receiptPath);
|
|
28
|
+
const receipt = parseJsonStrict(decodeUtf8Strict(bytes));
|
|
29
|
+
if (!validQuickReceiptShape(receipt)) throw new Error("quick_receipt_schema_invalid");
|
|
30
|
+
const snapshotsValid = quickSnapshotFingerprintValid(receipt.workspaceBefore)
|
|
31
|
+
&& quickSnapshotFingerprintValid(receipt.workspaceAfter);
|
|
32
|
+
const sourceChanged = receipt.workspaceBefore.sourceFingerprint
|
|
33
|
+
!== receipt.workspaceAfter.sourceFingerprint;
|
|
34
|
+
const mutationBindingValid = receipt.mutationDecision === "source_unchanged"
|
|
35
|
+
? !sourceChanged && !receipt.issueCodes.includes("source_mutated_during_verification")
|
|
36
|
+
: sourceChanged && receipt.issueCodes.includes("source_mutated_during_verification");
|
|
37
|
+
if (!snapshotsValid || !mutationBindingValid) {
|
|
38
|
+
throw new Error("quick_receipt_source_binding_invalid");
|
|
39
|
+
}
|
|
40
|
+
return receipt;
|
|
41
|
+
}
|
|
42
|
+
|
|
12
43
|
function trustedReceiptRoot(workspaceRoot) {
|
|
13
44
|
const workspace = realpathSync(workspaceRoot);
|
|
14
45
|
const root = quickReceiptRoot(workspace);
|
|
@@ -65,10 +96,17 @@ export function readLocalQuickMetrics(workspaceRoot) {
|
|
|
65
96
|
};
|
|
66
97
|
for (const receiptPath of receiptPaths) {
|
|
67
98
|
try {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
99
|
+
const receipt = readHistoricalReceipt(receiptPath);
|
|
100
|
+
const attestation = attestQuickReceipt({ receiptPath, workspaceRoot });
|
|
101
|
+
if (attestation.issueCodes.some((issue) => INVALID_ATTESTATION_ISSUES.has(issue))) {
|
|
102
|
+
totals.invalid += 1;
|
|
103
|
+
} else if (receipt.mutationDecision === "invalidated_by_command_source_mutation") {
|
|
104
|
+
totals.sourceMutated += 1;
|
|
105
|
+
} else if (receipt.exitResult.exitCode === 0 && receipt.exitResult.signal === null) {
|
|
106
|
+
totals.passed += 1;
|
|
107
|
+
} else {
|
|
108
|
+
totals.failed += 1;
|
|
109
|
+
}
|
|
72
110
|
} catch {
|
|
73
111
|
totals.invalid += 1;
|
|
74
112
|
}
|
|
@@ -9,6 +9,14 @@ import {
|
|
|
9
9
|
} from "./quick-receipt.mjs";
|
|
10
10
|
import { captureWorkspaceSnapshot } from "./quick-workspace-snapshot.mjs";
|
|
11
11
|
|
|
12
|
+
function shellQuote(value) {
|
|
13
|
+
return `'${String(value).replaceAll("'", `'"'"'`)}'`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function quickAttestCommand(workspaceRoot, receiptPath) {
|
|
17
|
+
return `owlrunkit quick-attest --workspace ${shellQuote(workspaceRoot)} --receipt ${shellQuote(receiptPath)}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
function runExactCommand({ executable, argv, cwd, stdoutFd, stderrFd }) {
|
|
13
21
|
return new Promise((resolve) => {
|
|
14
22
|
let settled = false;
|
|
@@ -153,6 +161,7 @@ export async function runQuickVerification({ workspaceRoot, commandArgv }) {
|
|
|
153
161
|
}
|
|
154
162
|
|
|
155
163
|
if (sourceMutated) {
|
|
164
|
+
const attestCommand = quickAttestCommand(root, persisted.receiptPath);
|
|
156
165
|
return {
|
|
157
166
|
status: "quick_verification_source_mutated",
|
|
158
167
|
exitCode: 2,
|
|
@@ -162,13 +171,14 @@ export async function runQuickVerification({ workspaceRoot, commandArgv }) {
|
|
|
162
171
|
commandExitCode: execution.exitCode,
|
|
163
172
|
mutationDecision: "invalidated_by_command_source_mutation",
|
|
164
173
|
issueCodes,
|
|
165
|
-
attestCommand
|
|
174
|
+
attestCommand,
|
|
166
175
|
issues: [],
|
|
167
176
|
nextAllowedAction: "restore_source_or_run_a_new_quick_verification",
|
|
168
177
|
authorizationGranted: false,
|
|
169
178
|
};
|
|
170
179
|
}
|
|
171
180
|
if (execution.launchError || execution.exitCode !== 0) {
|
|
181
|
+
const attestCommand = quickAttestCommand(root, persisted.receiptPath);
|
|
172
182
|
return {
|
|
173
183
|
status: "quick_verification_failed",
|
|
174
184
|
exitCode: 1,
|
|
@@ -178,12 +188,13 @@ export async function runQuickVerification({ workspaceRoot, commandArgv }) {
|
|
|
178
188
|
commandExitCode: execution.exitCode,
|
|
179
189
|
mutationDecision: "source_unchanged",
|
|
180
190
|
issueCodes,
|
|
181
|
-
attestCommand
|
|
191
|
+
attestCommand,
|
|
182
192
|
issues: execution.launchError ? [execution.launchError] : [],
|
|
183
193
|
nextAllowedAction: "inspect_output_and_rerun",
|
|
184
194
|
authorizationGranted: false,
|
|
185
195
|
};
|
|
186
196
|
}
|
|
197
|
+
const attestCommand = quickAttestCommand(root, persisted.receiptPath);
|
|
187
198
|
return {
|
|
188
199
|
status: "quick_verification_passed",
|
|
189
200
|
exitCode: 0,
|
|
@@ -193,9 +204,9 @@ export async function runQuickVerification({ workspaceRoot, commandArgv }) {
|
|
|
193
204
|
commandExitCode: 0,
|
|
194
205
|
mutationDecision: "source_unchanged",
|
|
195
206
|
issueCodes,
|
|
196
|
-
attestCommand
|
|
207
|
+
attestCommand,
|
|
197
208
|
issues: [],
|
|
198
|
-
nextAllowedAction:
|
|
209
|
+
nextAllowedAction: attestCommand,
|
|
199
210
|
authorizationGranted: false,
|
|
200
211
|
};
|
|
201
212
|
}
|