intent-eval-core 0.7.0__py3-none-any.whl

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.
@@ -0,0 +1,218 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: eval-spec.schema.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+ from typing import Any, Literal
8
+
9
+ from pydantic import BaseModel, ConfigDict, Field, confloat, conint, constr
10
+
11
+ from . import _common_schema as schema
12
+
13
+
14
+ class Class(Enum):
15
+ output_equals = "output-equals"
16
+ output_contains = "output-contains"
17
+ output_matches = "output-matches"
18
+ schema_conforms = "schema-conforms"
19
+ judge_verdict = "judge-verdict"
20
+ matcher_satisfied = "matcher-satisfied"
21
+
22
+
23
+ class Assertions(BaseModel):
24
+ model_config = ConfigDict(
25
+ extra="forbid",
26
+ )
27
+ class_: Class = Field(..., alias="class")
28
+ target: Any
29
+ negate: bool | None = None
30
+
31
+
32
+ class Assertions1(BaseModel):
33
+ model_config = ConfigDict(
34
+ extra="forbid",
35
+ )
36
+ class_: str = Field(..., alias="class")
37
+ target: Any
38
+ negate: bool | None = None
39
+ extension: Literal[True]
40
+
41
+
42
+ class AggregationRule(Enum):
43
+ majority = "majority"
44
+ unanimous = "unanimous"
45
+ weighted = "weighted"
46
+
47
+
48
+ class WeightDimension(Enum):
49
+ """
50
+ Dimension the weighted rule distributes over (deferral-C, bd_000-projects-21re). Required when `weights` present; ignored otherwise.
51
+ """
52
+
53
+ matcher = "matcher"
54
+ mm_class = "mm-class"
55
+ judge = "judge"
56
+
57
+
58
+ class Weight(BaseModel):
59
+ model_config = ConfigDict(
60
+ extra="forbid",
61
+ )
62
+ key: str
63
+ weight: confloat(ge=0.0)
64
+
65
+
66
+ class Tiebreaker(Enum):
67
+ """
68
+ Deterministic resolution of an exact aggregate tie (deferral-C). NOT a threshold — it resolves a tie, it does not set a pass bar.
69
+ """
70
+
71
+ fail_closed = "fail-closed"
72
+ fail_open = "fail-open"
73
+ first_listed = "first-listed"
74
+
75
+
76
+ class Scoring(BaseModel):
77
+ """
78
+ Scoring configuration. aggregation_rule is the spec-bound field per Blueprint B § 2.1. weight_dimension/weights/tiebreaker are the deferral-C lockup (bd_000-projects-21re), additive + optional. § 7.6 architectural rule: ship/no-ship THRESHOLDS belong in consumer-side tests/TESTING.md, NOT here — only weights + exact-tie resolution are kernel-side.
79
+ """
80
+
81
+ aggregation_rule: AggregationRule
82
+ weight_dimension: WeightDimension | None = None
83
+ """
84
+ Dimension the weighted rule distributes over (deferral-C, bd_000-projects-21re). Required when `weights` present; ignored otherwise.
85
+ """
86
+ weights: list[Weight] | None = None
87
+ """
88
+ Per-unit weights for the weighted rule (deferral-C). Normalized by their sum at scoring time.
89
+ """
90
+ tiebreaker: Tiebreaker | None = None
91
+ """
92
+ Deterministic resolution of an exact aggregate tie (deferral-C). NOT a threshold — it resolves a tie, it does not set a pass bar.
93
+ """
94
+ extensions: dict[str, Any] | None = None
95
+ """
96
+ Tool-specific scoring metadata. MUST NOT drive ship/no-ship decisions (mirrors § 7.4 metadata rule).
97
+ """
98
+
99
+
100
+ class Kind(Enum):
101
+ """
102
+ Node type per Blueprint B § 1.3 line 92.
103
+ """
104
+
105
+ eval_run = "eval_run"
106
+ tool_invocation = "tool_invocation"
107
+
108
+
109
+ class Node(BaseModel):
110
+ model_config = ConfigDict(
111
+ extra="forbid",
112
+ )
113
+ id: str
114
+ """
115
+ Local-to-DAG node identifier (unique within composition).
116
+ """
117
+ kind: Kind
118
+ """
119
+ Node type per Blueprint B § 1.3 line 92.
120
+ """
121
+ ref: schema.Uuidv7
122
+
123
+
124
+ class Kind1(Enum):
125
+ """
126
+ Edge type — drives runtime failure-propagation per Blueprint B § 1.3 line 100.
127
+ """
128
+
129
+ feeds = "feeds"
130
+ gates = "gates"
131
+ enriches = "enriches"
132
+
133
+
134
+ class Edge(BaseModel):
135
+ model_config = ConfigDict(
136
+ extra="forbid",
137
+ )
138
+ from_: str = Field(..., alias="from")
139
+ to: str
140
+ kind: Kind1
141
+ """
142
+ Edge type — drives runtime failure-propagation per Blueprint B § 1.3 line 100.
143
+ """
144
+
145
+
146
+ class Composition(BaseModel):
147
+ """
148
+ DAG declaration per Blueprint B § 1.3. Validation contract: runtime topologically sorts; cycles rejected at submission with 400. Wire format (adjacency list with typed edges) is engineer's choice per bd_000-projects-3sjx; semantics ARE spec-bound (node types + edge kinds + failure propagation per § 1.3 line 100).
149
+ """
150
+
151
+ model_config = ConfigDict(
152
+ extra="forbid",
153
+ )
154
+ nodes: list[Node]
155
+ edges: list[Edge]
156
+
157
+
158
+ class RuntimeLimits(BaseModel):
159
+ """
160
+ Resource ceilings applied per EvalRun per Blueprint B § 2.1.
161
+ """
162
+
163
+ model_config = ConfigDict(
164
+ extra="forbid",
165
+ )
166
+ token_ceiling: conint(ge=0)
167
+ wall_clock_ceiling_ms: conint(ge=0)
168
+ memory_ceiling_mb: conint(ge=0)
169
+ concurrency_hint: conint(ge=0)
170
+
171
+
172
+ class EvalspecDeclarativeEvaluationSpecificationBlueprintB21(BaseModel):
173
+ """
174
+ Content-addressed via content_hash. State machine: draft → published → deprecated (deprecated reversible to published). Mutable in draft; immutable once published.
175
+ """
176
+
177
+ model_config = ConfigDict(
178
+ extra="forbid",
179
+ )
180
+ id: schema.Uuidv7
181
+ version: schema.Semver
182
+ name: schema.KebabSlug
183
+ description: constr(min_length=1)
184
+ matchers: list[schema.Uuidv7]
185
+ """
186
+ MatcherMap FKs.
187
+ """
188
+ assertions: list[Assertions | Assertions1]
189
+ """
190
+ Typed assertion expressions. Class union LOCKED additively per deferral-A (bd_000-projects-gzgj): a named-class discriminated union plus an open extension slot. Per-class `target` payload stays open (refined at the validator layer per engagement).
191
+ """
192
+ scoring: Scoring
193
+ """
194
+ Scoring configuration. aggregation_rule is the spec-bound field per Blueprint B § 2.1. weight_dimension/weights/tiebreaker are the deferral-C lockup (bd_000-projects-21re), additive + optional. § 7.6 architectural rule: ship/no-ship THRESHOLDS belong in consumer-side tests/TESTING.md, NOT here — only weights + exact-tie resolution are kernel-side.
195
+ """
196
+ composition: Composition
197
+ """
198
+ DAG declaration per Blueprint B § 1.3. Validation contract: runtime topologically sorts; cycles rejected at submission with 400. Wire format (adjacency list with typed edges) is engineer's choice per bd_000-projects-3sjx; semantics ARE spec-bound (node types + edge kinds + failure propagation per § 1.3 line 100).
199
+ """
200
+ expected_artifacts: list[schema.Sha256]
201
+ """
202
+ SkillSnapshot.combined_sha values this spec targets. Anchors on CONTENT (sha), not FK — rebuilt snapshots with the same combined_sha still satisfy.
203
+ """
204
+ runtime_limits: RuntimeLimits
205
+ """
206
+ Resource ceilings applied per EvalRun per Blueprint B § 2.1.
207
+ """
208
+ provider_constraints: list[str]
209
+ """
210
+ Allowlist of provider IDs.
211
+ """
212
+ created_at: schema.Rfc3339
213
+ created_by: schema.ActorIdentity
214
+ content_hash: schema.Sha256
215
+ tenant_id: schema.Uuidv7 | None = None
216
+ """
217
+ RESERVED multi-tenancy slot (deferral-G, bd_000-projects-k0fj). OPTIONAL + additive per § 7.2; tenant-isolation semantics deferred to a future DR. v1 single-tenant specs omit it.
218
+ """
@@ -0,0 +1,78 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: evidence-bundle.schema.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+
8
+ from pydantic import AnyUrl, BaseModel, ConfigDict, conint
9
+
10
+ from . import _common_schema as schema
11
+
12
+
13
+ class Digest(BaseModel):
14
+ model_config = ConfigDict(
15
+ extra="allow",
16
+ )
17
+ sha256: schema.Sha256
18
+
19
+
20
+ class SubjectSetItem(BaseModel):
21
+ model_config = ConfigDict(
22
+ extra="forbid",
23
+ )
24
+ name: schema.SubjectName
25
+ digest: Digest
26
+
27
+
28
+ class SigningMode(Enum):
29
+ """
30
+ Signing posture. sigstore_staging is DR-010 Q3 default for predicates without normative SPEC.md (everything except gate-result/v1 at v1).
31
+ """
32
+
33
+ sigstore_staging = "sigstore_staging"
34
+ rekor_production = "rekor_production"
35
+ unsigned_experimental = "unsigned_experimental"
36
+
37
+
38
+ class VerificationStatus(Enum):
39
+ verified = "verified"
40
+ unverified = "unverified"
41
+ failed = "failed"
42
+
43
+
44
+ class EvidencebundleAppendOnlyCollectionOfSignedPredicateRowsBlueprintB24(BaseModel):
45
+ """
46
+ State machine: building → signing → signed → archived_to_rekor. APPEND-ONLY. Corrections = new bundle with new UUIDv7 referencing prior content_hash.
47
+ """
48
+
49
+ model_config = ConfigDict(
50
+ extra="forbid",
51
+ )
52
+ id: schema.Uuidv7
53
+ eval_run_id: schema.Uuidv7
54
+ created_at: schema.Rfc3339
55
+ predicate_uri_set: list[AnyUrl]
56
+ """
57
+ Predicate URIs represented in this bundle's rows.
58
+ """
59
+ row_count: conint(ge=0)
60
+ subject_set: list[SubjectSetItem]
61
+ """
62
+ Deduplicated in-toto Subject entries across all rows.
63
+ """
64
+ storage_key: schema.StorageKey
65
+ signing_mode: SigningMode
66
+ """
67
+ Signing posture. sigstore_staging is DR-010 Q3 default for predicates without normative SPEC.md (everything except gate-result/v1 at v1).
68
+ """
69
+ rekor_log_indices: list[conint(ge=0)]
70
+ """
71
+ Populated when signing_mode='rekor_production'; empty otherwise.
72
+ """
73
+ verification_status: VerificationStatus
74
+ verification_last_checked_at: schema.Rfc3339
75
+ pre_registration_hash: schema.Sha256Prefixed | None = None
76
+ """
77
+ Pre-registration commitment hash (D2 binding, v0.2.0 additive). `sha256:<hex>` digest of the pre-registration commitment artifact when the run was pre-registered, or null when it was not. ADDITIVE + OPTIONAL — every v0.1.0 bundle stays valid (absent ≡ null). Cross-field invariants governing when this MUST be non-null land in iec-E12; this is the field surface only.
78
+ """
@@ -0,0 +1,53 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: failure-taxonomy.schema.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+
8
+ from pydantic import BaseModel, ConfigDict, constr
9
+
10
+ from . import _common_schema as schema
11
+
12
+
13
+ class Example(BaseModel):
14
+ model_config = ConfigDict(
15
+ extra="forbid",
16
+ )
17
+ ref: str
18
+ """
19
+ URL, gist, doc path, EvalRun id, etc.
20
+ """
21
+ description: str | None = None
22
+
23
+
24
+ class Status(Enum):
25
+ proposed = "proposed"
26
+ canonical = "canonical"
27
+ deprecated = "deprecated"
28
+
29
+
30
+ class FailuretaxonomyCanonicalRegistryOfFailureModeClassesBlueprintB213(BaseModel):
31
+ """
32
+ State machine: proposed → canonical → deprecated (forward-only). canonical → deprecated requires Class-1 ISEDC DR. JudgeDecision with verdict='FAIL' MUST classify against an entry here. Drift emits `taxonomy.drift.detected` OTel event. Source of truth for what MM-N classes exist — MatcherMap.mm_class kernel enum is DOWNSTREAM of this entity (proposed → canonical → MmClass enum bump).
33
+ """
34
+
35
+ model_config = ConfigDict(
36
+ extra="forbid",
37
+ )
38
+ id: schema.Uuidv7
39
+ mm_class: schema.MmClassId
40
+ """
41
+ Natural key. Accepts any MM-N value (broader than MmClass enum).
42
+ """
43
+ name: schema.KebabSlug
44
+ description: constr(min_length=1)
45
+ discriminating_question: constr(min_length=1)
46
+ """
47
+ The question a human asks to decide whether a given failure belongs in this class. Drives the classification UI.
48
+ """
49
+ examples: list[Example]
50
+ version: schema.Semver
51
+ status: Status
52
+ created_at: schema.Rfc3339
53
+ created_by: schema.ActorIdentity
@@ -0,0 +1,116 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: gate-result.schema.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+ from typing import Any
8
+
9
+ from pydantic import BaseModel, ConfigDict, constr
10
+
11
+ from . import _common_schema as schema
12
+
13
+
14
+ class GateDecision(Enum):
15
+ """
16
+ Decision verdict (Blueprint B § 7.4 line 800, closed 4-element enum). Distinct from JudgeVerdict (UPPERCASE) and RolloutGateDecision (ship/no_ship).
17
+ """
18
+
19
+ pass_ = "pass"
20
+ fail = "fail"
21
+ advisory = "advisory"
22
+ error = "error"
23
+
24
+
25
+ class AdvisorySeverity(Enum):
26
+ """
27
+ Severity hint when gate_decision='advisory'. Consumer policy decides whether to elevate to blocking.
28
+ """
29
+
30
+ info = "info"
31
+ warn = "warn"
32
+ error = "error"
33
+
34
+
35
+ class ReplayFidelityLevel(Enum):
36
+ """
37
+ Replay fidelity level per iel-E11.
38
+ """
39
+
40
+ RF_0 = "RF-0"
41
+ RF_1 = "RF-1"
42
+ RF_2 = "RF-2"
43
+ RF_3 = "RF-3"
44
+ RF_4 = "RF-4"
45
+
46
+
47
+ class GateResultV1NormativeInTotoPredicateBody(BaseModel):
48
+ """
49
+ Predicate body of an in-toto Statement v1 whose predicateType is https://evals.intentsolutions.io/gate-result/v1. Source of truth: Blueprint B § 7.4 (lines 794-834). The ONLY predicate body fully spec-bound at v1; every other predicate URI runs in sigstore_staging until its SPEC.md normative section lands per DR-010 Q3. This schema validates ONLY the predicate body — the enclosing in-toto Statement envelope (_type, subject, predicateType) is validated separately. Each row independently verifiable; NO top-level bundle signature per § 7 line 754. Adding/loosening any field requires Class-1 ISEDC convening.
50
+
51
+ Migration note: this schema SUPERSEDES the lab's v0.1.0-draft schema (which used `result`/`timestamp` and was missing gate_name/gate_version/gate_reasons/coverage/policy_ref). Blueprint B § 7.4 is the canonical source — the lab schema was authored before Blueprint B landed on main.
52
+ """
53
+
54
+ model_config = ConfigDict(
55
+ extra="forbid",
56
+ )
57
+ gate_id: schema.SubjectName
58
+ """
59
+ Pipeline-hop-qualified gate identifier. MUST match the in-toto subject `name` per § 7.3.
60
+ """
61
+ gate_name: schema.KebabSlug
62
+ """
63
+ Short human-readable kebab-case gate name.
64
+ """
65
+ gate_version: schema.Semver
66
+ """
67
+ SemVer version of the gate logic that produced this row.
68
+ """
69
+ gate_decision: GateDecision
70
+ """
71
+ Decision verdict (Blueprint B § 7.4 line 800, closed 4-element enum). Distinct from JudgeVerdict (UPPERCASE) and RolloutGateDecision (ship/no_ship).
72
+ """
73
+ gate_reasons: list[str]
74
+ """
75
+ Structured reason strings. Empty array permitted ONLY for unconditional pass. For fail/advisory/error, at least one entry MUST appear; for error, gate_reasons[0] MUST capture the error class per § 7.4 line 829.
76
+ """
77
+ coverage: schema.Coverage
78
+ policy_ref: constr(pattern=r"^sha256:[a-f0-9]{64}:.+$")
79
+ """
80
+ Format: `sha256:<hex>:<repo-relative-path>`. Defends against mid-flight policy mutation per § 7.4 line 810.
81
+ """
82
+ policy_hash: schema.Sha256Prefixed
83
+ """
84
+ sha256-prefixed hash of the policy file content.
85
+ """
86
+ input_hash: schema.Sha256Prefixed
87
+ """
88
+ sha256-prefixed hash of the input the gate evaluated. MUST equal the in-toto subject[].digest.sha256 for the row per § 7.4 line 814 + § 7.3 line 792.
89
+ """
90
+ evaluated_at: schema.Rfc3339
91
+ runner: schema.RunnerIdentifier
92
+ commit_sha: schema.CommitSha
93
+ metadata: dict[str, Any] | None = None
94
+ """
95
+ Tool-specific free-form metadata. Consumers MUST NOT use this for ship/no-ship decisions per § 7.4 line 818.
96
+ """
97
+ failure_mode: str | None = None
98
+ """
99
+ Failure-mode classifier. MUST be populated when gate_decision='fail' AND the originating tool defines failure modes (e.g., MM-class for audit-harness gates).
100
+ """
101
+ advisory_severity: AdvisorySeverity | None = None
102
+ """
103
+ Severity hint when gate_decision='advisory'. Consumer policy decides whether to elevate to blocking.
104
+ """
105
+ cost_record_ref: schema.Uuidv7 | None = None
106
+ """
107
+ FK → CostRecord.id for cost attribution.
108
+ """
109
+ replay_fidelity_level: ReplayFidelityLevel | None = None
110
+ """
111
+ Replay fidelity level per iel-E11.
112
+ """
113
+ coverage_detail: list[schema.CoverageDimensionDetail] | None = None
114
+ """
115
+ Richer per-dimension coverage metadata (deferral-D lockup, bd_000-projects-9xyk). OPTIONAL + additive — the required `coverage` string arrays are unchanged, so the predicate URI is unaffected per § 7.2. Each entry's id MUST be a member of the matching `coverage` array (enforced at the validator layer). Descriptive only; MUST NOT drive ship/no-ship.
116
+ """
@@ -0,0 +1,76 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: judge-decision.schema.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+
8
+ from pydantic import BaseModel, ConfigDict, confloat, conint, constr
9
+
10
+ from . import _common_schema as schema
11
+
12
+
13
+ class Verdict(Enum):
14
+ """
15
+ Verdict enum per Blueprint B § 2.5 (closed 5-element set). UPPERCASE — deliberately DISTINCT from GateDecision (lowercase).
16
+ """
17
+
18
+ PASS = "PASS"
19
+ FAIL = "FAIL"
20
+ ADVISORY = "ADVISORY"
21
+ NOT_APPLICABLE = "NOT_APPLICABLE"
22
+ ERROR = "ERROR"
23
+
24
+
25
+ class VerdictSource(Enum):
26
+ """
27
+ How the verdict was reached.
28
+ """
29
+
30
+ deterministic = "deterministic"
31
+ llm_with_seed = "llm_with_seed"
32
+ llm_no_seed = "llm_no_seed"
33
+ hybrid = "hybrid"
34
+
35
+
36
+ class JudgedecisionSingleJudgeSVerdictOnAnEvalrunForAMatchermapBlueprintB25(BaseModel):
37
+ """
38
+ Single terminal state `recorded`. Immutable at creation. Follow-up verdicts = new rows. When emitted as a signed predicate row, the URI is eval-verdict/v1 (currently sigstore_staging).
39
+ """
40
+
41
+ model_config = ConfigDict(
42
+ extra="forbid",
43
+ )
44
+ id: schema.Uuidv7
45
+ eval_run_id: schema.Uuidv7
46
+ session_trace_id: schema.Uuidv7
47
+ matcher_map_id: schema.Uuidv7
48
+ judge_identity: constr(min_length=1)
49
+ """
50
+ Stable judge identity, e.g., `audit-harness@0.3.0:escape-scan`.
51
+ """
52
+ judge_version: schema.Semver
53
+ verdict: Verdict
54
+ """
55
+ Verdict enum per Blueprint B § 2.5 (closed 5-element set). UPPERCASE — deliberately DISTINCT from GateDecision (lowercase).
56
+ """
57
+ verdict_source: VerdictSource
58
+ """
59
+ How the verdict was reached.
60
+ """
61
+ confidence: confloat(ge=0.0, le=1.0) | None = None
62
+ """
63
+ Populated for LLM judges; null for deterministic judges.
64
+ """
65
+ reasoning: str | None = None
66
+ """
67
+ Free-form judge reasoning output.
68
+ """
69
+ input_hash: schema.Sha256
70
+ seed: int | str | None = None
71
+ """
72
+ Populated for verdict_source='llm_with_seed'. Blueprint B does not specify integer vs string — both accepted.
73
+ """
74
+ evaluated_at: schema.Rfc3339
75
+ latency_ms: conint(ge=0)
76
+ cost_record_ref: schema.Uuidv7
@@ -0,0 +1,153 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: matcher-map.schema.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from enum import Enum
7
+ from typing import Any, Literal
8
+
9
+ from pydantic import BaseModel, ConfigDict, Field, constr
10
+
11
+ from . import _common_schema as schema
12
+
13
+
14
+ class InputPattern(BaseModel):
15
+ """
16
+ Typed input pattern — closed 3-variant discriminated union per Blueprint B § 2.3 line 159.
17
+ """
18
+
19
+ model_config = ConfigDict(
20
+ extra="forbid",
21
+ )
22
+ kind: Literal["regex"]
23
+ pattern: str
24
+ flags: str | None = None
25
+
26
+
27
+ class InputPattern1(BaseModel):
28
+ """
29
+ Typed input pattern — closed 3-variant discriminated union per Blueprint B § 2.3 line 159.
30
+ """
31
+
32
+ model_config = ConfigDict(
33
+ extra="forbid",
34
+ )
35
+ kind: Literal["json-schema"]
36
+ schema_: dict[str, Any] = Field(..., alias="schema")
37
+
38
+
39
+ class Mode(Enum):
40
+ """
41
+ v1 fixes `all` (every constraint must hold); reserved for a future additive `any`.
42
+ """
43
+
44
+ all = "all"
45
+
46
+
47
+ class Op(Enum):
48
+ exists = "exists"
49
+ absent = "absent"
50
+ equals = "equals"
51
+ type_is = "type-is"
52
+ matches = "matches"
53
+ length_equals = "length-equals"
54
+
55
+
56
+ class Constraint(BaseModel):
57
+ model_config = ConfigDict(
58
+ extra="forbid",
59
+ )
60
+ path: constr(min_length=1)
61
+ """
62
+ Dotted/bracketed accessor into the candidate's parsed tree. Accessor grammar is the runtime's concern.
63
+ """
64
+ op: Op
65
+ value: Any | None = None
66
+ """
67
+ Required for value-bearing ops (equals/type-is/matches/length-equals); omitted for presence ops (exists/absent). Cross-field enforced at the validator layer.
68
+ """
69
+
70
+
71
+ class Matcher(BaseModel):
72
+ """
73
+ Structural-matcher payload — LOCKED per deferral-B (bd_000-projects-ra9a). A conjunction of path-anchored constraints over the candidate's parsed tree.
74
+ """
75
+
76
+ model_config = ConfigDict(
77
+ extra="forbid",
78
+ )
79
+ mode: Mode
80
+ """
81
+ v1 fixes `all` (every constraint must hold); reserved for a future additive `any`.
82
+ """
83
+ constraints: list[Constraint]
84
+
85
+
86
+ class InputPattern2(BaseModel):
87
+ """
88
+ Typed input pattern — closed 3-variant discriminated union per Blueprint B § 2.3 line 159.
89
+ """
90
+
91
+ model_config = ConfigDict(
92
+ extra="forbid",
93
+ )
94
+ kind: Literal["structural"]
95
+ matcher: Matcher
96
+ """
97
+ Structural-matcher payload — LOCKED per deferral-B (bd_000-projects-ra9a). A conjunction of path-anchored constraints over the candidate's parsed tree.
98
+ """
99
+
100
+
101
+ class Kind(Enum):
102
+ exact = "exact"
103
+ semantic = "semantic"
104
+ contract_conformance = "contract-conformance"
105
+ redaction_confirmed = "redaction-confirmed"
106
+
107
+
108
+ class ExpectedBehavior(BaseModel):
109
+ """
110
+ Typed expected behavior. v1 named variants + open extension slot per spec's explicit 'etc.' trailer.
111
+ """
112
+
113
+ kind: Kind
114
+ payload: Any | None = None
115
+
116
+
117
+ class ExpectedBehavior1(BaseModel):
118
+ """
119
+ Typed expected behavior. v1 named variants + open extension slot per spec's explicit 'etc.' trailer.
120
+ """
121
+
122
+ model_config = ConfigDict(
123
+ extra="allow",
124
+ )
125
+ kind: str
126
+ payload: Any
127
+ extension: Literal[True]
128
+
129
+
130
+ class MatchermapReusableInputBehaviorPatternDefinitionBlueprintB23(BaseModel):
131
+ """
132
+ State machine: draft → published → deprecated (one-way). Immutable once published; revisions = new row + incremented version.
133
+ """
134
+
135
+ model_config = ConfigDict(
136
+ extra="forbid",
137
+ )
138
+ id: schema.Uuidv7
139
+ mm_class: schema.MmClass
140
+ name: schema.KebabSlug
141
+ input_pattern: InputPattern | InputPattern1 | InputPattern2
142
+ """
143
+ Typed input pattern — closed 3-variant discriminated union per Blueprint B § 2.3 line 159.
144
+ """
145
+ expected_behavior: ExpectedBehavior | ExpectedBehavior1
146
+ """
147
+ Typed expected behavior. v1 named variants + open extension slot per spec's explicit 'etc.' trailer.
148
+ """
149
+ version: schema.Semver
150
+ content_hash: schema.Sha256
151
+ description: constr(min_length=1)
152
+ created_at: schema.Rfc3339
153
+ created_by: schema.ActorIdentity