@gate-forge/core 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classifier/bind.d.ts +2 -0
- package/dist/classifier/bind.d.ts.map +1 -1
- package/dist/classifier/bind.js +8 -0
- package/dist/classifier/bind.js.map +1 -1
- package/dist/classifier/classify.d.ts +2 -0
- package/dist/classifier/classify.d.ts.map +1 -1
- package/dist/classifier/classify.js +127 -2
- package/dist/classifier/classify.js.map +1 -1
- package/dist/classifier/index.d.ts +2 -2
- package/dist/classifier/index.d.ts.map +1 -1
- package/dist/classifier/index.js +1 -1
- package/dist/classifier/index.js.map +1 -1
- package/dist/classifier/schema.d.ts +54 -0
- package/dist/classifier/schema.d.ts.map +1 -1
- package/dist/classifier/schema.js +17 -0
- package/dist/classifier/schema.js.map +1 -1
- package/dist/config/index.d.ts +186 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +327 -1
- package/dist/config/index.js.map +1 -1
- package/dist/graph/schema.d.ts +34 -0
- package/dist/graph/schema.d.ts.map +1 -1
- package/dist/index.d.ts +80 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +58 -6
- package/dist/index.js.map +1 -1
- package/dist/mapping/resolve.d.ts +32 -1
- package/dist/mapping/resolve.d.ts.map +1 -1
- package/dist/mapping/resolve.js +297 -65
- package/dist/mapping/resolve.js.map +1 -1
- package/dist/policy/evaluate.d.ts +30 -0
- package/dist/policy/evaluate.d.ts.map +1 -1
- package/dist/policy/evaluate.js +22 -12
- package/dist/policy/evaluate.js.map +1 -1
- package/dist/quarantine/index.d.ts +82 -0
- package/dist/quarantine/index.d.ts.map +1 -0
- package/dist/quarantine/index.js +194 -0
- package/dist/quarantine/index.js.map +1 -0
- package/dist/receipt/index.d.ts +65 -1
- package/dist/receipt/index.d.ts.map +1 -1
- package/dist/receipt/index.js +115 -1
- package/dist/receipt/index.js.map +1 -1
- package/dist/report/human-message.d.ts +33 -0
- package/dist/report/human-message.d.ts.map +1 -0
- package/dist/report/human-message.js +33 -0
- package/dist/report/human-message.js.map +1 -0
- package/dist/report/index.d.ts +183 -9
- package/dist/report/index.d.ts.map +1 -1
- package/dist/report/index.js +317 -23
- package/dist/report/index.js.map +1 -1
- package/dist/schemas/adoption.d.ts +2 -0
- package/dist/schemas/adoption.d.ts.map +1 -1
- package/dist/schemas/adoption.js +6 -0
- package/dist/schemas/adoption.js.map +1 -1
- package/dist/schemas/behavior-catalog.d.ts +12 -0
- package/dist/schemas/behavior-catalog.d.ts.map +1 -1
- package/dist/schemas/behavior-evidence.d.ts +40 -0
- package/dist/schemas/behavior-evidence.d.ts.map +1 -1
- package/dist/schemas/behavior-evidence.js +9 -0
- package/dist/schemas/behavior-evidence.js.map +1 -1
- package/dist/schemas/behavior-policy.d.ts +26 -0
- package/dist/schemas/behavior-policy.d.ts.map +1 -1
- package/dist/schemas/behavior-policy.js +37 -1
- package/dist/schemas/behavior-policy.js.map +1 -1
- package/dist/schemas/execution-result.d.ts +17 -5
- package/dist/schemas/execution-result.d.ts.map +1 -1
- package/dist/schemas/execution-result.js +57 -2
- package/dist/schemas/execution-result.js.map +1 -1
- package/dist/schemas/gate-receipt.d.ts +25 -2
- package/dist/schemas/gate-receipt.d.ts.map +1 -1
- package/dist/schemas/gate-receipt.js +181 -2
- package/dist/schemas/gate-receipt.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/policy.d.ts +19 -0
- package/dist/schemas/policy.d.ts.map +1 -1
- package/dist/schemas/policy.js +36 -0
- package/dist/schemas/policy.js.map +1 -1
- package/dist/schemas/quarantine.d.ts +25 -0
- package/dist/schemas/quarantine.d.ts.map +1 -0
- package/dist/schemas/quarantine.js +34 -0
- package/dist/schemas/quarantine.js.map +1 -0
- package/dist/schemas/queue-observer.d.ts +195 -0
- package/dist/schemas/queue-observer.d.ts.map +1 -0
- package/dist/schemas/queue-observer.js +190 -0
- package/dist/schemas/queue-observer.js.map +1 -0
- package/dist/schemas/run-record.d.ts +57 -0
- package/dist/schemas/run-record.d.ts.map +1 -0
- package/dist/schemas/run-record.js +108 -0
- package/dist/schemas/run-record.js.map +1 -0
- package/dist/schemas/runtime-config.d.ts +67 -0
- package/dist/schemas/runtime-config.d.ts.map +1 -1
- package/dist/schemas/runtime-config.js +75 -1
- package/dist/schemas/runtime-config.js.map +1 -1
- package/dist/schemas/signature-profile.d.ts +99 -0
- package/dist/schemas/signature-profile.d.ts.map +1 -0
- package/dist/schemas/signature-profile.js +197 -0
- package/dist/schemas/signature-profile.js.map +1 -0
- package/dist/schemas/test-map.d.ts +4 -0
- package/dist/schemas/test-map.d.ts.map +1 -1
- package/dist/schemas/test-map.js +12 -0
- package/dist/schemas/test-map.js.map +1 -1
- package/dist/schemas/verdict.d.ts +19 -4
- package/dist/schemas/verdict.d.ts.map +1 -1
- package/dist/schemas/verdict.js +42 -5
- package/dist/schemas/verdict.js.map +1 -1
- package/dist/strictness.d.ts +102 -0
- package/dist/strictness.d.ts.map +1 -0
- package/dist/strictness.js +92 -0
- package/dist/strictness.js.map +1 -0
- package/dist/supervision/index.js +6 -6
- package/dist/supervision/index.js.map +1 -1
- package/dist/twin-paths.d.ts +125 -0
- package/dist/twin-paths.d.ts.map +1 -0
- package/dist/twin-paths.js +233 -0
- package/dist/twin-paths.js.map +1 -0
- package/dist/verdict/behavior.d.ts.map +1 -1
- package/dist/verdict/behavior.js +284 -10
- package/dist/verdict/behavior.js.map +1 -1
- package/dist/verdict/cause.d.ts.map +1 -1
- package/dist/verdict/cause.js +18 -0
- package/dist/verdict/cause.js.map +1 -1
- package/dist/verdict/evaluate.d.ts +62 -0
- package/dist/verdict/evaluate.d.ts.map +1 -1
- package/dist/verdict/evaluate.js +300 -13
- package/dist/verdict/evaluate.js.map +1 -1
- package/dist/verdict/index.d.ts +3 -3
- package/dist/verdict/index.d.ts.map +1 -1
- package/dist/verdict/index.js +3 -3
- package/dist/verdict/index.js.map +1 -1
- package/dist/verdict/pack-verifiers.d.ts +17 -3
- package/dist/verdict/pack-verifiers.d.ts.map +1 -1
- package/dist/verdict/pack-verifiers.js +47 -8
- package/dist/verdict/pack-verifiers.js.map +1 -1
- package/dist/verdict/registry.d.ts +19 -0
- package/dist/verdict/registry.d.ts.map +1 -1
- package/dist/verdict/registry.js +21 -0
- package/dist/verdict/registry.js.map +1 -1
- package/package.json +1 -1
package/dist/schemas/verdict.js
CHANGED
|
@@ -33,10 +33,10 @@ export const UnresolvedReasonSchema = z
|
|
|
33
33
|
/**
|
|
34
34
|
* Stable cause codes for the shared report model (plan §5.4, ADR 0005).
|
|
35
35
|
* Blocking-obligation causes name WHY an obligation is not satisfied and
|
|
36
|
-
* select its next action
|
|
37
|
-
*
|
|
38
|
-
* obligation verdicts. The seven verdict
|
|
39
|
-
* enrich
|
|
36
|
+
* select its next action. `DIAGNOSTIC_*` codes advise on the separate
|
|
37
|
+
* diagnostic run; `TEST_MAP_OUT_OF_SYNC` advises on generated mappings.
|
|
38
|
+
* These report advisories are never obligation verdicts. The seven verdict
|
|
39
|
+
* VALUES are unchanged; causes enrich reports without weakening contracts.
|
|
40
40
|
*/
|
|
41
41
|
export const CauseCodeSchema = z.enum([
|
|
42
42
|
'TEST_INVENTORY_INCOMPLETE',
|
|
@@ -44,6 +44,7 @@ export const CauseCodeSchema = z.enum([
|
|
|
44
44
|
'TEST_MAPPING_MISSING',
|
|
45
45
|
'TEST_MAPPING_AMBIGUOUS',
|
|
46
46
|
'TEST_MAPPING_STALE',
|
|
47
|
+
'TEST_MAP_OUT_OF_SYNC',
|
|
47
48
|
'EVIDENCE_NOT_COLLECTED',
|
|
48
49
|
'VERIFIER_UNSUPPORTED',
|
|
49
50
|
'TEST_NOT_EXECUTED',
|
|
@@ -70,6 +71,20 @@ export const CauseCodeSchema = z.enum([
|
|
|
70
71
|
'ENFORCEMENT_BOUNDARY_UNVERIFIED',
|
|
71
72
|
'RUNTIME_PREPARATION_FAILED',
|
|
72
73
|
'RUNTIME_READINESS_FAILED',
|
|
74
|
+
'QUARANTINE_EXPIRED',
|
|
75
|
+
'MIGRATION_MISSING',
|
|
76
|
+
'MIGRATION_LINEAGE_BROKEN',
|
|
77
|
+
'MIGRATION_DOWNGRADE_NOOP',
|
|
78
|
+
'MIGRATION_DRIFT',
|
|
79
|
+
'MIGRATION_ROUNDTRIP_FAILED',
|
|
80
|
+
'MIGRATION_DATA_LOST',
|
|
81
|
+
'MIGRATION_CONFLICT',
|
|
82
|
+
'MIGRATION_SCRATCH_UNSAFE',
|
|
83
|
+
'ADAPTER_CANNOT_WITNESS',
|
|
84
|
+
'ADAPTER_VOLATILE_FIELD_SKIPPED',
|
|
85
|
+
'RESOURCE_SINGLETON_PER_TENANT',
|
|
86
|
+
'RESPONSE_FIELD_MISSING_FROM_MODEL',
|
|
87
|
+
'TWIN_PATH_DIVERGENT',
|
|
73
88
|
]);
|
|
74
89
|
/**
|
|
75
90
|
* The plan §5.4 next action per cause code. Text, JSON, and SARIF
|
|
@@ -83,6 +98,7 @@ export const CAUSE_NEXT_ACTIONS = Object.freeze({
|
|
|
83
98
|
'— that cannot satisfy the obligation.',
|
|
84
99
|
TEST_MAPPING_AMBIGUOUS: 'Correct the exact mapping',
|
|
85
100
|
TEST_MAPPING_STALE: 'Correct the exact mapping',
|
|
101
|
+
TEST_MAP_OUT_OF_SYNC: 'gateforge tests sync',
|
|
86
102
|
EVIDENCE_NOT_COLLECTED: 'Write an overlay test in `tests/e2e/gateforge/` using the Gateforge Playwright fixture ' +
|
|
87
103
|
'(`evidence.ui.*` + `persistence.verify`). Do not rewrite existing journeys. Mappings ' +
|
|
88
104
|
'(`tests mark`) are intent, not proof.',
|
|
@@ -91,7 +107,10 @@ export const CAUSE_NEXT_ACTIONS = Object.freeze({
|
|
|
91
107
|
TEST_FAILED: 'Run or repair the selected suite',
|
|
92
108
|
RUN_INCOMPLETE: 'Run or repair the selected suite',
|
|
93
109
|
EVIDENCE_STALE: 'Rerun for the exact candidate',
|
|
94
|
-
CHANGE_UNMAPPED: '
|
|
110
|
+
CHANGE_UNMAPPED: 'Attribute the change with `gateforge explain <file>` (it prints what the file is and what ' +
|
|
111
|
+
'governs it): map the detected resource, declare documentation folders with ' +
|
|
112
|
+
'`gateforge init --docs-exclude <folders>`, or add the detection that owns the file. ' +
|
|
113
|
+
'Do not weaken policy.',
|
|
95
114
|
EVIDENCE_SCOPE_INCOMPLETE: 'Map a test to the uncovered obligation (`gateforge tests mark`) or run full scope ' +
|
|
96
115
|
'(`test-gates --changed` without `--scope changed`)',
|
|
97
116
|
ENFORCEMENT_UNTRUSTED: 'Repair enforcement setup',
|
|
@@ -113,7 +132,25 @@ export const CAUSE_NEXT_ACTIONS = Object.freeze({
|
|
|
113
132
|
ENFORCEMENT_BOUNDARY_UNVERIFIED: 'Owner provisions/verifies runtime',
|
|
114
133
|
RUNTIME_PREPARATION_FAILED: 'Repair the tracked `runtime.prepare` command (its failure log is under run state `runtime/`) — ' +
|
|
115
134
|
'the candidate runtime must build or install before the gate can execute',
|
|
135
|
+
QUARANTINE_EXPIRED: 'Owner: renew or delete the expired quarantine (`gateforge quarantine <testKey> --owner --approver --reason --expires`); an expired quarantine blocks',
|
|
116
136
|
RUNTIME_READINESS_FAILED: 'Repair the tracked `runtime.services` command or readiness probe — the candidate ' +
|
|
117
137
|
'runtime must become ready before evidence is trusted',
|
|
138
|
+
MIGRATION_MISSING: 'Write an Alembic revision for the changed model, then run `gateforge check`',
|
|
139
|
+
MIGRATION_LINEAGE_BROKEN: 'Repair the migration chain so it has one head, unique revision ids, and existing parents, then run `gateforge check`',
|
|
140
|
+
MIGRATION_DOWNGRADE_NOOP: 'Implement downgrade() so the chain round-trips, or pin the revision in `alembic.irreversible`, then run `gateforge check`',
|
|
141
|
+
MIGRATION_DRIFT: 'Make `alembic check` clean against the models, then run `gateforge check`',
|
|
142
|
+
MIGRATION_ROUNDTRIP_FAILED: 'Fix the migration so upgrade, downgrade base, and upgrade head succeed on a disposable database, then run `gateforge check`',
|
|
143
|
+
MIGRATION_DATA_LOST: 'Preserve declared table rows across the upgrade, then run `gateforge check`',
|
|
144
|
+
MIGRATION_CONFLICT: 'Rebase onto the target head and merge the named revisions, then run `gateforge check`',
|
|
145
|
+
MIGRATION_SCRATCH_UNSAFE: 'Set `alembic.scratch.adminUrl` to a trusted disposable Postgres admin URL. The engine only creates and drops `gf_tmp_` databases',
|
|
146
|
+
ADAPTER_CANNOT_WITNESS: 'Give the adapter a complete paged collection read (or a natural key) so a create can be proven; until then the engine cannot witness that obligation',
|
|
147
|
+
ADAPTER_VOLATILE_FIELD_SKIPPED: 'Review the adapter: it declares this field server-computed, so the entered value was not echo-checked. Drop the declaration if the app should store what was entered',
|
|
148
|
+
RESOURCE_SINGLETON_PER_TENANT: 'Witness this create on a fresh tenant: the unique constraint admits one row per tenant, so ' +
|
|
149
|
+
"register the new tenant's login with the witness for THIS session only " +
|
|
150
|
+
'(POST /sessions/identity) and prove the create there',
|
|
151
|
+
RESPONSE_FIELD_MISSING_FROM_MODEL: 'The frontend reads a field the response model does not declare: restore the field on the ' +
|
|
152
|
+
'response model (or read the one it declares). A test that mocks the response proves nothing ' +
|
|
153
|
+
'about this read',
|
|
154
|
+
TWIN_PATH_DIVERGENT: 'Make the raw test and its witnessed twin send the same request: align the shared helper defaults, or map the pair with `twinOf`',
|
|
118
155
|
});
|
|
119
156
|
//# sourceMappingURL=verdict.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict.js","sourceRoot":"","sources":["../../src/schemas/verdict.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC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2H;IAC7H,eAAe,EAAE,2EAA2E;IAC5F,0BAA0B,EACxB,6HAA6H;IAC/H,mBAAmB,EAAE,6EAA6E;IAClG,kBAAkB,EAAE,uFAAuF;IAC3G,wBAAwB,EACtB,kIAAkI;IACpI,sBAAsB,EACpB,sJAAsJ;IACxJ,8BAA8B,EAC5B,sKAAsK;IACxK,6BAA6B,EAC3B,6FAA6F;QAC7F,yEAAyE;QACzE,sDAAsD;IACxD,iCAAiC,EAC/B,2FAA2F;QAC3F,8FAA8F;QAC9F,iBAAiB;IACnB,mBAAmB,EACjB,iIAAiI;CACpI,CAAC,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner-chosen gate strictness and the
|
|
3
|
+
* flaky-test quarantine model (Phase 2).
|
|
4
|
+
*
|
|
5
|
+
* `mode` is an OPTIONAL owner-owned config key. Its default is
|
|
6
|
+
* `strict`, which is exactly the behavior a repository without the key
|
|
7
|
+
* has today — the frozen contract. The owner may soften the GATE, never
|
|
8
|
+
* the evidence: `warn` still evaluates, counts and reports everything
|
|
9
|
+
* and only the exit code changes; `changed` blocks on debt this change
|
|
10
|
+
* touches while the full debt stays in the report.
|
|
11
|
+
*
|
|
12
|
+
* Pure and deterministic: every function here is total, side-effect
|
|
13
|
+
* free and free of wall-clock reads, so the decision is unit-testable
|
|
14
|
+
* and identical on every surface that asks for it.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
/**
|
|
18
|
+
* The three owner-selectable gate strictness levels.
|
|
19
|
+
*
|
|
20
|
+
* - `strict` — today's gate (also the default when the key is absent).
|
|
21
|
+
* - `changed` — block only for debt the evaluated change touches; the
|
|
22
|
+
* full debt is still reported.
|
|
23
|
+
* - `warn` — evaluate fully, report everything, exit 0.
|
|
24
|
+
*/
|
|
25
|
+
export declare const StrictnessModeSchema: z.ZodEnum<{
|
|
26
|
+
strict: "strict";
|
|
27
|
+
changed: "changed";
|
|
28
|
+
warn: "warn";
|
|
29
|
+
}>;
|
|
30
|
+
/** Inferred strictness-mode union. */
|
|
31
|
+
export type StrictnessMode = z.infer<typeof StrictnessModeSchema>;
|
|
32
|
+
/** The mode a repository without a `mode` key runs in (today's behavior). */
|
|
33
|
+
export declare const DEFAULT_STRICTNESS_MODE: StrictnessMode;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves the effective strictness mode of a config document.
|
|
36
|
+
*
|
|
37
|
+
* Args:
|
|
38
|
+
* config: the loaded config (the `mode` key is optional).
|
|
39
|
+
*
|
|
40
|
+
* Returns:
|
|
41
|
+
* StrictnessMode: the declared mode, or `strict` when absent.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveStrictnessMode(config: {
|
|
44
|
+
mode?: StrictnessMode | undefined;
|
|
45
|
+
}): StrictnessMode;
|
|
46
|
+
/**
|
|
47
|
+
* The debt a changed-scope decision can see: whether a diff was actually
|
|
48
|
+
* resolved, and how many blocking items it touches.
|
|
49
|
+
*/
|
|
50
|
+
export interface ChangedBlockingScope {
|
|
51
|
+
/** True when a diff provider produced the changed-file set. */
|
|
52
|
+
active: boolean;
|
|
53
|
+
/** Blocking verdicts + blocking entries attributable to the diff. */
|
|
54
|
+
blockingInScope: number;
|
|
55
|
+
}
|
|
56
|
+
/** One gate decision under the owner's chosen strictness. */
|
|
57
|
+
export interface StrictnessDecision {
|
|
58
|
+
/** The mode this decision was made under. */
|
|
59
|
+
mode: StrictnessMode;
|
|
60
|
+
/** What strict mode would have returned (the frozen exit-code meaning). */
|
|
61
|
+
strictExitCode: 0 | 1 | 2;
|
|
62
|
+
/** The exit code this process actually returns. */
|
|
63
|
+
exitCode: 0 | 1 | 2;
|
|
64
|
+
/** True when strict mode would have blocked (1) — honest under warn. */
|
|
65
|
+
wouldBlock: boolean;
|
|
66
|
+
/** Blocking items that still block under this mode. */
|
|
67
|
+
blockingInScope: number;
|
|
68
|
+
/** Total blocking items the strict decision saw. */
|
|
69
|
+
blockingTotal: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Maps a strict gate decision onto the owner's chosen strictness. Exit
|
|
73
|
+
* codes keep their meaning: 2 (config/usage) is NEVER softened, because
|
|
74
|
+
* a gate that cannot evaluate honestly has nothing to report; only the
|
|
75
|
+
* debt exit 1 is affected. `changed` fails closed when no diff could be
|
|
76
|
+
* resolved — you cannot narrow a gate to an unknown change.
|
|
77
|
+
*
|
|
78
|
+
* Args:
|
|
79
|
+
* input: mode, the strict decision, the total blocking count, and
|
|
80
|
+
* (for `changed`) the resolved diff scope.
|
|
81
|
+
*
|
|
82
|
+
* Returns:
|
|
83
|
+
* StrictnessDecision: the effective exit code plus what it hides.
|
|
84
|
+
*/
|
|
85
|
+
export declare function decideStrictness(input: {
|
|
86
|
+
mode: StrictnessMode;
|
|
87
|
+
strictExitCode: 0 | 1 | 2;
|
|
88
|
+
blockingTotal: number;
|
|
89
|
+
changed?: ChangedBlockingScope;
|
|
90
|
+
}): StrictnessDecision;
|
|
91
|
+
/**
|
|
92
|
+
* Renders the one-line strictness summary every text report shows, so a
|
|
93
|
+
* softened gate always announces itself: `mode: warn (would block: 3)`.
|
|
94
|
+
*
|
|
95
|
+
* Args:
|
|
96
|
+
* decision: the decision to render.
|
|
97
|
+
*
|
|
98
|
+
* Returns:
|
|
99
|
+
* string: the single-line summary.
|
|
100
|
+
*/
|
|
101
|
+
export declare function strictnessSummaryLine(decision: StrictnessDecision): string;
|
|
102
|
+
//# sourceMappingURL=strictness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strictness.d.ts","sourceRoot":"","sources":["../src/strictness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;;EAAwC,CAAC;AAE1E,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB,EAAE,cAAyB,CAAC;AAEhE;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,cAAc,GAAG,SAAS,CAAA;CAAE,GAAG,cAAc,CAEnG;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,IAAI,EAAE,cAAc,CAAC;IACrB,2EAA2E;IAC3E,cAAc,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,mDAAmD;IACnD,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,wEAAwE;IACxE,UAAU,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,GAAG,kBAAkB,CAoBrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,CAG1E"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner-chosen gate strictness and the
|
|
3
|
+
* flaky-test quarantine model (Phase 2).
|
|
4
|
+
*
|
|
5
|
+
* `mode` is an OPTIONAL owner-owned config key. Its default is
|
|
6
|
+
* `strict`, which is exactly the behavior a repository without the key
|
|
7
|
+
* has today — the frozen contract. The owner may soften the GATE, never
|
|
8
|
+
* the evidence: `warn` still evaluates, counts and reports everything
|
|
9
|
+
* and only the exit code changes; `changed` blocks on debt this change
|
|
10
|
+
* touches while the full debt stays in the report.
|
|
11
|
+
*
|
|
12
|
+
* Pure and deterministic: every function here is total, side-effect
|
|
13
|
+
* free and free of wall-clock reads, so the decision is unit-testable
|
|
14
|
+
* and identical on every surface that asks for it.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
/**
|
|
18
|
+
* The three owner-selectable gate strictness levels.
|
|
19
|
+
*
|
|
20
|
+
* - `strict` — today's gate (also the default when the key is absent).
|
|
21
|
+
* - `changed` — block only for debt the evaluated change touches; the
|
|
22
|
+
* full debt is still reported.
|
|
23
|
+
* - `warn` — evaluate fully, report everything, exit 0.
|
|
24
|
+
*/
|
|
25
|
+
export const StrictnessModeSchema = z.enum(['strict', 'changed', 'warn']);
|
|
26
|
+
/** The mode a repository without a `mode` key runs in (today's behavior). */
|
|
27
|
+
export const DEFAULT_STRICTNESS_MODE = 'strict';
|
|
28
|
+
/**
|
|
29
|
+
* Resolves the effective strictness mode of a config document.
|
|
30
|
+
*
|
|
31
|
+
* Args:
|
|
32
|
+
* config: the loaded config (the `mode` key is optional).
|
|
33
|
+
*
|
|
34
|
+
* Returns:
|
|
35
|
+
* StrictnessMode: the declared mode, or `strict` when absent.
|
|
36
|
+
*/
|
|
37
|
+
export function resolveStrictnessMode(config) {
|
|
38
|
+
return config.mode ?? DEFAULT_STRICTNESS_MODE;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Maps a strict gate decision onto the owner's chosen strictness. Exit
|
|
42
|
+
* codes keep their meaning: 2 (config/usage) is NEVER softened, because
|
|
43
|
+
* a gate that cannot evaluate honestly has nothing to report; only the
|
|
44
|
+
* debt exit 1 is affected. `changed` fails closed when no diff could be
|
|
45
|
+
* resolved — you cannot narrow a gate to an unknown change.
|
|
46
|
+
*
|
|
47
|
+
* Args:
|
|
48
|
+
* input: mode, the strict decision, the total blocking count, and
|
|
49
|
+
* (for `changed`) the resolved diff scope.
|
|
50
|
+
*
|
|
51
|
+
* Returns:
|
|
52
|
+
* StrictnessDecision: the effective exit code plus what it hides.
|
|
53
|
+
*/
|
|
54
|
+
export function decideStrictness(input) {
|
|
55
|
+
const total = Math.max(0, input.blockingTotal);
|
|
56
|
+
const base = {
|
|
57
|
+
mode: input.mode,
|
|
58
|
+
strictExitCode: input.strictExitCode,
|
|
59
|
+
wouldBlock: input.strictExitCode === 1,
|
|
60
|
+
blockingTotal: total,
|
|
61
|
+
};
|
|
62
|
+
if (input.strictExitCode !== 1) {
|
|
63
|
+
return { ...base, exitCode: input.strictExitCode, blockingInScope: total };
|
|
64
|
+
}
|
|
65
|
+
if (input.mode === 'warn') {
|
|
66
|
+
return { ...base, exitCode: 0, blockingInScope: 0 };
|
|
67
|
+
}
|
|
68
|
+
if (input.mode === 'changed') {
|
|
69
|
+
const inScope = input.changed?.active === true ? Math.max(0, input.changed.blockingInScope) : total;
|
|
70
|
+
if (inScope > 0)
|
|
71
|
+
return { ...base, exitCode: 1, blockingInScope: inScope };
|
|
72
|
+
if (input.changed?.active === true)
|
|
73
|
+
return { ...base, exitCode: 0, blockingInScope: 0 };
|
|
74
|
+
}
|
|
75
|
+
return { ...base, exitCode: 1, blockingInScope: total };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Renders the one-line strictness summary every text report shows, so a
|
|
79
|
+
* softened gate always announces itself: `mode: warn (would block: 3)`.
|
|
80
|
+
*
|
|
81
|
+
* Args:
|
|
82
|
+
* decision: the decision to render.
|
|
83
|
+
*
|
|
84
|
+
* Returns:
|
|
85
|
+
* string: the single-line summary.
|
|
86
|
+
*/
|
|
87
|
+
export function strictnessSummaryLine(decision) {
|
|
88
|
+
if (decision.strictExitCode !== 1)
|
|
89
|
+
return `mode: ${decision.mode}`;
|
|
90
|
+
return `mode: ${decision.mode} (would block: ${String(decision.blockingTotal)})`;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=strictness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strictness.js","sourceRoot":"","sources":["../src/strictness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAK1E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,uBAAuB,GAAmB,QAAQ,CAAC;AAEhE;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA6C;IACjF,OAAO,MAAM,CAAC,IAAI,IAAI,uBAAuB,CAAC;AAChD,CAAC;AA6BD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAKhC;IACC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG;QACX,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,UAAU,EAAE,KAAK,CAAC,cAAc,KAAK,CAAC;QACtC,aAAa,EAAE,KAAK;KACrB,CAAC;IACF,IAAI,KAAK,CAAC,cAAc,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;IAC7E,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;IACtD,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACpG,IAAI,OAAO,GAAG,CAAC;YAAE,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC;QAC3E,IAAI,KAAK,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;YAAE,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;IAC1F,CAAC;IACD,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AAC1D,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAA4B;IAChE,IAAI,QAAQ,CAAC,cAAc,KAAK,CAAC;QAAE,OAAO,SAAS,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnE,OAAO,SAAS,QAAQ,CAAC,IAAI,kBAAkB,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;AACnF,CAAC"}
|
|
@@ -89,7 +89,7 @@ export function superviseExecution(planned, envelope) {
|
|
|
89
89
|
findings.push({
|
|
90
90
|
cause: 'RUN_INCOMPLETE',
|
|
91
91
|
detail: `retry-assisted execution detected${envelope.retriesDetail !== undefined ? ` (${envelope.retriesDetail})` : ''} — ` +
|
|
92
|
-
'required retries are zero; only first-attempt outcomes prove behavior
|
|
92
|
+
'required retries are zero; only first-attempt outcomes prove behavior',
|
|
93
93
|
logicalKey: null,
|
|
94
94
|
});
|
|
95
95
|
}
|
|
@@ -116,7 +116,7 @@ export function superviseExecution(planned, envelope) {
|
|
|
116
116
|
if (!executedKeys.has(key)) {
|
|
117
117
|
findings.push({
|
|
118
118
|
cause: 'RUN_INCOMPLETE',
|
|
119
|
-
detail: `planned instance '${instance.logicalKey}' never executed — a
|
|
119
|
+
detail: `planned instance '${instance.logicalKey}' never executed — a selected case is missing, so the run blocks`,
|
|
120
120
|
logicalKey: instance.logicalKey,
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -141,14 +141,14 @@ export function superviseExecution(planned, envelope) {
|
|
|
141
141
|
findings.push({
|
|
142
142
|
cause: 'RUN_INCOMPLETE',
|
|
143
143
|
detail: `instance '${outcome.logicalKey}' executed on attempt ${String(outcome.attempt)} — ` +
|
|
144
|
-
'retry-assisted execution is prohibited (required retries are zero
|
|
144
|
+
'retry-assisted execution is prohibited (required retries are zero)',
|
|
145
145
|
logicalKey: outcome.logicalKey,
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
if (outcome.status === 'failed' && !outcome.expectedFailure) {
|
|
149
149
|
findings.push({
|
|
150
150
|
cause: 'TEST_FAILED',
|
|
151
|
-
detail: `instance '${outcome.logicalKey}' failed on attempt ${String(outcome.attempt)} — the whole run fails
|
|
151
|
+
detail: `instance '${outcome.logicalKey}' failed on attempt ${String(outcome.attempt)} — the whole run fails`,
|
|
152
152
|
logicalKey: outcome.logicalKey,
|
|
153
153
|
});
|
|
154
154
|
continue;
|
|
@@ -156,7 +156,7 @@ export function superviseExecution(planned, envelope) {
|
|
|
156
156
|
if (outcome.expectedFailure) {
|
|
157
157
|
findings.push({
|
|
158
158
|
cause: 'TEST_NOT_EXECUTED',
|
|
159
|
-
detail: `instance '${outcome.logicalKey}' is an expected failure — an expected-failure exemption never proves behavior
|
|
159
|
+
detail: `instance '${outcome.logicalKey}' is an expected failure — an expected-failure exemption never proves behavior`,
|
|
160
160
|
logicalKey: outcome.logicalKey,
|
|
161
161
|
});
|
|
162
162
|
continue;
|
|
@@ -174,7 +174,7 @@ export function superviseExecution(planned, envelope) {
|
|
|
174
174
|
findings.push({
|
|
175
175
|
cause: 'RUN_INCOMPLETE',
|
|
176
176
|
detail: envelope.fixtureOutcome === 'failed'
|
|
177
|
-
? 'the run did not end successfully: a setup, teardown, or runner-level error was observed — fixtures and teardown must pass too
|
|
177
|
+
? 'the run did not end successfully: a setup, teardown, or runner-level error was observed — fixtures and teardown must pass too'
|
|
178
178
|
: 'the run did not report a final fixture/teardown outcome (crash or lost reporter contact) — fail closed',
|
|
179
179
|
logicalKey: null,
|
|
180
180
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/supervision/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmIvD,8EAA8E;AAC9E,SAAS,WAAW,CAAC,OAAsB,EAAE,IAAY,EAAE,SAA4B;IACrF,OAAO,GAAG,OAAO,IAAI,GAAG,SAAS,IAAI,SAAS,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAwC,EACxC,QAAkC;IAElC,MAAM,QAAQ,GAAyB,EAAE,CAAC;IAE1C,qEAAqE;IACrE,8DAA8D;IAC9D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,QAAQ,CAAC,IAAI,CAAC;YACZ,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EACJ,oHAAoH;YACtH,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;IAED,oEAAoE;IACpE,oEAAoE;IACpE,8CAA8C;IAC9C,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;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EAAE,EAAE,CACP,cAAc,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;QAChD,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;QAC9B,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC/D,CAAC;IACJ,OAAO,eAAe,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/** One observed request, as the observation-only proxy saw it. */
|
|
2
|
+
export interface ObservedRequest {
|
|
3
|
+
/** Uppercase method (GET, POST, ...). */
|
|
4
|
+
method: string;
|
|
5
|
+
/** The request target: path plus query, exactly as it arrived. */
|
|
6
|
+
url: string;
|
|
7
|
+
}
|
|
8
|
+
/** The route inventory a shape resolves against (compiled endpoints). */
|
|
9
|
+
export interface RouteInventory {
|
|
10
|
+
/** Route templates in the engine's `{}` grammar, e.g. `/accounts/{}`. */
|
|
11
|
+
templates: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
/** Owner-declared query keys whose VALUES a shape may carry. */
|
|
14
|
+
export interface TwinShapeOptions {
|
|
15
|
+
/** The compiled http.endpoint templates, when the run has them. */
|
|
16
|
+
inventory?: RouteInventory;
|
|
17
|
+
/**
|
|
18
|
+
* Query keys whose values may be recorded (`enforcement.twinQueryKeys`).
|
|
19
|
+
* Absent or empty = keys only: the shape says `tab` was sent and
|
|
20
|
+
* nothing about what it said.
|
|
21
|
+
*/
|
|
22
|
+
queryKeys?: readonly string[];
|
|
23
|
+
}
|
|
24
|
+
/** One request shape: comparable, and free of anything identifying. */
|
|
25
|
+
export interface TwinShape {
|
|
26
|
+
/** Uppercase method. */
|
|
27
|
+
method: string;
|
|
28
|
+
/** The route template the request resolved to (never a concrete id). */
|
|
29
|
+
route: string;
|
|
30
|
+
/** Allowlisted query values, sorted by key. Absent = keys only. */
|
|
31
|
+
query?: Record<string, string>;
|
|
32
|
+
}
|
|
33
|
+
/** One twin's observed request shapes, with the test that produced them. */
|
|
34
|
+
export interface TwinObservation {
|
|
35
|
+
/** The logical key of the test that made these requests. */
|
|
36
|
+
logicalKey: string;
|
|
37
|
+
/** The shapes it exercised, in observation order. */
|
|
38
|
+
shapes: readonly TwinShape[];
|
|
39
|
+
}
|
|
40
|
+
/** One direction of a divergence between two twins. */
|
|
41
|
+
export interface TwinDivergence {
|
|
42
|
+
/** The twin that DID exercise the shape. */
|
|
43
|
+
presentIn: string;
|
|
44
|
+
/** The twin that never did. */
|
|
45
|
+
missingFrom: string;
|
|
46
|
+
/** The shape itself (method, route template, allowlisted values). */
|
|
47
|
+
shape: TwinShape;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Turns one observed request into its comparable shape.
|
|
51
|
+
*
|
|
52
|
+
* Args:
|
|
53
|
+
* request: the method and target the proxy observed.
|
|
54
|
+
* options: the run's route inventory and owner-declared query keys.
|
|
55
|
+
*
|
|
56
|
+
* Returns:
|
|
57
|
+
* TwinShape: method + route template + allowlisted query values.
|
|
58
|
+
*/
|
|
59
|
+
export declare function twinShapeOf(request: ObservedRequest, options?: TwinShapeOptions): TwinShape;
|
|
60
|
+
/**
|
|
61
|
+
* Compares two twins' shapes and returns both directions of the
|
|
62
|
+
* divergence: what the witnessed twin did that the raw twin never did,
|
|
63
|
+
* and what the raw twin did that the witnessed twin never did. A shape
|
|
64
|
+
* both exercised is not reported — twins that agree are the healthy
|
|
65
|
+
* case and must stay silent.
|
|
66
|
+
*
|
|
67
|
+
* Args:
|
|
68
|
+
* witnessed: the witnessed twin's shapes.
|
|
69
|
+
* raw: the raw twin's shapes.
|
|
70
|
+
*
|
|
71
|
+
* Returns:
|
|
72
|
+
* TwinDivergence[]: every one-sided shape, witnessed-side first,
|
|
73
|
+
* deterministic in shape identity.
|
|
74
|
+
*/
|
|
75
|
+
export declare function twinPathDivergence(witnessed: TwinObservation, raw: TwinObservation): TwinDivergence[];
|
|
76
|
+
/** The finding text a divergence produces, naming BOTH tests and the shape. */
|
|
77
|
+
export declare function twinDivergenceDetail(divergence: TwinDivergence): string;
|
|
78
|
+
/**
|
|
79
|
+
* The tag a title carries to declare itself the WITNESSED twin. It is
|
|
80
|
+
* part of the title convention, not a gate: the link is a naming
|
|
81
|
+
* convention an owner follows, and the engine only reads it when the
|
|
82
|
+
* owner switched twin coverage on.
|
|
83
|
+
*/
|
|
84
|
+
export declare const WITNESSED_TITLE_TAG = "[witnessed]";
|
|
85
|
+
/** The one catalog fact a twin link needs: which test, and its title. */
|
|
86
|
+
export interface TwinCandidate {
|
|
87
|
+
/** Stable logical key (the catalog's `logicalKey`). */
|
|
88
|
+
logicalKey: string;
|
|
89
|
+
/** The test's own title (the last segment of its title path). */
|
|
90
|
+
title: string;
|
|
91
|
+
}
|
|
92
|
+
/** One linked raw/witnessed pair, with the reason the link exists. */
|
|
93
|
+
export interface TwinLink {
|
|
94
|
+
/** The witnessed test: the one the run grades. */
|
|
95
|
+
witnessed: string;
|
|
96
|
+
/** The raw test it is the twin of. */
|
|
97
|
+
raw: string;
|
|
98
|
+
/** Which rule produced the link (for the run's own explanation). */
|
|
99
|
+
source: 'test-map' | 'title';
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Resolves the raw/witnessed pairs a run should compare.
|
|
103
|
+
*
|
|
104
|
+
* Two rules, in that order, and never a guess:
|
|
105
|
+
* - `twinOf`: the explicit test-map declaration — the only link that
|
|
106
|
+
* survives a rename of either test, because it names logical keys.
|
|
107
|
+
* - the title convention: a witnessed title that carries
|
|
108
|
+
* {@link WITNESSED_TITLE_TAG} links to the untagged title with the
|
|
109
|
+
* same stem: `X raw`, else the one `X raw: <description>`, else a
|
|
110
|
+
* bare `X`.
|
|
111
|
+
*
|
|
112
|
+
* A link is only returned when BOTH tests exist in the catalog: a
|
|
113
|
+
* dangling `twinOf` or a title with no partner names nothing, because
|
|
114
|
+
* a pair with one missing side has no shapes to compare and a finding
|
|
115
|
+
* about it would be a ghost.
|
|
116
|
+
*
|
|
117
|
+
* Args:
|
|
118
|
+
* candidates: every test the catalog knows (logical key + title).
|
|
119
|
+
* twinOf: explicit `witnessed -> raw` logical-key declarations.
|
|
120
|
+
*
|
|
121
|
+
* Returns:
|
|
122
|
+
* TwinLink[]: every resolvable pair, deterministic in witnessed key.
|
|
123
|
+
*/
|
|
124
|
+
export declare function twinLinksFor(candidates: readonly TwinCandidate[], twinOf?: Readonly<Record<string, string>>): TwinLink[];
|
|
125
|
+
//# sourceMappingURL=twin-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twin-paths.d.ts","sourceRoot":"","sources":["../src/twin-paths.ts"],"names":[],"mappings":"AA0BA,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED,uEAAuE;AACvE,MAAM,WAAW,SAAS;IACxB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9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