@rulvar/cli 1.177.0 → 1.179.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.d.ts +12 -0
- package/dist/index.js +1 -1
- package/dist/{io-Cnnpu6i5.js → io-CiYi4jwQ.js} +56 -6
- package/package.json +7 -7
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -223,6 +223,18 @@ declare function reportOutcome(outcome: RunOutcome<unknown>, io: CliIo): number;
|
|
|
223
223
|
* that never opted into orchestrate acceptance) and nonzero exit codes
|
|
224
224
|
* pass through unchanged, so the flag never masks the ordinary status
|
|
225
225
|
* exit and never bites a plain workflow.
|
|
226
|
+
*
|
|
227
|
+
* Completion is a MECHANICAL verdict, and the eighteenth comparison
|
|
228
|
+
* benchmark showed how easily `completion: 'complete'` reads as
|
|
229
|
+
* semantic green while the claim judge saw 40 of 144 citing sentences.
|
|
230
|
+
* So strict also reads the claim-coverage grade (RV1702) when the
|
|
231
|
+
* outcome carries a claim-consistency meta: `'judge-failed'` (nothing
|
|
232
|
+
* was judged) and `'critical-uncovered'` (declared claims went
|
|
233
|
+
* unverified) exit nonzero, because both previously slipped through
|
|
234
|
+
* strict as green; `'partial'` prints its counts to stderr and keeps
|
|
235
|
+
* the exit, because the bounded pass is the documented default and
|
|
236
|
+
* declaring critical anchors is the opt-in that makes the subset
|
|
237
|
+
* enforceable.
|
|
226
238
|
*/
|
|
227
239
|
declare function strictExitCode(outcome: RunOutcome<unknown>, base: number, io: CliIo): number;
|
|
228
240
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as loadCliConfig, a as invoiceCommand, c as runCommand, d as reportOutcome, f as strictExitCode, g as assembleEngine, h as DEFAULT_STORE_DIR, i as inspectCommand, l as runsLsCommand, m as renderEventLine, n as HELP, o as preflightCommand, p as attachProgress, r as runCli, s as resumeCommand, t as processIo, u as driveRun, v as loadWorkflowModule, y as looksLikeFile } from "./io-
|
|
1
|
+
import { _ as loadCliConfig, a as invoiceCommand, c as runCommand, d as reportOutcome, f as strictExitCode, g as assembleEngine, h as DEFAULT_STORE_DIR, i as inspectCommand, l as runsLsCommand, m as renderEventLine, n as HELP, o as preflightCommand, p as attachProgress, r as runCli, s as resumeCommand, t as processIo, u as driveRun, v as loadWorkflowModule, y as looksLikeFile } from "./io-CiYi4jwQ.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, claimExpired, claimExpiry, compilePermissionPreset, costReportFromJournal, createEngine, hashRunArgs, hashRunOutput, invoiceFromJournal, journalPricingSnapshot, lastRunSettle, parseModelRef, preflightEstimate, priceUsdOf, proposalStatement, readRunMeta, reconcileRunMeta, remeasureQueue, resolvePricing, runProfile, sanitizeTerminalText } from "@rulvar/core";
|
|
1
|
+
import { ConfigError, FileModelKnowledgeStore, INBOX_PROPOSAL_TTL_DAYS, JsonlFileStore, LeaseHeldError, auditRuns, claimCoverageOf, claimExpired, claimExpiry, compilePermissionPreset, costReportFromJournal, createEngine, hashRunArgs, hashRunOutput, invoiceFromJournal, journalPricingSnapshot, lastRunSettle, 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";
|
|
@@ -385,6 +385,36 @@ function reportOutcome(outcome, io) {
|
|
|
385
385
|
default: return 1;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
+
/** The closed grade vocabulary strict accepts from a persisted meta. */
|
|
389
|
+
const COVERAGE_GRADES = [
|
|
390
|
+
"full",
|
|
391
|
+
"partial",
|
|
392
|
+
"critical-uncovered",
|
|
393
|
+
"judge-failed"
|
|
394
|
+
];
|
|
395
|
+
/**
|
|
396
|
+
* The claim-coverage grade of an outcome's acceptance envelope, when
|
|
397
|
+
* one is derivable (RV1702): the stamped `coverage` field when it
|
|
398
|
+
* carries a known grade, else {@link claimCoverageOf} over the counts
|
|
399
|
+
* (a meta persisted before the grade shipped), else undefined.
|
|
400
|
+
*/
|
|
401
|
+
function coverageGradeOf(value) {
|
|
402
|
+
if (typeof value !== "object" || value === null) return;
|
|
403
|
+
const meta = value.claimConsistencyMeta;
|
|
404
|
+
if (typeof meta !== "object" || meta === null) return;
|
|
405
|
+
const record = meta;
|
|
406
|
+
const stamped = COVERAGE_GRADES.find((grade) => grade === record.coverage);
|
|
407
|
+
if (stamped !== void 0) return stamped;
|
|
408
|
+
if (typeof record.draftCitingSentences !== "number" || typeof record.truncated !== "boolean" || typeof record.coveredCitingSentences !== "number") return;
|
|
409
|
+
return claimCoverageOf({
|
|
410
|
+
draftCitingSentences: record.draftCitingSentences,
|
|
411
|
+
truncated: record.truncated,
|
|
412
|
+
coveredCitingSentences: record.coveredCitingSentences,
|
|
413
|
+
...typeof record.criticalUncoveredTotal === "number" ? { criticalUncoveredTotal: record.criticalUncoveredTotal } : {},
|
|
414
|
+
...record.runFactPairsTruncated === true ? { runFactPairsTruncated: true } : {},
|
|
415
|
+
...record.judgeFailed === true ? { judgeFailed: true } : {}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
388
418
|
/**
|
|
389
419
|
* `--strict` (the v1.40.0 improvement plan's completion contract): a
|
|
390
420
|
* settled ok run whose orchestration acceptance envelope reports a
|
|
@@ -393,16 +423,36 @@ function reportOutcome(outcome, io) {
|
|
|
393
423
|
* that never opted into orchestrate acceptance) and nonzero exit codes
|
|
394
424
|
* pass through unchanged, so the flag never masks the ordinary status
|
|
395
425
|
* exit and never bites a plain workflow.
|
|
426
|
+
*
|
|
427
|
+
* Completion is a MECHANICAL verdict, and the eighteenth comparison
|
|
428
|
+
* benchmark showed how easily `completion: 'complete'` reads as
|
|
429
|
+
* semantic green while the claim judge saw 40 of 144 citing sentences.
|
|
430
|
+
* So strict also reads the claim-coverage grade (RV1702) when the
|
|
431
|
+
* outcome carries a claim-consistency meta: `'judge-failed'` (nothing
|
|
432
|
+
* was judged) and `'critical-uncovered'` (declared claims went
|
|
433
|
+
* unverified) exit nonzero, because both previously slipped through
|
|
434
|
+
* strict as green; `'partial'` prints its counts to stderr and keeps
|
|
435
|
+
* the exit, because the bounded pass is the documented default and
|
|
436
|
+
* declaring critical anchors is the opt-in that makes the subset
|
|
437
|
+
* enforceable.
|
|
396
438
|
*/
|
|
397
439
|
function strictExitCode(outcome, base, io) {
|
|
398
440
|
if (base !== 0 || outcome.status !== "ok") return base;
|
|
399
441
|
const value = outcome.value;
|
|
400
442
|
const completion = typeof value === "object" && value !== null && typeof value.completion === "string" ? value.completion : void 0;
|
|
401
|
-
if (completion
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
443
|
+
if (completion !== void 0 && completion !== "complete") {
|
|
444
|
+
io.err(`strict: the orchestration acceptance reports completion '${sanitizeTerminalText(completion)}'`);
|
|
445
|
+
const reasons = Array.isArray(value?.degradedReasons) ? value.degradedReasons : [];
|
|
446
|
+
for (const reason of reasons.filter((entry) => typeof entry === "string")) io.err(` ${sanitizeTerminalText(reason)}`);
|
|
447
|
+
return 1;
|
|
448
|
+
}
|
|
449
|
+
const grade = coverageGradeOf(value);
|
|
450
|
+
if (grade === "judge-failed" || grade === "critical-uncovered") {
|
|
451
|
+
io.err(`strict: claim coverage '${grade}': ` + (grade === "judge-failed" ? "the claim-consistency judge did not settle ok, so nothing was judged" : "declared critical anchors got no judged pair"));
|
|
452
|
+
return 1;
|
|
453
|
+
}
|
|
454
|
+
if (grade === "partial") io.err("strict: claim coverage 'partial': the judge saw a bounded subset of the citing sentences; declare critical anchors (or raise the pair bound) to make the subset enforceable");
|
|
455
|
+
return base;
|
|
406
456
|
}
|
|
407
457
|
//#endregion
|
|
408
458
|
//#region src/grammar.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.179.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.179.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/store-sqlite": "1.179.0",
|
|
32
|
+
"@rulvar/testing": "1.179.0",
|
|
33
|
+
"@rulvar/planner": "1.179.0",
|
|
34
|
+
"@rulvar/plan": "1.179.0",
|
|
35
|
+
"@rulvar/evals": "1.179.0"
|
|
36
36
|
},
|
|
37
37
|
"bin": {
|
|
38
38
|
"rulvar": "./dist/cli.js"
|