@pome-sh/cli 0.18.0 → 0.19.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/capture-server/index.js +1 -1
- package/dist/src/runner/mergeAdapterSignals.d.ts +23 -0
- package/dist/src/runner/mergeAdapterSignals.js +45 -3
- package/dist/src/scaffolds/mcp-loop/loop.js +3 -3
- package/node_modules/@pome-sh/sdk/dist/check-state-path.d.ts +71 -0
- package/node_modules/@pome-sh/sdk/dist/check-state-path.js +200 -0
- package/node_modules/@pome-sh/sdk/dist/check-state-path.js.map +1 -0
- package/node_modules/@pome-sh/sdk/dist/checks.d.ts +2 -0
- package/node_modules/@pome-sh/sdk/dist/checks.js +5 -0
- package/node_modules/@pome-sh/sdk/dist/checks.js.map +1 -1
- package/node_modules/@pome-sh/sdk/dist/recorder.d.ts +10 -1
- package/node_modules/@pome-sh/sdk/dist/recorder.js +11 -2
- package/node_modules/@pome-sh/sdk/dist/recorder.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 +111 -24
- package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +3 -3
- package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +6 -3
- package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +7 -2
- package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +68 -4
- package/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +19 -5
- package/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -1
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +60 -28
- package/node_modules/@pome-sh/shared-types/dist/recorder-events.js +81 -10
- 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 +49 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-issues.js +35 -9
- package/node_modules/@pome-sh/twin-github/dist/src/check-issues.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-pulls.js +21 -5
- package/node_modules/@pome-sh/twin-github/dist/src/check-pulls.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-repos.js +26 -6
- package/node_modules/@pome-sh/twin-github/dist/src/check-repos.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-state.d.ts +20 -1
- package/node_modules/@pome-sh/twin-github/dist/src/check-state.js +62 -10
- package/node_modules/@pome-sh/twin-github/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-github/package.json +3 -3
- package/node_modules/@pome-sh/twin-gmail/CHANGELOG.md +29 -0
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-drafts.js +19 -4
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-drafts.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-labels.js +15 -4
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-labels.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-messages.js +19 -3
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-messages.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.d.ts +26 -1
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.js +52 -16
- package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-gmail/package.json +2 -2
- package/node_modules/@pome-sh/twin-linear/CHANGELOG.md +29 -0
- package/node_modules/@pome-sh/twin-linear/dist/src/check-comments.js +15 -3
- package/node_modules/@pome-sh/twin-linear/dist/src/check-comments.js.map +1 -1
- package/node_modules/@pome-sh/twin-linear/dist/src/check-issues.js +31 -4
- package/node_modules/@pome-sh/twin-linear/dist/src/check-issues.js.map +1 -1
- package/node_modules/@pome-sh/twin-linear/dist/src/check-state.d.ts +27 -2
- package/node_modules/@pome-sh/twin-linear/dist/src/check-state.js +73 -20
- package/node_modules/@pome-sh/twin-linear/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-linear/package.json +2 -2
- package/node_modules/@pome-sh/twin-slack/dist/src/check-messages.js +28 -7
- package/node_modules/@pome-sh/twin-slack/dist/src/check-messages.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/dist/src/check-secrets.js +16 -3
- package/node_modules/@pome-sh/twin-slack/dist/src/check-secrets.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/dist/src/check-state.d.ts +26 -1
- package/node_modules/@pome-sh/twin-slack/dist/src/check-state.js +31 -4
- package/node_modules/@pome-sh/twin-slack/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-slack/package.json +3 -3
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.d.ts +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.js +16 -0
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-refunds.js +11 -3
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-refunds.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.d.ts +25 -1
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.js +31 -3
- package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.js.map +1 -1
- package/node_modules/@pome-sh/twin-stripe/package.json +3 -3
- package/package.json +8 -8
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-08-
|
|
3
|
+
"version": "0.19.0",
|
|
4
|
+
"git_sha": "f6fc19d8c27d039a35859dd942d4f0783671b695",
|
|
5
|
+
"build_time": "2026-08-04T00:45:27.607Z"
|
|
6
6
|
}
|
|
@@ -127,7 +127,7 @@ function handleConnect({ req, clientSocket, head, writer, egressWriter, allowHos
|
|
|
127
127
|
const row = {
|
|
128
128
|
ts: new Date().toISOString(),
|
|
129
129
|
event_id: randomUUID(),
|
|
130
|
-
|
|
130
|
+
parent_event_id: null,
|
|
131
131
|
kind: "LlmCallEvent",
|
|
132
132
|
host,
|
|
133
133
|
port,
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
import { type Event } from "../types/shared.js";
|
|
2
|
+
/**
|
|
3
|
+
* F-1200 — give every twin HTTP row the tool call that caused it.
|
|
4
|
+
*
|
|
5
|
+
* The twin writes `parent_event_id: null` because it runs in its own process
|
|
6
|
+
* and cannot know the agent-side `event_id`; the adapter knows the `event_id`
|
|
7
|
+
* but never sees the twin's tape. This merge is the one place both halves are
|
|
8
|
+
* in hand, so the join belongs here — and it is a pure data operation over two
|
|
9
|
+
* finished files, with no dependency on the order the two writers ran in.
|
|
10
|
+
*
|
|
11
|
+
* The join key is the SDK's `tool_use_id`, which since F-1200 is what the
|
|
12
|
+
* adapter stamps on `x-pome-correlation-id`. The twin persists that header as
|
|
13
|
+
* `correlation_id` ALWAYS and as `tool_call_id` only when it pins
|
|
14
|
+
* `stampToolCallId` (github's frozen tape shape) — so `correlation_id` is the
|
|
15
|
+
* key that works for every twin, with `tool_call_id` preferred when present
|
|
16
|
+
* because it is unambiguously the header rather than the request-id fallback.
|
|
17
|
+
*
|
|
18
|
+
* A row keeps its null parent when the id names no tool call: a pre-F-1200
|
|
19
|
+
* `tlc_…`, a `req_…` from the no-header fallback, or a direct REST call made
|
|
20
|
+
* outside any tool handler. An unresolvable parent is the honest answer there —
|
|
21
|
+
* inventing one would put twin calls under tools that did not make them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveTwinHttpParents(rows: Event[]): Event[];
|
|
1
24
|
export declare function mergeAdapterSignalsIntoEvents(signalsPath: string, eventsJsonlPath: string): Promise<{
|
|
2
25
|
appended: number;
|
|
3
26
|
dropped: number;
|
|
@@ -24,6 +24,48 @@ import { redactEvent } from "../recorder/redaction.js";
|
|
|
24
24
|
// lines are dropped and counted; the caller can log the drop count. Existing
|
|
25
25
|
// events.jsonl rows that fail to parse are passed through unsorted at the
|
|
26
26
|
// head of the file so a corrupted in-flight write is never silently dropped.
|
|
27
|
+
/**
|
|
28
|
+
* F-1200 — give every twin HTTP row the tool call that caused it.
|
|
29
|
+
*
|
|
30
|
+
* The twin writes `parent_event_id: null` because it runs in its own process
|
|
31
|
+
* and cannot know the agent-side `event_id`; the adapter knows the `event_id`
|
|
32
|
+
* but never sees the twin's tape. This merge is the one place both halves are
|
|
33
|
+
* in hand, so the join belongs here — and it is a pure data operation over two
|
|
34
|
+
* finished files, with no dependency on the order the two writers ran in.
|
|
35
|
+
*
|
|
36
|
+
* The join key is the SDK's `tool_use_id`, which since F-1200 is what the
|
|
37
|
+
* adapter stamps on `x-pome-correlation-id`. The twin persists that header as
|
|
38
|
+
* `correlation_id` ALWAYS and as `tool_call_id` only when it pins
|
|
39
|
+
* `stampToolCallId` (github's frozen tape shape) — so `correlation_id` is the
|
|
40
|
+
* key that works for every twin, with `tool_call_id` preferred when present
|
|
41
|
+
* because it is unambiguously the header rather than the request-id fallback.
|
|
42
|
+
*
|
|
43
|
+
* A row keeps its null parent when the id names no tool call: a pre-F-1200
|
|
44
|
+
* `tlc_…`, a `req_…` from the no-header fallback, or a direct REST call made
|
|
45
|
+
* outside any tool handler. An unresolvable parent is the honest answer there —
|
|
46
|
+
* inventing one would put twin calls under tools that did not make them.
|
|
47
|
+
*/
|
|
48
|
+
export function resolveTwinHttpParents(rows) {
|
|
49
|
+
const eventIdByToolUseId = new Map();
|
|
50
|
+
for (const row of rows) {
|
|
51
|
+
if (row.kind === "ToolUseEvent")
|
|
52
|
+
eventIdByToolUseId.set(row.tool_use_id, row.event_id);
|
|
53
|
+
}
|
|
54
|
+
if (eventIdByToolUseId.size === 0)
|
|
55
|
+
return rows;
|
|
56
|
+
return rows.map((row) => {
|
|
57
|
+
if (row.kind !== "TwinHttpEvent")
|
|
58
|
+
return row;
|
|
59
|
+
// Never overwrite a parent the writer already established.
|
|
60
|
+
if (row.parent_event_id != null)
|
|
61
|
+
return row;
|
|
62
|
+
const causingToolUseId = row.tool_call_id ?? row.correlation_id ?? null;
|
|
63
|
+
if (causingToolUseId === null)
|
|
64
|
+
return row;
|
|
65
|
+
const parentEventId = eventIdByToolUseId.get(causingToolUseId);
|
|
66
|
+
return parentEventId === undefined ? row : { ...row, parent_event_id: parentEventId };
|
|
67
|
+
});
|
|
68
|
+
}
|
|
27
69
|
export async function mergeAdapterSignalsIntoEvents(signalsPath, eventsJsonlPath) {
|
|
28
70
|
let rawSignals;
|
|
29
71
|
try {
|
|
@@ -84,9 +126,9 @@ export async function mergeAdapterSignalsIntoEvents(signalsPath, eventsJsonlPath
|
|
|
84
126
|
unparseablePassthrough.push(line);
|
|
85
127
|
}
|
|
86
128
|
}
|
|
87
|
-
// Concat
|
|
88
|
-
// lexicographic compare.
|
|
89
|
-
const merged = eventRows.concat(signalRows);
|
|
129
|
+
// Concat, resolve twin-HTTP parentage, then stable sort by ts. ISO-8601 with
|
|
130
|
+
// `Z` sorts chronologically under lexicographic compare.
|
|
131
|
+
const merged = resolveTwinHttpParents(eventRows.concat(signalRows));
|
|
90
132
|
merged.sort((a, b) => (a.ts < b.ts ? -1 : a.ts > b.ts ? 1 : 0));
|
|
91
133
|
const sortedJsonl = merged.map((r) => JSON.stringify(r)).join("\n");
|
|
92
134
|
const head = unparseablePassthrough.length > 0 ? unparseablePassthrough.join("\n") + "\n" : "";
|
|
@@ -116,7 +116,7 @@ function emitToolUse(signalsPath, row) {
|
|
|
116
116
|
appendFileSync(signalsPath, JSON.stringify({
|
|
117
117
|
ts: new Date().toISOString(),
|
|
118
118
|
event_id: randomUUID(),
|
|
119
|
-
|
|
119
|
+
parent_event_id: null,
|
|
120
120
|
kind: "ToolUseEvent",
|
|
121
121
|
tool_use_id: row.tool_use_id,
|
|
122
122
|
tool_name: row.tool_name,
|
|
@@ -134,7 +134,7 @@ function emitToolResult(signalsPath, row) {
|
|
|
134
134
|
appendFileSync(signalsPath, JSON.stringify({
|
|
135
135
|
ts: new Date().toISOString(),
|
|
136
136
|
event_id: randomUUID(),
|
|
137
|
-
|
|
137
|
+
parent_event_id: null,
|
|
138
138
|
kind: "ToolResultEvent",
|
|
139
139
|
tool_use_id: row.tool_use_id,
|
|
140
140
|
output: row.output,
|
|
@@ -163,7 +163,7 @@ function emitLlmCall(signalsPath, row) {
|
|
|
163
163
|
appendFileSync(signalsPath, JSON.stringify({
|
|
164
164
|
ts: new Date().toISOString(),
|
|
165
165
|
event_id: randomUUID(),
|
|
166
|
-
|
|
166
|
+
parent_event_id: null,
|
|
167
167
|
kind: "LlmCallEvent",
|
|
168
168
|
host: row.host,
|
|
169
169
|
port: 443,
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { CheckDefinition } from "./checks.js";
|
|
2
|
+
/**
|
|
3
|
+
* A pointer from the ROOT of the exported tree.
|
|
4
|
+
*
|
|
5
|
+
* Numbers are array indices and strings are object keys, but this function does
|
|
6
|
+
* not enforce that — the tree decides, at resolution time. Passing no segments
|
|
7
|
+
* returns `""`, which RFC 6901 defines as the whole document; a check with
|
|
8
|
+
* nothing narrower to name must OMIT `evidenceStatePaths` rather than cite the
|
|
9
|
+
* root, for the same reason it must omit rather than send `[]`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function statePath(...segments: readonly (string | number)[]): string;
|
|
12
|
+
/**
|
|
13
|
+
* A pointer relative to one a resolver already built.
|
|
14
|
+
*
|
|
15
|
+
* The twins' `resolve*` helpers walk the tree to find an entity and now hand
|
|
16
|
+
* back the pointer they walked; a check appends the field it went on to read.
|
|
17
|
+
* Written as its own function rather than string concatenation at 37 call sites
|
|
18
|
+
* because the escaping has to happen on the appended segments and NOT on the
|
|
19
|
+
* base, which already contains real `/` separators — concatenating by hand is
|
|
20
|
+
* how a `~1` ends up double-encoded.
|
|
21
|
+
*/
|
|
22
|
+
export declare function childStatePath(base: string, ...segments: readonly (string | number)[]): string;
|
|
23
|
+
/**
|
|
24
|
+
* What a pointer addresses in a tree, or `null` when it addresses nothing.
|
|
25
|
+
*
|
|
26
|
+
* `null` is a NORMAL answer and every caller must handle it: the state blob a
|
|
27
|
+
* report renders can be a different export from the one the check read (a
|
|
28
|
+
* re-run, a truncated upload, a snapshot predating a field). A consumer turns
|
|
29
|
+
* `null` into "no affordance", exactly as `findEventIndexForEvidence` turns an
|
|
30
|
+
* unresolvable event id into one.
|
|
31
|
+
*
|
|
32
|
+
* Wrapped in `{ value }` rather than returned bare because `undefined` and
|
|
33
|
+
* `null` are both legal JSON-ish values a tree can hold at a pointer, and a bare
|
|
34
|
+
* return could not tell "the path is absent" from "the path holds null" — the
|
|
35
|
+
* difference between no evidence and evidence that the field is empty.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveStatePath(tree: unknown, pointer: string): {
|
|
38
|
+
value: unknown;
|
|
39
|
+
} | null;
|
|
40
|
+
export type StateCitationArm = "passing" | "failing";
|
|
41
|
+
export type StateCitationVerdict = {
|
|
42
|
+
kind: "cites";
|
|
43
|
+
} | {
|
|
44
|
+
kind: "declined";
|
|
45
|
+
} | {
|
|
46
|
+
kind: "uncited";
|
|
47
|
+
arm: StateCitationArm;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "unresolvable";
|
|
50
|
+
arm: StateCitationArm;
|
|
51
|
+
pointer: string;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "malformed";
|
|
54
|
+
arm: StateCitationArm;
|
|
55
|
+
detail: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Does this state-reading check say WHERE it looked, in a form that resolves?
|
|
59
|
+
*
|
|
60
|
+
* Probes BOTH arms, and that is deliberate. A citation present on the passing
|
|
61
|
+
* world and absent on the failing one is worse than no citation at all: its
|
|
62
|
+
* absence starts reading as a verdict class — "no evidence" would come to mean
|
|
63
|
+
* "this one failed" — and the reader has no way to know that is an accident of
|
|
64
|
+
* how the predicate was written. So a check must be able to say where it looked
|
|
65
|
+
* whether or not it liked what it found there.
|
|
66
|
+
*
|
|
67
|
+
* Only meaningful for `final` / `seed+final` checks. A `tape` check cites
|
|
68
|
+
* `evidenceEventIds` instead and is not this gate's business; callers filter on
|
|
69
|
+
* `substrate` before probing.
|
|
70
|
+
*/
|
|
71
|
+
export declare function probeStateCitation<TState, TArgs extends Record<string, string>>(def: CheckDefinition<TState, TArgs>, args: TArgs): StateCitationVerdict;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
//
|
|
3
|
+
// Where a state-reading check LOOKED (F-1197).
|
|
4
|
+
//
|
|
5
|
+
// `evidenceEventIds` (F-980/F-1076) answers "which recorded call produced this
|
|
6
|
+
// verdict", and only a `substrate: "tape"` check can fill it. That left 37 of
|
|
7
|
+
// the 45 declared checks citing nothing at all — not a call, not a state path,
|
|
8
|
+
// nothing a report could turn into an affordance. This module is the other
|
|
9
|
+
// pointer: the address, inside the twin's own exported state tree, of the thing
|
|
10
|
+
// the predicate compared.
|
|
11
|
+
//
|
|
12
|
+
// Split from `checks.ts` for the same reason `check-discrimination.ts` is:
|
|
13
|
+
// that file DEFINES the grammar a declaration is written in, this one defines a
|
|
14
|
+
// second, much smaller grammar — the one a POINTER is written in — and `checks.ts`
|
|
15
|
+
// is already at the 500-line health limit. Consumers import both from
|
|
16
|
+
// `@pome-sh/sdk/checks`, which re-exports these.
|
|
17
|
+
//
|
|
18
|
+
// ─── Why RFC 6901, and why not a friendlier syntax ──────────────────────────
|
|
19
|
+
//
|
|
20
|
+
// A pointer here is a JSON Pointer over the tree the twin's `exportState()`
|
|
21
|
+
// produced. Two properties decided it, and both are about the READER rather
|
|
22
|
+
// than the writer:
|
|
23
|
+
//
|
|
24
|
+
// 1. It resolves or it does not. There is no partial match, no fuzzy segment,
|
|
25
|
+
// no "the array moved by one" — so a consumer can ask a total question
|
|
26
|
+
// (`resolveStatePath`) and get a total answer. That is exactly what
|
|
27
|
+
// `apps/dashboard/src/lib/criterion-evidence.ts` needs to decide between
|
|
28
|
+
// rendering an affordance and rendering none: F-980's rule is that a row
|
|
29
|
+
// never advertises a jump that then does nothing, and a pointer language
|
|
30
|
+
// with a maybe in it cannot honour that rule.
|
|
31
|
+
// 2. It is somebody else's spec. A hand-rolled `repositories[0].issues[2]`
|
|
32
|
+
// needs an escaping story the first time a key contains a dot, and this
|
|
33
|
+
// tree has keys like `full_name` today and label names tomorrow. RFC 6901
|
|
34
|
+
// already wrote that story down (`~0` for `~`, `~1` for `/`), and the
|
|
35
|
+
// consumer is a browser that will re-implement the walk in fifteen lines
|
|
36
|
+
// whatever we choose.
|
|
37
|
+
//
|
|
38
|
+
// ─── Which tree a pointer addresses ─────────────────────────────────────────
|
|
39
|
+
//
|
|
40
|
+
// ALWAYS `final` — the exported end state — even for a `seed+final` check whose
|
|
41
|
+
// assertion is a delta. That is not a shortcut, it is what makes the pointer
|
|
42
|
+
// usable: the reader has the final tree on screen, and a pointer into a seed it
|
|
43
|
+
// is not rendering would be an affordance that lands nowhere, which is the
|
|
44
|
+
// defect this module exists to remove rather than relocate.
|
|
45
|
+
//
|
|
46
|
+
// A delta check therefore cites the field whose CHANGE it asserted about
|
|
47
|
+
// (`github.no-new-labels` cites the repo's final label set), and its reason
|
|
48
|
+
// sentence carries the before/after. The pointer says where to look; the reason
|
|
49
|
+
// says what was wrong there.
|
|
50
|
+
/**
|
|
51
|
+
* One segment, escaped per RFC 6901 §3.
|
|
52
|
+
*
|
|
53
|
+
* Order matters and is not interchangeable: `~` must be encoded FIRST, or the
|
|
54
|
+
* `/` pass would turn a literal `/` into `~1` and the `~` pass would then turn
|
|
55
|
+
* that into `~01`, which decodes back to `~1` — a different string. This is the
|
|
56
|
+
* canonical ordering the spec spells out, restated here because getting it
|
|
57
|
+
* backwards produces a pointer that looks right and resolves to nothing.
|
|
58
|
+
*/
|
|
59
|
+
function escapeSegment(segment) {
|
|
60
|
+
return segment.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
61
|
+
}
|
|
62
|
+
function unescapeSegment(segment) {
|
|
63
|
+
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A pointer from the ROOT of the exported tree.
|
|
67
|
+
*
|
|
68
|
+
* Numbers are array indices and strings are object keys, but this function does
|
|
69
|
+
* not enforce that — the tree decides, at resolution time. Passing no segments
|
|
70
|
+
* returns `""`, which RFC 6901 defines as the whole document; a check with
|
|
71
|
+
* nothing narrower to name must OMIT `evidenceStatePaths` rather than cite the
|
|
72
|
+
* root, for the same reason it must omit rather than send `[]`.
|
|
73
|
+
*/
|
|
74
|
+
export function statePath(...segments) {
|
|
75
|
+
return segments.map((segment) => `/${escapeSegment(String(segment))}`).join("");
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A pointer relative to one a resolver already built.
|
|
79
|
+
*
|
|
80
|
+
* The twins' `resolve*` helpers walk the tree to find an entity and now hand
|
|
81
|
+
* back the pointer they walked; a check appends the field it went on to read.
|
|
82
|
+
* Written as its own function rather than string concatenation at 37 call sites
|
|
83
|
+
* because the escaping has to happen on the appended segments and NOT on the
|
|
84
|
+
* base, which already contains real `/` separators — concatenating by hand is
|
|
85
|
+
* how a `~1` ends up double-encoded.
|
|
86
|
+
*/
|
|
87
|
+
export function childStatePath(base, ...segments) {
|
|
88
|
+
return `${base}${statePath(...segments)}`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* What a pointer addresses in a tree, or `null` when it addresses nothing.
|
|
92
|
+
*
|
|
93
|
+
* `null` is a NORMAL answer and every caller must handle it: the state blob a
|
|
94
|
+
* report renders can be a different export from the one the check read (a
|
|
95
|
+
* re-run, a truncated upload, a snapshot predating a field). A consumer turns
|
|
96
|
+
* `null` into "no affordance", exactly as `findEventIndexForEvidence` turns an
|
|
97
|
+
* unresolvable event id into one.
|
|
98
|
+
*
|
|
99
|
+
* Wrapped in `{ value }` rather than returned bare because `undefined` and
|
|
100
|
+
* `null` are both legal JSON-ish values a tree can hold at a pointer, and a bare
|
|
101
|
+
* return could not tell "the path is absent" from "the path holds null" — the
|
|
102
|
+
* difference between no evidence and evidence that the field is empty.
|
|
103
|
+
*/
|
|
104
|
+
export function resolveStatePath(tree, pointer) {
|
|
105
|
+
if (pointer === "")
|
|
106
|
+
return { value: tree };
|
|
107
|
+
// RFC 6901 §3: a non-empty pointer MUST begin with "/". Anything else is not
|
|
108
|
+
// a pointer, and guessing (say, by prefixing one) would resolve a string the
|
|
109
|
+
// writer never wrote.
|
|
110
|
+
if (!pointer.startsWith("/"))
|
|
111
|
+
return null;
|
|
112
|
+
let cursor = tree;
|
|
113
|
+
// `slice(1)` drops the leading "" that splitting on the leading "/" produces.
|
|
114
|
+
// A trailing "/" is meaningful — it is the empty-string KEY, which is legal —
|
|
115
|
+
// so this deliberately does not trim.
|
|
116
|
+
for (const raw of pointer.slice(1).split("/")) {
|
|
117
|
+
const segment = unescapeSegment(raw);
|
|
118
|
+
if (Array.isArray(cursor)) {
|
|
119
|
+
// Array indices are decimal, no leading zeros, no "+", no "-0" — spelled
|
|
120
|
+
// out rather than left to `Number()`, which happily accepts "1e0", " 1"
|
|
121
|
+
// and "0x1" and would resolve pointers nobody could have written.
|
|
122
|
+
if (!/^(?:0|[1-9][0-9]*)$/.test(segment))
|
|
123
|
+
return null;
|
|
124
|
+
const index = Number(segment);
|
|
125
|
+
if (index >= cursor.length)
|
|
126
|
+
return null;
|
|
127
|
+
cursor = cursor[index];
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
// `typeof null === "object"`, so the null guard is not redundant.
|
|
131
|
+
if (cursor === null || typeof cursor !== "object")
|
|
132
|
+
return null;
|
|
133
|
+
const record = cursor;
|
|
134
|
+
// `in` rather than a truthiness test, so a field holding `null`, `0` or `""`
|
|
135
|
+
// resolves. A pointer at a field that exists and is empty is evidence — it
|
|
136
|
+
// is how a reader sees that the label set the check read was empty.
|
|
137
|
+
//
|
|
138
|
+
// Own properties only: `/constructor` must not resolve through the
|
|
139
|
+
// prototype chain and hand a consumer a function to render.
|
|
140
|
+
if (!Object.prototype.hasOwnProperty.call(record, segment))
|
|
141
|
+
return null;
|
|
142
|
+
cursor = record[segment];
|
|
143
|
+
}
|
|
144
|
+
return { value: cursor };
|
|
145
|
+
}
|
|
146
|
+
function probeArm(def, args, arm, world) {
|
|
147
|
+
const outcome = def.evaluate(args, world);
|
|
148
|
+
const paths = outcome.evidenceStatePaths;
|
|
149
|
+
if (paths === undefined)
|
|
150
|
+
return { kind: "uncited", arm };
|
|
151
|
+
if (!Array.isArray(paths) || paths.length === 0) {
|
|
152
|
+
// The omit-don't-empty rule, enforced rather than documented. `[]` and
|
|
153
|
+
// absent mean the same thing downstream, so a check that sends `[]` has
|
|
154
|
+
// written a key the consumer must special-case for no gain.
|
|
155
|
+
return {
|
|
156
|
+
kind: "malformed",
|
|
157
|
+
arm,
|
|
158
|
+
detail: `evidenceStatePaths must be omitted when empty, not sent as ${JSON.stringify(paths)}`,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
for (const pointer of paths) {
|
|
162
|
+
if (typeof pointer !== "string" || pointer === "") {
|
|
163
|
+
return {
|
|
164
|
+
kind: "malformed",
|
|
165
|
+
arm,
|
|
166
|
+
detail: `${JSON.stringify(pointer)} is not a pointer — the whole-document pointer "" is not a citation`,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
// Against `final`, because that is the tree a pointer addresses and the tree
|
|
170
|
+
// a reader has on screen.
|
|
171
|
+
if (resolveStatePath(world.final, pointer) === null) {
|
|
172
|
+
return { kind: "unresolvable", arm, pointer };
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return { kind: "cites" };
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Does this state-reading check say WHERE it looked, in a form that resolves?
|
|
179
|
+
*
|
|
180
|
+
* Probes BOTH arms, and that is deliberate. A citation present on the passing
|
|
181
|
+
* world and absent on the failing one is worse than no citation at all: its
|
|
182
|
+
* absence starts reading as a verdict class — "no evidence" would come to mean
|
|
183
|
+
* "this one failed" — and the reader has no way to know that is an accident of
|
|
184
|
+
* how the predicate was written. So a check must be able to say where it looked
|
|
185
|
+
* whether or not it liked what it found there.
|
|
186
|
+
*
|
|
187
|
+
* Only meaningful for `final` / `seed+final` checks. A `tape` check cites
|
|
188
|
+
* `evidenceEventIds` instead and is not this gate's business; callers filter on
|
|
189
|
+
* `substrate` before probing.
|
|
190
|
+
*/
|
|
191
|
+
export function probeStateCitation(def, args) {
|
|
192
|
+
const worlds = def.discriminatingWorlds(args);
|
|
193
|
+
if (worlds === null)
|
|
194
|
+
return { kind: "declined" };
|
|
195
|
+
const passing = probeArm(def, args, "passing", worlds.passing);
|
|
196
|
+
if (passing.kind !== "cites")
|
|
197
|
+
return passing;
|
|
198
|
+
return probeArm(def, args, "failing", worlds.failing);
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=check-state-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-state-path.js","sourceRoot":"","sources":["../src/check-state-path.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,2EAA2E;AAC3E,gFAAgF;AAChF,0BAA0B;AAC1B,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,mFAAmF;AACnF,sEAAsE;AACtE,iDAAiD;AACjD,EAAE;AACF,+EAA+E;AAC/E,EAAE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AAmC,EACnC,IAAW;IAEX,MAAM,MAAM,GAAG,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC9C,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,OAAO,CAAC;IAC7C,OAAO,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -17,6 +17,7 @@ export interface CheckOutcome {
|
|
|
17
17
|
reason: string;
|
|
18
18
|
status?: "passed" | "failed" | "unmatched" | "skipped";
|
|
19
19
|
evidenceEventIds?: string[];
|
|
20
|
+
evidenceStatePaths?: string[];
|
|
20
21
|
}
|
|
21
22
|
export interface CheckTapeEvent {
|
|
22
23
|
ts?: string | null;
|
|
@@ -89,3 +90,4 @@ export declare function checksDigest(defs: readonly CheckBindingShape[]): string
|
|
|
89
90
|
export declare function checkNearMissPattern(def: CheckBindingShape): RegExp;
|
|
90
91
|
export declare function parseCheck<TState, TArgs extends Record<string, string>>(def: CheckDefinition<TState, TArgs>, text: string): TArgs | null;
|
|
91
92
|
export { probeDiscrimination } from "./check-discrimination.js";
|
|
93
|
+
export { statePath, childStatePath, resolveStatePath, probeStateCitation, type StateCitationArm, type StateCitationVerdict, } from "./check-state-path.js";
|
|
@@ -210,4 +210,9 @@ export function parseCheck(def, text) {
|
|
|
210
210
|
// Re-exported here so `@pome-sh/sdk/checks` keeps one import site: consumers ask
|
|
211
211
|
// the vocabulary module about the vocabulary, and the split stays internal.
|
|
212
212
|
export { probeDiscrimination } from "./check-discrimination.js";
|
|
213
|
+
// F-1197 — the pointer grammar `CheckOutcome.evidenceStatePaths` is written in,
|
|
214
|
+
// re-exported for the same reason: a declaration builds a pointer, a consumer
|
|
215
|
+
// resolves one, and both reach for `@pome-sh/sdk/checks` rather than learning
|
|
216
|
+
// which internal module the split put them in.
|
|
217
|
+
export { statePath, childStatePath, resolveStatePath, probeStateCitation, } from "./check-state-path.js";
|
|
213
218
|
//# sourceMappingURL=checks.js.map
|
|
@@ -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;IACZ,OAAO,EAAE,iCAAiC;IAC1C,OAAO,EAAE,UAAU;IACnB,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;IACxB,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG;CACpB,CAAC;AAEF,6EAA6E;AAC7E,0EAA0E;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AA2B,CAAC;AAEhE,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,+CAA+C;AAC/C,OAAO,EACL,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,GAEhE,MAAM,uBAAuB,CAAC"}
|
|
@@ -70,11 +70,20 @@ export declare const POME_RECORDER_EVENTS_PATH = "POME_RECORDER_EVENTS_PATH";
|
|
|
70
70
|
* durable tape never persists a mismatched discriminator. Disk rows from the
|
|
71
71
|
* durable store use this shape so finalize/upload does not need a second wrap
|
|
72
72
|
* for crash-streamed events.
|
|
73
|
+
*
|
|
74
|
+
* `parent_event_id` is null here and that is not a stub: the twin runs in its
|
|
75
|
+
* own process and legitimately cannot know the `event_id` of the agent-side
|
|
76
|
+
* `ToolUseEvent` that caused the call. What it DOES carry is the causing tool's
|
|
77
|
+
* id, arriving on `x-pome-correlation-id` and persisted as `correlation_id`
|
|
78
|
+
* (always) and `tool_call_id` (when the twin pins `stampToolCallId`). Since
|
|
79
|
+
* F-1200 that header holds the SDK's real `toolu_…`, so the parent is resolvable
|
|
80
|
+
* — and `mergeAdapterSignalsIntoEvents` in the CLI resolves it, because that is
|
|
81
|
+
* the one place that sees both this tape and the adapter's signals.
|
|
73
82
|
*/
|
|
74
83
|
export declare function toTwinHttpEventRow(event: RecorderEvent): RecorderEvent & {
|
|
75
84
|
kind: "TwinHttpEvent";
|
|
76
85
|
event_id: string;
|
|
77
|
-
|
|
86
|
+
parent_event_id: null;
|
|
78
87
|
};
|
|
79
88
|
/**
|
|
80
89
|
* Durable recorder store (F-720 contract / F-698 implementation).
|
|
@@ -93,6 +93,15 @@ export const POME_RECORDER_EVENTS_PATH = "POME_RECORDER_EVENTS_PATH";
|
|
|
93
93
|
* durable tape never persists a mismatched discriminator. Disk rows from the
|
|
94
94
|
* durable store use this shape so finalize/upload does not need a second wrap
|
|
95
95
|
* for crash-streamed events.
|
|
96
|
+
*
|
|
97
|
+
* `parent_event_id` is null here and that is not a stub: the twin runs in its
|
|
98
|
+
* own process and legitimately cannot know the `event_id` of the agent-side
|
|
99
|
+
* `ToolUseEvent` that caused the call. What it DOES carry is the causing tool's
|
|
100
|
+
* id, arriving on `x-pome-correlation-id` and persisted as `correlation_id`
|
|
101
|
+
* (always) and `tool_call_id` (when the twin pins `stampToolCallId`). Since
|
|
102
|
+
* F-1200 that header holds the SDK's real `toolu_…`, so the parent is resolvable
|
|
103
|
+
* — and `mergeAdapterSignalsIntoEvents` in the CLI resolves it, because that is
|
|
104
|
+
* the one place that sees both this tape and the adapter's signals.
|
|
96
105
|
*/
|
|
97
106
|
export function toTwinHttpEventRow(event) {
|
|
98
107
|
const maybeKind = event.kind;
|
|
@@ -101,14 +110,14 @@ export function toTwinHttpEventRow(event) {
|
|
|
101
110
|
return {
|
|
102
111
|
...existing,
|
|
103
112
|
event_id: typeof existing.event_id === "string" ? existing.event_id : event.request_id,
|
|
104
|
-
|
|
113
|
+
parent_event_id: null,
|
|
105
114
|
};
|
|
106
115
|
}
|
|
107
116
|
return {
|
|
108
117
|
...event,
|
|
109
118
|
kind: "TwinHttpEvent",
|
|
110
119
|
event_id: event.request_id,
|
|
111
|
-
|
|
120
|
+
parent_event_id: null,
|
|
112
121
|
};
|
|
113
122
|
}
|
|
114
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorder.js","sourceRoot":"","sources":["../src/recorder.ts"],"names":[],"mappings":"AAAA,wMAAwM;AACxM,sCAAsC;AACtC,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,uEAAuE;AACvE,4BAA4B;AAC5B,2EAA2E;AAC3E,wEAAwE;AACxE,gEAAgE;AAChE,0EAA0E;AAC1E,sDAAsD;AACtD,+EAA+E;AAC/E,4EAA4E;AAC5E,uEAAuE;AACvE,6EAA6E;AAC7E,0EAA0E;AAC1E,6EAA6E;AAC7E,wEAAwE;AACxE,0EAA0E;AAC1E,iEAAiE;AACjE,+DAA+D;AAC/D,wEAAwE;AAC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I,CAAC,IAAa,EAAE,MAAe,CAAC,CAAC;AAChD,CAAC;AAED,0EAA0E;AAC1E,uEAAuE;AACvE,qEAAqE;AACrE,KAAK,UAAU,eAAe,CAAC,CAAU;IACvC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,IAAa;IACnC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACxD,MAAM,MAAM,GAAG,IAA8C,CAAC;IAC9D,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IAC9D,gFAAgF;IAChF,IAAI,MAAM,CAAC,KAAK,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrD,MAAM,MAAM,GAAI,MAAM,CAAC,KAA+B,CAAC,OAAO,CAAC;QAC/D,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC;IAChD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pome-sh/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Twin engine for Pome digital twins — defineTwin() + serve(): HTTP mounting, bearer auth, trace recorder, MCP dispatch, SQLite-backed state.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dist"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@pome-sh/shared-types": "0.
|
|
43
|
+
"@pome-sh/shared-types": "0.14.0",
|
|
44
44
|
"hono": "^4.12.31",
|
|
45
45
|
"zod": "^4.1.13"
|
|
46
46
|
},
|