@gate-forge/core 0.10.3 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/classifier/bind.d.ts +2 -2
  2. package/dist/classifier/bind.d.ts.map +1 -1
  3. package/dist/classifier/classify.d.ts +2 -2
  4. package/dist/classifier/classify.d.ts.map +1 -1
  5. package/dist/classifier/classify.js.map +1 -1
  6. package/dist/config/index.d.ts +294 -3
  7. package/dist/config/index.d.ts.map +1 -1
  8. package/dist/config/index.js +137 -0
  9. package/dist/config/index.js.map +1 -1
  10. package/dist/index.d.ts +51 -9
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +40 -6
  13. package/dist/index.js.map +1 -1
  14. package/dist/policy/business-rules.d.ts +143 -0
  15. package/dist/policy/business-rules.d.ts.map +1 -0
  16. package/dist/policy/business-rules.js +314 -0
  17. package/dist/policy/business-rules.js.map +1 -0
  18. package/dist/policy/evaluate.d.ts +8 -0
  19. package/dist/policy/evaluate.d.ts.map +1 -1
  20. package/dist/policy/index.d.ts +1 -0
  21. package/dist/policy/index.d.ts.map +1 -1
  22. package/dist/policy/index.js +1 -0
  23. package/dist/policy/index.js.map +1 -1
  24. package/dist/schemas/business-rules.d.ts +215 -0
  25. package/dist/schemas/business-rules.d.ts.map +1 -0
  26. package/dist/schemas/business-rules.js +227 -0
  27. package/dist/schemas/business-rules.js.map +1 -0
  28. package/dist/schemas/classification-policy.d.ts +74 -11
  29. package/dist/schemas/classification-policy.d.ts.map +1 -1
  30. package/dist/schemas/classification-policy.js +62 -28
  31. package/dist/schemas/classification-policy.js.map +1 -1
  32. package/dist/schemas/scan-config.d.ts +94 -0
  33. package/dist/schemas/scan-config.d.ts.map +1 -0
  34. package/dist/schemas/scan-config.js +101 -0
  35. package/dist/schemas/scan-config.js.map +1 -0
  36. package/dist/schemas/test-catalog.d.ts +12 -12
  37. package/dist/schemas/test-map.d.ts +4 -4
  38. package/dist/schemas/verdict.d.ts +4 -0
  39. package/dist/schemas/verdict.d.ts.map +1 -1
  40. package/dist/schemas/verdict.js +13 -0
  41. package/dist/schemas/verdict.js.map +1 -1
  42. package/dist/testing/gate-runner.d.ts +2 -2
  43. package/dist/testing/gate-runner.d.ts.map +1 -1
  44. package/package.json +1 -1
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Owner-declared BUSINESS RULES (plan 2026-10-05 §4 D1/D2) and the test
3
+ * type table that decides what proof each rule's declared test type
4
+ * requires.
5
+ *
6
+ * Two deliberate separations:
7
+ * - A RULE is a DECLARATION, never an obligation. It has no detector
8
+ * resource, no contract namespace and no verifier; it is graded by a
9
+ * pure evaluator over the run's SEALED facts (see `policy/business-rules.ts`).
10
+ * Nothing here mints an obligation id.
11
+ * - The TYPE TABLE is DATA, one row per supported `test:` value. Proof
12
+ * strength follows the type, and a weaker kind never satisfies a
13
+ * stronger one. Adding a type later is one row plus its honest proof
14
+ * level, never a change to the evaluator.
15
+ *
16
+ * The claim id per case is `business-rule:<ruleId>/<caseId>`, which
17
+ * satisfies the existing `<resourceId>:<contract>` shape so the sidecar
18
+ * schema is unchanged — the sidecar stores it under the SAME `claims`
19
+ * list it already uses for obligations.
20
+ *
21
+ * YAML parsing stays in the CLI (the existing core/CLI split); this
22
+ * module speaks validated plain data only.
23
+ */
24
+ import { z } from 'zod';
25
+ import { SchemaVersionField } from './common.js';
26
+ /** The claim namespace every business-rule case id lives in. */
27
+ export const BUSINESS_RULE_NAMESPACE = 'business-rule';
28
+ /**
29
+ * The claim id one case is mapped by: `business-rule:<ruleId>/<caseId>`.
30
+ * Deterministic and stable, so a sidecar entry survives a re-order of
31
+ * `cases:` and the evaluator can join bindings to cases by string.
32
+ */
33
+ export function businessRuleClaimId(ruleId, caseId) {
34
+ return `${BUSINESS_RULE_NAMESPACE}:${ruleId}/${caseId}`;
35
+ }
36
+ /** Whether one claim id belongs to the business-rule namespace. */
37
+ export function isBusinessRuleClaimId(claimId) {
38
+ return claimId.startsWith(`${BUSINESS_RULE_NAMESPACE}:`);
39
+ }
40
+ /**
41
+ * The `<ruleId>/<caseId>` pair a business-rule claim id carries, or null
42
+ * when the id is not a business-rule claim or carries no case part.
43
+ */
44
+ export function parseBusinessRuleClaimId(claimId) {
45
+ if (!isBusinessRuleClaimId(claimId))
46
+ return null;
47
+ const rest = claimId.slice(`${BUSINESS_RULE_NAMESPACE}:`.length);
48
+ const slash = rest.lastIndexOf('/');
49
+ if (slash <= 0 || slash === rest.length - 1)
50
+ return null;
51
+ return { ruleId: rest.slice(0, slash), caseId: rest.slice(slash + 1) };
52
+ }
53
+ /** Rule ids are stable, filesystem- and URL-safe slugs. */
54
+ const RULE_ID = /^[a-z0-9][a-z0-9._-]*$/;
55
+ /** Case ids follow the same rule inside their rule. */
56
+ const CASE_ID = /^[a-z0-9][a-z0-9._-]*$/;
57
+ /** The test types this release ships. More are one table row each. */
58
+ export const BUSINESS_RULE_TEST_TYPES = ['e2e', 'pytest'];
59
+ /** One declared observable consequence of a rule (typically both sides). */
60
+ export const BusinessRuleCaseSchema = z
61
+ .object({
62
+ /** Case id, unique inside its rule; joined as `<ruleId>/<caseId>`. */
63
+ id: z.string().regex(CASE_ID, 'case id must match [a-z0-9][a-z0-9._-]*'),
64
+ /** What the case says must be observed; required (a case with no words cannot be reviewed). */
65
+ describe: z.string().trim().min(1),
66
+ })
67
+ .strict();
68
+ /**
69
+ * Ranking-only hints for `tests suggest`. They NEVER grade: a hint can
70
+ * promote a candidate, never prove anything, and a rule with no hints
71
+ * behaves exactly like a rule with them.
72
+ */
73
+ export const BusinessRuleHintsSchema = z
74
+ .object({
75
+ /** URL path globs the proving test is expected to send. */
76
+ routes: z.array(z.string().min(1)).optional(),
77
+ /** Repo-relative file globs the proving test is expected to live in. */
78
+ globs: z.array(z.string().min(1)).optional(),
79
+ })
80
+ .strict();
81
+ /**
82
+ * One owner-declared business rule. Every field is a DECLARATION: it
83
+ * changes the trusted policy digest (the rule lives in the owner-answers
84
+ * document) and therefore can never be self-approved by an agent.
85
+ */
86
+ export const BusinessRuleSchema = z
87
+ .object({
88
+ /** Stable rule id; unique in the document. */
89
+ id: z.string().regex(RULE_ID, 'rule id must match [a-z0-9][a-z0-9._-]*'),
90
+ /** The rule in the owner's own words (required: a rule with no title cannot be reviewed). */
91
+ title: z.string().trim().min(1),
92
+ /** Optional longer prose; the title stays the one-line statement. */
93
+ describe: z.string().trim().min(1).optional(),
94
+ /** Optional resource name; validated against the run's inventory (never proof). */
95
+ subject: z.string().trim().min(1).optional(),
96
+ /** Which kind of test must prove it. `e2e` is the default. */
97
+ test: z.enum(BUSINESS_RULE_TEST_TYPES).default('e2e'),
98
+ /** `block` (default) or `advisory`; advisory findings never reach the exit code. */
99
+ enforcement: z.enum(['block', 'advisory']).default('block'),
100
+ /** REQUIRED iff `enforcement: advisory` — an advisory with no reason hides itself. */
101
+ advisoryReason: z.string().trim().min(1).optional(),
102
+ /** Observable cases; absent means the single implicit case `default`. */
103
+ cases: z.array(BusinessRuleCaseSchema).min(1).optional(),
104
+ /** Ranking-only hints for `tests suggest`. */
105
+ hints: BusinessRuleHintsSchema.optional(),
106
+ })
107
+ .strict()
108
+ .superRefine((rule, ctx) => {
109
+ if (rule.enforcement === 'advisory' && rule.advisoryReason === undefined) {
110
+ ctx.addIssue({
111
+ code: 'custom',
112
+ path: ['advisoryReason'],
113
+ message: "rule '" + rule.id + "' is advisory but declares no advisoryReason: an advisory rule must say why it does not block",
114
+ });
115
+ }
116
+ if (rule.enforcement === 'block' && rule.advisoryReason !== undefined) {
117
+ ctx.addIssue({
118
+ code: 'custom',
119
+ path: ['advisoryReason'],
120
+ message: "rule '" + rule.id + "' blocks but declares advisoryReason: the reason belongs on an advisory rule only",
121
+ });
122
+ }
123
+ const seen = new Set();
124
+ for (let index = 0; index < (rule.cases ?? []).length; index += 1) {
125
+ const id = rule.cases?.[index]?.id;
126
+ if (id === undefined)
127
+ continue;
128
+ if (seen.has(id)) {
129
+ ctx.addIssue({
130
+ code: 'custom',
131
+ path: ['cases', index, 'id'],
132
+ message: `duplicate case id '${id}' in rule '${rule.id}'`,
133
+ });
134
+ }
135
+ seen.add(id);
136
+ }
137
+ });
138
+ /**
139
+ * The `rules:` section. Duplicate rule ids are an ambiguity, not a
140
+ * last-one-wins: two rules with one id cannot be graded deterministically.
141
+ */
142
+ export const BusinessRulesSchema = z
143
+ .array(BusinessRuleSchema)
144
+ .superRefine((rules, ctx) => {
145
+ const seen = new Set();
146
+ for (let index = 0; index < rules.length; index += 1) {
147
+ const id = rules[index]?.id;
148
+ if (id === undefined)
149
+ continue;
150
+ if (seen.has(id)) {
151
+ ctx.addIssue({
152
+ code: 'custom',
153
+ path: [index, 'id'],
154
+ message: `duplicate business rule id '${id}' — every rule must be separately addressable`,
155
+ });
156
+ }
157
+ seen.add(id);
158
+ }
159
+ });
160
+ /** The case id a rule without `cases:` uses. */
161
+ export const IMPLICIT_CASE_ID = 'default';
162
+ /**
163
+ * The rule's cases with the implicit `default` case materialized. Pure:
164
+ * a rule that declares cases returns exactly those, in order.
165
+ */
166
+ export function casesOf(rule) {
167
+ if (rule.cases !== undefined && rule.cases.length > 0)
168
+ return [...rule.cases];
169
+ return [{ id: IMPLICIT_CASE_ID, describe: rule.title }];
170
+ }
171
+ /**
172
+ * The owners-answers document's RULE section: `rules:` is optional and
173
+ * an ABSENT section means the feature is off — byte-identical findings,
174
+ * report and digests to a release without it (plan invariant 1).
175
+ */
176
+ export const BusinessRulePolicySchema = z
177
+ .object({
178
+ /** Owner-declared business rules. */
179
+ rules: z.array(BusinessRuleSchema),
180
+ })
181
+ .strict();
182
+ /**
183
+ * THE type table: one row per supported `test:` value. Proof strength
184
+ * follows the type, and a weaker kind is never accepted by a stronger
185
+ * row — `e2e` is never satisfied by `api-e2e`, `server-e2e`, `unit`, a
186
+ * mocked spec, or a test that did not run.
187
+ */
188
+ export const BUSINESS_RULE_TYPE_TABLE = Object.freeze({
189
+ e2e: Object.freeze({
190
+ id: 'e2e',
191
+ label: 'e2e',
192
+ runner: 'playwright',
193
+ acceptedKinds: Object.freeze(['browser-e2e', 'observed-e2e']),
194
+ kindChannels: Object.freeze({ 'browser-e2e': 'engine', 'observed-e2e': 'observe' }),
195
+ defaultChannel: 'observe',
196
+ requiresWitnessedSuite: false,
197
+ starter: 'playwright',
198
+ }),
199
+ pytest: Object.freeze({
200
+ id: 'pytest',
201
+ label: 'pytest',
202
+ runner: 'pytest',
203
+ acceptedKinds: Object.freeze(['unit', 'integration', 'server-e2e']),
204
+ kindChannels: Object.freeze({ unit: 'execution', integration: 'execution', 'server-e2e': 'execution' }),
205
+ defaultChannel: 'execution',
206
+ requiresWitnessedSuite: true,
207
+ starter: 'pytest',
208
+ }),
209
+ });
210
+ /** The type table as a deterministic list (sorted by type id). */
211
+ export function businessRuleTypeRows() {
212
+ return [...BUSINESS_RULE_TEST_TYPES].sort().map((id) => BUSINESS_RULE_TYPE_TABLE[id]);
213
+ }
214
+ /**
215
+ * The per-case status the evaluator reports. `satisfied` carries the
216
+ * proof channel in its label (`satisfied (observe)`), because "satisfied"
217
+ * read as "the rule holds" is exactly the overclaim invariant 6 forbids.
218
+ */
219
+ export const BUSINESS_RULE_CASE_STATUSES = ['unmapped', 'wrong-type', 'unproven', 'failing', 'satisfied'];
220
+ /**
221
+ * The `rules:` key as it appears in the owner-answers document, named
222
+ * once so the loader, the migrator and the init template cannot drift.
223
+ */
224
+ export const BUSINESS_RULES_KEY = 'rules';
225
+ /** The `schemaVersion` every engine document carries. */
226
+ export const BusinessRuleSchemaVersionField = SchemaVersionField;
227
+ //# sourceMappingURL=business-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"business-rules.js","sourceRoot":"","sources":["../../src/schemas/business-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD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CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;QACvG,cAAc,EAAE,WAAW;QAC3B,sBAAsB,EAAE,IAAI;QAC5B,OAAO,EAAE,QAAQ;KAClB,CAAC;CACH,CAAC,CAAC;AAEH,kEAAkE;AAClE,MAAM,UAAU,oBAAoB;IAClC,OAAO,CAAC,GAAG,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC;AACxF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;AAKnH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAE1C,yDAAyD;AACzD,MAAM,CAAC,MAAM,8BAA8B,GAAG,kBAAkB,CAAC"}
@@ -124,13 +124,55 @@ export declare const CoverageRuleSchema: z.ZodObject<{
124
124
  /** Inferred coverage-rule shape. */
125
125
  export type CoverageRule = z.infer<typeof CoverageRuleSchema>;
126
126
  /**
127
- * The classification-policy document: scan roots (complete-scan scope),
128
- * trusted internal entry-point categories, organization internal rules,
129
- * the supported source declaration syntax, and volatile fields.
127
+ * One owner-declared PLANE rule list — the `planes:` section of the
128
+ * answers document (0.11.0, was `.gateforge/planes.json`). The section
129
+ * keeps the document shape it always had (`{ rules: [...] }`) so
130
+ * `gateforge migrate` is a pure text move, but the RULES themselves stay
131
+ * validated by the pack that applies them (one validation source, the
132
+ * same fail-closed reader that has always guarded them): this schema
133
+ * rejects a wrong document SHAPE and the owning reader rejects a wrong
134
+ * rule. Absent = no plane channel, byte-identical to today.
135
+ */
136
+ export declare const PlanesSectionSchema: z.ZodObject<{
137
+ rules: z.ZodArray<z.ZodUnknown>;
138
+ }, z.core.$strict>;
139
+ /** Inferred `planes:` section shape. */
140
+ export type PlanesSection = z.infer<typeof PlanesSectionSchema>;
141
+ /**
142
+ * One owner-declared ENDPOINT-CAPABILITY rule list — the `endpoints:`
143
+ * section of the answers document (0.11.0, was `.gateforge/endpoints.json`).
144
+ * Same posture as {@link PlanesSectionSchema}: shape here, rules validated
145
+ * by the endpoint compiler that applies them.
146
+ */
147
+ export declare const EndpointsSectionSchema: z.ZodObject<{
148
+ rules: z.ZodArray<z.ZodUnknown>;
149
+ }, z.core.$strict>;
150
+ /** Inferred `endpoints:` section shape. */
151
+ export type EndpointsSection = z.infer<typeof EndpointsSectionSchema>;
152
+ /**
153
+ * Repo-root-relative location of the ONE owner-answers document. Named
154
+ * once, in the package that owns the document, so every diagnostic that
155
+ * has to point the owner at a declaration — the refusals, the migrator,
156
+ * the packs — names the same path.
157
+ */
158
+ export declare const OWNER_ANSWERS_PATH = ".gateforge/classification-policy.yml";
159
+ /**
160
+ * The classification-policy document: the ONE owner-answers file
161
+ * (`.gateforge/classification-policy.yml`, name kept by owner decision).
162
+ * Since 0.11.0 it holds every owner answer — trusted internal
163
+ * entry-point categories, organization internal rules, exact lifecycle
164
+ * disables, delete semantics, plane rules, endpoint capabilities, and
165
+ * the owner's business `rules:`.
166
+ *
167
+ * The SCANNER settings (`scanRoots`, `coverage`, `declarations`,
168
+ * `volatileFields`) MOVED OUT to `.gateforge.yml` under `scan:`, next to
169
+ * the other machine-wide declarations. They are no longer accepted here:
170
+ * a repository still carrying them fails closed naming `gateforge
171
+ * migrate` rather than silently running on a setting the engine cannot
172
+ * see.
130
173
  */
131
174
  export declare const ClassificationPolicySchema: z.ZodObject<{
132
175
  schemaVersion: z.ZodLiteral<1>;
133
- scanRoots: z.ZodArray<z.ZodString>;
134
176
  trustedInternalEntryPoints: z.ZodArray<z.ZodObject<{
135
177
  category: z.ZodString;
136
178
  patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -164,14 +206,35 @@ export declare const ClassificationPolicySchema: z.ZodObject<{
164
206
  archiveFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
165
207
  reason: z.ZodString;
166
208
  }, z.core.$strict>>>;
167
- coverage: z.ZodOptional<z.ZodArray<z.ZodObject<{
168
- capability: z.ZodString;
169
- detector: z.ZodString;
170
- appliesTo: z.ZodArray<z.ZodString>;
171
- exhaustive: z.ZodOptional<z.ZodBoolean>;
209
+ planes: z.ZodOptional<z.ZodObject<{
210
+ rules: z.ZodArray<z.ZodUnknown>;
211
+ }, z.core.$strict>>;
212
+ endpoints: z.ZodOptional<z.ZodObject<{
213
+ rules: z.ZodArray<z.ZodUnknown>;
214
+ }, z.core.$strict>>;
215
+ rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
216
+ id: z.ZodString;
217
+ title: z.ZodString;
218
+ describe: z.ZodOptional<z.ZodString>;
219
+ subject: z.ZodOptional<z.ZodString>;
220
+ test: z.ZodDefault<z.ZodEnum<{
221
+ e2e: "e2e";
222
+ pytest: "pytest";
223
+ }>>;
224
+ enforcement: z.ZodDefault<z.ZodEnum<{
225
+ block: "block";
226
+ advisory: "advisory";
227
+ }>>;
228
+ advisoryReason: z.ZodOptional<z.ZodString>;
229
+ cases: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
+ id: z.ZodString;
231
+ describe: z.ZodString;
232
+ }, z.core.$strict>>>;
233
+ hints: z.ZodOptional<z.ZodObject<{
234
+ routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
235
+ globs: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
+ }, z.core.$strict>>;
172
237
  }, z.core.$strict>>>;
173
- declarations: z.ZodRecord<z.ZodString, z.ZodString>;
174
- volatileFields: z.ZodArray<z.ZodString>;
175
238
  }, z.core.$strict>;
176
239
  /** Inferred classification-policy shape. */
177
240
  export type ClassificationPolicy = z.infer<typeof ClassificationPolicySchema>;
@@ -1 +1 @@
1
- {"version":3,"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AAO,MAAM,kBAAkB;;;;;kBAyBpB,CAAC;AAEZ,oCAAoC;AACpC,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB;;kBAKrB,CAAC;AAEZ,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;kBAKxB,CAAC;AAEZ,2CAA2C;AAC3C,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AAEzE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgC5B,CAAC;AAEZ,4CAA4C;AAC5C,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -9,6 +9,7 @@
9
9
  import { z } from 'zod';
10
10
  import { compareStrings } from '../graph/util.js';
11
11
  import { SchemaVersionField } from './common.js';
12
+ import { BusinessRulesSchema } from './business-rules.js';
12
13
  /** One trusted internal entry-point category (worker, migration, …). */
13
14
  export const InternalEntryPointCategorySchema = z
14
15
  .object({
@@ -276,20 +277,58 @@ export const CoverageRuleSchema = z
276
277
  })
277
278
  .strict();
278
279
  /**
279
- * The classification-policy document: scan roots (complete-scan scope),
280
- * trusted internal entry-point categories, organization internal rules,
281
- * the supported source declaration syntax, and volatile fields.
280
+ * One owner-declared PLANE rule list — the `planes:` section of the
281
+ * answers document (0.11.0, was `.gateforge/planes.json`). The section
282
+ * keeps the document shape it always had (`{ rules: [...] }`) so
283
+ * `gateforge migrate` is a pure text move, but the RULES themselves stay
284
+ * validated by the pack that applies them (one validation source, the
285
+ * same fail-closed reader that has always guarded them): this schema
286
+ * rejects a wrong document SHAPE and the owning reader rejects a wrong
287
+ * rule. Absent = no plane channel, byte-identical to today.
288
+ */
289
+ export const PlanesSectionSchema = z
290
+ .object({
291
+ /** Owner-declared plane rules; validated by the SQLAlchemy pack. */
292
+ rules: z.array(z.unknown()),
293
+ })
294
+ .strict();
295
+ /**
296
+ * One owner-declared ENDPOINT-CAPABILITY rule list — the `endpoints:`
297
+ * section of the answers document (0.11.0, was `.gateforge/endpoints.json`).
298
+ * Same posture as {@link PlanesSectionSchema}: shape here, rules validated
299
+ * by the endpoint compiler that applies them.
300
+ */
301
+ export const EndpointsSectionSchema = z
302
+ .object({
303
+ /** Owner-declared endpoint-capability rules; validated by the compiler. */
304
+ rules: z.array(z.unknown()),
305
+ })
306
+ .strict();
307
+ /**
308
+ * Repo-root-relative location of the ONE owner-answers document. Named
309
+ * once, in the package that owns the document, so every diagnostic that
310
+ * has to point the owner at a declaration — the refusals, the migrator,
311
+ * the packs — names the same path.
312
+ */
313
+ export const OWNER_ANSWERS_PATH = '.gateforge/classification-policy.yml';
314
+ /**
315
+ * The classification-policy document: the ONE owner-answers file
316
+ * (`.gateforge/classification-policy.yml`, name kept by owner decision).
317
+ * Since 0.11.0 it holds every owner answer — trusted internal
318
+ * entry-point categories, organization internal rules, exact lifecycle
319
+ * disables, delete semantics, plane rules, endpoint capabilities, and
320
+ * the owner's business `rules:`.
321
+ *
322
+ * The SCANNER settings (`scanRoots`, `coverage`, `declarations`,
323
+ * `volatileFields`) MOVED OUT to `.gateforge.yml` under `scan:`, next to
324
+ * the other machine-wide declarations. They are no longer accepted here:
325
+ * a repository still carrying them fails closed naming `gateforge
326
+ * migrate` rather than silently running on a setting the engine cannot
327
+ * see.
282
328
  */
283
329
  export const ClassificationPolicySchema = z
284
330
  .object({
285
331
  schemaVersion: SchemaVersionField,
286
- /**
287
- * Repo-root-relative globs defining the scope a closed-world proof
288
- * must cover. A non-empty list is the prerequisite of every
289
- * complete-scan attestation (ADR 0003 D4); findings or unresolved
290
- * entries inside these roots invalidate the attestation.
291
- */
292
- scanRoots: z.array(z.string().min(1)).min(1),
293
332
  /** Entry-point categories counted as trusted-internal reachability. */
294
333
  trustedInternalEntryPoints: z.array(InternalEntryPointCategorySchema),
295
334
  /** Organization internal rules — certificate inputs, never overrides. */
@@ -301,28 +340,23 @@ export const ClassificationPolicySchema = z
301
340
  * Declaring semantics ADDS an evidence contract — it can resolve
302
341
  * DELETE_SEMANTICS_UNRESOLVED, never remove an obligation: detector
303
342
  * evidence that disagrees still blocks as a contradiction.
343
+ *
344
+ * This is the hard/archive answer for a RESOURCE: the rule's `match`
345
+ * glob names a source file, so a DELETE route that links no resource
346
+ * (a link-row teardown, a draft discard) cannot be answered here —
347
+ * that case is declared as `crud-delete`/`crud-archive` in `endpoints:`.
304
348
  */
305
349
  deleteRules: DeleteRulesSchema.optional(),
350
+ /** Owner-declared data-plane rules (was `.gateforge/planes.json`). */
351
+ planes: PlanesSectionSchema.optional(),
352
+ /** Owner-declared endpoint capabilities (was `.gateforge/endpoints.json`). */
353
+ endpoints: EndpointsSectionSchema.optional(),
306
354
  /**
307
- * Coverage requirements for COMPLETE-scan proofs (ADR 0003 D4). A
308
- * closed-world attestation holds only when every rule's detector is
309
- * configured, reports coverage, and covers every applicable requested
310
- * file. Declaring none means no scan is provably complete — closed-
311
- * world proofs stay unavailable (fail closed).
312
- */
313
- coverage: z.array(CoverageRuleSchema).optional(),
314
- /**
315
- * Supported source declaration syntax: the machine-readable keys
316
- * detectors may translate into declaration signals (e.g.
317
- * `internality: 'gateforge:internal'`). Declarations are assertions
318
- * consumed by the classifier — contradictory code signals still block.
319
- */
320
- declarations: z.record(z.string(), z.string().min(1)),
321
- /**
322
- * Bookkeeping columns that never satisfy an update by themselves
323
- * (mirrors the verdict engine's `updateableFields` fail-closed rule).
355
+ * The owner's BUSINESS RULES (0.11.0). Each rule names the test type
356
+ * that must prove it and its observable cases. Absent = the feature is
357
+ off, byte for byte: no finding, no report row, no digest change.
324
358
  */
325
- volatileFields: z.array(z.string().min(1)),
359
+ rules: BusinessRulesSchema.optional(),
326
360
  })
327
361
  .strict();
328
362
  //# sourceMappingURL=classification-policy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"classification-policy.js","sourceRoot":"","sources":["../../src/schemas/classification-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,wEAAwE;AACxE,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,MAAM,CAAC;IACN,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B;;;OAGG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC;KACD,MAAM,EAAE,CAAC;AAKZ,oEAAoE;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,yFAAyF;IACzF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC1C,yEAAyE;IACzE,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC;KACD,MAAM,EAAE;KACR,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of `.gateforge.yml` (0.11.0).
3
+ *
4
+ * These four settings used to live in `classification-policy.yml`
5
+ * (`scanRoots`, `coverage`, `declarations`, `volatileFields`). They moved
6
+ * here for ONE reason: they are not owner ANSWERS, they are machine-wide
7
+ * scan configuration, and the answers file now holds exactly the answers.
8
+ * They are still inside the owner-approved policy digest, because
9
+ * `.gateforge.yml` is a trusted-policy input like every other declaration
10
+ * there — the move changes which document an agent has to edit, never who
11
+ * has to approve it.
12
+ *
13
+ * The section also carries the two detector configuration documents that
14
+ * used to be their own files (`scan.httpClients`, was
15
+ * `.gateforge/http-clients.json`; `scan.fastapi`, was
16
+ * `.gateforge/fastapi.json`), for the same reason and with the same
17
+ * rule: the SHAPE is checked here, the RULES by the detector that applies
18
+ * them (one validation source, unchanged from the readers that have always
19
+ * guarded them).
20
+ */
21
+ import { z } from 'zod';
22
+ import type { ClassificationPolicy } from './classification-policy.js';
23
+ /**
24
+ * One owner-declared HTTP client-scan section (was
25
+ * `.gateforge/http-clients.json`). Shape here; the client-symbol /
26
+ * wrapper / URL-builder / same-origin rules are validated by pack-http's
27
+ * own reader, which is the single source of truth for that document.
28
+ */
29
+ export declare const HttpClientsScanSectionSchema: z.ZodObject<{
30
+ clientSymbols: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
31
+ wrapperFunctions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
32
+ urlBuilders: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
33
+ sameOriginHosts: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
34
+ clientScanRoots: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
35
+ serverScanRoots: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
36
+ }, z.core.$strict>;
37
+ /** Inferred `scan.httpClients` shape. */
38
+ export type HttpClientsScanSection = z.infer<typeof HttpClientsScanSectionSchema>;
39
+ /**
40
+ * One owner-declared FastAPI scan section (was `.gateforge/fastapi.json`):
41
+ * repo-root-relative directories acting as Python import roots.
42
+ */
43
+ export declare const FastapiScanSectionSchema: z.ZodObject<{
44
+ importRoots: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
45
+ }, z.core.$strict>;
46
+ /** Inferred `scan.fastapi` shape. */
47
+ export type FastapiScanSection = z.infer<typeof FastapiScanSectionSchema>;
48
+ /**
49
+ * The `scan:` section of `.gateforge.yml`. REQUIRED: a repository without
50
+ * it has not answered "what does a closed-world proof have to cover", and
51
+ * defaulting that would silently weaken every suppressive decision. The
52
+ * key lives in `.gateforge.yml`, so it is inside the trusted policy
53
+ * digest exactly like the settings it replaces.
54
+ */
55
+ export declare const ScanConfigSchema: z.ZodObject<{
56
+ scanRoots: z.ZodArray<z.ZodString>;
57
+ coverage: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
+ capability: z.ZodString;
59
+ detector: z.ZodString;
60
+ appliesTo: z.ZodArray<z.ZodString>;
61
+ exhaustive: z.ZodOptional<z.ZodBoolean>;
62
+ }, z.core.$strict>>>;
63
+ declarations: z.ZodRecord<z.ZodString, z.ZodString>;
64
+ volatileFields: z.ZodArray<z.ZodString>;
65
+ httpClients: z.ZodOptional<z.ZodObject<{
66
+ clientSymbols: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
67
+ wrapperFunctions: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
68
+ urlBuilders: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
69
+ sameOriginHosts: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
70
+ clientScanRoots: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
71
+ serverScanRoots: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
72
+ }, z.core.$strict>>;
73
+ fastapi: z.ZodOptional<z.ZodObject<{
74
+ importRoots: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
75
+ }, z.core.$strict>>;
76
+ }, z.core.$strict>;
77
+ /** Inferred `scan:` section shape. */
78
+ export type ScanConfig = z.infer<typeof ScanConfigSchema>;
79
+ /** The scanner keys that used to live in `classification-policy.yml`. */
80
+ export declare const MOVED_SCANNER_KEYS: readonly ["scanRoots", "coverage", "declarations", "volatileFields"];
81
+ /** Union of the moved scanner keys. */
82
+ export type MovedScannerKey = (typeof MOVED_SCANNER_KEYS)[number];
83
+ /** Whether `key` is one of the scanner settings that moved to `.gateforge.yml`. */
84
+ export declare function isMovedScannerKey(key: string): key is MovedScannerKey;
85
+ /**
86
+ * What the classifier ACTUALLY consumes: the owner answers and the
87
+ * scanner settings, composed by the caller from the two documents they
88
+ * now live in. The classifier has always needed both (a suppressive
89
+ * decision needs an owner answer AND the scan scope that makes it
90
+ * provable), and it still gets exactly one object — so nothing in the
91
+ * lattice learned that the two documents were split.
92
+ */
93
+ export type ClassifierPolicy = ClassificationPolicy & ScanConfig;
94
+ //# sourceMappingURL=scan-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scan-config.d.ts","sourceRoot":"","sources":["../../src/schemas/scan-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;kBAe9B,CAAC;AAEZ,yCAAyC;AACzC,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;kBAK1B,CAAC;AAEZ,qCAAqC;AACrC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;kBAgClB,CAAC;AAEZ,sCAAsC;AACtC,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,sEAAuE,CAAC;AAEvG,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,eAAe,CAErE;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,UAAU,CAAC"}