@dtmd/temper 0.0.20 → 0.0.22

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.
@@ -65,6 +65,19 @@ export interface Harness {
65
65
  * {@link harness}.
66
66
  */
67
67
  readonly contract: readonly Clause[];
68
+ /**
69
+ * Whether the author declared {@link contract} at all — `true` even for an authored
70
+ * empty array, `false` only where the field was absent and {@link rootDefaultContract}
71
+ * filled it.
72
+ *
73
+ * The distinction {@link contract} itself cannot hold: an empty array is a declared
74
+ * contract with no clauses, and the default applies only where nothing is declared
75
+ * (decision 0072, `specs/builtins.md`, "Default contracts"). Row presence alone cannot
76
+ * say it — an authored `[]` writes no clause row, exactly like silence — so
77
+ * `assemblyFactRows` lowers this flag to a kind-less `contract` assembly fact and
78
+ * `compose::root_contract` reads it instead of guessing from the rows.
79
+ */
80
+ readonly contractDeclared: boolean;
68
81
  /**
69
82
  * The root member's declared enforcement mode — harness-wide, overridable
70
83
  * per member. Defaults to `warn`: temper fabricates no enforcement the
@@ -95,18 +108,20 @@ export declare function harness(init: {
95
108
  * Homed beside the root member's other fields, the precedent `dialDefaultContract` sets
96
109
  * in `dial.ts`: a default contract lives with the surface it governs.
97
110
  *
98
- * Three clauses, all predicates only the root can bind: their selection is the whole
111
+ * Four clauses, all predicates only the root can bind: their selection is the whole
99
112
  * forest and their judges read the reference graph, the committed lock and the discovery
100
113
  * walk, none of which any one kind's population carries. `reachable` is the one check
101
114
  * that catches authored configuration the harness never loads at all; `fresh` is the one
102
115
  * that catches a projection or a fingerprinted source dependency that has moved out from
103
116
  * under its lock row; `locus-declared` is the one that catches a document sitting at a
104
- * governed locus that the program never declared.
117
+ * governed locus that the program never declared; `engine-matches` is the one that
118
+ * catches a lock compiled by an engine other than the one now reading it.
105
119
  *
106
120
  * All advisory — today's posture for each, so no adopter turns red on the upgrade. A
107
121
  * dead registration is often deliberate work-in-progress, a drifted projection is usually
108
- * a re-emit away, and an undeclared document is often a surface mid-adoption; whether any
109
- * of them gates is the adopting author's call, dialed or re-declared rather than
110
- * tool-decided.
122
+ * a re-emit away, an undeclared document is often a surface mid-adoption, and a stale
123
+ * engine stamp is the ordinary state of every checkout between an upgrade and the next
124
+ * `emit`; whether any of them gates is the adopting author's call, dialed or re-declared
125
+ * rather than tool-decided.
111
126
  */
112
127
  export declare const rootDefaultContract: readonly Clause[];
@@ -6,7 +6,7 @@
6
6
  * `temper.toml`, no roster/bindings dialect (the Decision rejects both);
7
7
  * composing partial harnesses is ordinary code.
8
8
  */
9
- import { clause, fresh, locusDeclared, reachable } from "./contract.js";
9
+ import { clause, engineMatches, fresh, locusDeclared, reachable } from "./contract.js";
10
10
  /**
11
11
  * Compose the harness from its six fields — ordinary code, Turing-completeness
12
12
  * quarantined at authoring time. Absent
@@ -26,6 +26,10 @@ export function harness(init) {
26
26
  // `contract` replaces the default wholesale, never merges with it — the same
27
27
  // rows-or-default rule a kind's `expect` binding takes over its floor.
28
28
  contract: init.contract ?? rootDefaultContract,
29
+ // …and the last place the distinction the line above erases is still visible: an
30
+ // authored `[]` is a declared contract with no clauses, so declaredness is recorded
31
+ // rather than re-derived from a row count downstream (decision 0072).
32
+ contractDeclared: init.contract !== undefined,
29
33
  };
30
34
  }
31
35
  /**
@@ -36,19 +40,21 @@ export function harness(init) {
36
40
  * Homed beside the root member's other fields, the precedent `dialDefaultContract` sets
37
41
  * in `dial.ts`: a default contract lives with the surface it governs.
38
42
  *
39
- * Three clauses, all predicates only the root can bind: their selection is the whole
43
+ * Four clauses, all predicates only the root can bind: their selection is the whole
40
44
  * forest and their judges read the reference graph, the committed lock and the discovery
41
45
  * walk, none of which any one kind's population carries. `reachable` is the one check
42
46
  * that catches authored configuration the harness never loads at all; `fresh` is the one
43
47
  * that catches a projection or a fingerprinted source dependency that has moved out from
44
48
  * under its lock row; `locus-declared` is the one that catches a document sitting at a
45
- * governed locus that the program never declared.
49
+ * governed locus that the program never declared; `engine-matches` is the one that
50
+ * catches a lock compiled by an engine other than the one now reading it.
46
51
  *
47
52
  * All advisory — today's posture for each, so no adopter turns red on the upgrade. A
48
53
  * dead registration is often deliberate work-in-progress, a drifted projection is usually
49
- * a re-emit away, and an undeclared document is often a surface mid-adoption; whether any
50
- * of them gates is the adopting author's call, dialed or re-declared rather than
51
- * tool-decided.
54
+ * a re-emit away, an undeclared document is often a surface mid-adoption, and a stale
55
+ * engine stamp is the ordinary state of every checkout between an upgrade and the next
56
+ * `emit`; whether any of them gates is the adopting author's call, dialed or re-declared
57
+ * rather than tool-decided.
52
58
  */
53
59
  export const rootDefaultContract = [
54
60
  clause(reachable(), {
@@ -62,6 +68,10 @@ export const rootDefaultContract = [
62
68
  }),
63
69
  clause(locusDeclared(), {
64
70
  severity: "advisory",
65
- guidance: "A document sits at a governed locus that your program declares no member for. Claude Code loads it, but temper maintains nothing about it: `emit` never writes or reaps it, `guard` never bound it, and every address under it resolves to nothing — so it reads as governed configuration while being governed by no one. Declare the member in the program and re-emit; for a directory whose documents are authored in place rather than projected, declare its kind `local` so `check` derives the rows at read time instead. Advisory because a tree mid-adoption legitimately carries documents the program has not reached yet; dial this label to `required` — or re-declare the clause — once every document at a governed locus should be one you declared.",
71
+ guidance: "A document sits at a governed locus that your program declares no member for. temper maintains nothing about it: `emit` never writes or reaps it, `guard` never bound it, and every address under it resolves to nothing — so it reads as governed configuration while being governed by no one. Where the locus is one the harness itself loads — a built-in kind's — it is live context on top of that; where the kind is your own, who reads it is yours to know and not temper's to claim. Declare the member in the program and re-emit; for a directory whose documents are authored in place rather than projected, declare its kind `local` so `check` derives the rows at read time instead. Advisory because a tree mid-adoption legitimately carries documents the program has not reached yet; dial this label to `required` — or re-declare the clause — once every document at a governed locus should be one you declared.",
72
+ }),
73
+ clause(engineMatches(), {
74
+ severity: "advisory",
75
+ guidance: "Your committed lock records a different temper version than the one running this gate. The rows being read were compiled by a compiler this binary is not, so every verdict below rests on a translation: an older spelling normalizes at read time, but a genuine change in what a row means reads the same from the inside. Re-run `emit` — it rewrites the lock whole in this engine's canonical form, and the stamp goes back to matching. Advisory because a lagging stamp is the ordinary state of every checkout between an upgrade and the next emit, and blocking there would make an upgrade a hard stop; dial this label to `required` — or re-declare the clause — once your CI should refuse a lock it did not compile.",
66
76
  }),
67
77
  ];
@@ -102,13 +102,17 @@ export interface Skill {
102
102
  /**
103
103
  * The optional path scope — a channel gate, not a channel of its own. A
104
104
  * present list removes the skill from *every* invocation channel — the `/`
105
- * listing, model invocation, and description-trigger invocation — until
106
- * Claude reads a file the globs match; an absent one leaves all channels
107
- * live. Distinct from a rule's `paths`, which registers the path-match as
108
- * the rule's channel: here the field gates the skill's existing channels
109
- * rather than being one, so it adds no `paths-match` registration entry
105
+ * listing, model invocation, and description-trigger invocation — until a
106
+ * file tool (read, edit, write) touches a matching path; an absent one
107
+ * leaves all channels live. A shell read of the same path, or a search
108
+ * tool's, opens no path gate, so a session that works inside the gate
109
+ * through the shell alone never loads the skill. Distinct from a rule's
110
+ * `paths`, which registers the path-match as the rule's channel: here the
111
+ * field gates the skill's existing channels rather than being one, so it
112
+ * adds no `paths-match` registration entry
110
113
  * (code.claude.com/docs/en/skills, retrieved 2026-07-15; verified against
111
- * 2.1.210).
114
+ * 2.1.210; shell and search reads open no path gate, probed on Claude Code
115
+ * 2.1.281, 2026-09-24).
112
116
  */
113
117
  readonly paths?: readonly string[];
114
118
  readonly prose?: Prose;
@@ -282,23 +286,109 @@ export interface Memory {
282
286
  * module-carried memory projects the root file.
283
287
  */
284
288
  export declare const memory: KindDefinition<Memory>;
289
+ /**
290
+ * One entry in a hook's `hooks` array — the handler that actually fires when the group's
291
+ * event and matcher admit it. Its fields are the documented handler table's own: the
292
+ * common row every handler kind carries, then each kind's, each cited where it is
293
+ * claimed. The group's `matcher` is deliberately absent — that is the matcher group's
294
+ * own key, lifted beside the handlers rather than carried by one
295
+ * (code.claude.com/docs/en/hooks, "Matcher patterns", retrieved 2026-09-29).
296
+ *
297
+ * `once` is deliberately untyped for the reason {@link Hook} states: the docs honor it
298
+ * only on a hook declared in skill frontmatter and ignore it in settings files
299
+ * (code.claude.com/docs/en/hooks, "Common fields", retrieved 2026-09-25).
300
+ */
301
+ export interface Handler {
302
+ /**
303
+ * The handler kind — how the hook fires when its event matches. Required and
304
+ * default-less: a handler naming no `type` is a registration Claude Code has no way to
305
+ * run (code.claude.com/docs/en/hooks, "Common fields", retrieved 2026-09-25).
306
+ */
307
+ readonly type: "command" | "http" | "mcp_tool" | "prompt" | "agent";
308
+ /**
309
+ * One permission rule scoping the fire (`"Bash(git *)"`, `"Edit(*.ts)"`). Holds exactly
310
+ * one rule — there is no `&&`/`||`/list syntax — and is evaluated only on the tool
311
+ * events; on any other event a hook carrying it never runs
312
+ * (code.claude.com/docs/en/hooks, "Common fields", retrieved 2026-09-25).
313
+ */
314
+ readonly if?: string;
315
+ /** Seconds before the handler is canceled; the default varies by handler kind and event (code.claude.com/docs/en/hooks, "Common fields", retrieved 2026-09-25). */
316
+ readonly timeout?: number;
317
+ /** The spinner message shown while the handler runs (code.claude.com/docs/en/hooks, "Common fields", retrieved 2026-09-25). */
318
+ readonly statusMessage?: string;
319
+ /** The shell command a `command` handler runs, or — beside `args` — the executable it spawns (code.claude.com/docs/en/hooks, "Command hook fields", retrieved 2026-09-25). */
320
+ readonly command?: string;
321
+ /** A `command` handler's argument vector; its presence spawns `command` directly, with no shell (same source). */
322
+ readonly args?: readonly string[];
323
+ /** A `command` handler runs in the background without blocking (same source). */
324
+ readonly async?: boolean;
325
+ /** A `command` handler runs in the background and wakes Claude on exit code 2 (same source). */
326
+ readonly asyncRewake?: boolean;
327
+ /** The shell a `command` handler runs under; ignored when `args` is set (same source). */
328
+ readonly shell?: "bash" | "powershell";
329
+ /** The endpoint an `http` handler POSTs the event's JSON input to (code.claude.com/docs/en/hooks, "HTTP hook fields", retrieved 2026-09-25). */
330
+ readonly url?: string;
331
+ /** Extra headers on an `http` handler's request; values interpolate `$VAR` names drawn from `allowedEnvVars` (same source). */
332
+ readonly headers?: Readonly<Record<string, string>>;
333
+ /** The environment variable names an `http` handler's headers may interpolate; unlisted references resolve empty (same source). */
334
+ readonly allowedEnvVars?: readonly string[];
335
+ /** The already-connected MCP server an `mcp_tool` handler calls — the scoped `plugin:<plugin>:<server>` name for a plugin-bundled one (code.claude.com/docs/en/hooks, "MCP tool hook fields", retrieved 2026-09-25). */
336
+ readonly server?: string;
337
+ /** The tool an `mcp_tool` handler calls on that server (same source). */
338
+ readonly tool?: string;
339
+ /** The arguments an `mcp_tool` handler passes; string values substitute `${path}` from the hook's JSON input (same source). */
340
+ readonly input?: Readonly<Record<string, unknown>>;
341
+ /** The prompt text a `prompt` or `agent` handler sends to the model; `$ARGUMENTS` stands for the hook input JSON (code.claude.com/docs/en/hooks, "Prompt and agent hook fields", retrieved 2026-09-25). */
342
+ readonly prompt?: string;
343
+ /** The model a `prompt` or `agent` handler evaluates under; absent means a fast default (same source). */
344
+ readonly model?: string;
345
+ }
346
+ /**
347
+ * `handler` — one entry in a hook's `hooks` array, at the **embedded** locus: it owns no
348
+ * file and no glob, living inside its host matcher group and keyed by its position there
349
+ * (`…/handler/0`). Fields-only (no body slot) and channel-less: a handler reaches the
350
+ * world only through the hook whose event fires it. Matching handlers run in parallel, so
351
+ * the position is an address and carries no runtime meaning.
352
+ *
353
+ * The kind's own format fact — that a matcher group carries its handlers in a `hooks`
354
+ * array, keyed by position — is cited here, the point of claim.
355
+ */
356
+ export declare const handler: KindDefinition<Handler>;
285
357
  /**
286
358
  * A Claude Code hook — a fields-only registration member surfacing inside
287
- * `settings.json`, keyed under its lifecycle event. It owns no artifact of its own; a
288
- * handler names how it fires (`command`/`http`/`mcp_tool`/`prompt`/`agent`) plus the
289
- * documented common fields (code.claude.com/docs/en/hooks, retrieved 2026-07-15).
290
- * Authoring `hook(...)` builds a member whose typed fields fold into its manifest entry;
291
- * emit erases it into a registration write fact (`emit.ts`).
359
+ * `settings.json`, keyed under its lifecycle event. It owns no artifact of its own: one
360
+ * `hook(...)` call mints one **matcher group**, carrying the group's own `matcher` beside
361
+ * the ordered {@link Handler}s it fires, however many that is. The typed fields fold into
362
+ * its manifest entry; emit erases it into a registration write fact (`emit.ts`).
363
+ *
364
+ * The two levels are two surfaces, with nothing duplicated across them: the group's own
365
+ * field is `matcher`, and every handler field — the documented common row plus each
366
+ * handler kind's, each cited where it is claimed — belongs to {@link Handler} alone. The
367
+ * read gives each entry of `hooks` back as a `handler` member at
368
+ * `<hook-address>/handler/<position>`, which is where {@link handlerDefaultContract}
369
+ * judges it; {@link hookDefaultContract} judges the group's own field alone.
370
+ *
371
+ * `once` is deliberately untyped: the docs honor it only on a hook declared in skill
372
+ * frontmatter and ignore it in settings files, and this kind's locus *is* a settings file
373
+ * — typing it would invite dead configuration (code.claude.com/docs/en/hooks, "Common
374
+ * fields", retrieved 2026-09-25).
292
375
  */
293
376
  export interface Hook {
294
- /** The handler kind — how the hook fires when its event matches. */
295
- readonly type?: "command" | "http" | "mcp_tool" | "prompt" | "agent";
296
- /** The shell command or executable a `command` handler runs. */
297
- readonly command?: string;
298
- /** Seconds before the handler is canceled. */
299
- readonly timeout?: number;
300
- /** The tool-name filter a tool-scoped event fires on (`"*"`/`""`/absent = all). */
377
+ /**
378
+ * The tool-name filter a tool-scoped event fires on (`"*"`/`""`/absent = all) — the
379
+ * matcher group's own key, scoping every handler under it, since Claude Code carries the
380
+ * matcher at the group level (code.claude.com/docs/en/hooks, "Matcher patterns",
381
+ * retrieved 2026-09-25).
382
+ */
301
383
  readonly matcher?: string;
384
+ /**
385
+ * The handlers this group fires, in wire order — the group's `hooks` array, each entry
386
+ * addressed by its position (`…/handler/0`). Required: the handlers are what the group
387
+ * does, and a group carrying no handler array is a shape Claude Code itself ignores.
388
+ * Matching handlers run in parallel, so the order is an address and carries no runtime
389
+ * meaning (code.claude.com/docs/en/hooks, "Matcher patterns", retrieved 2026-09-29).
390
+ */
391
+ readonly hooks: readonly Handler[];
302
392
  }
303
393
  /**
304
394
  * The manifest Claude Code's harness-level settings reside in — the file the assembly's
@@ -307,18 +397,46 @@ export interface Hook {
307
397
  */
308
398
  export declare const SETTINGS_MANIFEST = "settings.json";
309
399
  /**
310
- * `hook` — a `settings.json` `hooks.<Event>` registration member: a fields-only kind (no
311
- * body slot), its members discovered off the `.claude/settings.json` manifest at the
312
- * `hooks.<Event>` collection address, keyed by lifecycle event; registers on the `event`
313
- * channel (code.claude.com/docs/en/hooks, retrieved 2026-07-15). The first manifest kind
314
- * temper ships — the read side of 0021's manifest-authoring surface.
400
+ * The key a matcher group carries its handler array under — {@link Hook}'s `hooks` field,
401
+ * the `member_key` of the kind's group-array entry shape, and the field name the join in
402
+ * `declarations.ts` reads to merge a synthesized tap hook into an authored group. One
403
+ * home, so the authored surface, the declared entry shape and the join cannot drift
404
+ * (code.claude.com/docs/en/hooks, "Matcher patterns", retrieved 2026-09-29).
405
+ */
406
+ export declare const HOOK_HANDLER_KEY = "hooks";
407
+ /** The one group-level field a matcher group lifts beside its handlers — {@link Hook}'s
408
+ * `matcher`, and the other half of the group's identity the join keys on (same source). */
409
+ export declare const HOOK_MATCHER_KEY = "matcher";
410
+ /**
411
+ * A hook member's **name** — its lifecycle `event`, then `:` and the matcher's authored
412
+ * bytes; the bare event where the group binds no matcher
413
+ * (`hook:PostToolUse:Edit|Write`, `hook:SessionStart`).
414
+ *
415
+ * Name and collection key part company because the **group** is the member and the event
416
+ * keys them all: Claude Code nests several matcher groups under one event, and two
417
+ * members at one address is a malformed lock. The matcher is joined verbatim, never
418
+ * normalized — `Edit|Write` and `Edit, Write` are two groups on the wire and two members
419
+ * here — which is also why an authored empty matcher joins as the empty bytes it is.
420
+ */
421
+ export declare function hookMemberName(event: string, matcher: string | undefined): string;
422
+ /**
423
+ * The `hooks.<Event>` collection key a hook member's name was joined onto — its text
424
+ * before its own first `:`. The inverse of {@link hookMemberName} for the one reader that
425
+ * needs the key back: a registration row keys where the group writes, and the group still
426
+ * writes under `hooks.<Event>` (`declarations.ts`). No documented lifecycle event carries
427
+ * a colon, so the first one is the join's.
315
428
  */
429
+ export declare function hookCollectionKey(name: string): string;
430
+ /** The authored `hook` constructor — {@link hookGroup}'s facts over {@link hookMember}'s
431
+ * name composition. */
316
432
  export declare const hook: KindDefinition<Hook>;
317
433
  /**
318
- * The tap hook registration's `hooks.<Event>` key-path and `Hook` field triple — the
434
+ * The tap hook registration's `hooks.<Event>` key-path and {@link Hook} fields — the
319
435
  * provider fact {@link tapHookRows} (`declarations.ts`) fills rather than authors inline.
320
- * A tap hook always fires a `command` handler (`type` fixed), so only the tap's own
321
- * `command` string and the per-event `matcher` {@link TELEMETRY_EVENT_HOOKS} names vary.
436
+ * One matcher group like any authored one: the per-event `matcher`
437
+ * {@link TELEMETRY_EVENT_HOOKS} names lifted beside a single `command` handler carrying
438
+ * the tap's own command, so a synthesized row and an authored one are the same shape and
439
+ * the join in `declarations.ts` can merge one into the other.
322
440
  */
323
441
  export declare function tapHookRegistration(command: string, matcher: string): {
324
442
  readonly keyPath: string;
@@ -711,12 +829,9 @@ export declare const marketplace: KindDefinition<Marketplace>;
711
829
  * catalog published under a name that later becomes reserved stops loading for every user
712
830
  * who already added it. That is the one clause here worth more than a lint.
713
831
  *
714
- * The `source` union's per-form required fields are now gated via `when` clauses: decision
715
- * 0041's Rust implementation shipped in src/contract.rs (Predicate::When, src/engine.rs:1207
716
- * decide logic), and the SDK's `when()` export has been available since 884a704 — both well
717
- * before these comments were last touched. The per-source-form requirements now hold via guarded
718
- * clauses at `plugins[*].source`: the string form needs `leading-dot-slash` shape; each object
719
- * form (`github`, `url`, `git-subdir`, `npm`) needs its required fields.
832
+ * The `source` union's per-form required fields gate as `when` clauses at
833
+ * `plugins[*].source`: the string form needs `leading-dot-slash` shape, and each object
834
+ * form (`github`, `url`, `git-subdir`, `npm`) needs its own required fields.
720
835
  *
721
836
  * Deliberately absent as undecidable, and never a clause (`specs/intent.md`, invariant 2):
722
837
  * the docs *also* block names that "impersonate official marketplaces" (`official-claude-plugins`,
@@ -899,6 +1014,59 @@ export declare const settings: KindDefinition<Settings>;
899
1014
  * judgment, never a gate clause.
900
1015
  */
901
1016
  export declare const settingsDefaultContract: readonly Clause[];
1017
+ /**
1018
+ * Claude Code's committed MCP manifest — `.mcp.json`, the file a team checks in so
1019
+ * everyone who clones the repository reaches the same MCP servers
1020
+ * (code.claude.com/docs/en/mcp, retrieved 2026-09-29).
1021
+ *
1022
+ * The surface types **no** top-level key, and the emptiness is the format's rather than an
1023
+ * omission: the docs document exactly one — `mcpServers` — and that key is the
1024
+ * {@link mcpServer} kind's collection address, so a server registers there and this
1025
+ * container never types it. Declaring it here would author the same segment twice, the
1026
+ * ownership {@link Settings} gives `hooks`. Every other key a `.mcp.json` carries is
1027
+ * unschematized residue, opaque and *named* through {@link Mcp.residue} — the
1028
+ * partial-governance posture the settings pair already holds, with the typed half empty.
1029
+ */
1030
+ export interface Mcp {
1031
+ /**
1032
+ * The opaque residue — every top-level key of the committed manifest that is not
1033
+ * `mcpServers`, projected flat and key-sorted. `mcpServers` is not merely absent from the
1034
+ * typed half above: it is a collection address, so it belongs in neither half, and a
1035
+ * `.mcp.json` key of that name does not belong here either
1036
+ * (code.claude.com/docs/en/mcp, retrieved 2026-09-29).
1037
+ */
1038
+ readonly residue?: Residue<Mcp>;
1039
+ }
1040
+ /**
1041
+ * `mcp` — `.mcp.json`, a whole-file JSON document at the **committed** commitment class:
1042
+ * the program authors every key, `emit` renders the file whole, and the member's byte
1043
+ * fingerprint makes a hand edit to any part of it drift under the root `fresh` clause
1044
+ * (decision 0050). Identity is the fixed singleton stem `.mcp` (the `file` unit shape — a
1045
+ * project's committed MCP manifest is the one file at the repository root, so no declared
1046
+ * key names it). Channel-less: configuration the harness reads, never surfaced to the
1047
+ * model — the connections it carries reach the world as {@link mcpServer} members.
1048
+ *
1049
+ * It is the **container** of one registration collection address, `mcpServers`, which keeps
1050
+ * its own kind ({@link mcpServer}). That segment and this member's opaque residue are one
1051
+ * file: emit renders the declared segment first, then the residue — which the member itself
1052
+ * authors through {@link Mcp.residue}, flat and key-sorted
1053
+ * (code.claude.com/docs/en/mcp, retrieved 2026-09-29).
1054
+ */
1055
+ export declare const mcp: KindDefinition<Mcp>;
1056
+ /**
1057
+ * The default contract for `mcp` — **deliberately empty**, and empty *by construction*
1058
+ * rather than by omission. `.mcp.json` documents exactly one top-level key, `mcpServers`
1059
+ * (code.claude.com/docs/en/mcp, retrieved 2026-09-29), and that key is
1060
+ * {@link mcpServer}'s collection address: its shape is that kind's contract to hold,
1061
+ * server by server, so gating it here would contract the same segment twice. Nothing else
1062
+ * is left to range over — a format that documents almost no contract earns an almost-empty
1063
+ * default contract, the honest encoding rather than a gap.
1064
+ *
1065
+ * No `closedKeys()` either: the remainder rides {@link Mcp.residue} opaque and named, so a
1066
+ * key upstream adds is unmodeled rather than indicted, and a valid committed manifest is
1067
+ * never stranded by temper's release cadence.
1068
+ */
1069
+ export declare const mcpDefaultContract: readonly Clause[];
902
1070
  /**
903
1071
  * The default contract for `skill` — Anthropic's documented skill contract: the Agent
904
1072
  * Skills open standard (agentskills.io), Anthropic's platform upload
@@ -967,9 +1135,11 @@ export declare const agentDefaultContract: readonly Clause[];
967
1135
  * v2.0.64). All sources retrieved 2026-07-15.
968
1136
  *
969
1137
  * `paths` is the one documented frontmatter key for rules: glob patterns
970
- * (brace expansion supported) that scope the rule to matching files. Rules
1138
+ * (brace expansion supported) that scope the rule to matching paths. Rules
971
1139
  * without it load at launch with the same priority as CLAUDE.md; path-scoped
972
- * rules load when Claude reads a matching file. Note skills now take a
1140
+ * rules load when a file tool (read, edit, write) touches a matching path — a
1141
+ * shell or search read of that path opens nothing (probed on Claude Code
1142
+ * 2.1.281, 2026-09-24; decision 0061). Note skills now take a
973
1143
  * `paths` key too — the two schemas are separate. (Guidance only: an
974
1144
  * optional field asserts nothing decidable, so it carries no clause of its
975
1145
  * own: `required` is the one
@@ -989,22 +1159,43 @@ export declare const ruleDefaultContract: readonly Clause[];
989
1159
  * budget; everything else the contract could say is guidance.
990
1160
  */
991
1161
  export declare const memoryAnthropicDefaultContract: readonly Clause[];
1162
+ /**
1163
+ * The default contract for `handler` — the handler-level half of Anthropic's documented
1164
+ * hooks contract (code.claude.com/docs/en/hooks, retrieved 2026-09-25), and the only home
1165
+ * and the only binding those six clauses have.
1166
+ *
1167
+ * The clauses address by bare name because a handler is a member: the group-array read
1168
+ * gives each entry of a group's `hooks` array its own member at
1169
+ * `<hook-address>/handler/<position>`, carrying that entry's own keys
1170
+ * (`hook_group_members`, `src/json_manifest.rs`), so `type`, `command`, `url`, `server`,
1171
+ * `tool` and `prompt` are its fields — no path into the handler array is ever spelled, and
1172
+ * none needs to be. The documented per-kind requirements therefore gate as `when` clauses
1173
+ * in the shape {@link mcpServerDefaultContract} already holds: a guard over `type`, a body
1174
+ * carrying that kind's required fields. `prompt` and `agent` share one guard because the
1175
+ * docs give them one table and one required field.
1176
+ *
1177
+ * The enum settles which values are legal, never that a value is present, and an absent
1178
+ * `type` enters no guard — so presence is its own clause beside the enum. The docs'
1179
+ * common-fields table marks `type` required and gives it no default, so a handler naming
1180
+ * none is dead configuration rather than a defaulted one.
1181
+ */
1182
+ export declare const handlerDefaultContract: readonly Clause[];
992
1183
  /**
993
1184
  * The default contract for `hook` — Anthropic's documented hooks contract
994
- * (code.claude.com/docs/en/hooks, retrieved 2026-07-15). A hook surfaces at
995
- * `hooks.<Event>`, so the member the gate reads is the lifecycle event itself, its name
996
- * carried as the `event` field off the collection key. The one decidable, cited property
997
- * of that member is its event: a key outside the documented set is dead configuration —
998
- * Claude Code silently never fires a hook under an unrecognized event, so the strictest
999
- * documented profile is that the event is one temper's cited docs name.
1185
+ * (code.claude.com/docs/en/hooks, retrieved 2026-09-25).
1186
+ *
1187
+ * A hook surfaces at `hooks.<Event>`, so the lifecycle event is a member field, its name
1188
+ * carried off the collection key. That event is the first decidable, cited property: a key
1189
+ * outside the documented set is dead configuration — Claude Code silently never fires a
1190
+ * hook under an unrecognized event, so the strictest documented profile is that the event
1191
+ * is one temper's cited docs name.
1000
1192
  *
1001
- * **Re-examined against decision 0041's widened vocabulary and confirmed to still hold**:
1002
- * The handler's own schema (`type`/`command`/`url`/`timeout`, the matcher grammar) lives
1003
- * one array level deeper than `hooks.<Event>`, inside each event's matcher-group list. The
1004
- * collection address `hooks.<Event>` does not walk into arrays, and even with the guard
1005
- * vocabulary's when/enumOf/type extensions, addressing still cannot spell a path into the
1006
- * handler array (e.g., `hooks.<Event>[0].type`). A clause over it would range over a field
1007
- * the read never surfaces, so it is no clause at all — the addressing-reach gap remains.
1193
+ * The event clause is the whole of it. The handler-level clauses are
1194
+ * {@link handlerDefaultContract}'s and bind under `handler` alone: a hook member is its
1195
+ * whole matcher group, and each entry of the group's `hooks` array is a `handler` member
1196
+ * keyed by its position there — so `type`, `command` and `url` are fields of a member this
1197
+ * contract does not range over. The transitional double binding is retired with this: the
1198
+ * six clauses have one binding, under the kind whose members carry the fields they judge.
1008
1199
  */
1009
1200
  export declare const hookDefaultContract: readonly Clause[];
1010
1201
  /**
@@ -1038,10 +1229,8 @@ export declare const TELEMETRY_EVENT_HOOKS: Readonly<Record<string, {
1038
1229
  * profile is that a present `type` names one temper's cited docs carry. An absent `type`
1039
1230
  * passes — Claude Code reads it as `stdio`, the documented default.
1040
1231
  *
1041
- * The per-transport requirements are now gated via `when` clauses: a stdio server (type
1042
- * absent or `stdio`) needs a `command`, and a remote server (type `http`, `streamable-http`,
1043
- * `sse`, or `ws`) needs a `url`. Decision 0041's Rust implementation shipped in
1044
- * src/contract.rs and the SDK's `when()` export has been available since 884a704 — both
1045
- * well before these comments were last written.
1232
+ * The per-transport requirements gate as `when` clauses: a `stdio` server needs a
1233
+ * `command`, and a remote server (`http`, `streamable-http`, `sse`, or `ws`) needs a
1234
+ * `url`.
1046
1235
  */
1047
1236
  export declare const mcpServerDefaultContract: readonly Clause[];