skillfit 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +226 -2
- package/README.zh-CN.md +224 -0
- package/benches/README.md +172 -0
- package/benches/code-review/bench.json +57 -0
- package/benches/code-review/fixtures/explain-x1/.skillfit-mock.json +10 -0
- package/benches/code-review/fixtures/explain-x1/SPEC.md +16 -0
- package/benches/code-review/fixtures/explain-x1/src/compact.js +18 -0
- package/benches/code-review/fixtures/explain-x1/tests/compact.test.js +18 -0
- package/benches/code-review/fixtures/review-r1/.skillfit-mock.json +10 -0
- package/benches/code-review/fixtures/review-r1/CHANGES.diff +42 -0
- package/benches/code-review/fixtures/review-r1/SPEC.md +16 -0
- package/benches/code-review/fixtures/review-r1/src/errors.js +7 -0
- package/benches/code-review/fixtures/review-r1/src/money.js +3 -0
- package/benches/code-review/fixtures/review-r1/src/order.js +13 -0
- package/benches/code-review/fixtures/review-r1/tests/order.test.js +17 -0
- package/benches/code-review/fixtures/review-r2/.skillfit-mock.json +10 -0
- package/benches/code-review/fixtures/review-r2/CHANGES.diff +81 -0
- package/benches/code-review/fixtures/review-r2/SPEC.md +25 -0
- package/benches/code-review/fixtures/review-r2/src/errors.js +7 -0
- package/benches/code-review/fixtures/review-r2/src/invoice.js +9 -0
- package/benches/code-review/fixtures/review-r2/src/money.js +3 -0
- package/benches/code-review/fixtures/review-r2/tests/invoice.test.js +13 -0
- package/benches/code-review/fixtures/review-r3/.skillfit-mock.json +10 -0
- package/benches/code-review/fixtures/review-r3/CHANGES.diff +76 -0
- package/benches/code-review/fixtures/review-r3/SPEC.md +24 -0
- package/benches/code-review/fixtures/review-r3/src/errors.js +7 -0
- package/benches/code-review/fixtures/review-r3/src/money.js +3 -0
- package/benches/code-review/fixtures/review-r3/src/pricing.js +20 -0
- package/benches/code-review/fixtures/review-r3/tests/pricing.test.js +15 -0
- package/benches/code-review/fixtures/summarize-s1/.skillfit-mock.json +16 -0
- package/benches/code-review/fixtures/summarize-s1/CHANGES.diff +27 -0
- package/benches/code-review/fixtures/summarize-s1/SPEC.md +15 -0
- package/benches/code-review/fixtures/summarize-s1/src/discount.js +20 -0
- package/benches/code-review/fixtures/summarize-s1/src/errors.js +7 -0
- package/benches/code-review/fixtures/summarize-s1/src/money.js +7 -0
- package/benches/code-review/ground-truth/oracle-r1.mjs +21 -0
- package/benches/code-review/ground-truth/oracle-r2.mjs +21 -0
- package/benches/code-review/ground-truth/oracle-r3.mjs +20 -0
- package/benches/code-review/ground-truth/oracle-summarize-s1.mjs +21 -0
- package/benches/code-review/ground-truth/oracle-x1.mjs +18 -0
- package/benches/code-review/ground-truth/r1.md +22 -0
- package/benches/code-review/ground-truth/r2.md +21 -0
- package/benches/code-review/ground-truth/r3.md +18 -0
- package/benches/code-review/ground-truth/summarize-s1.md +26 -0
- package/benches/code-review/ground-truth/x1.md +7 -0
- package/benches/code-review/prompts/explain-x1.md +5 -0
- package/benches/code-review/prompts/explain-x1.trigger.md +5 -0
- package/benches/code-review/prompts/review-r1.md +7 -0
- package/benches/code-review/prompts/review-r1.trigger.md +7 -0
- package/benches/code-review/prompts/review-r2.md +7 -0
- package/benches/code-review/prompts/review-r2.trigger.md +7 -0
- package/benches/code-review/prompts/review-r3.md +7 -0
- package/benches/code-review/prompts/review-r3.trigger.md +7 -0
- package/benches/code-review/prompts/summarize-s1.md +9 -0
- package/benches/code-review/prompts/summarize-s1.trigger.md +9 -0
- package/benches/code-review/verifiers/explain-x1.mjs +30 -0
- package/benches/code-review/verifiers/review-r2.mjs +66 -0
- package/benches/code-review/verifiers/review-r3.mjs +60 -0
- package/benches/code-review/verifiers/seeded-bugs.mjs +74 -0
- package/benches/code-review/verifiers/summarize-s1.mjs +80 -0
- package/benches/contrib/README.md +42 -0
- package/benches/contrib/oss-lru-cache/README.md +24 -0
- package/benches/contrib/oss-lru-cache/bench.json +37 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-abort/LICENSE +15 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-abort/README.md +3 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-abort/index.js +1044 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-abort/package.json +11 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-abort/runtime.mjs +22 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-abort/test.mjs +11 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/LICENSE.md +55 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/README.md +3 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/package.json +11 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/runtime.mjs +22 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/src/diagnostics-channel-browser.ts +11 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/src/diagnostics-channel-cjs.cts +11 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/src/diagnostics-channel-esm.mts +29 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/src/diagnostics-channel-node.ts +7 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/src/diagnostics-channel.ts +6 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/src/index.ts +3148 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/src/perf.ts +17 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-lifecycle/test.mjs +11 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-size/LICENSE +15 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-size/README.md +3 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-size/index.js +1028 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-size/package.json +11 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-size/runtime.mjs +22 -0
- package/benches/contrib/oss-lru-cache/fixtures/fetch-size/test.mjs +11 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-abort/LICENSE +15 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-abort/index.js +1053 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-abort.md +11 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/LICENSE.md +55 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/src/diagnostics-channel-browser.ts +11 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/src/diagnostics-channel-cjs.cts +11 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/src/diagnostics-channel-esm.mts +29 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/src/diagnostics-channel-node.ts +7 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/src/diagnostics-channel.ts +6 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/src/index.ts +3174 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle/src/perf.ts +17 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-lifecycle.md +11 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-size/LICENSE +15 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-size/index.js +1028 -0
- package/benches/contrib/oss-lru-cache/ground-truth/fetch-size.md +11 -0
- package/benches/contrib/oss-lru-cache/ground-truth/oracle-fetch-abort.mjs +8 -0
- package/benches/contrib/oss-lru-cache/ground-truth/oracle-fetch-lifecycle.mjs +7 -0
- package/benches/contrib/oss-lru-cache/ground-truth/oracle-fetch-size.mjs +7 -0
- package/benches/contrib/oss-lru-cache/ground-truth/oracle.mjs +9 -0
- package/benches/contrib/oss-lru-cache/prompts/fetch-abort.md +5 -0
- package/benches/contrib/oss-lru-cache/prompts/fetch-lifecycle.md +5 -0
- package/benches/contrib/oss-lru-cache/prompts/fetch-size.md +5 -0
- package/benches/contrib/oss-lru-cache/provenance.json +62 -0
- package/benches/contrib/oss-lru-cache/runtime.mjs +22 -0
- package/benches/contrib/oss-lru-cache/verifiers/cases.mjs +74 -0
- package/benches/contrib/oss-lru-cache/verifiers/fetch-abort.mjs +3 -0
- package/benches/contrib/oss-lru-cache/verifiers/fetch-lifecycle.mjs +3 -0
- package/benches/contrib/oss-lru-cache/verifiers/fetch-size.mjs +3 -0
- package/benches/contrib/oss-lru-cache/verifiers/probe.mjs +14 -0
- package/benches/contrib/oss-lru-cache/verifiers/shared.mjs +130 -0
- package/benches/contrib/oss-lru-cache/verifiers/test-reporter.mjs +29 -0
- package/benches/contrib/oss-mcp-use-utf8/LICENSE.upstream +21 -0
- package/benches/contrib/oss-mcp-use-utf8/README.md +56 -0
- package/benches/contrib/oss-mcp-use-utf8/bench.json +16 -0
- package/benches/contrib/oss-mcp-use-utf8/fixtures/view-utf8/LICENSE +21 -0
- package/benches/contrib/oss-mcp-use-utf8/fixtures/view-utf8/package.json +3 -0
- package/benches/contrib/oss-mcp-use-utf8/fixtures/view-utf8/src/ext-apps-bridge.js +3 -0
- package/benches/contrib/oss-mcp-use-utf8/fixtures/view-utf8/src/resolve-view-resource.ts +96 -0
- package/benches/contrib/oss-mcp-use-utf8/fixtures/view-utf8/test/basic.test.mjs +13 -0
- package/benches/contrib/oss-mcp-use-utf8/ground-truth/README.md +5 -0
- package/benches/contrib/oss-mcp-use-utf8/ground-truth/oracle-view-utf8.mjs +11 -0
- package/benches/contrib/oss-mcp-use-utf8/ground-truth/solutions/view-utf8/src/resolve-view-resource.ts +96 -0
- package/benches/contrib/oss-mcp-use-utf8/ground-truth/solutions/view-utf8/test/utf8.regression.test.mjs +14 -0
- package/benches/contrib/oss-mcp-use-utf8/prompts/view-utf8.md +8 -0
- package/benches/contrib/oss-mcp-use-utf8/verifiers/view-utf8.mjs +120 -0
- package/benches/contrib/waza-behavior/LICENSE.upstream +21 -0
- package/benches/contrib/waza-behavior/README.md +31 -0
- package/benches/contrib/waza-behavior/bench.json +10 -0
- package/benches/contrib/waza-behavior/fixtures/explicit-hold/README.md +1 -0
- package/benches/contrib/waza-behavior/fixtures/explicit-hold/notes.txt +1 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-current/README.md +1 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-current/docs/guide.md +2 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-current/notes.txt +1 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-current/scripts/check-links.mjs +16 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-current/validation-receipt.json +10 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-stale/README.md +1 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-stale/docs/guide.md +3 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-stale/notes.txt +1 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-stale/scripts/check-links.mjs +16 -0
- package/benches/contrib/waza-behavior/fixtures/receipt-stale/validation-receipt.json +10 -0
- package/benches/contrib/waza-behavior/ground-truth/oracle.mjs +24 -0
- package/benches/contrib/waza-behavior/prompts/explicit-hold.md +1 -0
- package/benches/contrib/waza-behavior/prompts/receipt-current.md +1 -0
- package/benches/contrib/waza-behavior/prompts/receipt-stale.md +1 -0
- package/benches/contrib/waza-behavior/verifiers/behavior.mjs +59 -0
- package/benches/debugging/bench.json +93 -0
- package/benches/debugging/fixtures/async-queue/src/task-queue.mjs +50 -0
- package/benches/debugging/fixtures/async-queue/test/basic.test.mjs +18 -0
- package/benches/debugging/fixtures/chunked-decoder/src/frame-decoder.mjs +39 -0
- package/benches/debugging/fixtures/chunked-decoder/test/basic.test.mjs +17 -0
- package/benches/debugging/fixtures/debug-redaction/src/debug-redaction.mjs +33 -0
- package/benches/debugging/fixtures/debug-redaction/test/basic.test.mjs +26 -0
- package/benches/debugging/fixtures/document-queue/.skillfit-mock.json +16 -0
- package/benches/debugging/fixtures/document-queue/src/task-queue.mjs +52 -0
- package/benches/debugging/fixtures/document-queue/test/basic.test.mjs +23 -0
- package/benches/debugging/fixtures/explain-cache/.skillfit-mock.json +16 -0
- package/benches/debugging/fixtures/explain-cache/src/ttl-cache.mjs +31 -0
- package/benches/debugging/fixtures/explain-cache/test/basic.test.mjs +28 -0
- package/benches/debugging/fixtures/feat-slug/test/slug.test.mjs +15 -0
- package/benches/debugging/fixtures/range-parser/src/range-parser.mjs +9 -0
- package/benches/debugging/fixtures/range-parser/test/basic.test.mjs +8 -0
- package/benches/debugging/fixtures/ttl-cache/src/ttl-cache.mjs +30 -0
- package/benches/debugging/fixtures/ttl-cache/test/basic.test.mjs +11 -0
- package/benches/debugging/ground-truth/async-queue.md +81 -0
- package/benches/debugging/ground-truth/chunked-decoder.md +91 -0
- package/benches/debugging/ground-truth/debug-redaction.md +113 -0
- package/benches/debugging/ground-truth/document-queue.md +24 -0
- package/benches/debugging/ground-truth/explain-cache.md +22 -0
- package/benches/debugging/ground-truth/feat-slug.md +45 -0
- package/benches/debugging/ground-truth/oracle-async-queue.mjs +14 -0
- package/benches/debugging/ground-truth/oracle-chunked-decoder.mjs +14 -0
- package/benches/debugging/ground-truth/oracle-debug-redaction.mjs +30 -0
- package/benches/debugging/ground-truth/oracle-document-queue.mjs +27 -0
- package/benches/debugging/ground-truth/oracle-explain-cache.mjs +28 -0
- package/benches/debugging/ground-truth/oracle-feat-slug.mjs +13 -0
- package/benches/debugging/ground-truth/oracle-range-parser.mjs +14 -0
- package/benches/debugging/ground-truth/oracle-ttl-cache.mjs +14 -0
- package/benches/debugging/ground-truth/range-parser.md +121 -0
- package/benches/debugging/ground-truth/solutions/async-queue/src/task-queue.mjs +52 -0
- package/benches/debugging/ground-truth/solutions/chunked-decoder/src/frame-decoder.mjs +50 -0
- package/benches/debugging/ground-truth/solutions/debug-redaction/src/debug-redaction.mjs +27 -0
- package/benches/debugging/ground-truth/solutions/debug-redaction/test/debug-leak.regression.test.mjs +27 -0
- package/benches/debugging/ground-truth/solutions/feat-slug/src/slug.mjs +6 -0
- package/benches/debugging/ground-truth/solutions/range-parser/src/range-parser.mjs +34 -0
- package/benches/debugging/ground-truth/solutions/range-parser/test/basic.test.mjs +26 -0
- package/benches/debugging/ground-truth/solutions/ttl-cache/src/ttl-cache.mjs +31 -0
- package/benches/debugging/ground-truth/ttl-cache.md +69 -0
- package/benches/debugging/prompts/async-queue.md +13 -0
- package/benches/debugging/prompts/async-queue.trigger.md +13 -0
- package/benches/debugging/prompts/chunked-decoder.md +13 -0
- package/benches/debugging/prompts/chunked-decoder.trigger.md +13 -0
- package/benches/debugging/prompts/debug-redaction.md +23 -0
- package/benches/debugging/prompts/debug-redaction.trigger.md +23 -0
- package/benches/debugging/prompts/document-queue.md +10 -0
- package/benches/debugging/prompts/document-queue.trigger.md +10 -0
- package/benches/debugging/prompts/explain-cache.md +10 -0
- package/benches/debugging/prompts/explain-cache.trigger.md +10 -0
- package/benches/debugging/prompts/feat-slug.md +3 -0
- package/benches/debugging/prompts/feat-slug.trigger.md +5 -0
- package/benches/debugging/prompts/range-parser.md +15 -0
- package/benches/debugging/prompts/range-parser.trigger.md +15 -0
- package/benches/debugging/prompts/ttl-cache.md +18 -0
- package/benches/debugging/prompts/ttl-cache.trigger.md +18 -0
- package/benches/debugging/verifiers/async-queue.mjs +221 -0
- package/benches/debugging/verifiers/chunked-decoder.mjs +208 -0
- package/benches/debugging/verifiers/debug-redaction.mjs +283 -0
- package/benches/debugging/verifiers/document-queue.mjs +52 -0
- package/benches/debugging/verifiers/explain-cache.mjs +62 -0
- package/benches/debugging/verifiers/feat-slug.mjs +127 -0
- package/benches/debugging/verifiers/range-parser.mjs +146 -0
- package/benches/debugging/verifiers/ttl-cache.mjs +111 -0
- package/dist/agents.js +26 -0
- package/dist/cli.js +310 -0
- package/dist/cli.test.js +76 -0
- package/dist/commands/bench.js +1035 -0
- package/dist/commands/bench.test.js +1061 -0
- package/dist/commands/bundle.js +334 -0
- package/dist/commands/bundle.test.js +142 -0
- package/dist/commands/confirm.js +39 -0
- package/dist/commands/doctor.js +399 -0
- package/dist/commands/doctor.test.js +280 -0
- package/dist/commands/eval-report.js +485 -0
- package/dist/commands/eval-report.test.js +306 -0
- package/dist/commands/eval.js +391 -0
- package/dist/commands/eval.test.js +446 -0
- package/dist/commands/install.js +653 -0
- package/dist/commands/install.test.js +555 -0
- package/dist/commands/mcp.js +20 -0
- package/dist/commands/report.js +78 -0
- package/dist/commands/report.test.js +110 -0
- package/dist/commands/setup.js +95 -0
- package/dist/commands/setup.test.js +150 -0
- package/dist/commands/upstream.js +210 -0
- package/dist/commands/upstream.test.js +139 -0
- package/dist/docs.test.js +154 -0
- package/dist/frontmatter.js +53 -0
- package/dist/frontmatter.test.js +49 -0
- package/dist/harness/bench.js +134 -0
- package/dist/harness/bench.test.js +109 -0
- package/dist/harness/bundle.js +46 -0
- package/dist/harness/bundle.test.js +71 -0
- package/dist/harness/constants.js +2 -0
- package/dist/harness/executors/api.js +68 -0
- package/dist/harness/executors/api.test.js +75 -0
- package/dist/harness/executors/cli.js +348 -0
- package/dist/harness/executors/cli.test.js +402 -0
- package/dist/harness/executors/mock.js +34 -0
- package/dist/harness/executors/mock.test.js +43 -0
- package/dist/harness/experiment-session.js +345 -0
- package/dist/harness/experiment-session.test.js +223 -0
- package/dist/harness/hash.js +29 -0
- package/dist/harness/installed-skill.js +78 -0
- package/dist/harness/installed-skill.test.js +162 -0
- package/dist/harness/judge.js +108 -0
- package/dist/harness/judge.test.js +181 -0
- package/dist/harness/kill-tree.js +43 -0
- package/dist/harness/kimi-usage.js +94 -0
- package/dist/harness/kimi-usage.test.js +62 -0
- package/dist/harness/oss-lru-cache.test.js +79 -0
- package/dist/harness/oss-regression-witness.test.js +89 -0
- package/dist/harness/prompt.js +57 -0
- package/dist/harness/prompt.test.js +48 -0
- package/dist/harness/receipts.js +297 -0
- package/dist/harness/receipts.test.js +148 -0
- package/dist/harness/report.js +225 -0
- package/dist/harness/report.test.js +297 -0
- package/dist/harness/runner.js +629 -0
- package/dist/harness/runner.test.js +555 -0
- package/dist/harness/stats.js +93 -0
- package/dist/harness/stats.test.js +124 -0
- package/dist/harness/target.js +90 -0
- package/dist/harness/target.test.js +60 -0
- package/dist/harness/trigger.js +368 -0
- package/dist/harness/trigger.test.js +249 -0
- package/dist/harness/types.js +1 -0
- package/dist/harness/verifier-summary.js +59 -0
- package/dist/harness/verifier-summary.test.js +99 -0
- package/dist/harness/waza-behavior.test.js +139 -0
- package/dist/invocation.js +21 -0
- package/dist/matrix/agents.json +200 -0
- package/dist/matrix/agents.schema.json +152 -0
- package/dist/mcp/probe.js +317 -0
- package/dist/mcp/probe.test.js +87 -0
- package/dist/version.js +4 -0
- package/docs/assets/skillfit-flow.en.svg +47 -0
- package/docs/assets/skillfit-flow.zh-CN.svg +47 -0
- package/docs/assets/skillfit-mark.svg +9 -0
- package/docs/audit-2026-09-24-triage.md +231 -0
- package/docs/audit-2026-09-24.md +876 -0
- package/docs/bench-authoring.md +407 -0
- package/docs/codex-upstream-audit.md +41 -0
- package/docs/config-experiments.md +119 -0
- package/docs/examples/bench-check.yml +32 -0
- package/docs/examples/eval-manifest.synthetic.json +61 -0
- package/docs/experiment-workflow.md +15 -0
- package/docs/first-real-eval.md +90 -0
- package/docs/growth-roadmap-2026-10.md +100 -0
- package/docs/installed-skill-evaluation.md +77 -0
- package/docs/metrics.md +318 -0
- package/docs/oss-task-evaluation.md +139 -0
- package/docs/plans/2026-10-01-oss-task-evaluation.md +73 -0
- package/docs/plans/2026-10-09-experiment-workflow.md +18 -0
- package/docs/plans/2026-10-09-grader-calibration-audit.md +13 -0
- package/docs/plans/2026-10-09-waza-resource-evaluation.md +46 -0
- package/docs/portable-codex.md +31 -0
- package/docs/reproducible-offline-example.md +29 -0
- package/docs/selectable-codex.md +41 -0
- package/docs/sharing-results.md +53 -0
- package/evidence/2026-07-skill-baseline.md +34 -0
- package/evidence/2026-09-22-codex-trigger-capture.md +36 -0
- package/evidence/2026-09-bench-calibration.md +46 -0
- package/evidence/2026-09-debugging-bench-exploratory.md +55 -0
- package/evidence/2026-09-debugging-hardening.md +42 -0
- package/evidence/2026-09-ocr-vs-code-review.md +31 -0
- package/evidence/2026-09-trigger-snapshot-correction.md +48 -0
- package/evidence/2026-10-01-codex-diagnosing-bugs-pilot.md +58 -0
- package/evidence/2026-10-01-oss-case-selection.md +42 -0
- package/evidence/2026-10-01-oss-workspace-smoke.md +110 -0
- package/evidence/README.md +47 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/README.md +27 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/artifact-index.json +118 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/output.md +5 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/prompt.txt +14 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/result.json +65 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/verifier.txt +2 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/workspace/LICENSE +21 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/workspace/package.json +3 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/workspace/src/ext-apps-bridge.js +3 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/workspace/src/resolve-view-resource.ts +100 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/workspace/test/basic.test.mjs +13 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/baseline/workspace/test/resolve-view-resource.test.mjs +102 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/manifest.json +206 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/original-console.txt +44 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/report.md +67 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/output.md +5 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/prompt.txt +163 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/result.json +65 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/verifier.txt +2 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/workspace/LICENSE +21 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/workspace/package.json +3 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/workspace/src/ext-apps-bridge.js +3 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/workspace/src/resolve-view-resource.ts +100 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/workspace/test/basic.test.mjs +13 -0
- package/evidence/artifacts/2026-10-01-oss-workspace-smoke/treatment/workspace/test/resolve-view-resource.test.mjs +136 -0
- package/evidence/inputs/README.md +15 -0
- package/evidence/inputs/diagnosing-bugs/LICENSE +21 -0
- package/evidence/inputs/diagnosing-bugs/SKILL.md +138 -0
- package/evidence/inputs/diagnosing-bugs/agents/openai.yaml +3 -0
- package/evidence/inputs/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/evidence/plans/2026-10-01-oss-workspace-smoke.json +29 -0
- package/package.json +47 -4
- package/profiles/codex-curated/catalog.json +28 -0
- package/profiles/codex-curated/profile.json +282 -0
- package/profiles/codex-curated/rules/global.md +12 -0
- package/profiles/codex-curated/skills/autonomous-iteration/SKILL.md +75 -0
- package/profiles/codex-curated/skills/autonomous-iteration/agents/openai.yaml +4 -0
- package/profiles/codex-curated/skills/vibe-coding/SKILL.md +45 -0
- package/profiles/codex-curated/skills/vibe-coding/agents/openai.yaml +4 -0
- package/profiles/codex-upstream-sources.json +2980 -0
- package/profiles/recommended/profile.json +12 -0
- package/profiles/recommended/rules/core-workflow.md +41 -0
- package/profiles/recommended/skills/commit-message/SKILL.md +18 -0
- package/skills/skillfit/SKILL.md +60 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const runDir = path.resolve(process.argv[2] ?? '.');
|
|
9
|
+
const graderDir = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const canonicalFixture = path.resolve(graderDir, '../fixtures/debug-redaction');
|
|
11
|
+
const sentinel = ['DEBUG', 'REDACTION', 'SENTINEL', '7wK3pQ9mT2'].join('_');
|
|
12
|
+
const maxFileBytes = 1024 * 1024;
|
|
13
|
+
|
|
14
|
+
const sectionScores = {
|
|
15
|
+
behavior: { score: 0, maxScore: 4 },
|
|
16
|
+
regression: { score: 0, maxScore: 3 },
|
|
17
|
+
secrecy: { score: 0, maxScore: 1 },
|
|
18
|
+
};
|
|
19
|
+
const failures = [];
|
|
20
|
+
const checkResults = [];
|
|
21
|
+
|
|
22
|
+
async function check(section, name, operation) {
|
|
23
|
+
try {
|
|
24
|
+
await operation();
|
|
25
|
+
sectionScores[section].score += 1;
|
|
26
|
+
checkResults.push({ name, pass: true });
|
|
27
|
+
} catch (error) {
|
|
28
|
+
checkResults.push({ name, pass: false });
|
|
29
|
+
failures.push(`${name}: ${error.message}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function listFiles(root, predicate = () => true) {
|
|
34
|
+
if (!fs.existsSync(root)) return [];
|
|
35
|
+
const files = [];
|
|
36
|
+
const visit = (directory) => {
|
|
37
|
+
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
|
|
38
|
+
if (entry.name === '.git') continue;
|
|
39
|
+
const fullPath = path.join(directory, entry.name);
|
|
40
|
+
if (entry.isDirectory()) visit(fullPath);
|
|
41
|
+
else if (entry.isFile() && predicate(fullPath, entry.name)) files.push(fullPath);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
visit(root);
|
|
45
|
+
return files.sort((left, right) => left.localeCompare(right, 'en'));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function testFiles(root) {
|
|
49
|
+
return listFiles(path.join(root, 'test'), (file) => file.endsWith('.test.mjs'));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function testSnapshot(root) {
|
|
53
|
+
return new Map(testFiles(root).map((file) => [
|
|
54
|
+
path.relative(root, file).replaceAll('\\', '/'),
|
|
55
|
+
fs.readFileSync(file, 'utf8'),
|
|
56
|
+
]));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function testAssetFiles(root) {
|
|
60
|
+
return listFiles(root, (file, name) => (
|
|
61
|
+
/(?:\.test|\.spec)\.mjs$/i.test(name)
|
|
62
|
+
|| /(^|[\\/])(?:test|tests|__tests__)([\\/]|$)/i.test(file)
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function runTests(root) {
|
|
67
|
+
const tests = testFiles(root);
|
|
68
|
+
assert.ok(tests.length > 0, 'no test/*.test.mjs files were found');
|
|
69
|
+
return spawnSync(process.execPath, ['--test', ...tests], {
|
|
70
|
+
cwd: root,
|
|
71
|
+
encoding: 'utf8',
|
|
72
|
+
timeout: 5_000,
|
|
73
|
+
windowsHide: true,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function commandOutput(result) {
|
|
78
|
+
return `${result.stdout ?? ''}\n${result.stderr ?? ''}`.trim();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function assertCompleted(result) {
|
|
82
|
+
if (result.error) throw result.error;
|
|
83
|
+
assert.equal(result.signal, null, `test process ended by signal ${result.signal}`);
|
|
84
|
+
assert.equal(typeof result.status, 'number', 'test process did not return an exit status');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function completedWith(result, predicate) {
|
|
88
|
+
return !result.error && result.signal == null && typeof result.status === 'number' && predicate(result.status);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function runOneTest(root, relative) {
|
|
92
|
+
const env = { ...process.env };
|
|
93
|
+
delete env.NODE_TEST_CONTEXT;
|
|
94
|
+
return spawnSync(process.execPath, ['--test', path.join(root, ...relative.split('/'))], {
|
|
95
|
+
cwd: root,
|
|
96
|
+
encoding: 'utf8',
|
|
97
|
+
timeout: 5_000,
|
|
98
|
+
windowsHide: true,
|
|
99
|
+
env,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function copyNonHarnessWorkspace(destination) {
|
|
104
|
+
fs.cpSync(runDir, destination, {
|
|
105
|
+
recursive: true,
|
|
106
|
+
filter: (source) => {
|
|
107
|
+
const relative = path.relative(runDir, source).replaceAll('\\', '/');
|
|
108
|
+
return relative === '' || (!relative.split('/').some((segment) => segment === '.git') && !path.basename(source).startsWith('_'));
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function collectTestAssetEvidence() {
|
|
114
|
+
const candidates = testAssetFiles(runDir)
|
|
115
|
+
.map((file) => path.relative(runDir, file).replaceAll('\\', '/'))
|
|
116
|
+
.filter((relative) => !fs.existsSync(path.join(canonicalFixture, ...relative.split('/'))));
|
|
117
|
+
return candidates.map((relative) => {
|
|
118
|
+
const finalPath = path.join(runDir, ...relative.split('/'));
|
|
119
|
+
const finalResult = runOneTest(runDir, relative);
|
|
120
|
+
const temporaryRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'debug-redaction-evidence-'));
|
|
121
|
+
let originalFailed = false;
|
|
122
|
+
try {
|
|
123
|
+
copyNonHarnessWorkspace(temporaryRoot);
|
|
124
|
+
fs.copyFileSync(
|
|
125
|
+
path.join(canonicalFixture, 'src/debug-redaction.mjs'),
|
|
126
|
+
path.join(temporaryRoot, 'src/debug-redaction.mjs'),
|
|
127
|
+
);
|
|
128
|
+
originalFailed = completedWith(runOneTest(temporaryRoot, relative), (status) => status !== 0);
|
|
129
|
+
} finally {
|
|
130
|
+
fs.rmSync(temporaryRoot, { recursive: true, force: true });
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
path: relative,
|
|
134
|
+
initialExists: false,
|
|
135
|
+
nonEmpty: fs.statSync(finalPath).size > 0,
|
|
136
|
+
finalPassed: completedWith(finalResult, (status) => status === 0),
|
|
137
|
+
originalFailed,
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function sensitiveKeyPaths(value, prefix = '') {
|
|
143
|
+
if (value === null || typeof value !== 'object') return [];
|
|
144
|
+
const paths = [];
|
|
145
|
+
for (const [key, nested] of Object.entries(value)) {
|
|
146
|
+
const current = prefix ? `${prefix}.${key}` : key;
|
|
147
|
+
if (/(?:auth(?:entication|orization)?|credential|password|secret|token|api[-_]?key)/i.test(key)) paths.push(current);
|
|
148
|
+
paths.push(...sensitiveKeyPaths(nested, current));
|
|
149
|
+
}
|
|
150
|
+
return paths;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function readNotes() {
|
|
154
|
+
const lastMessage = path.join(runDir, '_output.md');
|
|
155
|
+
if (!fs.existsSync(lastMessage)) return '';
|
|
156
|
+
const raw = fs.readFileSync(lastMessage, 'utf8');
|
|
157
|
+
try {
|
|
158
|
+
const parsed = JSON.parse(raw);
|
|
159
|
+
return typeof parsed.notes === 'string' ? parsed.notes : '';
|
|
160
|
+
} catch {
|
|
161
|
+
return raw;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
let formatFailure;
|
|
166
|
+
let importError;
|
|
167
|
+
try {
|
|
168
|
+
({ formatFailure } = await import(pathToFileURL(path.join(runDir, 'src/debug-redaction.mjs'))));
|
|
169
|
+
} catch (error) {
|
|
170
|
+
importError = error;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function buildReport(overrides = {}) {
|
|
174
|
+
if (importError) throw importError;
|
|
175
|
+
assert.equal(typeof formatFailure, 'function', 'formatFailure must remain a named export');
|
|
176
|
+
const raw = formatFailure({
|
|
177
|
+
message: 'webhook delivery failed',
|
|
178
|
+
requestId: 'req-17',
|
|
179
|
+
headers: {
|
|
180
|
+
AUTHORIZATION: 'Bearer customer-token',
|
|
181
|
+
Cookie: 'session=customer-cookie',
|
|
182
|
+
'x-trace-id': 'trace-42',
|
|
183
|
+
},
|
|
184
|
+
debug: true,
|
|
185
|
+
...overrides,
|
|
186
|
+
});
|
|
187
|
+
assert.equal(typeof raw, 'string', 'formatFailure must return a string');
|
|
188
|
+
return JSON.parse(raw);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
await check('behavior', 'public report shape', () => {
|
|
192
|
+
const report = buildReport({ debug: false });
|
|
193
|
+
assert.equal(report.level, 'error');
|
|
194
|
+
assert.equal(report.message, 'webhook delivery failed');
|
|
195
|
+
assert.equal(report.requestId, 'req-17');
|
|
196
|
+
assert.equal(report.debug, undefined);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
await check('behavior', 'case-insensitive header redaction', () => {
|
|
200
|
+
const report = buildReport();
|
|
201
|
+
assert.equal(report.headers.AUTHORIZATION, '[REDACTED]');
|
|
202
|
+
assert.equal(report.headers.Cookie, '[REDACTED]');
|
|
203
|
+
assert.equal(report.headers['x-trace-id'], 'trace-42');
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
await check('behavior', 'safe debug metadata retained', () => {
|
|
207
|
+
const report = buildReport();
|
|
208
|
+
assert.equal(report.debug.transport, 'webhook');
|
|
209
|
+
assert.equal(report.debug.attempt, 1);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// Merged with the sentinel assertion: both inspect the same debug report, and a credential-bearing
|
|
213
|
+
// key surviving under `debug` is the only route by which the sentinel value reaches the output.
|
|
214
|
+
await check('behavior', 'sensitive debug keys removed', () => {
|
|
215
|
+
const report = buildReport();
|
|
216
|
+
assert.deepEqual(sensitiveKeyPaths(report.debug), []);
|
|
217
|
+
assert.equal(
|
|
218
|
+
JSON.stringify(report).includes(sentinel),
|
|
219
|
+
false,
|
|
220
|
+
'the fixture sentinel reached the report output',
|
|
221
|
+
);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
await check('regression', 'final fixture tests pass', () => {
|
|
225
|
+
const result = runTests(runDir);
|
|
226
|
+
assertCompleted(result);
|
|
227
|
+
assert.equal(result.status, 0, commandOutput(result) || `test process exited ${result.status}`);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
await check('regression', 'regression test was added or changed', () => {
|
|
231
|
+
const original = testSnapshot(canonicalFixture);
|
|
232
|
+
const final = testSnapshot(runDir);
|
|
233
|
+
const changed = [...final].some(([name, content]) => !original.has(name) || original.get(name) !== content);
|
|
234
|
+
assert.equal(changed, true, 'the final test suite is identical to the starting fixture');
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
await check('regression', 'regression test fails against the original bug', () => {
|
|
238
|
+
const originalSource = path.join(canonicalFixture, 'src/debug-redaction.mjs');
|
|
239
|
+
assert.ok(fs.existsSync(originalSource), 'canonical buggy source is missing');
|
|
240
|
+
const temporaryRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'debug-redaction-grade-'));
|
|
241
|
+
try {
|
|
242
|
+
fs.cpSync(path.join(runDir, 'src'), path.join(temporaryRoot, 'src'), { recursive: true });
|
|
243
|
+
fs.cpSync(path.join(runDir, 'test'), path.join(temporaryRoot, 'test'), { recursive: true });
|
|
244
|
+
fs.copyFileSync(originalSource, path.join(temporaryRoot, 'src/debug-redaction.mjs'));
|
|
245
|
+
const result = runTests(temporaryRoot);
|
|
246
|
+
assertCompleted(result);
|
|
247
|
+
assert.notEqual(result.status, 0, 'final tests stayed green when the original leaking implementation was restored');
|
|
248
|
+
} finally {
|
|
249
|
+
fs.rmSync(temporaryRoot, { recursive: true, force: true });
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// One property across two scopes: the sentinel must not survive anywhere a reader could find it. The
|
|
254
|
+
// file walk skips `_`-prefixed harness files, which is exactly where the notes live, so the notes are
|
|
255
|
+
// checked explicitly rather than falling out of the walk.
|
|
256
|
+
await check('secrecy', 'sentinel survives in no artifact or note', () => {
|
|
257
|
+
const leaking = listFiles(runDir, (file, name) => !name.startsWith('_'))
|
|
258
|
+
.filter((file) => fs.statSync(file).size <= maxFileBytes)
|
|
259
|
+
.filter((file) => fs.readFileSync(file, 'utf8').includes(sentinel))
|
|
260
|
+
.map((file) => path.relative(runDir, file).replaceAll('\\', '/'));
|
|
261
|
+
if (readNotes().includes(sentinel)) leaking.push('_output.md (notes)');
|
|
262
|
+
assert.deepEqual(leaking, []);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
const score = Object.values(sectionScores).reduce((total, section) => total + section.score, 0);
|
|
266
|
+
const maxScore = Object.values(sectionScores).reduce((total, section) => total + section.maxScore, 0);
|
|
267
|
+
const evidence = { testAssets: collectTestAssetEvidence() };
|
|
268
|
+
const passed = score === maxScore;
|
|
269
|
+
console.log(JSON.stringify({
|
|
270
|
+
score,
|
|
271
|
+
maxScore,
|
|
272
|
+
passed,
|
|
273
|
+
behaviorScore: sectionScores.behavior.score,
|
|
274
|
+
behaviorMaxScore: sectionScores.behavior.maxScore,
|
|
275
|
+
regressionScore: sectionScores.regression.score,
|
|
276
|
+
regressionMaxScore: sectionScores.regression.maxScore,
|
|
277
|
+
secrecyScore: sectionScores.secrecy.score,
|
|
278
|
+
secrecyMaxScore: sectionScores.secrecy.maxScore,
|
|
279
|
+
failures,
|
|
280
|
+
checks: checkResults,
|
|
281
|
+
evidence,
|
|
282
|
+
}));
|
|
283
|
+
process.exit(passed ? 0 : 1);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const runDir = process.argv[2];
|
|
5
|
+
if (!runDir) {
|
|
6
|
+
console.error('usage: node document-queue.mjs <run-dir>');
|
|
7
|
+
process.exit(2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const CHECK_NAMES = ['serial-in-order', 'rejection-isolated', 'idle-after-settle', 'no-defect-claims'];
|
|
11
|
+
|
|
12
|
+
// The fixture is the CORRECT implementation, so an answer that reports a defect has misread the task.
|
|
13
|
+
// "must be" and "should be" are deliberately absent: they are ordinary documentation language.
|
|
14
|
+
const DEFECT_CLAIMS = /\bbugs?\b|\bdefects?\b|\bbroken\b|\bincorrect\b|\bviolates?\b|\bwrong\b|off-by-one|\bneeds? (?:to be )?fix/i;
|
|
15
|
+
|
|
16
|
+
const SERIAL = /one at a time|\bserial\w*|sequential\w*|never (?:runs? )?concurrent|not concurrent|does not (?:run )?concurrent|in (?:enqueue |the )?order|in the order they were enqueued/i;
|
|
17
|
+
|
|
18
|
+
// Both halves are required: naming a failure, and saying what happens to the work behind it. An
|
|
19
|
+
// answer that mentions only one has not actually documented the guarantee callers depend on.
|
|
20
|
+
const REJECTION = /\breject\w*|\bfail\w*|\bthrow\w*|\berror\w*/i;
|
|
21
|
+
const QUEUE_SURVIVES = /only its own|still run|behind it|does not (?:strand|abandon|discard)|neither abandons|rest of the queue|remaining (?:tasks|work)|subsequent tasks|does not (?:affect )?the (?:queue|backlog)/i;
|
|
22
|
+
|
|
23
|
+
const IDLE_MENTIONED = /onIdle/i;
|
|
24
|
+
const IDLE_SETTLES = /\bsettl\w*|\bresolv\w*|\bafter\b|\bonce\b|\bfinished\b|\bcomplet\w*/i;
|
|
25
|
+
|
|
26
|
+
const outputPath = path.join(runDir, '_output.md');
|
|
27
|
+
let output;
|
|
28
|
+
try {
|
|
29
|
+
output = fs.readFileSync(outputPath, 'utf8');
|
|
30
|
+
} catch {
|
|
31
|
+
console.log(JSON.stringify({
|
|
32
|
+
passed: false,
|
|
33
|
+
defectClaims: false,
|
|
34
|
+
checks: CHECK_NAMES.map((name) => ({ name, pass: false })),
|
|
35
|
+
error: `missing ${outputPath}`,
|
|
36
|
+
}));
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const defectClaims = DEFECT_CLAIMS.test(output);
|
|
41
|
+
|
|
42
|
+
const results = {
|
|
43
|
+
'serial-in-order': SERIAL.test(output),
|
|
44
|
+
'rejection-isolated': REJECTION.test(output) && QUEUE_SURVIVES.test(output),
|
|
45
|
+
'idle-after-settle': IDLE_MENTIONED.test(output) && IDLE_SETTLES.test(output),
|
|
46
|
+
'no-defect-claims': !defectClaims,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const checks = CHECK_NAMES.map((name) => ({ name, pass: results[name] === true }));
|
|
50
|
+
const passed = checks.every((check) => check.pass);
|
|
51
|
+
console.log(JSON.stringify({ passed, defectClaims, checks }));
|
|
52
|
+
process.exit(passed ? 0 : 1);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const runDir = process.argv[2];
|
|
5
|
+
if (!runDir) {
|
|
6
|
+
console.error('usage: node explain-cache.mjs <run-dir>');
|
|
7
|
+
process.exit(2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const CHECK_NAMES = ['fixed-deadline', 'lazy-deletion', 'ttl-contract', 'no-defect-claims'];
|
|
11
|
+
|
|
12
|
+
// The fixture is the CORRECT implementation, so an answer that reports a defect has misread the task.
|
|
13
|
+
// Note what is deliberately absent from this list: "must be" and "should be". Those are ordinary spec
|
|
14
|
+
// language ("ttlMs must be finite") and matching them would fail correct answers.
|
|
15
|
+
const DEFECT_CLAIMS = /\bbugs?\b|\bdefects?\b|\bbroken\b|\bincorrect\b|\bviolates?\b|\bwrong\b|off-by-one|\bneeds? (?:to be )?fix/i;
|
|
16
|
+
|
|
17
|
+
// A deadline fixed at write time, stated from either direction: "fixed when set" or "reads do not
|
|
18
|
+
// extend it". Requiring both phrasings would grade vocabulary rather than understanding.
|
|
19
|
+
const FIXED_DEADLINE = [
|
|
20
|
+
/(?:fixed|constant|set once|immutable)[^.\n]{0,80}(?:set|write|deadline|ttl)/i,
|
|
21
|
+
/(?:set|write)[^.\n]{0,80}(?:fixed|never (?:moves|changes|extends)|does not (?:move|change|extend))/i,
|
|
22
|
+
/(?:read|reading|get\(\)|get)[^.\n]{0,80}(?:never|does not|doesn't|do not)[^.\n]{0,40}(?:extend|renew|push|move|reset|refresh|slide)/i,
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const LAZY_WORDS = /\blazy\b|on demand|no background|nothing runs in the background/i;
|
|
26
|
+
const REMOVAL_WORDS = /\bdelet\w*|\bremov\w*|\bevict\w*|\bpurg\w*|\bdrop(?:s|ped)?\b/i;
|
|
27
|
+
|
|
28
|
+
const TTL_CONTRACT = [
|
|
29
|
+
/ttl[^.\n]{0,60}(?:finite|non-negative|not negative)/i,
|
|
30
|
+
/(?:finite|non-negative)[^.\n]{0,80}ttl/i,
|
|
31
|
+
/TypeError/i,
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
const outputPath = path.join(runDir, '_output.md');
|
|
35
|
+
let output;
|
|
36
|
+
try {
|
|
37
|
+
output = fs.readFileSync(outputPath, 'utf8');
|
|
38
|
+
} catch {
|
|
39
|
+
console.log(JSON.stringify({
|
|
40
|
+
passed: false,
|
|
41
|
+
defectClaims: false,
|
|
42
|
+
checks: CHECK_NAMES.map((name) => ({ name, pass: false })),
|
|
43
|
+
error: `missing ${outputPath}`,
|
|
44
|
+
}));
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const anyMatch = (patterns) => patterns.some((re) => re.test(output));
|
|
49
|
+
const defectClaims = DEFECT_CLAIMS.test(output);
|
|
50
|
+
|
|
51
|
+
const results = {
|
|
52
|
+
'fixed-deadline': anyMatch(FIXED_DEADLINE),
|
|
53
|
+
// Two halves of one property: expiry is not backgrounded, and the observing read cleans up.
|
|
54
|
+
'lazy-deletion': LAZY_WORDS.test(output) && REMOVAL_WORDS.test(output),
|
|
55
|
+
'ttl-contract': anyMatch(TTL_CONTRACT),
|
|
56
|
+
'no-defect-claims': !defectClaims,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const checks = CHECK_NAMES.map((name) => ({ name, pass: results[name] === true }));
|
|
60
|
+
const passed = checks.every((check) => check.pass);
|
|
61
|
+
console.log(JSON.stringify({ passed, defectClaims, checks }));
|
|
62
|
+
process.exit(passed ? 0 : 1);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const runDir = path.resolve(process.argv[2] ?? '');
|
|
8
|
+
if (!process.argv[2]) {
|
|
9
|
+
console.error('usage: node feat-slug.mjs <run-dir>');
|
|
10
|
+
process.exit(2);
|
|
11
|
+
}
|
|
12
|
+
const graderDir = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const canonicalFixture = path.resolve(graderDir, '../fixtures/feat-slug');
|
|
14
|
+
const VISIBLE_TEST = 'test/slug.test.mjs';
|
|
15
|
+
|
|
16
|
+
function scrubbedEnv() {
|
|
17
|
+
const env = { ...process.env };
|
|
18
|
+
delete env.NODE_TEST_CONTEXT;
|
|
19
|
+
return env;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// The visible suite is the task's specification, so it is also the thing an agent can edit to win.
|
|
23
|
+
// Grading by running it in place let a run pass by replacing its assertions; comparing it against
|
|
24
|
+
// the canonical fixture first is what makes running it meaningful.
|
|
25
|
+
function visibleTestTampered() {
|
|
26
|
+
const canonical = path.join(canonicalFixture, ...VISIBLE_TEST.split('/'));
|
|
27
|
+
const actual = path.join(runDir, ...VISIBLE_TEST.split('/'));
|
|
28
|
+
if (!fs.existsSync(canonical)) return false;
|
|
29
|
+
if (!fs.existsSync(actual)) return true;
|
|
30
|
+
const normalize = (file) => fs.readFileSync(file, 'utf8').replaceAll('\r\n', '\n').trim();
|
|
31
|
+
return normalize(canonical) !== normalize(actual);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let slugify;
|
|
35
|
+
try {
|
|
36
|
+
({ slugify } = await import(pathToFileURL(path.join(runDir, 'src/slug.mjs'))));
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.log(JSON.stringify({
|
|
39
|
+
score: 0,
|
|
40
|
+
maxScore: 6,
|
|
41
|
+
passed: false,
|
|
42
|
+
failures: [`import: ${error.message}`],
|
|
43
|
+
checks: [
|
|
44
|
+
{ name: 'visible suite unmodified', pass: false },
|
|
45
|
+
{ name: 'visible tests pass', pass: false },
|
|
46
|
+
{ name: 'separator runs collapse', pass: false },
|
|
47
|
+
{ name: 'surrounding noise trimmed', pass: false },
|
|
48
|
+
{ name: 'empty and symbol-only input', pass: false },
|
|
49
|
+
{ name: 'non-ascii stays well-formed', pass: false },
|
|
50
|
+
],
|
|
51
|
+
}));
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function runVisibleTests() {
|
|
56
|
+
return spawnSync(process.execPath, ['--test', path.join(runDir, ...VISIBLE_TEST.split('/'))], {
|
|
57
|
+
cwd: runDir,
|
|
58
|
+
encoding: 'utf8',
|
|
59
|
+
timeout: 30_000,
|
|
60
|
+
windowsHide: true,
|
|
61
|
+
env: scrubbedEnv(),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// A slug shape that follows from the visible contract without pinning anything the task leaves open:
|
|
66
|
+
// no leading or trailing separator, and no collapsed run longer than one.
|
|
67
|
+
function assertWellFormedSlug(value) {
|
|
68
|
+
assert.equal(typeof value, 'string', 'slugify must return a string');
|
|
69
|
+
assert.ok(!value.startsWith('-'), `slug starts with a separator: ${JSON.stringify(value)}`);
|
|
70
|
+
assert.ok(!value.endsWith('-'), `slug ends with a separator: ${JSON.stringify(value)}`);
|
|
71
|
+
assert.ok(!value.includes('--'), `slug has an uncollapsed separator run: ${JSON.stringify(value)}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const checks = [
|
|
75
|
+
['visible suite unmodified', () => assert.equal(visibleTestTampered(), false, `${VISIBLE_TEST} differs from the fixture copy — the task's specification was edited, not satisfied`)],
|
|
76
|
+
['visible tests pass', () => {
|
|
77
|
+
const result = runVisibleTests();
|
|
78
|
+
assert.ok(!result.error, `node --test could not run: ${result.error?.message ?? 'unknown'}`);
|
|
79
|
+
assert.equal(result.status, 0, `the visible suite failed:\n${(result.stdout ?? '') + (result.stderr ?? '')}`);
|
|
80
|
+
}],
|
|
81
|
+
['separator runs collapse', () => {
|
|
82
|
+
assert.equal(slugify('a---b'), 'a-b');
|
|
83
|
+
assert.equal(slugify('a b'), 'a-b');
|
|
84
|
+
assert.equal(slugify('a__b'), 'a-b');
|
|
85
|
+
assert.equal(slugify('a!@#b'), 'a-b');
|
|
86
|
+
}],
|
|
87
|
+
['surrounding noise trimmed', () => {
|
|
88
|
+
assert.equal(slugify('--hello--'), 'hello');
|
|
89
|
+
assert.equal(slugify(' hello '), 'hello');
|
|
90
|
+
assert.equal(slugify('!hello!'), 'hello');
|
|
91
|
+
}],
|
|
92
|
+
['empty and symbol-only input', () => {
|
|
93
|
+
assert.equal(slugify(''), '');
|
|
94
|
+
assert.equal(slugify('!!!'), '');
|
|
95
|
+
assert.equal(slugify('___'), '');
|
|
96
|
+
assert.equal(slugify(' '), '');
|
|
97
|
+
}],
|
|
98
|
+
// Deliberately shape-only. The visible suite never specifies accent handling, and folding
|
|
99
|
+
// ("cafe-bar") and dropping ("caf-bar") are both defensible readings, so pinning either would
|
|
100
|
+
// grade an invented requirement. What is pinned follows from the trim/collapse contract.
|
|
101
|
+
['non-ascii stays well-formed', () => {
|
|
102
|
+
for (const input of ['Café Déjà--Vu!!', 'naïve_über-cool', '你好 world', 'Ωμέγα']) {
|
|
103
|
+
assertWellFormedSlug(slugify(input));
|
|
104
|
+
}
|
|
105
|
+
}],
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
const failures = [];
|
|
109
|
+
const checkList = [];
|
|
110
|
+
for (const [name, check] of checks) {
|
|
111
|
+
try {
|
|
112
|
+
check();
|
|
113
|
+
checkList.push({ name, pass: true });
|
|
114
|
+
} catch (error) {
|
|
115
|
+
checkList.push({ name, pass: false });
|
|
116
|
+
failures.push(`${name}: ${error.message}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const passed = failures.length === 0;
|
|
120
|
+
console.log(JSON.stringify({
|
|
121
|
+
score: checks.length - failures.length,
|
|
122
|
+
maxScore: checks.length,
|
|
123
|
+
passed,
|
|
124
|
+
failures,
|
|
125
|
+
checks: checkList,
|
|
126
|
+
}));
|
|
127
|
+
process.exit(passed ? 0 : 1);
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const runDir = path.resolve(process.argv[2] ?? '');
|
|
9
|
+
if (!process.argv[2]) {
|
|
10
|
+
console.error('usage: node range-parser.mjs <run-dir>');
|
|
11
|
+
process.exit(2);
|
|
12
|
+
}
|
|
13
|
+
const graderDir = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const canonicalFixture = path.resolve(graderDir, '../fixtures/range-parser');
|
|
15
|
+
const ORIGINAL_SOURCE = 'src/range-parser.mjs';
|
|
16
|
+
|
|
17
|
+
const CHECK_NAMES = [
|
|
18
|
+
'list sorted and unique',
|
|
19
|
+
'ascending range',
|
|
20
|
+
'descending range',
|
|
21
|
+
'mixed input',
|
|
22
|
+
'negative values and ranges',
|
|
23
|
+
'invalid input rejected with TypeError',
|
|
24
|
+
'maxItems enforced with RangeError',
|
|
25
|
+
'suite is a real red-to-green regression test',
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
function emit(score, failures, checkList) {
|
|
29
|
+
console.log(JSON.stringify({
|
|
30
|
+
score,
|
|
31
|
+
maxScore: CHECK_NAMES.length,
|
|
32
|
+
passed: failures.length === 0,
|
|
33
|
+
failures,
|
|
34
|
+
checks: checkList,
|
|
35
|
+
}));
|
|
36
|
+
process.exit(failures.length === 0 ? 0 : 1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function scrubbedEnv() {
|
|
40
|
+
const env = { ...process.env };
|
|
41
|
+
delete env.NODE_TEST_CONTEXT;
|
|
42
|
+
return env;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function completedWith(result, predicate) {
|
|
46
|
+
return (
|
|
47
|
+
!result.error &&
|
|
48
|
+
result.signal == null &&
|
|
49
|
+
typeof result.status === 'number' &&
|
|
50
|
+
predicate(result.status)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function copyNonHarnessWorkspace(destination) {
|
|
55
|
+
fs.cpSync(runDir, destination, {
|
|
56
|
+
recursive: true,
|
|
57
|
+
filter: (source) => {
|
|
58
|
+
const relative = path.relative(runDir, source).replaceAll('\\', '/');
|
|
59
|
+
return (
|
|
60
|
+
relative === '' ||
|
|
61
|
+
(!relative.split('/').some((segment) => segment === '.git') &&
|
|
62
|
+
!path.basename(source).startsWith('_'))
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function runSuite(root) {
|
|
69
|
+
return spawnSync(process.execPath, ['--test'], {
|
|
70
|
+
cwd: root,
|
|
71
|
+
encoding: 'utf8',
|
|
72
|
+
timeout: 60_000,
|
|
73
|
+
windowsHide: true,
|
|
74
|
+
env: scrubbedEnv(),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let parseRange;
|
|
79
|
+
try {
|
|
80
|
+
({ parseRange } = await import(pathToFileURL(path.join(runDir, ORIGINAL_SOURCE))));
|
|
81
|
+
} catch (error) {
|
|
82
|
+
emit(
|
|
83
|
+
0,
|
|
84
|
+
[`import: ${error.message}`],
|
|
85
|
+
CHECK_NAMES.map((name) => ({ name, pass: false })),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const checks = [
|
|
90
|
+
['list sorted and unique', () => assert.deepEqual(parseRange('3, 1, 3, 2'), [1, 2, 3])],
|
|
91
|
+
['ascending range', () => assert.deepEqual(parseRange('1-3'), [1, 2, 3])],
|
|
92
|
+
['descending range', () => assert.deepEqual(parseRange('3-1'), [1, 2, 3])],
|
|
93
|
+
['mixed input', () => assert.deepEqual(parseRange('1-2, 5, 8-7'), [1, 2, 5, 7, 8])],
|
|
94
|
+
['negative values and ranges', () => assert.deepEqual(parseRange('-3--1, 2'), [-3, -2, -1, 2])],
|
|
95
|
+
// One contract, four inputs: an empty segment, a decimal, bare text, and a non-string. The
|
|
96
|
+
// earlier version scored these as four separate checks, which inflated the facet count without
|
|
97
|
+
// adding a distinction anyone would act on — they all assert the same rejection rule.
|
|
98
|
+
['invalid input rejected with TypeError', () => {
|
|
99
|
+
assert.throws(() => parseRange('1,,2'), TypeError, 'empty segment');
|
|
100
|
+
assert.throws(() => parseRange('1.5'), TypeError, 'decimal');
|
|
101
|
+
assert.throws(() => parseRange('abc'), TypeError, 'bare text');
|
|
102
|
+
assert.throws(() => parseRange(null), TypeError, 'non-string');
|
|
103
|
+
}],
|
|
104
|
+
['maxItems enforced with RangeError', () => {
|
|
105
|
+
assert.throws(() => parseRange('1-5', { maxItems: 4 }), RangeError);
|
|
106
|
+
}],
|
|
107
|
+
// Replaces two checks that graded the *text* of the test directory — counting `test(` occurrences
|
|
108
|
+
// and matching /negative|maxItems|invalid|reject/i — both satisfiable by writing empty tests
|
|
109
|
+
// containing the right words. This grades what a regression test is for: it must fail against the
|
|
110
|
+
// original buggy implementation and pass against the final one.
|
|
111
|
+
['suite is a real red-to-green regression test', () => {
|
|
112
|
+
const finalResult = runSuite(runDir);
|
|
113
|
+
assert.ok(
|
|
114
|
+
completedWith(finalResult, (status) => status === 0),
|
|
115
|
+
`the test suite does not pass against the final implementation: ${String(finalResult.stdout ?? '').slice(-400)}`,
|
|
116
|
+
);
|
|
117
|
+
const temporaryRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'range-parser-red-'));
|
|
118
|
+
try {
|
|
119
|
+
copyNonHarnessWorkspace(temporaryRoot);
|
|
120
|
+
fs.copyFileSync(
|
|
121
|
+
path.join(canonicalFixture, ...ORIGINAL_SOURCE.split('/')),
|
|
122
|
+
path.join(temporaryRoot, ...ORIGINAL_SOURCE.split('/')),
|
|
123
|
+
);
|
|
124
|
+
const originalResult = runSuite(temporaryRoot);
|
|
125
|
+
assert.ok(
|
|
126
|
+
completedWith(originalResult, (status) => status !== 0),
|
|
127
|
+
'the test suite still passes against the original buggy implementation — it detects none of the seeded bugs, so it is not a regression test',
|
|
128
|
+
);
|
|
129
|
+
} finally {
|
|
130
|
+
fs.rmSync(temporaryRoot, { recursive: true, force: true });
|
|
131
|
+
}
|
|
132
|
+
}],
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
const failures = [];
|
|
136
|
+
const checkList = [];
|
|
137
|
+
for (const [name, check] of checks) {
|
|
138
|
+
try {
|
|
139
|
+
check();
|
|
140
|
+
checkList.push({ name, pass: true });
|
|
141
|
+
} catch (error) {
|
|
142
|
+
checkList.push({ name, pass: false });
|
|
143
|
+
failures.push(`${name}: ${error.message}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
emit(checks.length - failures.length, failures, checkList);
|