@skill-harness/cli 0.7.0 → 0.8.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 +46 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFileSync, existsSync, mkdirSync, writeFileSync, mkdtempSync, rmSync
|
|
|
3
3
|
import { load as yamlLoad } from "js-yaml";
|
|
4
4
|
import { basename, dirname, join, resolve, relative } from "node:path";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
|
-
import { discover, resolveSkill, loadSpec, parseSpec, appendScenario, parseModelRef, runSkillModel, formatScorecard, readResults, regradeRun, lintSkill, failsGate, renderTemplateSpec, isTemplateSpec, renderDraftSpec, buildSuggestPrompt, parseSuggestDraft, rescoreRun, regateRun, specPathForRunDir, collectLift, collectStability, boundaryCells, stabilityNote, PATH_LEGEND, resolveAdjudicationJudges, adjudicateRun, judgeResemblesSubject, computeCoverage, formatCoverage, selectAffected, formatAffected, gitDiff, exec, HARNESS_VERSION, defaultJudge, assertJudgeAllowed, assertNotDowngraded, downgradeWarning, } from "@skill-harness/core";
|
|
6
|
+
import { discover, resolveSkill, loadSpec, parseSpec, appendScenario, parseModelRef, runSkillModel, formatScorecard, readResults, regradeRun, lintSkill, failsGate, renderTemplateSpec, isTemplateSpec, renderDraftSpec, buildSuggestPrompt, parseSuggestDraft, rescoreRun, regateRun, specPathForRunDir, collectLift, collectStability, boundaryCells, stabilityNote, PATH_LEGEND, restampSkill, resolveAdjudicationJudges, adjudicateRun, judgeResemblesSubject, computeCoverage, formatCoverage, selectAffected, formatAffected, gitDiff, exec, HARNESS_VERSION, defaultJudge, assertJudgeAllowed, assertNotDowngraded, downgradeWarning, } from "@skill-harness/core";
|
|
7
7
|
import { getAdapter } from "@skill-harness/adapters";
|
|
8
8
|
import { serveReview } from "./serve.js";
|
|
9
9
|
const DEFAULT_MODEL = "fireworks:accounts/fireworks/models/deepseek-v4-pro";
|
|
@@ -358,6 +358,49 @@ export async function cmdRegate(args, adapterOverride) {
|
|
|
358
358
|
* spec; it is a statement about how much one run of that cell is worth. Making it a
|
|
359
359
|
* gate would turn "this needs more reps" into "your build is broken".
|
|
360
360
|
*/
|
|
361
|
+
/**
|
|
362
|
+
* Upgrade committed runs to the model-visible skill digest — free, offline, no re-runs.
|
|
363
|
+
*
|
|
364
|
+
* Run it once on a board that lints clean. Every record whose SKILL.md (or agent file)
|
|
365
|
+
* still matches the bytes it measured gains a digest of that same file's model-visible
|
|
366
|
+
* text, after which editing frontmatter the model never receives — `allowed-tools:`, a
|
|
367
|
+
* tool ceiling — stops demanding a paid re-run. Records whose file has already moved are
|
|
368
|
+
* left alone: nothing in a one-way hash can say whether that edit touched the body, and
|
|
369
|
+
* inventing freshness is the one thing this gate must never do.
|
|
370
|
+
*/
|
|
371
|
+
async function cmdRestamp(args) {
|
|
372
|
+
const root = flagStr(args, "skills", process.cwd());
|
|
373
|
+
const target = args._[0] ?? "all";
|
|
374
|
+
const skills = target === "all" ? discover(root).filter((s) => s.hasSpec) : [resolveSkill(root, target)];
|
|
375
|
+
if (skills.length === 0)
|
|
376
|
+
throw new Error(`no skills with a spec under ${root}`);
|
|
377
|
+
let runs = 0;
|
|
378
|
+
let upgraded = 0;
|
|
379
|
+
let unprovable = 0;
|
|
380
|
+
let unchanged = 0;
|
|
381
|
+
let partial = 0;
|
|
382
|
+
for (const skill of skills) {
|
|
383
|
+
const r = restampSkill(skill.dir, { from: flagStr(args, "from") });
|
|
384
|
+
runs += r.runs;
|
|
385
|
+
upgraded += r.upgraded;
|
|
386
|
+
unprovable += r.unprovable;
|
|
387
|
+
unchanged += r.unchanged;
|
|
388
|
+
partial += r.partial;
|
|
389
|
+
console.log(`\n${skill.name}: ${r.upgraded} upgraded, ${r.unprovable} left alone, ${r.unchanged} already current (${r.runs} run(s))`);
|
|
390
|
+
for (const a of r.added)
|
|
391
|
+
console.log(` + ${a}`);
|
|
392
|
+
if (r.unprovable > 0) {
|
|
393
|
+
console.log(` ${r.unprovable} left alone — a document they measured has already moved, so no digest of it can be proven; \`lint\` names the remedy`);
|
|
394
|
+
}
|
|
395
|
+
if (r.partial > 0) {
|
|
396
|
+
console.log(` ${r.partial} of the upgraded still carry a document that could not be proven`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
// The three buckets sum to the records examined, on purpose: a total that does not add
|
|
400
|
+
// up reads like the command skipped something rather than like there being nothing to do.
|
|
401
|
+
console.log(`\n${runs} run(s) examined: ${upgraded} upgraded, ${unprovable} left alone, ${unchanged} already current.` +
|
|
402
|
+
`${partial > 0 ? ` (${partial} upgraded only in part.)` : ""} No models were called.`);
|
|
403
|
+
}
|
|
361
404
|
async function cmdStability(args) {
|
|
362
405
|
const root = flagStr(args, "skills", process.cwd());
|
|
363
406
|
const target = args._[0] ?? "all";
|
|
@@ -713,6 +756,7 @@ export function help() {
|
|
|
713
756
|
ship-deciding). OFF by default; prints the exact MAX extra call count first.
|
|
714
757
|
rescore <run-dir>... re-score saved reps vs current spec thresholds (free)
|
|
715
758
|
regate <run-dir>... [--judge prov:model] re-evaluate diff needles against the saved diffs (free; judges only reps whose gate flipped)
|
|
759
|
+
restamp <skill|all> --skills <root> [--from <git-ref>] record the model-visible skill digest on runs that still match (free, offline; one-time migration)
|
|
716
760
|
stability <skill|all> --skills <root> [--window N] [--all] run-over-run verdict flips per scenario (free, offline)
|
|
717
761
|
review <skill> --skills <root> [--port N] serve the interactive review UI
|
|
718
762
|
add-test <skill> --skills <root> --id ID --title T --turn ... --check ... [--critical] [--mode seeded --fixture path]
|
|
@@ -740,6 +784,7 @@ export async function main(argv) {
|
|
|
740
784
|
case "grade": return cmdGrade(args);
|
|
741
785
|
case "rescore": return cmdRescore(args);
|
|
742
786
|
case "regate": return cmdRegate(args);
|
|
787
|
+
case "restamp": return cmdRestamp(args);
|
|
743
788
|
case "stability": return cmdStability(args);
|
|
744
789
|
case "review": return cmdReview(args);
|
|
745
790
|
case "add-test": return cmdAddTest(args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skill-harness/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "skill-harness CLI — run, grade, review, and lint agent-skill scenarios on the pi harness",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"prepack": "rm -rf ./assets && mkdir -p ./assets && cp ../../assets/report.* ./assets/ && cp ../../LICENSE ./LICENSE"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@skill-harness/core": "0.
|
|
48
|
-
"@skill-harness/adapters": "0.
|
|
47
|
+
"@skill-harness/core": "0.8.0",
|
|
48
|
+
"@skill-harness/adapters": "0.8.0"
|
|
49
49
|
}
|
|
50
50
|
}
|