@rulvar/cli 1.229.0 → 1.230.0
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/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{io-gaixYC7a.js → io-OKD0hUpc.js} +53 -2
- package/package.json +7 -7
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as assembleEngine, a as inspectCommand, b as looksLikeFile, c as resumeCommand, d as driveRun, f as reportOutcome, g as DEFAULT_STORE_DIR, h as renderEventLine, i as costAuditCommand, l as runCommand, m as attachProgress, n as HELP, o as invoiceCommand, p as strictExitCode, r as runCli, s as preflightCommand, t as processIo, u as runsLsCommand, v as loadCliConfig, y as loadWorkflowModule } from "./io-
|
|
1
|
+
import { _ as assembleEngine, a as inspectCommand, b as looksLikeFile, c as resumeCommand, d as driveRun, f as reportOutcome, g as DEFAULT_STORE_DIR, h as renderEventLine, i as costAuditCommand, l as runCommand, m as attachProgress, n as HELP, o as invoiceCommand, p as strictExitCode, r as runCli, s as preflightCommand, t as processIo, u as runsLsCommand, v as loadCliConfig, y as loadWorkflowModule } from "./io-OKD0hUpc.js";
|
|
2
2
|
import { ConfigError, JournalCompatibilityError, LeaseHeldError, Replayer, RulvarError, buildDeriverRegistry, compileSecretMasker, costReportFromJournal, journalPricingSnapshot, maskSecrets, normalizeEntry, persistedTerminalEnvelope, readRunMeta, scanJournalCompatibility, validateDetachedResolution } from "@rulvar/core";
|
|
3
3
|
//#region src/server.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigError, FileModelKnowledgeStore, INBOX_PROPOSAL_TTL_DAYS, JsonlFileStore, LeaseHeldError, auditRuns, claimCoverageOf, claimExpired, claimExpiry, compilePermissionPreset, costReportFromJournal, createEngine, hashRunArgs, hashRunOutput, invoiceFromJournal, journalPricingSnapshot, lastRunSettle, logicalRunTelemetry, parseModelRef, preflightEstimate, priceUsdOf, proposalStatement, readRunMeta, reconcileRunMeta, remeasureQueue, resolvePricing, runProfile, sanitizeTerminalText } from "@rulvar/core";
|
|
1
|
+
import { ConfigError, FileModelKnowledgeStore, INBOX_PROPOSAL_TTL_DAYS, JsonlFileStore, LeaseHeldError, auditRuns, childRostersFromJournal, claimCoverageOf, claimExpired, claimExpiry, compilePermissionPreset, costReportFromJournal, createEngine, hashRunArgs, hashRunOutput, invoiceFromJournal, journalPricingSnapshot, lastRunSettle, logicalRunTelemetry, parseModelRef, preflightEstimate, priceUsdOf, proposalStatement, readRunMeta, reconcileRunMeta, remeasureQueue, resolvePricing, runProfile, sanitizeTerminalText } from "@rulvar/core";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
3
|
import { existsSync, statSync } from "node:fs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -373,6 +373,7 @@ function reportOutcome(outcome, io) {
|
|
|
373
373
|
io.err(`status: ${outcome.status}`);
|
|
374
374
|
if (outcome.value !== void 0) io.out(JSON.stringify(outcome.value, null, 2));
|
|
375
375
|
if (outcome.error !== void 0) io.err(`error: ${sanitizeTerminalText(outcome.error.message)}`);
|
|
376
|
+
reportSemanticTerminal(outcome, io);
|
|
376
377
|
if (outcome.dropped.length > 0) io.err(`dropped: ${outcome.dropped.length} item(s)`);
|
|
377
378
|
for (const pending of outcome.pending) io.err(`pending: ${sanitizeTerminalText(pending.key)} (entry ${pending.entryRef})`);
|
|
378
379
|
io.err(`cost: $${outcome.cost.totalUsd.toFixed(4)}${outcome.cost.usageApprox === true ? " (approximate: some usage was estimated, not reported by the provider)" : ""}`);
|
|
@@ -385,6 +386,42 @@ function reportOutcome(outcome, io) {
|
|
|
385
386
|
default: return 1;
|
|
386
387
|
}
|
|
387
388
|
}
|
|
389
|
+
/**
|
|
390
|
+
* What the terminal CLAIMS, printed beside what it transported
|
|
391
|
+
* (RV2703).
|
|
392
|
+
*
|
|
393
|
+
* `status` answers whether the run ran. It has never answered whether
|
|
394
|
+
* the work is done, whether the artifact passed the contract it
|
|
395
|
+
* declared, or what the children produced when nothing judged them,
|
|
396
|
+
* and until this shipped a human reading `rulvar run` saw `status: ok`
|
|
397
|
+
* for an accepted-with-degradation run, for a run whose declared
|
|
398
|
+
* finish contract refused every candidate it was handed, and for a
|
|
399
|
+
* clean one, with no line between them. `--strict` has read those
|
|
400
|
+
* fields since RV2604, but strict is the MACHINE gate: a person who
|
|
401
|
+
* does not pass the flag was left with exactly the blindness two
|
|
402
|
+
* releases went into curing.
|
|
403
|
+
*
|
|
404
|
+
* Absence prints nothing, in every line below (RV1209): no contract
|
|
405
|
+
* declared means nobody judged anything, which is not a verdict and
|
|
406
|
+
* must not be rendered as one.
|
|
407
|
+
*/
|
|
408
|
+
function reportSemanticTerminal(outcome, io) {
|
|
409
|
+
if (outcome.completion !== void 0) io.err(`completion: ${outcome.completion}` + (outcome.completion === "complete" ? "" : " (the work is NOT complete)"));
|
|
410
|
+
for (const reason of outcome.degradedReasons ?? []) io.err(` degraded: ${sanitizeTerminalText(reason)}`);
|
|
411
|
+
if (outcome.deliverableAccepted !== void 0) io.err(`deliverable: ${outcome.deliverableAccepted ? "accepted by the declared finish contract" : "REFUSED by the declared finish contract"}` + (outcome.resultAvailable === false ? "; the terminal carries no artifact" : ""));
|
|
412
|
+
const rejected = outcome.rejectedFinishCandidates ?? [];
|
|
413
|
+
if (rejected.length > 0) {
|
|
414
|
+
const distinct = new Set(rejected.map((row) => row.hash)).size;
|
|
415
|
+
io.err(`rejected finish candidates: ${rejected.length}` + (distinct === rejected.length ? "" : ` (${distinct} distinct document(s))`));
|
|
416
|
+
}
|
|
417
|
+
const roster = outcome.childrenAtFailure;
|
|
418
|
+
if (roster !== void 0) {
|
|
419
|
+
const statuses = Object.entries(roster.statusCounts).map(([status, count]) => `${sanitizeTerminalText(status)} ${count}`).join(", ");
|
|
420
|
+
io.err(`children at failure: ${roster.spawned} spawned, ${roster.settled} settled` + (statuses === "" ? "" : ` (${statuses})`) + "; no acceptance verdict was ever rendered");
|
|
421
|
+
if (roster.belowFloorOkChildren !== void 0) io.err(` settled ok below their declared evidence floor: ${roster.belowFloorOkChildren.length}`);
|
|
422
|
+
if (roster.unsettled !== void 0) io.err(` still running when the run gave up: ${roster.unsettled.length}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
388
425
|
/** The closed grade vocabulary strict accepts from a persisted meta. */
|
|
389
426
|
const COVERAGE_GRADES = [
|
|
390
427
|
"full",
|
|
@@ -1226,7 +1263,21 @@ async function inspectCommand(argv, context) {
|
|
|
1226
1263
|
context.io.out(`segments: ${logical.segments} (${logical.statuses.map((status, index) => `${sanitizeTerminalText(status)} after ${String(logical.entriesPerSegment[index] ?? 0)}`).join(", ")})`);
|
|
1227
1264
|
if (logical.entriesAfterLastSettle > 0) context.io.out(` entries after the last settle: ${logical.entriesAfterLastSettle}`);
|
|
1228
1265
|
}
|
|
1229
|
-
const
|
|
1266
|
+
const settled = lastRunSettle(entries);
|
|
1267
|
+
if (settled?.completion !== void 0) context.io.out(`completion: ${settled.completion}` + (settled.completion === "complete" ? " (the last settle claims the work is complete)" : " (the last settle claims the work is NOT complete)"));
|
|
1268
|
+
for (const roster of childRostersFromJournal(entries)) {
|
|
1269
|
+
const statusCounts = /* @__PURE__ */ new Map();
|
|
1270
|
+
for (const child of roster.children) if (child.status !== void 0) statusCounts.set(child.status, (statusCounts.get(child.status) ?? 0) + 1);
|
|
1271
|
+
const settledChildren = roster.children.filter((child) => child.status !== void 0);
|
|
1272
|
+
const statuses = [...statusCounts.entries()].map(([status, count]) => `${sanitizeTerminalText(status)} ${String(count)}`).join(", ");
|
|
1273
|
+
context.io.out(`children under ${sanitizeTerminalText(roster.childScope)}: ${roster.admitted} admitted, ${settledChildren.length} settled` + (statuses === "" ? "" : ` (${statuses})`) + (roster.rejected === 0 ? "" : `; ${roster.rejected} refused admission`));
|
|
1274
|
+
if (roster.children.length < roster.admitted) context.io.out(` admitted with no dispatch entry: ${roster.admitted - roster.children.length}`);
|
|
1275
|
+
const belowFloor = roster.children.filter((child) => child.status === "ok" && child.evidence?.met === false);
|
|
1276
|
+
if (belowFloor.length > 0) context.io.out(` settled ok below their declared evidence floor: ${belowFloor.length} (handle${belowFloor.length === 1 ? "" : "s"} ${belowFloor.map((child) => String(child.handle)).join(", ")})`);
|
|
1277
|
+
const unsettled = roster.children.filter((child) => child.status === void 0);
|
|
1278
|
+
if (unsettled.length > 0) context.io.out(` dispatched with no terminal in the journal: ${unsettled.length} (handle${unsettled.length === 1 ? "" : "s"} ${unsettled.map((child) => String(child.handle)).join(", ")})`);
|
|
1279
|
+
}
|
|
1280
|
+
const rejected = settled?.rejectedFinishCandidates ?? [];
|
|
1230
1281
|
if (rejected.length > 0) {
|
|
1231
1282
|
const distinct = new Set(rejected.map((row) => row.hash)).size;
|
|
1232
1283
|
context.io.out(`rejected finish candidates: ${rejected.length}` + (distinct === rejected.length ? "" : ` (${distinct} distinct document(s))`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.230.0",
|
|
4
4
|
"description": "Rulvar shell: run/resume/runs/inspect/plan/kb commands, TUI progress, createServer, createWorker, OTel exporter.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@rulvar/core": "1.
|
|
25
|
+
"@rulvar/core": "1.230.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.20.1",
|
|
29
29
|
"tsdown": "^0.22.14",
|
|
30
30
|
"typescript": "~6.0.3",
|
|
31
|
-
"@rulvar/
|
|
32
|
-
"@rulvar/
|
|
33
|
-
"@rulvar/
|
|
34
|
-
"@rulvar/
|
|
35
|
-
"@rulvar/
|
|
31
|
+
"@rulvar/testing": "1.230.0",
|
|
32
|
+
"@rulvar/planner": "1.230.0",
|
|
33
|
+
"@rulvar/store-sqlite": "1.230.0",
|
|
34
|
+
"@rulvar/evals": "1.230.0",
|
|
35
|
+
"@rulvar/plan": "1.230.0"
|
|
36
36
|
},
|
|
37
37
|
"bin": {
|
|
38
38
|
"rulvar": "./dist/cli.js"
|