promptwheel 0.8.4 → 0.8.6
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/bin/promptwheel.d.ts +2 -0
- package/bin/promptwheel.mjs +18 -3
- package/package.json +1 -1
package/bin/promptwheel.d.ts
CHANGED
|
@@ -254,6 +254,8 @@ export interface SetupFailure {
|
|
|
254
254
|
// ---------------------------------------------------------------------------
|
|
255
255
|
|
|
256
256
|
/** The Contract revision this build implements; bumps only when the verdict schema or the exit codes change. */
|
|
257
|
+
/** The output lines read as a missing dependency in the clean copy (module not found, a shell's "command not found"). */
|
|
258
|
+
export declare const MISSING_DEP: RegExp;
|
|
257
259
|
export declare const CONTRACT_VERSION: '1';
|
|
258
260
|
export declare const VERDICTS: readonly ['pass', 'fail', 'gamed', 'inconclusive'];
|
|
259
261
|
export declare const METRIC_STATUSES: readonly ['improved', 'regressed', 'unchanged', 'inconclusive', 'unmeasurable'];
|
package/bin/promptwheel.mjs
CHANGED
|
@@ -165,7 +165,7 @@ const exitCodes = new WeakMap();
|
|
|
165
165
|
const neverRan = (samples) => { const c = exitCodes.get(samples) || []; return c.length > 0 && c.every((x) => x == null || x === 126 || x === 127); };
|
|
166
166
|
// Why a metric's command failed, read from its output: a dependency the clean copy does not have reads differently
|
|
167
167
|
// from tests that simply fail. A hint for the person, never part of a verdict.
|
|
168
|
-
const MISSING_DEP = /Cannot find (?:module|package) ['"][^'"\n]+['"]|ERR_MODULE_NOT_FOUND[^\n]*|ModuleNotFoundError: [^\n]+|No module named [^\n]+|error TS2307: [^\n]+|[^\n:]
|
|
168
|
+
const MISSING_DEP = /Cannot find (?:module|package) ['"][^'"\n]+['"]|ERR_MODULE_NOT_FOUND[^\n]*|ModuleNotFoundError: [^\n]+|No module named [^\n]+|error TS2307: [^\n]+|(?:^|\n)[^\n:]*(?:sh|bash|zsh|dash)(?::\s*\d+)?:[^\n]*?: (?:command )?not found[^\n]*|(?:^|\n)\S+: command not found[^\n]*|can't find crate[^\n]*|cannot find package [^\n]+/i;
|
|
169
169
|
function whyFailed(text) {
|
|
170
170
|
const m = String(text || '').replace(/\x1b\[[0-9;]*m/g, '').match(MISSING_DEP);
|
|
171
171
|
return m ? { cause: 'missing-dependency', detail: m[0].trim().slice(0, 200) } : { cause: 'failing' };
|
|
@@ -356,6 +356,13 @@ const NON_SOURCE = [
|
|
|
356
356
|
/(^|\/)(tests?|__tests?__|spec|e2e|fixtures|snapshots|__snapshots__|__mocks__)\//i,
|
|
357
357
|
/\.(test|spec)\.[cm]?[jt]sx?$/i,
|
|
358
358
|
/(^|\/)tests?\.[cm]?[jt]sx?$/i, // a file literally named test.js / tests.ts
|
|
359
|
+
// hyphen names (ava's and node --test's test-*.js, *-test.js, *-spec.js) count outside src/, lib/ and scripts/ only: real
|
|
360
|
+
// production code is named test-patterns.ts or generate-test.ts (found across 18k files, 2026-11-10). A fixed
|
|
361
|
+
// test-release.js at the root read as a source win before this (sendback bench, p-map).
|
|
362
|
+
/^(?!(?:.*\/)?(?:src|lib|scripts)\/)(?:.*\/)?tests?-[^/]*\.[cm]?[jt]sx?$/i,
|
|
363
|
+
/^(?!(?:.*\/)?(?:src|lib|scripts)\/)(?:.*\/)?[^/]+-(test|spec)\.[cm]?[jt]sx?$/i,
|
|
364
|
+
/_test\.[cm]?[jt]sx?$/i, // node --test's, Deno's and Bun's *_test.js, anywhere (a strong signal)
|
|
365
|
+
/\.test-d\.[cm]?tsx?$/i, // tsd type tests (index.test-d.ts), run by a test script like xo && ava && tsd
|
|
359
366
|
/(^|\/)test_[^/]*\.py$/i, /_test\.py$/i, /(^|\/)conftest\.py$/i,
|
|
360
367
|
// cross-language test-filename conventions, strong-signal tokens only (a dedicated
|
|
361
368
|
// _test / _spec / Test(s) suffix, or a file literally named test.<lang>), so production
|
|
@@ -367,7 +374,15 @@ const NON_SOURCE = [
|
|
|
367
374
|
/(^|\/)test_[^/]*\.(c|cc|cpp|cxx|h|hpp|go|rs)$/i,
|
|
368
375
|
/_test\.(c|cc|cpp|cxx|h|hpp|go|rs|rb)$/i,
|
|
369
376
|
/_spec\.rb$/i,
|
|
370
|
-
/[a-z0-9](Test|Tests)\.(java|kt|kts|scala)$/,
|
|
377
|
+
/[a-z0-9](Test|Tests)\.(java|kt|kts|scala|cs|php|swift)$/, // JUnit, xUnit/NUnit (.NET), PHPUnit, XCTest
|
|
378
|
+
/(^|\/)[^/]+\.Tests?(\/|\.csproj$)/, // a .NET test project: MyApp.Tests/ and MyApp.Tests.csproj
|
|
379
|
+
/_spec\.[cm]?[jt]sx?$/i, // Bun's *_spec.ts
|
|
380
|
+
/\.cy\.[cm]?[jt]sx?$/i, // Cypress specs (login.cy.ts)
|
|
381
|
+
/_test\.(exs|dart)$/i, /(^|\/)integration_test\//i, // ExUnit, Dart and Flutter
|
|
382
|
+
/(^|\/)testdata\//i, /(^|\/)benches\//i, // Go test data at any depth, Rust benchmarks
|
|
383
|
+
// test runner and coverage-gate config: editing these skips tests or loosens a threshold
|
|
384
|
+
/(^|\/)\.(mocharc|nycrc|c8rc|coveragerc)[^/]*$/i, /(^|\/)\.rspec$/i, /(^|\/)codecov\.ya?ml$/i,
|
|
385
|
+
/(^|\/)phpunit\.xml(\.dist)?$/i, /(^|\/)vitest\.workspace\.[^/]+$/i, /(^|\/)setupTests\.[cm]?[jt]sx?$/i,
|
|
371
386
|
/\.snap$/i, /(^|\/)golden[^/]*$/i, /\.golden$/i,
|
|
372
387
|
// a grader/eval/score FILE by name in a scripting language (eval.py, grader-x.js, grade.sh, scoring.ts), never a
|
|
373
388
|
// prefix: evaluate.ts, evaluation.py, scoreboard.js stay source. Compiled names stay source too (eval.c, eval.go
|
|
@@ -1368,7 +1383,7 @@ function parseArgs(argv) {
|
|
|
1368
1383
|
|
|
1369
1384
|
// pure, side-effect-free helpers are exported for unit testing; the CLI below only
|
|
1370
1385
|
// runs when this file is executed directly (not when imported by the test suite).
|
|
1371
|
-
export { extract, evaluate, median, spread, renderMarkdown, isNonSource, evaluatorMatcher, gain, judgeGaming, verdictFingerprint };
|
|
1386
|
+
export { MISSING_DEP, extract, evaluate, median, spread, renderMarkdown, isNonSource, evaluatorMatcher, gain, judgeGaming, verdictFingerprint };
|
|
1372
1387
|
|
|
1373
1388
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
1374
1389
|
// Public library API: the Verified-Outcome Contract, in process.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "promptwheel",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "A deterministic, zero-LLM check for your coding loop. A win must survive a re-run from the agent's source edits alone, so a test that went green by editing the test reads GAMED. Runs in CI or a Claude Code plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|