@pome-sh/cli 0.12.0 → 0.13.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/build-info.json +3 -3
- package/dist/src/cli/checks-add.js +16 -0
- package/dist/src/cli/checks-lint.d.ts +1 -0
- package/dist/src/cli/checks-lint.js +59 -0
- package/dist/src/cli/criterion-binding.d.ts +41 -0
- package/dist/src/cli/criterion-binding.js +111 -0
- package/dist/src/cli/main.js +12 -0
- package/dist/src/runner/runTask.d.ts +2 -2
- package/dist/src/task/insertCriterion.js +6 -1
- package/dist/src/task/parseTask.d.ts +21 -0
- package/dist/src/task/parseTask.js +48 -1
- package/dist/src/task/taskSchema.d.ts +4 -4
- package/node_modules/@pome-sh/sdk/dist/checks.d.ts +2 -0
- package/node_modules/@pome-sh/sdk/dist/checks.js.map +1 -1
- package/node_modules/@pome-sh/sdk/dist/failure-injection.js +7 -0
- package/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +1 -1
- package/node_modules/@pome-sh/sdk/dist/index.d.ts +8 -0
- package/node_modules/@pome-sh/sdk/dist/index.js +1 -0
- package/node_modules/@pome-sh/sdk/dist/index.js.map +1 -1
- package/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +10 -0
- package/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +1 -1
- package/node_modules/@pome-sh/sdk/dist/recorder.js +8 -4
- package/node_modules/@pome-sh/sdk/dist/recorder.js.map +1 -1
- package/node_modules/@pome-sh/sdk/dist/request-capture.d.ts +31 -0
- package/node_modules/@pome-sh/sdk/dist/request-capture.js +59 -0
- package/node_modules/@pome-sh/sdk/dist/request-capture.js.map +1 -0
- package/node_modules/@pome-sh/sdk/dist/server.d.ts +1 -0
- package/node_modules/@pome-sh/sdk/dist/server.js +13 -0
- package/node_modules/@pome-sh/sdk/dist/server.js.map +1 -1
- package/node_modules/@pome-sh/sdk/package.json +2 -2
- package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +6 -0
- package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +2 -0
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +14 -0
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.js +40 -0
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/package.json +1 -1
- package/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/access-control.d.ts +3 -3
- package/node_modules/@pome-sh/twin-github/dist/src/check-params.d.ts +1 -0
- package/node_modules/@pome-sh/twin-github/dist/src/check-params.js +17 -0
- package/node_modules/@pome-sh/twin-github/dist/src/check-params.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-tape.d.ts +3 -0
- package/node_modules/@pome-sh/twin-github/dist/src/check-tape.js +77 -0
- package/node_modules/@pome-sh/twin-github/dist/src/check-tape.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/checks.d.ts +3 -1
- package/node_modules/@pome-sh/twin-github/dist/src/checks.js +4 -3
- package/node_modules/@pome-sh/twin-github/dist/src/checks.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/domain/checks.d.ts +4 -4
- package/node_modules/@pome-sh/twin-github/dist/src/domain/github-domain.d.ts +5 -5
- package/node_modules/@pome-sh/twin-github/dist/src/domain/pulls.d.ts +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/routes.js +16 -2
- package/node_modules/@pome-sh/twin-github/dist/src/routes.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/seed.d.ts +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/serializers.d.ts +3 -3
- package/node_modules/@pome-sh/twin-github/dist/src/tools.d.ts +22 -21
- package/node_modules/@pome-sh/twin-github/dist/src/tools.js +22 -0
- package/node_modules/@pome-sh/twin-github/dist/src/tools.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/package.json +3 -3
- package/node_modules/@pome-sh/twin-stripe/dist/src/idempotency.js +6 -0
- package/node_modules/@pome-sh/twin-stripe/dist/src/idempotency.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js +9 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/seed.d.ts +2 -2
- package/node_modules/@pome-sh/twin-stripe/dist/src/session.d.ts +3 -0
- package/node_modules/@pome-sh/twin-stripe/dist/src/session.js +72 -0
- package/node_modules/@pome-sh/twin-stripe/dist/src/session.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/twin.js +5 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/twin.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/package.json +4 -4
- package/package.json +5 -5
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.d.ts +0 -35
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.js +0 -103
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.d.ts +0 -100
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.js +0 -262
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.d.ts +0 -7
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.js +0 -14
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.d.ts +0 -44
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.js +0 -113
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.d.ts +0 -24
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.js +0 -61
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.d.ts +0 -43
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.js +0 -160
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +0 -121
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +0 -204
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.d.ts +0 -8
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.js +0 -39
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.d.ts +0 -372
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.js +0 -139
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.d.ts +0 -10
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +0 -221
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.d.ts +0 -61
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.js +0 -123
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.d.ts +0 -120
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.js +0 -368
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.d.ts +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.js +0 -3
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +0 -54
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.js +0 -181
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.d.ts +0 -46
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.js +0 -394
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.d.ts +0 -8
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.js +0 -22
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/package.json +0 -54
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.d.ts +0 -39
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js +0 -33
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +0 -254
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +0 -122
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +0 -175
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js +0 -182
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.d.ts +0 -90
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js +0 -72
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.d.ts +0 -28
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js +0 -35
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.d.ts +0 -31
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.js +0 -76
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +0 -331
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +0 -33
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +0 -65
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +0 -455
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +0 -39
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +0 -47
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +0 -25
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js +0 -27
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +0 -100
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +0 -193
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +0 -64
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +0 -112
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +0 -26
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js +0 -61
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +0 -42
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js +0 -104
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +0 -57
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +0 -102
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +0 -134
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +0 -152
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +0 -480
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js +0 -270
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +0 -2
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js +0 -152
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.d.ts +0 -257
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js +0 -335
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.d.ts +0 -208
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js +0 -170
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +0 -14
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +0 -46
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +0 -1006
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js +0 -263
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +0 -53
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js +0 -51
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +0 -80
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js +0 -98
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.d.ts +0 -859
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js +0 -60
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js.map +0 -1
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/manifest-schema.json +0 -68
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/package.json +0 -55
- package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/trace-contract.json +0 -41
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "pome-sh",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"git_sha": "
|
|
5
|
-
"build_time": "2026-07-
|
|
3
|
+
"version": "0.13.0",
|
|
4
|
+
"git_sha": "45b5f066845db6361ba505607349d3caec7b3627",
|
|
5
|
+
"build_time": "2026-07-29T23:22:10.923Z"
|
|
6
6
|
}
|
|
@@ -21,6 +21,7 @@ import { readConfigTwins } from "../task/parseTask.js";
|
|
|
21
21
|
import { resolveSeams } from "./agent-resolver.js";
|
|
22
22
|
import { SUBSTRATE_HELP, checksFor, displaySentence, findCheck, localDigest, pinnedVersion, twinOf, } from "./checks.js";
|
|
23
23
|
import { resolveCredentials } from "./credentials.js";
|
|
24
|
+
import { auditCodeCriteria, formatBindingReport } from "./criterion-binding.js";
|
|
24
25
|
export function parseArgFlags(pairs) {
|
|
25
26
|
const args = {};
|
|
26
27
|
for (const pair of pairs) {
|
|
@@ -233,4 +234,19 @@ export async function runChecksAddCommand(file, opts) {
|
|
|
233
234
|
console.log(picked.polarity(args) === "negative"
|
|
234
235
|
? " negative — this should PASS on an untouched seed; only the examinee can break it."
|
|
235
236
|
: " positive — this should FAIL on an untouched seed; the examinee has to make it true.");
|
|
237
|
+
// F-1134 — audit the WHOLE block, not just the line just appended. A
|
|
238
|
+
// hand-edited criterion binds nothing and leaves the score denominator in
|
|
239
|
+
// silence, and this is the one moment a local-only author is looking at the
|
|
240
|
+
// file. Audits `next`, so the sentence just written is included and has to come
|
|
241
|
+
// back bound — it was rendered from a declaration, so it always does.
|
|
242
|
+
//
|
|
243
|
+
// WARN, never refuse, and after the summary rather than before it: declining to
|
|
244
|
+
// append because of an unrelated pre-existing line would be obnoxious and would
|
|
245
|
+
// tempt authors back to typing sentences by hand, which is the defect. Deliberately
|
|
246
|
+
// does not touch `process.exitCode` — `pome checks lint` is the surface that fails.
|
|
247
|
+
const { findings } = auditCodeCriteria(next);
|
|
248
|
+
if (findings.length > 0) {
|
|
249
|
+
console.error("");
|
|
250
|
+
console.error(formatBindingReport(findings, file));
|
|
251
|
+
}
|
|
236
252
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runChecksLintCommand(files: string[]): Promise<void>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* `pome checks lint <file...>` — do this task's `[code]` criteria bind to a check
|
|
4
|
+
* their twin declares? (F-1134)
|
|
5
|
+
*
|
|
6
|
+
* `pome checks add` warns about the block it writes into, which covers an author
|
|
7
|
+
* mid-edit. This covers the rest: a file already on disk, a whole directory of
|
|
8
|
+
* them via a shell glob, and a builder's own CI. Before this, the only doors that
|
|
9
|
+
* refused a non-binding criterion were `save_task` and `validate_task` over the
|
|
10
|
+
* hosted MCP and the corpus gate in this repo's CI — so a builder authoring tasks
|
|
11
|
+
* in their own repo had no way to ask the question at all, and their first signal
|
|
12
|
+
* was a run whose score had quietly dropped a criterion.
|
|
13
|
+
*
|
|
14
|
+
* OFFLINE. Reads only the CLI's own pinned declarations, so the answer does not
|
|
15
|
+
* depend on reaching the cloud — which is the point, since the gap this closes
|
|
16
|
+
* lives in exactly the mode where the cloud is not there.
|
|
17
|
+
*/
|
|
18
|
+
import { readFile } from "node:fs/promises";
|
|
19
|
+
import { auditCodeCriteria, formatBindingReport } from "./criterion-binding.js";
|
|
20
|
+
function count(n, singular, plural) {
|
|
21
|
+
return `${n} [code] ${n === 1 ? singular : plural}`;
|
|
22
|
+
}
|
|
23
|
+
export async function runChecksLintCommand(files) {
|
|
24
|
+
let unreadable = false;
|
|
25
|
+
let failing = false;
|
|
26
|
+
for (const file of files) {
|
|
27
|
+
let source;
|
|
28
|
+
try {
|
|
29
|
+
source = await readFile(file, "utf8");
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Never a silent pass: a file we could not open is the one case where
|
|
33
|
+
// saying nothing would read as a clean bill.
|
|
34
|
+
console.error(`Could not read ${file}.`);
|
|
35
|
+
unreadable = true;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const { bound, unanswerable, findings } = auditCodeCriteria(source);
|
|
39
|
+
if (findings.length > 0) {
|
|
40
|
+
console.error(formatBindingReport(findings, file));
|
|
41
|
+
console.error("");
|
|
42
|
+
failing = true;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const notes = [`${count(bound, "criterion binds", "criteria bind")}`];
|
|
46
|
+
if (unanswerable.length > 0) {
|
|
47
|
+
const twins = [...new Set(unanswerable.map((c) => c.twin))].sort();
|
|
48
|
+
notes.push(`${unanswerable.length} unanswerable (${twins.join(", ")} ` +
|
|
49
|
+
`declare${twins.length === 1 ? "s" : ""} no checks yet)`);
|
|
50
|
+
}
|
|
51
|
+
console.log(`✓ ${file} — ${notes.join(", ")}`);
|
|
52
|
+
}
|
|
53
|
+
// A file we could not read outranks a criterion that will not be graded: one is
|
|
54
|
+
// "the question was not asked", the other is an answer.
|
|
55
|
+
if (unreadable)
|
|
56
|
+
process.exitCode = 2;
|
|
57
|
+
else if (failing)
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type CodeCriterion } from "../task/parseTask.js";
|
|
2
|
+
export type CriterionBinding = {
|
|
3
|
+
kind: "bound";
|
|
4
|
+
checkId: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: "corrupted";
|
|
7
|
+
checkId: string;
|
|
8
|
+
slot: string;
|
|
9
|
+
value: string;
|
|
10
|
+
example: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "unbound";
|
|
13
|
+
} | {
|
|
14
|
+
kind: "no-vocabulary";
|
|
15
|
+
};
|
|
16
|
+
export declare function bindCriterion(criterion: CodeCriterion): CriterionBinding;
|
|
17
|
+
export interface BindingFinding {
|
|
18
|
+
criterion: CodeCriterion;
|
|
19
|
+
binding: Extract<CriterionBinding, {
|
|
20
|
+
kind: "corrupted" | "unbound";
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export interface BindingAudit {
|
|
24
|
+
/** How many criteria bind. A count, not a list — a pass line needs the number. */
|
|
25
|
+
bound: number;
|
|
26
|
+
/** Criteria whose twin has not migrated its vocabulary. NEITHER a pass nor a
|
|
27
|
+
* failure: this CLI holds no declaration to judge them by, and folding them
|
|
28
|
+
* into either bucket would be the false clean bill the vocabulary exists to
|
|
29
|
+
* remove. Kept separate so a caller has to decide what to say about them. */
|
|
30
|
+
unanswerable: CodeCriterion[];
|
|
31
|
+
/** The criteria that will not be graded. */
|
|
32
|
+
findings: BindingFinding[];
|
|
33
|
+
}
|
|
34
|
+
/** Classify every `[code]` criterion in a task file. Three buckets, because the
|
|
35
|
+
* interesting one is the third and lumping the second into the first is how a
|
|
36
|
+
* tool ends up promising more than it checked. */
|
|
37
|
+
export declare function auditCodeCriteria(markdown: string): BindingAudit;
|
|
38
|
+
/** The author-facing report, one block per finding. Names the file so it stands
|
|
39
|
+
* on its own in a scrollback that already carries a write summary, and echoes
|
|
40
|
+
* each sentence verbatim so the author can find the line. */
|
|
41
|
+
export declare function formatBindingReport(findings: BindingFinding[], file: string): string;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* F-1134 — does a `[code]` criterion bind to a check its twin declares?
|
|
4
|
+
*
|
|
5
|
+
* A criterion that binds nothing is not an error anywhere: the grader skips it
|
|
6
|
+
* and the score is computed over the rest, so the denominator moves for a reason
|
|
7
|
+
* nobody wrote down. Three doors already refuse one — `save_task` and
|
|
8
|
+
* `validate_task` over the hosted MCP, and the corpus gate in CI — and a
|
|
9
|
+
* local-only author authoring tasks in their own repo reaches none of them.
|
|
10
|
+
* `pome` is meant to work offline, so a gap that only appears offline is a gap.
|
|
11
|
+
*
|
|
12
|
+
* OFFLINE BY CONSTRUCTION. Nothing here consults the cloud. Binding is a
|
|
13
|
+
* question about the sentence and the CLI's own pinned declaration, and any
|
|
14
|
+
* answer that needed the network would inherit F-1132's skew problem in the one
|
|
15
|
+
* mode where this gap lives. The digest handshake in `checks-add.ts` remains the
|
|
16
|
+
* place where the two pins are compared — that is a question about WRITING a
|
|
17
|
+
* sentence, and it is a different question from whether one already binds.
|
|
18
|
+
*
|
|
19
|
+
* Resolution comes from `./checks.js` and nowhere else. That module is already a
|
|
20
|
+
* deliberate SECOND resolution point (pome-cloud's registry is the first); a
|
|
21
|
+
* third would be a third thing that can silently resolve nothing, which is
|
|
22
|
+
* F-989's lesson.
|
|
23
|
+
*/
|
|
24
|
+
import { checkNearMissPattern, checkPattern, templateSlots } from "@pome-sh/sdk/checks";
|
|
25
|
+
import { readCodeCriteria } from "../task/parseTask.js";
|
|
26
|
+
import { checksFor } from "./checks.js";
|
|
27
|
+
export function bindCriterion(criterion) {
|
|
28
|
+
const declared = checksFor(criterion.twin);
|
|
29
|
+
if (declared.length === 0)
|
|
30
|
+
return { kind: "no-vocabulary" };
|
|
31
|
+
const text = criterion.text.trim();
|
|
32
|
+
// EVERY exact pattern first, across the whole twin, before any near-miss. A
|
|
33
|
+
// near-miss opens each slot to `.+?`, so one check's near-miss can swallow
|
|
34
|
+
// another's perfectly valid sentence; interleaving the two passes would report
|
|
35
|
+
// a criterion that grades fine as a corrupted instance of its neighbour.
|
|
36
|
+
for (const def of declared) {
|
|
37
|
+
if (checkPattern(def).test(text))
|
|
38
|
+
return { kind: "bound", checkId: def.id };
|
|
39
|
+
}
|
|
40
|
+
for (const def of declared) {
|
|
41
|
+
const near = text.match(checkNearMissPattern(def));
|
|
42
|
+
if (!near)
|
|
43
|
+
continue;
|
|
44
|
+
const offender = firstInvalidSlot(def, near);
|
|
45
|
+
// A near-miss whose every slot value is valid would have matched the exact
|
|
46
|
+
// pattern, unless the non-greedy split landed elsewhere than the typed one
|
|
47
|
+
// would. Keep looking rather than reporting a corruption we cannot name.
|
|
48
|
+
if (offender)
|
|
49
|
+
return { kind: "corrupted", checkId: def.id, ...offender };
|
|
50
|
+
}
|
|
51
|
+
return { kind: "unbound" };
|
|
52
|
+
}
|
|
53
|
+
/** Which slot the sentence filled with something its type rejects. Group `i + 1`
|
|
54
|
+
* is slot `i` — `defineCheck` asserts every slot pattern is group-free so those
|
|
55
|
+
* indices cannot shift, and the near-miss pattern's `.+?` is group-free too. */
|
|
56
|
+
function firstInvalidSlot(def, match) {
|
|
57
|
+
const { params } = templateSlots(def.template);
|
|
58
|
+
for (const [index, name] of params.entries()) {
|
|
59
|
+
const type = def.params[name];
|
|
60
|
+
const value = match[index + 1];
|
|
61
|
+
if (!new RegExp(`^${type.pattern}$`).test(value)) {
|
|
62
|
+
return { slot: name, value, example: type.example };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
/** Classify every `[code]` criterion in a task file. Three buckets, because the
|
|
68
|
+
* interesting one is the third and lumping the second into the first is how a
|
|
69
|
+
* tool ends up promising more than it checked. */
|
|
70
|
+
export function auditCodeCriteria(markdown) {
|
|
71
|
+
const audit = { bound: 0, unanswerable: [], findings: [] };
|
|
72
|
+
for (const criterion of readCodeCriteria(markdown)) {
|
|
73
|
+
const binding = bindCriterion(criterion);
|
|
74
|
+
if (binding.kind === "bound")
|
|
75
|
+
audit.bound += 1;
|
|
76
|
+
else if (binding.kind === "no-vocabulary")
|
|
77
|
+
audit.unanswerable.push(criterion);
|
|
78
|
+
else
|
|
79
|
+
audit.findings.push({ criterion, binding });
|
|
80
|
+
}
|
|
81
|
+
return audit;
|
|
82
|
+
}
|
|
83
|
+
/** The author-facing report, one block per finding. Names the file so it stands
|
|
84
|
+
* on its own in a scrollback that already carries a write summary, and echoes
|
|
85
|
+
* each sentence verbatim so the author can find the line. */
|
|
86
|
+
export function formatBindingReport(findings, file) {
|
|
87
|
+
const count = findings.length;
|
|
88
|
+
const blocks = findings.flatMap(({ criterion, binding }) => [
|
|
89
|
+
` - ${criterion.marker} ${criterion.text}`,
|
|
90
|
+
...(binding.kind === "unbound"
|
|
91
|
+
? [
|
|
92
|
+
` Binds nothing ${criterion.twin} declares, so the grader skips it and`,
|
|
93
|
+
` the score is computed without it.`,
|
|
94
|
+
]
|
|
95
|
+
: [
|
|
96
|
+
` Says ${binding.checkId}, but \`${binding.slot}\` = ${JSON.stringify(binding.value)} is not a valid`,
|
|
97
|
+
` value for that slot (e.g. ${binding.example}). It will be reported as`,
|
|
98
|
+
` corrupted_check_instance:${binding.checkId}.`,
|
|
99
|
+
]),
|
|
100
|
+
"",
|
|
101
|
+
]);
|
|
102
|
+
const twins = [...new Set(findings.map((f) => f.criterion.twin))].sort();
|
|
103
|
+
return [
|
|
104
|
+
`⚠ ${file} — ${count} [code] ${count === 1 ? "criterion" : "criteria"} will not be graded:`,
|
|
105
|
+
"",
|
|
106
|
+
...blocks,
|
|
107
|
+
` Run ${twins.map((t) => `\`pome checks ${t}\``).join(", ")} to see the sentences that do bind,`,
|
|
108
|
+
` then \`pome checks add\` to write one — pome renders the English, so a`,
|
|
109
|
+
` criterion it wrote cannot fail to bind.`,
|
|
110
|
+
].join("\n");
|
|
111
|
+
}
|
package/dist/src/cli/main.js
CHANGED
|
@@ -19,6 +19,7 @@ import { runCompileSeeds } from "./compile-seeds.js";
|
|
|
19
19
|
import { runTasksCommand } from "./tasks.js";
|
|
20
20
|
import { runChecksCommand } from "./checks.js";
|
|
21
21
|
import { runChecksAddCommand } from "./checks-add.js";
|
|
22
|
+
import { runChecksLintCommand } from "./checks-lint.js";
|
|
22
23
|
import { runEvalCommand } from "./eval.js";
|
|
23
24
|
import { copyAnnounceLine, ensureDefaultTask, runYoursFrameLines, trialsPinFallbackLine, } from "./default-task.js";
|
|
24
25
|
import { findTwin, runnableTasks, } from "./tasks-catalog.js";
|
|
@@ -273,6 +274,17 @@ export function createProgram() {
|
|
|
273
274
|
apiBaseUrl: opts.apiUrl,
|
|
274
275
|
});
|
|
275
276
|
});
|
|
277
|
+
// F-1134 — the read-only half. `checks add` warns about the block it writes
|
|
278
|
+
// into, which covers an author mid-edit; this answers the same question about a
|
|
279
|
+
// file already on disk, which is what a builder's own CI needs. Offline: it
|
|
280
|
+
// reads this CLI's pinned declarations and never calls the cloud.
|
|
281
|
+
checks
|
|
282
|
+
.command("lint")
|
|
283
|
+
.argument("<file...>", "Task markdown file(s) — shell globs work: tasks/*.md")
|
|
284
|
+
.description("Report [code] criteria that bind no declared check, so are never graded")
|
|
285
|
+
.action(async (files) => {
|
|
286
|
+
await runChecksLintCommand(files);
|
|
287
|
+
});
|
|
276
288
|
program
|
|
277
289
|
.command("compile-seeds")
|
|
278
290
|
.argument("[target]", "Task .md file or directory (defaults to ./tasks)")
|
|
@@ -75,7 +75,7 @@ export declare function runTask(options: RunTaskOptions): Promise<{
|
|
|
75
75
|
}[];
|
|
76
76
|
statuses: {
|
|
77
77
|
context: string;
|
|
78
|
-
state: "error" | "
|
|
78
|
+
state: "error" | "success" | "failure" | "pending";
|
|
79
79
|
description: string;
|
|
80
80
|
}[];
|
|
81
81
|
number?: number | undefined;
|
|
@@ -470,7 +470,7 @@ export declare function runTask(options: RunTaskOptions): Promise<{
|
|
|
470
470
|
}[];
|
|
471
471
|
statuses: {
|
|
472
472
|
context: string;
|
|
473
|
-
state: "error" | "
|
|
473
|
+
state: "error" | "success" | "failure" | "pending";
|
|
474
474
|
description: string;
|
|
475
475
|
}[];
|
|
476
476
|
number?: number | undefined;
|
|
@@ -57,6 +57,11 @@ export function insertCriterion(source, line, path = "this task file") {
|
|
|
57
57
|
// like every shipped task instead of butting against the heading.
|
|
58
58
|
insertAt = lines[start + 1]?.trim() === "" ? start + 2 : start + 1;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
// F-1134 — a section whose only content is its blank line puts `insertAt` on
|
|
61
|
+
// the NEXT heading, so the criterion would land against it with nothing
|
|
62
|
+
// between. Cosmetic (it parses either way), but this is the very first write
|
|
63
|
+
// into a freshly scaffolded task, which is the file an author reads hardest.
|
|
64
|
+
const blankAfter = NEXT_HEADING_RE.test(lines[insertAt] ?? "") ? [""] : [];
|
|
65
|
+
lines.splice(insertAt, 0, line, ...blankAfter);
|
|
61
66
|
return lines.join("\n");
|
|
62
67
|
}
|
|
@@ -5,6 +5,27 @@ export declare function parseTaskFile(path: string): Promise<Task>;
|
|
|
5
5
|
* twin list BEFORE it has written one. Reuses this module's own section
|
|
6
6
|
* splitter and config schema, so it is not a second parser. */
|
|
7
7
|
export declare function readConfigTwins(markdown: string): string[];
|
|
8
|
+
/** One `[code]` criterion as an authoring surface sees it: the sentence, the twin
|
|
9
|
+
* whose declared vocabulary is supposed to grade it, and the human-facing marker
|
|
10
|
+
* reconstructed the way `parseCriteria` reconstructs it for error messages — so
|
|
11
|
+
* a report can echo a line the author can find by searching the file. */
|
|
12
|
+
export interface CodeCriterion {
|
|
13
|
+
marker: string;
|
|
14
|
+
twin: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
17
|
+
/** The task's `[code]` criteria with each one's attributed twin, read WITHOUT the
|
|
18
|
+
* full task schema (F-1134). Same reason `readConfigTwins` exists, one step
|
|
19
|
+
* further along: `pome checks add` and `pome checks lint` audit files that are
|
|
20
|
+
* mid-edit, and `taskSchema` refuses one carrying no criteria or no resolvable
|
|
21
|
+
* seed. Reuses this module's own section splitter and criterion grammar, so it
|
|
22
|
+
* is not a second parser.
|
|
23
|
+
*
|
|
24
|
+
* TOLERANT BY DESIGN. `parseCriteria` throws on a retired marker or a tag naming
|
|
25
|
+
* no declared twin, and it is right to — it gates a run. This reader only warns,
|
|
26
|
+
* so a line it cannot understand is skipped instead: turning an author's
|
|
27
|
+
* half-finished file into a crash is how a warning surface stops being used. */
|
|
28
|
+
export declare function readCodeCriteria(markdown: string): CodeCriterion[];
|
|
8
29
|
export declare function parseTask(markdown: string, slug?: string, sidecarSeed?: unknown, taskPath?: string): Task;
|
|
9
30
|
/** The flat seed a single twin boots from. Single-twin scenarios return the
|
|
10
31
|
* flat `seedState` as-is; multi-twin scenarios return that twin's slice of the
|
|
@@ -25,11 +25,58 @@ export function readConfigTwins(markdown) {
|
|
|
25
25
|
: taskConfigSchema.parse({});
|
|
26
26
|
return config.twins;
|
|
27
27
|
}
|
|
28
|
+
/** Which heading holds the criteria. ONE definition, shared by `parseTask` and
|
|
29
|
+
* `readCodeCriteria` (F-1134): a reader that knew fewer spellings than the parser
|
|
30
|
+
* would find zero criteria in a task that has several, and zero criteria reads as
|
|
31
|
+
* a clean bill. Blessing a file whose criteria were never looked at is the exact
|
|
32
|
+
* failure the binding check exists to remove. */
|
|
33
|
+
function criteriaSection(sections) {
|
|
34
|
+
return sections.get("success criteria") ?? sections.get("checks") ?? "";
|
|
35
|
+
}
|
|
36
|
+
/** The task's `[code]` criteria with each one's attributed twin, read WITHOUT the
|
|
37
|
+
* full task schema (F-1134). Same reason `readConfigTwins` exists, one step
|
|
38
|
+
* further along: `pome checks add` and `pome checks lint` audit files that are
|
|
39
|
+
* mid-edit, and `taskSchema` refuses one carrying no criteria or no resolvable
|
|
40
|
+
* seed. Reuses this module's own section splitter and criterion grammar, so it
|
|
41
|
+
* is not a second parser.
|
|
42
|
+
*
|
|
43
|
+
* TOLERANT BY DESIGN. `parseCriteria` throws on a retired marker or a tag naming
|
|
44
|
+
* no declared twin, and it is right to — it gates a run. This reader only warns,
|
|
45
|
+
* so a line it cannot understand is skipped instead: turning an author's
|
|
46
|
+
* half-finished file into a crash is how a warning surface stops being used. */
|
|
47
|
+
export function readCodeCriteria(markdown) {
|
|
48
|
+
const criteriaText = criteriaSection(splitSections(markdown));
|
|
49
|
+
// A malformed ## Config block is `parseTask`'s error to report, not this
|
|
50
|
+
// reader's — fall back to the schema default so an audit still runs.
|
|
51
|
+
let twins;
|
|
52
|
+
try {
|
|
53
|
+
twins = readConfigTwins(markdown);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
twins = taskConfigSchema.parse({}).twins;
|
|
57
|
+
}
|
|
58
|
+
const primary = twins[0];
|
|
59
|
+
if (primary === undefined)
|
|
60
|
+
return [];
|
|
61
|
+
const found = [];
|
|
62
|
+
for (const rawLine of criteriaText.split("\n")) {
|
|
63
|
+
const match = rawLine.trim().match(CRITERION_LINE_RE);
|
|
64
|
+
if (!match || match[1] !== "code")
|
|
65
|
+
continue;
|
|
66
|
+
const tag = match[2];
|
|
67
|
+
found.push({
|
|
68
|
+
marker: `[code${tag ? `:${tag}` : ""}]`,
|
|
69
|
+
twin: tag ?? primary,
|
|
70
|
+
text: match[3].trim(),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return found;
|
|
74
|
+
}
|
|
28
75
|
export function parseTask(markdown, slug = "scenario", sidecarSeed, taskPath) {
|
|
29
76
|
const title = markdown.match(/^#\s+(.+)$/m)?.[1]?.trim() ?? slug;
|
|
30
77
|
const sections = splitSections(markdown);
|
|
31
78
|
const prompt = sections.get("prompt") ?? sections.get("task") ?? "";
|
|
32
|
-
const criteriaText =
|
|
79
|
+
const criteriaText = criteriaSection(sections);
|
|
33
80
|
const configText = sections.get("config") ?? "";
|
|
34
81
|
const seedText = sections.get("seed state") ?? "";
|
|
35
82
|
const config = configText.trim() ? taskConfigSchema.parse(parseFencedYaml(configText)) : taskConfigSchema.parse({});
|
|
@@ -491,9 +491,9 @@ export declare const seedStateSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
491
491
|
context: z.ZodDefault<z.ZodString>;
|
|
492
492
|
state: z.ZodDefault<z.ZodEnum<{
|
|
493
493
|
error: "error";
|
|
494
|
+
success: "success";
|
|
494
495
|
failure: "failure";
|
|
495
496
|
pending: "pending";
|
|
496
|
-
success: "success";
|
|
497
497
|
}>>;
|
|
498
498
|
description: z.ZodDefault<z.ZodString>;
|
|
499
499
|
}, z.core.$strip>>>;
|
|
@@ -964,9 +964,9 @@ export declare const seedEnvelopeSchema: z.ZodRecord<z.ZodString, z.ZodUnion<rea
|
|
|
964
964
|
context: z.ZodDefault<z.ZodString>;
|
|
965
965
|
state: z.ZodDefault<z.ZodEnum<{
|
|
966
966
|
error: "error";
|
|
967
|
+
success: "success";
|
|
967
968
|
failure: "failure";
|
|
968
969
|
pending: "pending";
|
|
969
|
-
success: "success";
|
|
970
970
|
}>>;
|
|
971
971
|
description: z.ZodDefault<z.ZodString>;
|
|
972
972
|
}, z.core.$strip>>>;
|
|
@@ -1459,9 +1459,9 @@ export declare const taskSchema: z.ZodObject<{
|
|
|
1459
1459
|
context: z.ZodDefault<z.ZodString>;
|
|
1460
1460
|
state: z.ZodDefault<z.ZodEnum<{
|
|
1461
1461
|
error: "error";
|
|
1462
|
+
success: "success";
|
|
1462
1463
|
failure: "failure";
|
|
1463
1464
|
pending: "pending";
|
|
1464
|
-
success: "success";
|
|
1465
1465
|
}>>;
|
|
1466
1466
|
description: z.ZodDefault<z.ZodString>;
|
|
1467
1467
|
}, z.core.$strip>>>;
|
|
@@ -1931,9 +1931,9 @@ export declare const taskSchema: z.ZodObject<{
|
|
|
1931
1931
|
context: z.ZodDefault<z.ZodString>;
|
|
1932
1932
|
state: z.ZodDefault<z.ZodEnum<{
|
|
1933
1933
|
error: "error";
|
|
1934
|
+
success: "success";
|
|
1934
1935
|
failure: "failure";
|
|
1935
1936
|
pending: "pending";
|
|
1936
|
-
success: "success";
|
|
1937
1937
|
}>>;
|
|
1938
1938
|
description: z.ZodDefault<z.ZodString>;
|
|
1939
1939
|
}, z.core.$strip>>>;
|
|
@@ -24,12 +24,14 @@ export interface CheckTapeEvent {
|
|
|
24
24
|
method?: string | null;
|
|
25
25
|
path?: string | null;
|
|
26
26
|
request_body?: unknown;
|
|
27
|
+
request_headers?: Record<string, string>;
|
|
27
28
|
status?: number | null;
|
|
28
29
|
response_body?: unknown;
|
|
29
30
|
latency_ms?: number | null;
|
|
30
31
|
fidelity?: string | null;
|
|
31
32
|
state_mutation?: boolean | null;
|
|
32
33
|
error?: string | null;
|
|
34
|
+
tool?: string | null;
|
|
33
35
|
event_id?: string | null;
|
|
34
36
|
}
|
|
35
37
|
export interface CheckSubstrate<TState> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../src/checks.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,2DAA2D;AAC3D,EAAE;AACF,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,wDAAwD;AACxD,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,gDAAgD;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,wEAAwE;AACxE,8EAA8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,8EAA8E;AAC9E,sBAAsB;AACtB,EAAE;AACF,iFAAiF;AACjF,+EAA+E;AAC/E,iFAAiF;AACjF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC;AAyBjD,8EAA8E;AAC9E,uEAAuE;AACvE,+EAA+E;AAC/E,yCAAyC;AACzC,MAAM,CAAC,MAAM,OAAO,GAAmB;IACrC,IAAI,EAAE,MAAM;IAC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H,OAAO,IAAa,CAAC;AACvB,CAAC"}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
// requests to a tuple that has at least one registered rule are counted.
|
|
27
27
|
import { randomUUID } from "node:crypto";
|
|
28
28
|
import { z } from "zod";
|
|
29
|
+
import { recordedRequestHeaders } from "./request-capture.js";
|
|
29
30
|
export const FAILURE_INJECTION_OVERRIDE_KEY = "failureInjectionOverride";
|
|
30
31
|
export const failureInjectionRuleSchema = z.object({
|
|
31
32
|
method: z.string().min(1).transform((s) => s.toUpperCase()),
|
|
@@ -127,6 +128,12 @@ export function failureInjectionMiddleware(store, options) {
|
|
|
127
128
|
method,
|
|
128
129
|
path: rawPath,
|
|
129
130
|
request_body: requestBody,
|
|
131
|
+
// F-1125 — same capture policy as the engine's emit(); an injected
|
|
132
|
+
// fault must not be the one row a header-reading check cannot see.
|
|
133
|
+
request_headers: recordedRequestHeaders(c),
|
|
134
|
+
// Injection is transport-level: it intercepts a (method, path) tuple,
|
|
135
|
+
// never a declared twin action.
|
|
136
|
+
tool: null,
|
|
130
137
|
status: rule.status,
|
|
131
138
|
response_body: rule.body,
|
|
132
139
|
latency_ms: Date.now() - started,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failure-injection.js","sourceRoot":"","sources":["../src/failure-injection.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,wEAAwE;AACxE,qEAAqE;AACrE,4EAA4E;AAC5E,wEAAwE;AACxE,EAAE;AACF,aAAa;AACb,EAAE;AACF,qEAAqE;AACrE,2EAA2E;AAC3E,oEAAoE;AACpE,wEAAwE;AACxE,4EAA4E;AAC5E,wEAAwE;AACxE,qEAAqE;AACrE,yEAAyE;AACzE,wEAAwE;AACxE,8BAA8B;AAC9B,EAAE;AACF,0EAA0E;AAC1E,2EAA2E;AAC3E,wEAAwE;AACxE,yEAAyE;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,aAA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AG,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;YAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IACjE,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
|
@@ -139,6 +139,14 @@ export interface RecorderHandle {
|
|
|
139
139
|
status: number;
|
|
140
140
|
body: unknown;
|
|
141
141
|
};
|
|
142
|
+
/**
|
|
143
|
+
* F-1125 — the twin ACTION this route performs, recorded as
|
|
144
|
+
* `RecorderEvent.tool` (see its doc for what the field means and why a
|
|
145
|
+
* REST route left undeclared answers "never" for a call that happened).
|
|
146
|
+
* Use the matching MCP tool's name; omit when there is no counterpart.
|
|
147
|
+
* MCP dispatch stashes its name with `setRecordedTool`, which wins.
|
|
148
|
+
*/
|
|
149
|
+
tool?: string;
|
|
142
150
|
}, fn: (c: Context) => Promise<RecorderHandlerResult> | RecorderHandlerResult): (c: Context) => Promise<Response>;
|
|
143
151
|
}
|
|
144
152
|
export interface AdminHandlers<TDomain = unknown, TSeed = unknown> {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// file-size: the package's public type barrel — every documented surface a community twin author sees lives here by design; splitting it would move types away from the docs that explain them.
|
|
1
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
3
|
// `@pome-sh/sdk` — public surface for community twin authors.
|
|
3
4
|
// `defineTwin()` returns data booted by `serve()` from `@pome-sh/sdk/server`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,8DAA8D;AAC9D,8EAA8E;AAC9E,uEAAuE;AAEvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GAIvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM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AAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,iBAAiB,CAAC,wBAAwB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAU,CAAC"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
import { toolInputSchema, toolListExtras, } from "./index.js";
|
|
9
9
|
import { UnknownToolError, envelopeFor } from "./errors.js";
|
|
10
|
+
import { recordedRequestHeaders } from "./request-capture.js";
|
|
10
11
|
import { makeToolCallContext } from "./tool-context.js";
|
|
11
12
|
const PARSE_ERROR = -32700;
|
|
12
13
|
const INVALID_REQUEST = -32600;
|
|
@@ -169,6 +170,9 @@ async function handleToolsCall(id, params, deps, c) {
|
|
|
169
170
|
mutation: effectiveMutation,
|
|
170
171
|
delta,
|
|
171
172
|
error: toolError,
|
|
173
|
+
// The name the CALLER used, stamped even when `tool` above is undefined
|
|
174
|
+
// (unknown tool) or the handler threw. See `RecorderEvent.tool`.
|
|
175
|
+
tool: name,
|
|
172
176
|
}));
|
|
173
177
|
return { jsonrpc: "2.0", id, result: mcpResult };
|
|
174
178
|
}
|
|
@@ -191,6 +195,12 @@ function buildEventCore(c, deps, fields) {
|
|
|
191
195
|
method: c.req.method,
|
|
192
196
|
path: new URL(c.req.url).pathname,
|
|
193
197
|
request_body: fields.requestBody,
|
|
198
|
+
request_headers: recordedRequestHeaders(c),
|
|
199
|
+
// F-1125 — the whole reason the field exists. This surface is where the
|
|
200
|
+
// tool name used to be reachable only by digging it out of `request_body`
|
|
201
|
+
// on a `/mcp` path; a check that had to do that was reverse-engineering
|
|
202
|
+
// transport, and getting it wrong false-passes a negative criterion.
|
|
203
|
+
tool: fields.tool,
|
|
194
204
|
status: fields.status,
|
|
195
205
|
response_body: fields.responseBody,
|
|
196
206
|
latency_ms: Date.now() - fields.started,
|