@mnemom/mnemom 0.17.34-next.1 → 0.17.34-next.2
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/base-url-proxy.mjs +18 -4
- package/dist/commands/agent-config.js +5 -1
- package/dist/commands/agent-doctor.d.ts +9 -0
- package/dist/commands/agent-doctor.js +4 -0
- package/dist/commands/agent-session.d.ts +1 -2
- package/dist/commands/agent-session.js +1 -2
- package/dist/commands/agent-setup.d.ts +6 -0
- package/dist/commands/agent-setup.js +12 -1
- package/dist/commands/agent.d.ts +11 -0
- package/dist/commands/agent.js +145 -46
- package/dist/commands/durable-doctor.d.ts +50 -0
- package/dist/commands/durable-doctor.js +186 -0
- package/dist/commands/durable-lock.d.ts +254 -0
- package/dist/commands/durable-lock.js +595 -0
- package/dist/commands/durable-sessions.d.ts +87 -0
- package/dist/commands/durable-sessions.js +303 -0
- package/dist/commands/durable-verbs.d.ts +116 -0
- package/dist/commands/durable-verbs.js +393 -0
- package/dist/durable/flock.d.ts +26 -0
- package/dist/durable/flock.js +80 -0
- package/dist/durable/launch-spec.d.ts +7 -1
- package/dist/durable/launch-spec.js +10 -3
- package/dist/durable/seat-proxy-entry.d.ts +11 -0
- package/dist/durable/seat-proxy-entry.js +25 -0
- package/dist/durable/seat-proxy.d.ts +107 -0
- package/dist/durable/seat-proxy.js +599 -0
- package/dist/durable/seat-socket.d.ts +46 -0
- package/dist/durable/seat-socket.js +179 -0
- package/dist/durable/seat-spec-validator.d.ts +28 -0
- package/dist/durable/seat-spec-validator.js +59 -0
- package/dist/durable/test-mode.mjs +81 -0
- package/dist/durable/turn-chain.d.ts +55 -0
- package/dist/durable/turn-chain.js +178 -0
- package/dist/host/auto-continue.d.ts +67 -0
- package/dist/host/auto-continue.js +118 -0
- package/dist/host/bootid.d.ts +13 -0
- package/dist/host/bootid.js +41 -0
- package/dist/host/client.d.ts +123 -0
- package/dist/host/client.js +171 -0
- package/dist/host/commands.d.ts +2 -0
- package/dist/host/commands.js +122 -0
- package/dist/host/control.d.ts +33 -0
- package/dist/host/control.js +144 -0
- package/dist/host/daemon.d.ts +217 -0
- package/dist/host/daemon.js +606 -0
- package/dist/host/gate.d.ts +46 -0
- package/dist/host/gate.js +82 -0
- package/dist/host/grant.d.ts +24 -0
- package/dist/host/grant.js +24 -0
- package/dist/host/instance.d.ts +35 -0
- package/dist/host/instance.js +62 -0
- package/dist/host/integrity.d.ts +35 -0
- package/dist/host/integrity.js +115 -0
- package/dist/host/launchd.d.ts +16 -0
- package/dist/host/launchd.js +45 -0
- package/dist/host/lock.d.ts +20 -0
- package/dist/host/lock.js +63 -0
- package/dist/host/owner.d.ts +55 -0
- package/dist/host/owner.js +121 -0
- package/dist/host/plist.d.ts +16 -0
- package/dist/host/plist.js +85 -0
- package/dist/host/procs.d.ts +27 -0
- package/dist/host/procs.js +105 -0
- package/dist/host/run.d.ts +66 -0
- package/dist/host/run.js +314 -0
- package/dist/host/runtime.d.ts +8 -0
- package/dist/host/runtime.js +22 -0
- package/dist/host/s1-names.d.ts +22 -0
- package/dist/host/s1-names.js +21 -0
- package/dist/host/seat-credential.d.ts +27 -0
- package/dist/host/seat-credential.js +41 -0
- package/dist/host/seat-launch-main.d.ts +1 -0
- package/dist/host/seat-launch-main.js +59 -0
- package/dist/host/seat-launch.d.ts +116 -0
- package/dist/host/seat-launch.js +302 -0
- package/dist/host/seat.d.ts +48 -0
- package/dist/host/seat.js +149 -0
- package/dist/host/state.d.ts +33 -0
- package/dist/host/state.js +117 -0
- package/dist/host/status.d.ts +101 -0
- package/dist/host/status.js +307 -0
- package/dist/host/tmux.d.ts +56 -0
- package/dist/host/tmux.js +182 -0
- package/dist/host/transcript.d.ts +30 -0
- package/dist/host/transcript.js +130 -0
- package/dist/host/verbs.d.ts +50 -0
- package/dist/host/verbs.js +271 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.js +197 -35
- package/dist/lib/agent.d.ts +8 -26
- package/dist/lib/agent.js +11 -26
- package/dist/lib/claude-plugin.d.ts +11 -2
- package/dist/lib/claude-plugin.js +10 -1
- package/dist/lib/durable/api.d.ts +136 -0
- package/dist/lib/durable/api.js +220 -0
- package/dist/lib/durable/codes.d.ts +8 -0
- package/dist/lib/durable/codes.js +2 -0
- package/dist/lib/durable/first-turn.d.ts +50 -0
- package/dist/lib/durable/first-turn.js +102 -0
- package/dist/lib/durable/gate.d.ts +48 -0
- package/dist/lib/durable/gate.js +122 -0
- package/dist/lib/durable/handover.d.ts +101 -0
- package/dist/lib/durable/handover.js +175 -0
- package/dist/lib/durable/launch.d.ts +182 -0
- package/dist/lib/durable/launch.js +443 -0
- package/dist/lib/durable/launching.d.ts +15 -0
- package/dist/lib/durable/launching.js +70 -0
- package/dist/lib/durable/live.d.ts +194 -0
- package/dist/lib/durable/live.js +635 -0
- package/dist/lib/durable/refusal.d.ts +57 -0
- package/dist/lib/durable/refusal.js +78 -0
- package/dist/lib/durable/view.d.ts +83 -0
- package/dist/lib/durable/view.js +244 -0
- package/dist/lib/experimental.d.ts +0 -9
- package/dist/lib/experimental.js +18 -17
- package/dist/lib/launcher-config.d.ts +7 -0
- package/dist/lib/launcher-config.js +21 -0
- package/dist/lib/scan/report-email.d.ts +1 -1
- package/dist/lib/scan/report-email.js +9 -1
- package/dist/lib/subscription-login.d.ts +15 -0
- package/dist/lib/subscription-login.js +28 -1
- package/dist/vendor/durable-contract/index.js +240 -18
- package/dist/vendor/shared/durable-contract/admission.d.ts +240 -0
- package/dist/vendor/shared/durable-contract/admission.js +533 -0
- package/dist/vendor/shared/durable-contract/arm.d.ts +51 -0
- package/dist/vendor/shared/durable-contract/arm.js +133 -0
- package/dist/vendor/shared/durable-contract/canonical.d.ts +29 -0
- package/dist/vendor/shared/durable-contract/canonical.js +98 -0
- package/dist/vendor/shared/durable-contract/cell-id.d.ts +22 -0
- package/dist/vendor/shared/durable-contract/cell-id.js +38 -0
- package/dist/vendor/shared/durable-contract/cli-output.d.ts +342 -0
- package/dist/vendor/shared/durable-contract/cli-output.js +201 -0
- package/dist/vendor/shared/durable-contract/cli-surface.d.ts +119 -0
- package/dist/vendor/shared/durable-contract/cli-surface.js +270 -0
- package/dist/vendor/shared/durable-contract/codes.d.ts +537 -0
- package/dist/vendor/shared/durable-contract/codes.js +475 -0
- package/dist/vendor/shared/durable-contract/constants.d.ts +153 -0
- package/dist/vendor/shared/durable-contract/constants.js +179 -0
- package/dist/vendor/shared/durable-contract/doors.d.ts +119 -0
- package/dist/vendor/shared/durable-contract/doors.js +249 -0
- package/dist/vendor/shared/durable-contract/envelope.d.ts +103 -0
- package/dist/vendor/shared/durable-contract/envelope.js +317 -0
- package/dist/vendor/shared/durable-contract/events.d.ts +147 -0
- package/dist/vendor/shared/durable-contract/events.js +630 -0
- package/dist/vendor/shared/durable-contract/executor-state.d.ts +41 -0
- package/dist/vendor/shared/durable-contract/executor-state.js +32 -0
- package/dist/vendor/shared/durable-contract/fixlines.d.ts +318 -0
- package/dist/vendor/shared/durable-contract/fixlines.js +483 -0
- package/dist/vendor/shared/durable-contract/freeze-record.d.ts +787 -0
- package/dist/vendor/shared/durable-contract/freeze-record.js +361 -0
- package/dist/vendor/shared/durable-contract/index.d.ts +36 -0
- package/dist/vendor/shared/durable-contract/index.js +37 -0
- package/dist/vendor/shared/durable-contract/journal-approvals.d.ts +29 -0
- package/dist/vendor/shared/durable-contract/journal-approvals.js +60 -0
- package/dist/vendor/shared/durable-contract/keys.d.ts +24 -0
- package/dist/vendor/shared/durable-contract/keys.js +66 -0
- package/dist/vendor/shared/durable-contract/lock.d.ts +128 -0
- package/dist/vendor/shared/durable-contract/lock.js +151 -0
- package/dist/vendor/shared/durable-contract/names.d.ts +25 -0
- package/dist/vendor/shared/durable-contract/names.js +78 -0
- package/dist/vendor/shared/durable-contract/owner-verbs.d.ts +175 -0
- package/dist/vendor/shared/durable-contract/owner-verbs.js +403 -0
- package/dist/vendor/shared/durable-contract/paths.d.ts +23 -0
- package/dist/vendor/shared/durable-contract/paths.js +35 -0
- package/dist/vendor/shared/durable-contract/pure-fn.d.ts +48 -0
- package/dist/vendor/shared/durable-contract/pure-fn.js +89 -0
- package/dist/vendor/shared/durable-contract/routes.d.ts +205 -0
- package/dist/vendor/shared/durable-contract/routes.js +315 -0
- package/dist/vendor/shared/durable-contract/schema.d.ts +126 -0
- package/dist/vendor/shared/durable-contract/schema.js +441 -0
- package/dist/vendor/shared/durable-contract/seal.d.ts +54 -0
- package/dist/vendor/shared/durable-contract/seal.js +99 -0
- package/dist/vendor/shared/durable-contract/secret-scope.d.ts +28 -0
- package/dist/vendor/shared/durable-contract/secret-scope.js +76 -0
- package/dist/vendor/shared/durable-contract/session-id.d.ts +21 -0
- package/dist/vendor/shared/durable-contract/session-id.js +58 -0
- package/dist/vendor/shared/durable-contract/spec.d.ts +162 -0
- package/dist/vendor/shared/durable-contract/spec.js +286 -0
- package/dist/vendor/shared/durable-contract/states.d.ts +96 -0
- package/dist/vendor/shared/durable-contract/states.js +218 -0
- package/dist/vendor/shared/durable-contract/telemetry.d.ts +94 -0
- package/dist/vendor/shared/durable-contract/telemetry.js +180 -0
- package/dist/vendor/shared/durable-contract/test-mode.d.ts +62 -0
- package/dist/vendor/shared/durable-contract/test-mode.js +140 -0
- package/dist/vendor/shared/durable-contract/turn.d.ts +57 -0
- package/dist/vendor/shared/durable-contract/turn.js +81 -0
- package/dist/vendor/shared/durable-contract/vectors.d.ts +191 -0
- package/dist/vendor/shared/durable-contract/vectors.js +208 -0
- package/package.json +3 -2
- package/plugins/integrity-manifest.json +35 -0
- package/plugins/mnemom/hooks/hooks.json +15 -1
- package/plugins/mnemom/hooks/register.tsx +60 -2
- package/plugins/mnemom/hooks/seat-hello.mjs +116 -0
- package/dist/commands/agent-implicit-notice.d.ts +0 -31
- package/dist/commands/agent-implicit-notice.js +0 -73
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// GENERATED from shared/durable-contract/src/test-mode.ts by cli/scripts/sync-durable-contract.mjs; do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* The closed TEST_MODE seam list T1-T12 and the per-repo guard lists (C17-R16, rulings I06, I22,
|
|
4
|
+
* I29; BACKBONE "TEST_MODE"). A seam is honoured only when DURABLE_SESSIONS_TEST_MODE is exactly
|
|
5
|
+
* "1" AND every URL on the repo's guard list is a loopback literal; an unset URL fails. Each repo
|
|
6
|
+
* reads the env in exactly one module (TEST_MODE_MODULE).
|
|
7
|
+
*/
|
|
8
|
+
export const TEST_MODE_ENV = "DURABLE_SESSIONS_TEST_MODE";
|
|
9
|
+
export const REPOS = ["cli", "api", "gateway"];
|
|
10
|
+
export const TEST_SEAMS = [
|
|
11
|
+
{ id: "T1", repo: "cli", kind: "env", names: ["DURABLE_BOOT_ID_FILE"] },
|
|
12
|
+
{ id: "T2", repo: "cli", kind: "env", names: ["DURABLE_HOST_TEST_PAUSE_AT"] },
|
|
13
|
+
{
|
|
14
|
+
id: "T3",
|
|
15
|
+
repo: "cli",
|
|
16
|
+
kind: "env",
|
|
17
|
+
names: ["http door on a loopback host (credential proxy)"],
|
|
18
|
+
},
|
|
19
|
+
{ id: "T4", repo: "api", kind: "env", names: ["DURABLE_TEST_GITHUB_API_BASE"] },
|
|
20
|
+
{ id: "T5", repo: "api", kind: "route", names: ["POST /__test/durable/barriers/{name}/release"] },
|
|
21
|
+
{ id: "T6", repo: "api", kind: "header", names: ["x-durable-test-fault"] },
|
|
22
|
+
{ id: "T7", repo: "api", kind: "route", names: ["POST /__test/durable/append"] },
|
|
23
|
+
{ id: "T8", repo: "api", kind: "body", names: ["max_rows", "time_budget_ms", "batch_size"] },
|
|
24
|
+
{
|
|
25
|
+
id: "T9",
|
|
26
|
+
repo: "api",
|
|
27
|
+
kind: "env",
|
|
28
|
+
names: [
|
|
29
|
+
"DURABLE_SWEEP_TEST_BATCH_DELAY_MS",
|
|
30
|
+
"DURABLE_SWEEP_TEST_PAUSE_ADVISORY_KEY",
|
|
31
|
+
"DURABLE_SWEEP_TEST_FAULT",
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{ id: "T10", repo: "gateway", kind: "env", names: ["SUBSCRIPTION_PROFILE_URL_OVERRIDE"] },
|
|
35
|
+
{
|
|
36
|
+
id: "T11",
|
|
37
|
+
repo: "gateway",
|
|
38
|
+
kind: "route",
|
|
39
|
+
names: ["POST /__test/durable/kv", "POST /__test/durable/fault", "POST /__test/durable/lru"],
|
|
40
|
+
},
|
|
41
|
+
{ id: "T12", repo: "api+gateway", kind: "header", names: ["x-mnemom-test-case"] },
|
|
42
|
+
];
|
|
43
|
+
export const T2_PAUSE_POINTS = [
|
|
44
|
+
"after_claim_before_spawn",
|
|
45
|
+
"after_spawn_before_register",
|
|
46
|
+
"after_register_before_hello",
|
|
47
|
+
"after_first_batch",
|
|
48
|
+
"after_verify_before_exec",
|
|
49
|
+
];
|
|
50
|
+
export const T5_BARRIERS = [
|
|
51
|
+
"lock.after_preconditions",
|
|
52
|
+
"lock.before_commit",
|
|
53
|
+
"session_create.before_insert",
|
|
54
|
+
"session_key_mint.before_insert",
|
|
55
|
+
];
|
|
56
|
+
export const T6_FAULTS = ["drop_response_after_commit"];
|
|
57
|
+
export const T9_SWEEP_FAULTS = ["after_update"];
|
|
58
|
+
/** Dropped seams: must be absent from every repo (C17-R16). */
|
|
59
|
+
export const DROPPED_SEAMS = [
|
|
60
|
+
"DURABLE_CLAUDE_BIN",
|
|
61
|
+
"DURABLE_SPAWN_PAUSE_AFTER_VERIFY_MS",
|
|
62
|
+
"DURABLE_SWEEP_BUDGET",
|
|
63
|
+
"/internal/durable/test/lru-flush",
|
|
64
|
+
"durable_test_barrier",
|
|
65
|
+
"test_barriers_enabled",
|
|
66
|
+
];
|
|
67
|
+
export const GUARD_LISTS = {
|
|
68
|
+
cli: ["MNEMOM_API_URL", "MNEMOM_GATEWAY_URL"],
|
|
69
|
+
api: ["SUPABASE_URL", "MNEMOM_GATEWAY_URL"],
|
|
70
|
+
gateway: ["SUPABASE_URL", "MNEMOM_ANALYZE_URL"],
|
|
71
|
+
};
|
|
72
|
+
/** The one module per repo that reads TEST_MODE and holds every seam getter (repo-relative). */
|
|
73
|
+
export const TEST_MODE_MODULE = {
|
|
74
|
+
cli: "cli/src/durable/test-mode.mjs",
|
|
75
|
+
api: "src/durable/test-mode.ts",
|
|
76
|
+
gateway: "gateway/src/durable/test-mode.ts",
|
|
77
|
+
};
|
|
78
|
+
export function seamsOf(repo) {
|
|
79
|
+
return TEST_SEAMS.filter((s) => s.repo === repo || (s.repo === "api+gateway" && repo !== "cli")).map((s) => s.id);
|
|
80
|
+
}
|
|
81
|
+
export const LOOPBACK_HOSTS = ["127.0.0.1", "[::1]", "localhost"];
|
|
82
|
+
/** A URL whose host is exactly a loopback literal (look-alikes such as 127.0.0.1.nip.io fail). */
|
|
83
|
+
export function isLoopbackUrl(value) {
|
|
84
|
+
if (value === undefined || value === "")
|
|
85
|
+
return false;
|
|
86
|
+
let u;
|
|
87
|
+
try {
|
|
88
|
+
u = new URL(value);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return LOOPBACK_HOSTS.includes(u.hostname);
|
|
94
|
+
}
|
|
95
|
+
/** The seam guard: TEST_MODE exactly "1" and every guard URL a loopback literal. */
|
|
96
|
+
export function testModeActive(repo, env) {
|
|
97
|
+
if (env[TEST_MODE_ENV] !== "1")
|
|
98
|
+
return false;
|
|
99
|
+
return GUARD_LISTS[repo].every((k) => isLoopbackUrl(env[k]));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The C17-R18 integrity allowlist (ruling 31(2)): the pre-existing tests and generated snapshots
|
|
103
|
+
* that M1 may legitimately change, so the test_integrity tool does not count their edits as a
|
|
104
|
+
* deletion, skip or weakening. Closed to R18's three kinds. Each entry is a literal repo-relative
|
|
105
|
+
* path (the narrowest glob): spec coverage is the api's spec-coverage gates, route inventory is
|
|
106
|
+
* `npm run inventory:check` (the extractor's tests and its exempt lists), openapi snapshots are
|
|
107
|
+
* the two files `npm run openapi:check` diffs. Repos use the vitest_suite enum; gateway, cli and
|
|
108
|
+
* the api postgrest suite hold no file of these kinds.
|
|
109
|
+
*/
|
|
110
|
+
export const TEST_ALLOWLIST_KINDS = [
|
|
111
|
+
"spec_coverage",
|
|
112
|
+
"route_inventory",
|
|
113
|
+
"openapi_snapshot",
|
|
114
|
+
];
|
|
115
|
+
export const TEST_ALLOWLIST_REPOS = [
|
|
116
|
+
"gateway",
|
|
117
|
+
"api",
|
|
118
|
+
"api_postgrest",
|
|
119
|
+
"cli",
|
|
120
|
+
"durable_contract",
|
|
121
|
+
];
|
|
122
|
+
const allow = (repo, kind, path) => Object.freeze({ repo, kind, path });
|
|
123
|
+
/**
|
|
124
|
+
* test_integrity baseline runs (ruling 31.1): the merge-base suites run this many times to record
|
|
125
|
+
* flaky tests (passes and fails across runs) and baseline_failing ones (fails every run); also the
|
|
126
|
+
* most attempts a test recorded flaky gets in the candidate run.
|
|
127
|
+
*/
|
|
128
|
+
export const TEST_FLAKY_RUNS = 3;
|
|
129
|
+
export const TEST_ALLOWLIST = Object.freeze([
|
|
130
|
+
allow("api", "spec_coverage", "src/__tests__/auth-gate-spec-coverage.test.ts"),
|
|
131
|
+
allow("api", "spec_coverage", "src/__tests__/spec-500-doc-coverage.test.ts"),
|
|
132
|
+
allow("api", "route_inventory", "openapi/__tests__/extract-routes.test.ts"),
|
|
133
|
+
allow("api", "route_inventory", "openapi/scripts/check-route-coverage.ts"),
|
|
134
|
+
allow("api", "openapi_snapshot", "openapi.json"),
|
|
135
|
+
allow("api", "openapi_snapshot", "openapi-internal.json"),
|
|
136
|
+
]);
|
|
137
|
+
/** Whether `path` (repo-relative, exact) is on TEST_ALLOWLIST for `repo`. */
|
|
138
|
+
export function isTestAllowlisted(repo, path) {
|
|
139
|
+
return TEST_ALLOWLIST.some((e) => e.repo === repo && e.path === path);
|
|
140
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The S1 attended rule, the reserved inbox key and the chain derivation (BACKBONE amendments 34,
|
|
3
|
+
* 38, 47; rulings r3 U03, U08, final F07; C09; C19-R03).
|
|
4
|
+
*
|
|
5
|
+
* x-mnemom-turn entries are the cli/src/turn-origin.mjs grammar
|
|
6
|
+
* origin=<o>; [source=<s>; ][producer=<p>; ]pastes=<n>; h=<64 hex>[; inbox=<64 hex>]
|
|
7
|
+
* `producer` (amendment 56) is stated on origin=task entries only: Claude Code's `origin.producer`.
|
|
8
|
+
* joined by ", ", plus one leading `chain=<64 hex>` element from the durable variant only (C3).
|
|
9
|
+
* This module holds the posture decision; the parser stays in the gateway (goal-turn-claims.ts).
|
|
10
|
+
*/
|
|
11
|
+
export declare const TURN_ORIGINS: readonly ["human", "channel", "scheduled", "peer", "task", "meta"];
|
|
12
|
+
export type TurnOrigin = (typeof TURN_ORIGINS)[number];
|
|
13
|
+
export declare const TURN_SOURCES: readonly ["typed", "queued", "system", "sdk"];
|
|
14
|
+
export type TurnSource = (typeof TURN_SOURCES)[number];
|
|
15
|
+
export declare const CHAIN_KEY = "chain";
|
|
16
|
+
/** Reserved entry key; no M1 emitter (P0a-B). Any entry carrying it is unattended. */
|
|
17
|
+
export declare const INBOX_KEY = "inbox";
|
|
18
|
+
export declare const TURN_HASH_RE: RegExp;
|
|
19
|
+
export interface TurnEntryFacts {
|
|
20
|
+
origin: TurnOrigin;
|
|
21
|
+
source?: TurnSource;
|
|
22
|
+
/** The entry's `producer=<p>` (amendment 56), when stated. */
|
|
23
|
+
producer?: string;
|
|
24
|
+
/** True when the entry carried `inbox=<sha256 hex>`. */
|
|
25
|
+
inbox: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Sources that keep a human entry attended: absent, typed, queued (queued attended is a recorded departure). */
|
|
28
|
+
export declare const ATTENDED_SOURCES: readonly (TurnSource | undefined)[];
|
|
29
|
+
/** A stated producer token: lowercase, digits and hyphens, at most 32 characters (amendment 56). */
|
|
30
|
+
export declare const TURN_PRODUCER_RE: RegExp;
|
|
31
|
+
/**
|
|
32
|
+
* Amendment 56 (approved by Wassim 2026-10-29: task-notification = attended continuation): the one
|
|
33
|
+
* task producer whose notification continues the human's own work. Claude Code records a finished
|
|
34
|
+
* background command or agent of this session as origin.kind task-notification, producer
|
|
35
|
+
* session-task, promptSource system.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ATTENDED_TASK_PRODUCER = "session-task";
|
|
38
|
+
/**
|
|
39
|
+
* Candidate posture of a chain's opening request: attended when the NEWEST stated entry is
|
|
40
|
+
* origin=human with source absent, typed or queued, and no inbox key. Amendment 56 adds one
|
|
41
|
+
* continuation: a newest origin=task entry with source=system, producer session-task and no inbox
|
|
42
|
+
* key is attended when an earlier stated entry is such a human turn. Anything else (every other
|
|
43
|
+
* origin, producer or source, a task entry with no human turn before it), an empty entry list, or
|
|
44
|
+
* `schemaKnown=false` (schema=unknown with a well-formed chain, F07) is unattended.
|
|
45
|
+
*/
|
|
46
|
+
export declare function candidatePosture(entries: readonly TurnEntryFacts[], schemaKnown?: boolean): "attended" | "unattended";
|
|
47
|
+
/** chain = sha256 hex of the root promptId (UTF-8). */
|
|
48
|
+
export declare function chainIdOf(rootPromptId: string): Promise<string>;
|
|
49
|
+
/** Request classes (day-1 spike vocabulary) and whether each waits for its transcript entry. */
|
|
50
|
+
export declare const REQUEST_CLASSES: readonly ["main_synced", "main_no_prompt_id", "compaction", "auxiliary", "count_tokens_pre_first_prompt"];
|
|
51
|
+
export type RequestClass = (typeof REQUEST_CLASSES)[number];
|
|
52
|
+
/** What the C3 proxy does per request class (amendment 38). */
|
|
53
|
+
export declare function chainHandling(c: RequestClass): {
|
|
54
|
+
wait: boolean;
|
|
55
|
+
chain: "own_root" | "current_root" | "none";
|
|
56
|
+
dropOnTimeout: boolean;
|
|
57
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// GENERATED from shared/durable-contract/src/turn.ts by cli/scripts/sync-durable-contract.mjs; do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* The S1 attended rule, the reserved inbox key and the chain derivation (BACKBONE amendments 34,
|
|
4
|
+
* 38, 47; rulings r3 U03, U08, final F07; C09; C19-R03).
|
|
5
|
+
*
|
|
6
|
+
* x-mnemom-turn entries are the cli/src/turn-origin.mjs grammar
|
|
7
|
+
* origin=<o>; [source=<s>; ][producer=<p>; ]pastes=<n>; h=<64 hex>[; inbox=<64 hex>]
|
|
8
|
+
* `producer` (amendment 56) is stated on origin=task entries only: Claude Code's `origin.producer`.
|
|
9
|
+
* joined by ", ", plus one leading `chain=<64 hex>` element from the durable variant only (C3).
|
|
10
|
+
* This module holds the posture decision; the parser stays in the gateway (goal-turn-claims.ts).
|
|
11
|
+
*/
|
|
12
|
+
import { sha256Hex } from "./canonical.js";
|
|
13
|
+
export const TURN_ORIGINS = ["human", "channel", "scheduled", "peer", "task", "meta"];
|
|
14
|
+
export const TURN_SOURCES = ["typed", "queued", "system", "sdk"];
|
|
15
|
+
export const CHAIN_KEY = "chain";
|
|
16
|
+
/** Reserved entry key; no M1 emitter (P0a-B). Any entry carrying it is unattended. */
|
|
17
|
+
export const INBOX_KEY = "inbox";
|
|
18
|
+
export const TURN_HASH_RE = /^[0-9a-f]{64}$/;
|
|
19
|
+
/** Sources that keep a human entry attended: absent, typed, queued (queued attended is a recorded departure). */
|
|
20
|
+
export const ATTENDED_SOURCES = [undefined, "typed", "queued"];
|
|
21
|
+
/** A stated producer token: lowercase, digits and hyphens, at most 32 characters (amendment 56). */
|
|
22
|
+
export const TURN_PRODUCER_RE = /^[a-z][a-z0-9-]{0,31}$/;
|
|
23
|
+
/**
|
|
24
|
+
* Amendment 56 (approved by Wassim 2026-10-29: task-notification = attended continuation): the one
|
|
25
|
+
* task producer whose notification continues the human's own work. Claude Code records a finished
|
|
26
|
+
* background command or agent of this session as origin.kind task-notification, producer
|
|
27
|
+
* session-task, promptSource system.
|
|
28
|
+
*/
|
|
29
|
+
export const ATTENDED_TASK_PRODUCER = "session-task";
|
|
30
|
+
const attendedHuman = (e) => e.origin === "human" && ATTENDED_SOURCES.includes(e.source) && !e.inbox;
|
|
31
|
+
/**
|
|
32
|
+
* Candidate posture of a chain's opening request: attended when the NEWEST stated entry is
|
|
33
|
+
* origin=human with source absent, typed or queued, and no inbox key. Amendment 56 adds one
|
|
34
|
+
* continuation: a newest origin=task entry with source=system, producer session-task and no inbox
|
|
35
|
+
* key is attended when an earlier stated entry is such a human turn. Anything else (every other
|
|
36
|
+
* origin, producer or source, a task entry with no human turn before it), an empty entry list, or
|
|
37
|
+
* `schemaKnown=false` (schema=unknown with a well-formed chain, F07) is unattended.
|
|
38
|
+
*/
|
|
39
|
+
export function candidatePosture(entries, schemaKnown = true) {
|
|
40
|
+
if (!schemaKnown)
|
|
41
|
+
return "unattended";
|
|
42
|
+
const newest = entries[entries.length - 1];
|
|
43
|
+
if (newest === undefined)
|
|
44
|
+
return "unattended";
|
|
45
|
+
if (attendedHuman(newest))
|
|
46
|
+
return "attended";
|
|
47
|
+
const continuation = newest.origin === "task" &&
|
|
48
|
+
newest.source === "system" &&
|
|
49
|
+
newest.producer === ATTENDED_TASK_PRODUCER &&
|
|
50
|
+
!newest.inbox &&
|
|
51
|
+
entries.slice(0, -1).some(attendedHuman);
|
|
52
|
+
return continuation ? "attended" : "unattended";
|
|
53
|
+
}
|
|
54
|
+
/** chain = sha256 hex of the root promptId (UTF-8). */
|
|
55
|
+
export async function chainIdOf(rootPromptId) {
|
|
56
|
+
if (typeof rootPromptId !== "string" || rootPromptId.length === 0)
|
|
57
|
+
throw new RangeError("root promptId is required");
|
|
58
|
+
return sha256Hex(rootPromptId);
|
|
59
|
+
}
|
|
60
|
+
/** Request classes (day-1 spike vocabulary) and whether each waits for its transcript entry. */
|
|
61
|
+
export const REQUEST_CLASSES = [
|
|
62
|
+
"main_synced",
|
|
63
|
+
"main_no_prompt_id",
|
|
64
|
+
"compaction",
|
|
65
|
+
"auxiliary",
|
|
66
|
+
"count_tokens_pre_first_prompt",
|
|
67
|
+
];
|
|
68
|
+
/** What the C3 proxy does per request class (amendment 38). */
|
|
69
|
+
export function chainHandling(c) {
|
|
70
|
+
switch (c) {
|
|
71
|
+
case "main_synced":
|
|
72
|
+
return { wait: true, chain: "own_root", dropOnTimeout: true };
|
|
73
|
+
case "main_no_prompt_id":
|
|
74
|
+
case "compaction":
|
|
75
|
+
case "auxiliary":
|
|
76
|
+
return { wait: false, chain: "current_root", dropOnTimeout: false };
|
|
77
|
+
// No chain: admission skips the posture step for it (admission.ts isUnchainedCountTokens, ruling 22).
|
|
78
|
+
case "count_tokens_pre_first_prompt":
|
|
79
|
+
return { wait: false, chain: "none", dropOnTimeout: false };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Golden vectors for the recipes S1 freezes, computed independently with node:crypto (a separate
|
|
3
|
+
* canonical-JSON and AES-256-GCM implementation, scratchpad s1gen/gen.cjs) and pinned here. The
|
|
4
|
+
* tests recompute each with this package's code; a mismatch is a contract break.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CONTRACT_VECTOR: {
|
|
7
|
+
readonly dek_b64url: "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8";
|
|
8
|
+
readonly iv_b64url: "oKGio6Slpqeoqaqr";
|
|
9
|
+
readonly session_id: "11111111-2222-4333-8444-555555555555";
|
|
10
|
+
readonly contract: {
|
|
11
|
+
readonly statement: "Ship the M1 durable contract and keep every flag inert when off.";
|
|
12
|
+
readonly requirements: readonly ["tests pass", "no prod change"];
|
|
13
|
+
readonly allowed_paths: readonly ["shared/durable-contract/**"];
|
|
14
|
+
readonly forbidden_paths: readonly [".github/**"];
|
|
15
|
+
};
|
|
16
|
+
readonly plaintext: "{\"allowed_paths\":[\"shared/durable-contract/**\"],\"forbidden_paths\":[\".github/**\"],\"requirements\":[\"tests pass\",\"no prod change\"],\"statement\":\"Ship the M1 durable contract and keep every flag inert when off.\"}";
|
|
17
|
+
readonly statement_hash: "51d9393d4b1b22b84e4fe45acb3e4f3c561e75d03701771aa40c805a5146f939";
|
|
18
|
+
readonly requirements_hash: "566af8b913e8827626360e11b53b0356f9784508e3e51e36c9d6d4ce5b64bb31";
|
|
19
|
+
readonly envelopes: readonly [{
|
|
20
|
+
readonly charter_version: 1;
|
|
21
|
+
readonly envelope: "v1.oKGio6Slpqeoqaqr.nTodQSmkddoGOveycxKz_Er3e2P61jAJ-CFC8w3KF223WySQwVYhXDzoK-IjWN7VZX0pOgC5fhokMFQuxQTtw5aG3k0ewo2UnJedN6Xk7ufhKdnBtLTwCIsYW_TF6W-u1KZfznDa_LvuunUjp6TPRktwEdyxUbtfR66ww9F3r2HnYsQepyftclkt3LEwGfm_-PnZA9vwt73dqciHzqVYTuZ7cN_CGCF19ipKTAvy3YQSVt39dAPcR6LkGlg7onY5UUQ46Re53oPTMiapZwZPU3bq5U_b2kWGfRebX73T3g";
|
|
22
|
+
}, {
|
|
23
|
+
readonly charter_version: 2;
|
|
24
|
+
readonly envelope: "v1.oKGio6Slpqeoqaqr.nTodQSmkddoGOveycxKz_Er3e2P61jAJ-CFC8w3KF223WySQwVYhXDzoK-IjWN7VZX0pOgC5fhokMFQuxQTtw5aG3k0ewo2UnJedN6Xk7ufhKdnBtLTwCIsYW_TF6W-u1KZfznDa_LvuunUjp6TPRktwEdyxUbtfR66ww9F3r2HnYsQepyftclkt3LEwGfm_-PnZA9vwt73dqciHzqVYTuZ7cN_CGCF19ipKTAvy3YQSVt39dAPcR6LkGlg7onY5UUQ46Re53oPTMiapZwZPLBiJm0K86YthUHE-qc35MQ";
|
|
25
|
+
}];
|
|
26
|
+
};
|
|
27
|
+
/** One journal row per writer class, each hashed as a genesis row (prev_hash = 64 zeros). */
|
|
28
|
+
export declare const EVENT_PREIMAGE_VECTORS: readonly [{
|
|
29
|
+
readonly writer: "executor";
|
|
30
|
+
readonly refs: {
|
|
31
|
+
readonly spawn_id: "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee";
|
|
32
|
+
};
|
|
33
|
+
readonly detail: "executor.spawned spawn_id=aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee";
|
|
34
|
+
readonly preimage: "{\"detail_sha256\":\"9869cd123386f64b766dbff0fcf4a6f7d35f4bf9f6eec5594055e77c5fe0d4b0\",\"epoch\":2,\"idempotency_key\":\"spawn:11111111-2222-4333-8444-555555555555:2:aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee\",\"kind\":\"executor.spawned\",\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"principal_ref\":null,\"refs_sha256\":\"80280db047606c26674cc10fa3e08ac9dabbde08c3958116f31f0211f15b31c9\",\"seq\":3,\"session_id\":\"11111111-2222-4333-8444-555555555555\",\"ts\":\"2026-10-16T12:00:00.123000Z\",\"v\":1}";
|
|
35
|
+
readonly hash: "a54e7c93b2bc865905a57755b02b0af397b6b281caab922c411de689a2e2273d";
|
|
36
|
+
}, {
|
|
37
|
+
readonly writer: "gateway";
|
|
38
|
+
readonly refs: {
|
|
39
|
+
readonly admitted_epoch: 2;
|
|
40
|
+
readonly current_epoch: 3;
|
|
41
|
+
};
|
|
42
|
+
readonly detail: "lease.zombie_call admitted_epoch=2 current_epoch=3";
|
|
43
|
+
readonly preimage: "{\"detail_sha256\":\"9ee4f5d787302fe3464b96cc8d38cfffe049c503fea6292db98e68135ceafd9b\",\"epoch\":3,\"idempotency_key\":\"zombie:req-0001\",\"kind\":\"lease.zombie_call\",\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"principal_ref\":null,\"refs_sha256\":\"351c59d5e2d263f0e3edc09e0ad8bf205b4fb0ba12898c5b5e666e7edf821eb4\",\"seq\":4,\"session_id\":\"11111111-2222-4333-8444-555555555555\",\"ts\":\"2026-10-16T12:00:01.000000Z\",\"v\":1}";
|
|
44
|
+
readonly hash: "db229bf5c9d46295dd6e3b282750ddfd291ea164c2b8fced450790fc141d9c39";
|
|
45
|
+
}, {
|
|
46
|
+
readonly writer: "api";
|
|
47
|
+
readonly refs: {
|
|
48
|
+
readonly durable_mode: "locked";
|
|
49
|
+
};
|
|
50
|
+
readonly detail: "session.registered durable_mode=locked";
|
|
51
|
+
readonly preimage: "{\"detail_sha256\":\"eab692f69df0b5aa9984cd233af2135fa08329f21236f6a095d9a289002a28b0\",\"epoch\":0,\"idempotency_key\":\"tr:11111111-2222-4333-8444-555555555555:session.registered:0\",\"kind\":\"session.registered\",\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"principal_ref\":\"9999999999999999999999999999999999999999999999999999999999999999\",\"refs_sha256\":\"b62d326eeec5672858e7bd2cfa73a0520968329af7e405a0d8cf86cd6cecd891\",\"seq\":1,\"session_id\":\"11111111-2222-4333-8444-555555555555\",\"ts\":\"2026-10-16T11:59:00.000000Z\",\"v\":1}";
|
|
52
|
+
readonly hash: "13acfe4d0979d989464c0a71fbae440afb4d6056eaf770db2b27d39e1793d6d3";
|
|
53
|
+
}];
|
|
54
|
+
export declare const PRINCIPAL_REF_VECTOR: {
|
|
55
|
+
readonly salt_utf8: "salt-0123456789abcdef";
|
|
56
|
+
readonly principal_uid: "user-uid-1";
|
|
57
|
+
readonly principal_ref: "beb9218556929a56f74799caabfb6679f829cbc1521d139fdb710a66ab2e29b6";
|
|
58
|
+
};
|
|
59
|
+
export declare const SPEC_HASH_VECTOR: {
|
|
60
|
+
readonly spec: {
|
|
61
|
+
readonly v: 1;
|
|
62
|
+
readonly cwd: "/Users/dev/repo";
|
|
63
|
+
readonly plugin: "bundled-mnemom";
|
|
64
|
+
readonly trim_mcp: false;
|
|
65
|
+
readonly model: "opus";
|
|
66
|
+
readonly effort: "high";
|
|
67
|
+
};
|
|
68
|
+
readonly hash: "ccd6829afca0f806e52f010b15a0ae407f58df6465a6edd11c58a6a543e369d8";
|
|
69
|
+
};
|
|
70
|
+
export declare const PLUGIN_DIR_HASH_VECTOR: {
|
|
71
|
+
readonly files: readonly [{
|
|
72
|
+
readonly path: "hooks/x.sh";
|
|
73
|
+
readonly sha256: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
|
|
74
|
+
}, {
|
|
75
|
+
readonly path: "a.json";
|
|
76
|
+
readonly sha256: "0000000000000000000000000000000000000000000000000000000000000000";
|
|
77
|
+
}];
|
|
78
|
+
readonly hash: "c9df73b3ae9cd900bb324ee0c5bb3f142a58cf5fac29673a038e95098edab5cd";
|
|
79
|
+
};
|
|
80
|
+
export declare const CHAIN_ID_VECTOR: {
|
|
81
|
+
readonly root_prompt_id: "root-prompt-0001";
|
|
82
|
+
readonly chain_id: "66e05a0707771bf96685f5963062f0c6413ec65c3cc159038aba55b081545100";
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Charter hash chain (C07-R04): a v1 genesis row and a v2 row chained to it, computed with an
|
|
86
|
+
* independent Python canonical-JSON + hashlib generator (scratchpad s1gen/charter_gen.py). created_at
|
|
87
|
+
* is given in the row's text form; the preimage carries its canonical form.
|
|
88
|
+
*/
|
|
89
|
+
export declare const CHARTER_HASH_VECTORS: {
|
|
90
|
+
readonly session_id: "11111111-2222-4333-8444-555555555555";
|
|
91
|
+
readonly rows: readonly [{
|
|
92
|
+
readonly version: 1;
|
|
93
|
+
readonly prev_hash: "0000000000000000000000000000000000000000000000000000000000000000";
|
|
94
|
+
readonly charter: {
|
|
95
|
+
readonly statement_hash: "51d9393d4b1b22b84e4fe45acb3e4f3c561e75d03701771aa40c805a5146f939";
|
|
96
|
+
readonly requirements_hash: "566af8b913e8827626360e11b53b0356f9784508e3e51e36c9d6d4ce5b64bb31";
|
|
97
|
+
readonly budget_usd: 5;
|
|
98
|
+
readonly max_turns: 40;
|
|
99
|
+
readonly pins: {
|
|
100
|
+
readonly card_content_hash: "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";
|
|
101
|
+
readonly policy_engine_major: 3;
|
|
102
|
+
};
|
|
103
|
+
readonly tool_classes: {
|
|
104
|
+
readonly Bash: "input_dependent";
|
|
105
|
+
};
|
|
106
|
+
readonly launch_spec: {
|
|
107
|
+
readonly v: 1;
|
|
108
|
+
readonly cwd: "/Users/dev/repo";
|
|
109
|
+
readonly plugin: "bundled-mnemom";
|
|
110
|
+
readonly trim_mcp: false;
|
|
111
|
+
readonly model: "opus";
|
|
112
|
+
readonly effort: "high";
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
readonly created_at: "2026-10-16 12:00:00.123+00";
|
|
116
|
+
readonly preimage: "{\"charter\":{\"budget_usd\":5,\"launch_spec\":{\"cwd\":\"/Users/dev/repo\",\"effort\":\"high\",\"model\":\"opus\",\"plugin\":\"bundled-mnemom\",\"trim_mcp\":false,\"v\":1},\"max_turns\":40,\"pins\":{\"card_content_hash\":\"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"policy_engine_major\":3},\"requirements_hash\":\"566af8b913e8827626360e11b53b0356f9784508e3e51e36c9d6d4ce5b64bb31\",\"statement_hash\":\"51d9393d4b1b22b84e4fe45acb3e4f3c561e75d03701771aa40c805a5146f939\",\"tool_classes\":{\"Bash\":\"input_dependent\"}},\"created_at\":\"2026-10-16T12:00:00.123000Z\",\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"session_id\":\"11111111-2222-4333-8444-555555555555\",\"v\":1,\"version\":1}";
|
|
117
|
+
readonly hash: "1db9e38158199cec38e592881b9568aa79005c230c28f4fee3cc139ddf676eaf";
|
|
118
|
+
}, {
|
|
119
|
+
readonly version: 2;
|
|
120
|
+
readonly prev_hash: "1db9e38158199cec38e592881b9568aa79005c230c28f4fee3cc139ddf676eaf";
|
|
121
|
+
readonly charter: {
|
|
122
|
+
readonly statement_hash: "51d9393d4b1b22b84e4fe45acb3e4f3c561e75d03701771aa40c805a5146f939";
|
|
123
|
+
readonly requirements_hash: "566af8b913e8827626360e11b53b0356f9784508e3e51e36c9d6d4ce5b64bb31";
|
|
124
|
+
readonly budget_usd: 4;
|
|
125
|
+
readonly max_turns: 40;
|
|
126
|
+
readonly pins: {
|
|
127
|
+
readonly card_content_hash: "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";
|
|
128
|
+
readonly policy_engine_major: 3;
|
|
129
|
+
};
|
|
130
|
+
readonly tool_classes: {
|
|
131
|
+
readonly Bash: "input_dependent";
|
|
132
|
+
};
|
|
133
|
+
readonly launch_spec: {
|
|
134
|
+
readonly v: 1;
|
|
135
|
+
readonly cwd: "/Users/dev/repo";
|
|
136
|
+
readonly plugin: "bundled-mnemom";
|
|
137
|
+
readonly trim_mcp: false;
|
|
138
|
+
readonly model: "opus";
|
|
139
|
+
readonly effort: "high";
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
readonly created_at: "2026-10-16T12:05:00Z";
|
|
143
|
+
readonly preimage: "{\"charter\":{\"budget_usd\":4,\"launch_spec\":{\"cwd\":\"/Users/dev/repo\",\"effort\":\"high\",\"model\":\"opus\",\"plugin\":\"bundled-mnemom\",\"trim_mcp\":false,\"v\":1},\"max_turns\":40,\"pins\":{\"card_content_hash\":\"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"policy_engine_major\":3},\"requirements_hash\":\"566af8b913e8827626360e11b53b0356f9784508e3e51e36c9d6d4ce5b64bb31\",\"statement_hash\":\"51d9393d4b1b22b84e4fe45acb3e4f3c561e75d03701771aa40c805a5146f939\",\"tool_classes\":{\"Bash\":\"input_dependent\"}},\"created_at\":\"2026-10-16T12:05:00.000000Z\",\"prev_hash\":\"1db9e38158199cec38e592881b9568aa79005c230c28f4fee3cc139ddf676eaf\",\"session_id\":\"11111111-2222-4333-8444-555555555555\",\"v\":1,\"version\":2}";
|
|
144
|
+
readonly hash: "70306a09f19c8df756547dae953756c3151536d30e0d7d46cbc8c4db0252b4c1";
|
|
145
|
+
}];
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Amendment 55 seal round trip (C07-R02, R13, R14). `seal` is the contract C07-HDR-01 sealed through a
|
|
149
|
+
* live gateway, which answered x-mnemom-contract-hash `gateway_enforce_h16` (mode enforce) and, for the
|
|
150
|
+
* same contract rehydrated as nudge, `gateway_nudge_h16`. The full hashes, the commitments and the v1
|
|
151
|
+
* charter row are from an independent Python canonical-JSON + hashlib generator (scratchpad
|
|
152
|
+
* s1gen/seal_gen.py). `sealed_at` is the seal instant in an offset form; charter_v1.created_at is it in UTC.
|
|
153
|
+
*/
|
|
154
|
+
export declare const SEAL_VECTORS: {
|
|
155
|
+
readonly seal: {
|
|
156
|
+
readonly statement: "Ship the release. canary zq-k1-102d461d964a345ca757";
|
|
157
|
+
readonly requirements: readonly ["Tests stay green. canary zq-k2-54e87989d0dd1c2f7a00"];
|
|
158
|
+
readonly budget_usd: 5;
|
|
159
|
+
readonly max_turns: 40;
|
|
160
|
+
readonly time_limit_s: 3600;
|
|
161
|
+
readonly mode: "enforce";
|
|
162
|
+
readonly allowed_paths: readonly ["src/**"];
|
|
163
|
+
readonly forbidden_paths: readonly ["secrets/**"];
|
|
164
|
+
};
|
|
165
|
+
readonly enforce_hash: "85fc982c26cf4a28ac1e7e3ba0f746a83bd96bc3ce7a3ed84401f79aa684d13a";
|
|
166
|
+
readonly gateway_enforce_h16: "85fc982c26cf4a28";
|
|
167
|
+
readonly nudge_hash: "d0344555137faf1ce06f81bb905ec9dfb15dd385de57b6a959e381bf1f3fe654";
|
|
168
|
+
readonly gateway_nudge_h16: "d0344555137faf1c";
|
|
169
|
+
readonly sealed_at: "2026-10-29T12:45:33.355-07:00";
|
|
170
|
+
readonly charter_v1: {
|
|
171
|
+
readonly commitments: {
|
|
172
|
+
readonly statement_hash: "04ed1e6039e500e2a1d09fd4238a77863cdfc699e504cea01a4c63263ffdf538";
|
|
173
|
+
readonly requirements_hash: "d594733b87aa9594eb4d084a49e8450aa8ac9e32ffb9c985d7a2f24fa6513fcd";
|
|
174
|
+
readonly contract_hash: "85fc982c26cf4a28ac1e7e3ba0f746a83bd96bc3ce7a3ed84401f79aa684d13a";
|
|
175
|
+
readonly mode: "enforce";
|
|
176
|
+
readonly budget_usd: 5;
|
|
177
|
+
readonly max_turns: 40;
|
|
178
|
+
readonly active_time_limit_s: 3600;
|
|
179
|
+
readonly pins: {
|
|
180
|
+
readonly card_content_hash: "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";
|
|
181
|
+
readonly policy_engine_major: 3;
|
|
182
|
+
};
|
|
183
|
+
readonly tool_classes: {
|
|
184
|
+
readonly Bash: "input_dependent";
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly created_at: "2026-10-29T19:45:33.355000Z";
|
|
188
|
+
readonly preimage: "{\"charter\":{\"active_time_limit_s\":3600,\"budget_usd\":5,\"contract_hash\":\"85fc982c26cf4a28ac1e7e3ba0f746a83bd96bc3ce7a3ed84401f79aa684d13a\",\"max_turns\":40,\"mode\":\"enforce\",\"pins\":{\"card_content_hash\":\"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"policy_engine_major\":3},\"requirements_hash\":\"d594733b87aa9594eb4d084a49e8450aa8ac9e32ffb9c985d7a2f24fa6513fcd\",\"statement_hash\":\"04ed1e6039e500e2a1d09fd4238a77863cdfc699e504cea01a4c63263ffdf538\",\"tool_classes\":{\"Bash\":\"input_dependent\"}},\"created_at\":\"2026-10-29T19:45:33.355000Z\",\"prev_hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"session_id\":\"11111111-2222-4333-8444-555555555555\",\"v\":1,\"version\":1}";
|
|
189
|
+
readonly hash: "5a3bb041c155d67e50d18ee9afb0e6903f7a64988c881ab6373d3447fd5906f5";
|
|
190
|
+
};
|
|
191
|
+
};
|