patchwork-os 0.2.0-beta.13.canary.284 → 0.2.0-beta.13.canary.286
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/index.js +17 -8
- package/dist/index.js.map +1 -1
- package/dist/recipeOrchestration.d.ts +6 -1
- package/dist/recipeOrchestration.js +23 -3
- package/dist/recipeOrchestration.js.map +1 -1
- package/dist/workers/backtest.d.ts +61 -0
- package/dist/workers/backtest.js +103 -0
- package/dist/workers/backtest.js.map +1 -0
- package/dist/workers/contextRiskScorer.d.ts +48 -0
- package/dist/workers/contextRiskScorer.js +94 -0
- package/dist/workers/contextRiskScorer.js.map +1 -0
- package/dist/workers/runWorkerShadow.d.ts +7 -0
- package/dist/workers/runWorkerShadow.js +29 -0
- package/dist/workers/runWorkerShadow.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3844,12 +3844,18 @@ if (process.argv[2] === "shadow-scan") {
|
|
|
3844
3844
|
// and prints the dial + a "ramp would vs gate did" comparison. Changes nothing.
|
|
3845
3845
|
if (process.argv[2] === "workers") {
|
|
3846
3846
|
const args = process.argv.slice(3);
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
"
|
|
3847
|
+
const sub = args[0];
|
|
3848
|
+
if ((sub !== "shadow" && sub !== "backtest") ||
|
|
3849
|
+
args.includes("--help") ||
|
|
3850
|
+
args.includes("-h")) {
|
|
3851
|
+
process.stdout.write("Usage: patchwork workers <shadow|backtest> [--workers-dir <path>]\n\n" +
|
|
3852
|
+
" shadow Read-only worker trust dial: replays ~/.patchwork/runs.jsonl\n" +
|
|
3853
|
+
" + the gate decision log through the (worker × action-class)\n" +
|
|
3854
|
+
" ramp. Computes what the ramp WOULD decide vs what the gate DID.\n" +
|
|
3855
|
+
" backtest Replays each worker's history and reports DIVERGENCE: where the\n" +
|
|
3856
|
+
" ramp would have auto-run a bad action (false-allow, the risk) or\n" +
|
|
3857
|
+
" gated a good one (false-gate, the cost). Calibration, not a\n" +
|
|
3858
|
+
" success rate. Neither command changes a live decision.\n\n" +
|
|
3853
3859
|
" --workers-dir <path> Where *.worker.yaml live (default ~/.patchwork/workers)\n");
|
|
3854
3860
|
process.exit(0);
|
|
3855
3861
|
}
|
|
@@ -3857,8 +3863,11 @@ if (process.argv[2] === "workers") {
|
|
|
3857
3863
|
try {
|
|
3858
3864
|
const dirIdx = args.indexOf("--workers-dir");
|
|
3859
3865
|
const workersDir = dirIdx !== -1 ? args[dirIdx + 1] : undefined;
|
|
3860
|
-
const { runWorkerShadowReport } = await import("./workers/runWorkerShadow.js");
|
|
3861
|
-
|
|
3866
|
+
const { runWorkerShadowReport, runWorkerBacktest } = await import("./workers/runWorkerShadow.js");
|
|
3867
|
+
const opts = workersDir ? { workersDir } : {};
|
|
3868
|
+
process.stdout.write(sub === "backtest"
|
|
3869
|
+
? runWorkerBacktest(opts)
|
|
3870
|
+
: runWorkerShadowReport(opts));
|
|
3862
3871
|
}
|
|
3863
3872
|
catch (err) {
|
|
3864
3873
|
process.stderr.write(`Error: ${err instanceof Error ? err.message : String(err)}\n`);
|