@tiphys/kernel 0.0.0 → 0.2.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/AGENTS.md +663 -0
- package/LICENSE +202 -0
- package/assurance-modes.yaml +299 -0
- package/checklists/clean-room.yaml +325 -0
- package/checklists/env-failure-diagnosis.yaml +68 -0
- package/checklists/flake-playbook.yaml +68 -0
- package/checklists/hazard-review.yaml +144 -0
- package/checklists/plan-review.yaml +103 -0
- package/dist/bin/tiphys.d.ts +2 -0
- package/dist/bin/tiphys.js +92 -0
- package/dist/src/adapters/load.d.ts +202 -0
- package/dist/src/adapters/load.js +440 -0
- package/dist/src/brief.d.ts +32 -0
- package/dist/src/brief.js +66 -0
- package/dist/src/checklists.d.ts +169 -0
- package/dist/src/checklists.js +310 -0
- package/dist/src/checks.d.ts +1539 -0
- package/dist/src/checks.js +5025 -0
- package/dist/src/cli.d.ts +9 -0
- package/dist/src/cli.js +68 -0
- package/dist/src/commands/brief.d.ts +92 -0
- package/dist/src/commands/brief.js +343 -0
- package/dist/src/commands/checklist.d.ts +42 -0
- package/dist/src/commands/checklist.js +168 -0
- package/dist/src/commands/cutover.d.ts +35 -0
- package/dist/src/commands/cutover.js +448 -0
- package/dist/src/commands/doctor.d.ts +264 -0
- package/dist/src/commands/doctor.js +1546 -0
- package/dist/src/commands/gates.d.ts +9 -0
- package/dist/src/commands/gates.js +360 -0
- package/dist/src/commands/init.d.ts +30 -0
- package/dist/src/commands/init.js +177 -0
- package/dist/src/commands/lock.d.ts +34 -0
- package/dist/src/commands/lock.js +340 -0
- package/dist/src/commands/mode.d.ts +40 -0
- package/dist/src/commands/mode.js +134 -0
- package/dist/src/commands/next.d.ts +130 -0
- package/dist/src/commands/next.js +597 -0
- package/dist/src/commands/plan.d.ts +20 -0
- package/dist/src/commands/plan.js +105 -0
- package/dist/src/commands/pool.d.ts +1 -0
- package/dist/src/commands/pool.js +139 -0
- package/dist/src/commands/resume.d.ts +1 -0
- package/dist/src/commands/resume.js +88 -0
- package/dist/src/commands/spawn.d.ts +1 -0
- package/dist/src/commands/spawn.js +195 -0
- package/dist/src/commands/status.d.ts +21 -0
- package/dist/src/commands/status.js +122 -0
- package/dist/src/commands/sync.d.ts +47 -0
- package/dist/src/commands/sync.js +341 -0
- package/dist/src/commands/teardown.d.ts +1 -0
- package/dist/src/commands/teardown.js +87 -0
- package/dist/src/commands/tuition.d.ts +21 -0
- package/dist/src/commands/tuition.js +218 -0
- package/dist/src/commands/validate.d.ts +78 -0
- package/dist/src/commands/validate.js +430 -0
- package/dist/src/commands/watch.d.ts +1 -0
- package/dist/src/commands/watch.js +172 -0
- package/dist/src/cutover.d.ts +584 -0
- package/dist/src/cutover.js +1444 -0
- package/dist/src/exclusion.d.ts +389 -0
- package/dist/src/exclusion.js +843 -0
- package/dist/src/exec/env.d.ts +278 -0
- package/dist/src/exec/env.js +334 -0
- package/dist/src/fleet.d.ts +223 -0
- package/dist/src/fleet.js +298 -0
- package/dist/src/gates/adapters/http-json.d.ts +5 -0
- package/dist/src/gates/adapters/http-json.js +283 -0
- package/dist/src/gates/adapters/migrations-command.d.ts +1 -0
- package/dist/src/gates/adapters/migrations-command.js +373 -0
- package/dist/src/gates/citations.d.ts +408 -0
- package/dist/src/gates/citations.js +1169 -0
- package/dist/src/gates/coverage.d.ts +375 -0
- package/dist/src/gates/coverage.js +836 -0
- package/dist/src/gates/credentials.d.ts +233 -0
- package/dist/src/gates/credentials.js +752 -0
- package/dist/src/gates/deploy.d.ts +1 -0
- package/dist/src/gates/deploy.js +33 -0
- package/dist/src/gates/gate-classes.d.ts +56 -0
- package/dist/src/gates/gate-classes.js +633 -0
- package/dist/src/gates/manifest.d.ts +99 -0
- package/dist/src/gates/manifest.js +208 -0
- package/dist/src/gates/merge-preconditions.d.ts +319 -0
- package/dist/src/gates/merge-preconditions.js +932 -0
- package/dist/src/gates/migrations.d.ts +1 -0
- package/dist/src/gates/migrations.js +36 -0
- package/dist/src/gates/pin.d.ts +114 -0
- package/dist/src/gates/pin.js +154 -0
- package/dist/src/gates/red-witness.d.ts +22 -0
- package/dist/src/gates/red-witness.js +482 -0
- package/dist/src/gates/release.d.ts +283 -0
- package/dist/src/gates/release.js +820 -0
- package/dist/src/gates/result.d.ts +116 -0
- package/dist/src/gates/result.js +91 -0
- package/dist/src/gates/run.d.ts +614 -0
- package/dist/src/gates/run.js +1614 -0
- package/dist/src/gates/schemas/citation-config.schema.json +59 -0
- package/dist/src/gates/schemas/coverage-config.schema.json +77 -0
- package/dist/src/gates/schemas/gate-manifest.schema.json +125 -0
- package/dist/src/gates/schemas/gate-result.schema.json +160 -0
- package/dist/src/gates/schemas/phase-declaration.schema.json +87 -0
- package/dist/src/gates/schemas/release-record.schema.json +119 -0
- package/dist/src/gates/schemas/verifier-config.schema.json +101 -0
- package/dist/src/gates/schemas/witness-spec.schema.json +110 -0
- package/dist/src/gates/scope.d.ts +131 -0
- package/dist/src/gates/scope.js +1018 -0
- package/dist/src/gates/suite.d.ts +217 -0
- package/dist/src/gates/suite.js +968 -0
- package/dist/src/gates/validate.d.ts +121 -0
- package/dist/src/gates/validate.js +414 -0
- package/dist/src/hooks.d.ts +84 -0
- package/dist/src/hooks.js +125 -0
- package/dist/src/index.d.ts +31 -0
- package/dist/src/index.js +30 -0
- package/dist/src/liveness.d.ts +321 -0
- package/dist/src/liveness.js +396 -0
- package/dist/src/lock.d.ts +256 -0
- package/dist/src/lock.js +792 -0
- package/dist/src/model-resolution.d.ts +159 -0
- package/dist/src/model-resolution.js +307 -0
- package/dist/src/modes.d.ts +149 -0
- package/dist/src/modes.js +258 -0
- package/dist/src/path-identity.d.ts +34 -0
- package/dist/src/path-identity.js +48 -0
- package/dist/src/plan.d.ts +73 -0
- package/dist/src/plan.js +153 -0
- package/dist/src/pool.d.ts +326 -0
- package/dist/src/pool.js +988 -0
- package/dist/src/roles.d.ts +461 -0
- package/dist/src/roles.js +776 -0
- package/dist/src/spawn.d.ts +482 -0
- package/dist/src/spawn.js +1003 -0
- package/dist/src/status.d.ts +116 -0
- package/dist/src/status.js +148 -0
- package/dist/src/task.d.ts +504 -0
- package/dist/src/task.js +307 -0
- package/dist/src/teardown.d.ts +39 -0
- package/dist/src/teardown.js +422 -0
- package/dist/src/tuition.d.ts +159 -0
- package/dist/src/tuition.js +311 -0
- package/dist/src/validate.d.ts +263 -0
- package/dist/src/validate.js +742 -0
- package/dist/src/version.d.ts +3 -0
- package/dist/src/version.js +38 -0
- package/dist/src/watcher.d.ts +275 -0
- package/dist/src/watcher.js +849 -0
- package/dist/src/witness/run.d.ts +299 -0
- package/dist/src/witness/run.js +1373 -0
- package/dist/src/witness/spec.d.ts +270 -0
- package/dist/src/witness/spec.js +475 -0
- package/dist/tsconfig.src.tsbuildinfo +1 -0
- package/gate-registry.yaml +526 -0
- package/gates.manifest.json +257 -0
- package/package.json +72 -3
- package/role-model-config.yaml +88 -0
- package/roles/README.md +128 -0
- package/roles/_shared-dispatch-contract.md +87 -0
- package/roles/adversarial-plan-reviewer.md +80 -0
- package/roles/clean-room-reviewer.md +140 -0
- package/roles/implementer.md +463 -0
- package/roles/investigator.md +138 -0
- package/roles/plan-writer.md +95 -0
- package/schemas/README.md +82 -0
- package/schemas/assurance-modes.schema.json +264 -0
- package/schemas/charter.schema.json +185 -0
- package/schemas/checklist.schema.json +114 -0
- package/schemas/cutover-state.schema.json +64 -0
- package/schemas/decision-record.schema.json +88 -0
- package/schemas/executor-record.schema.json +36 -0
- package/schemas/final-report.schema.json +90 -0
- package/schemas/finding.schema.json +106 -0
- package/schemas/gate-registry.schema.json +260 -0
- package/schemas/mechanism-index.schema.json +94 -0
- package/schemas/model-resolution.schema.json +362 -0
- package/schemas/plan.schema.json +300 -0
- package/schemas/report.schema.json +579 -0
- package/schemas/role-brief.schema.json +105 -0
- package/schemas/role-model-config.schema.json +90 -0
- package/schemas/status-line.schema.json +40 -0
- package/schemas/tuition.schema.json +191 -0
- package/schemas/verdict.schema.json +295 -0
- package/schemas/work-history.schema.json +183 -0
- package/schemas/write-bypass.schema.json +69 -0
- package/templates/charter.example.yaml +54 -0
- package/templates/decision-record.example.yaml +27 -0
- package/templates/final-report.example.yaml +80 -0
- package/templates/plan.example.yaml +87 -0
- package/templates/report.example.yaml +236 -0
- package/templates/warnings.md +74 -0
- package/templates/work-history.example.yaml +185 -0
- package/tuition/README.md +76 -0
- package/tuition/T-001.yaml +48 -0
- package/tuition/T-002.yaml +51 -0
- package/tuition/T-003.yaml +100 -0
- package/tuition/T-004.yaml +52 -0
- package/tuition/T-005.yaml +72 -0
- package/tuition/T-006.yaml +81 -0
- package/tuition/T-007.yaml +56 -0
- package/tuition/T-008.yaml +111 -0
- package/tuition/T-009.yaml +50 -0
- package/tuition/T-015.yaml +36 -0
- package/tuition/T-016.yaml +36 -0
- package/tuition/T-017.yaml +46 -0
- package/tuition/T-018.yaml +84 -0
- package/tuition/T-021.yaml +40 -0
- package/tuition/T-022.yaml +36 -0
- package/tuition/mechanism-index.yaml +256 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import type { GateStatus } from "./result.ts";
|
|
2
|
+
import type { SchemaDocument } from "./validate.ts";
|
|
3
|
+
/**
|
|
4
|
+
* THE RELEASE-VERIFICATION CONTRACT (kernel plan M2, M2-P7 step 3; DR-0014;
|
|
5
|
+
* delivery/verification/release-verification-interface.md).
|
|
6
|
+
*
|
|
7
|
+
* ONE post-merge verification contract with two registry entries (`deploy`
|
|
8
|
+
* and `migrations`). The kernel owns the SUBJECT, the CLOCK, the LOOP and
|
|
9
|
+
* the OUTCOME MAPPING; an adapter owns the platform mapping and nothing
|
|
10
|
+
* else. An adapter is an executable named by committed configuration,
|
|
11
|
+
* spawned as a subprocess with a request file path in argv, performing ONE
|
|
12
|
+
* bounded observation per invocation and writing its response to a
|
|
13
|
+
* kernel-supplied record path. It returns an OUTCOME, never a status path:
|
|
14
|
+
* JSON-pointer extraction exists only inside the http-json adapter's own
|
|
15
|
+
* configuration, and the kernel never learns what a statusPath is.
|
|
16
|
+
*
|
|
17
|
+
* WHY THE BOUNDARY IS A PROCESS (M2-D-07, investigation section 5): it
|
|
18
|
+
* works for any language, and it makes the per-attempt timeout ENFORCEABLE
|
|
19
|
+
* rather than promised. The kernel terminates an attempt that overruns
|
|
20
|
+
* (`spawnSync`'s `timeout` and `killSignal` options) and records that
|
|
21
|
+
* attempt as `error`, so an adapter that hangs cannot hang the kernel.
|
|
22
|
+
*
|
|
23
|
+
* C-2 EXEMPTION, STATED WHERE THE TERMINATION HAPPENS AND NOWHERE ELSE.
|
|
24
|
+
* C-2 forbids pid, process liveness, signals and /proc FOR IDENTITY OR
|
|
25
|
+
* EXCLUSION. The per-attempt termination above is neither: it is a timeout
|
|
26
|
+
* bound on a child this kernel itself spawned and still holds the handle
|
|
27
|
+
* of, it probes nothing, identifies nothing and excludes nothing, and no
|
|
28
|
+
* pid is ever read, recorded or compared. That is the one place any kill
|
|
29
|
+
* may appear in this module or its adapters, and it appears as a spawn
|
|
30
|
+
* option, not as a process.kill call.
|
|
31
|
+
*
|
|
32
|
+
* NO FAILURE VOCABULARY SHIPS (plan step 2, T-003 lesson 4). No
|
|
33
|
+
* non-success platform state was ever captured, so none is named anywhere
|
|
34
|
+
* in this module or its adapters. The safe rule instead: one satisfying
|
|
35
|
+
* value per configured adapter; every other observed value is recorded
|
|
36
|
+
* verbatim and treated as `pending` until the deadline, at which point it
|
|
37
|
+
* becomes red naming the last observed value. Unknown never becomes green.
|
|
38
|
+
*
|
|
39
|
+
* NEVER auto-background (C-3): the loop is a foreground await, every spawn
|
|
40
|
+
* is spawnSync, nothing is detached and nothing is unref'd.
|
|
41
|
+
*/
|
|
42
|
+
/** The one declaration path (design decision D-p7-1 in the work history). */
|
|
43
|
+
export declare const DECLARATION_PATH = "release-verification.json";
|
|
44
|
+
/** The contract versions this kernel accepts (fail-closed rule 6). */
|
|
45
|
+
export declare const ACCEPTED_CONTRACT_VERSIONS: readonly string[];
|
|
46
|
+
/**
|
|
47
|
+
* The subject: what the kernel knows for certain the moment a merge
|
|
48
|
+
* happens. Platform vocabulary (deployment id, workflow run id, migration
|
|
49
|
+
* set) is the adapter's, and the kernel never learns it.
|
|
50
|
+
*/
|
|
51
|
+
export interface ReleaseSubject {
|
|
52
|
+
repository: string;
|
|
53
|
+
integrationRef: string;
|
|
54
|
+
mergedSha: string;
|
|
55
|
+
mergedAt: string;
|
|
56
|
+
phaseId: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const SUBJECT_FIELDS: readonly (keyof ReleaseSubject)[];
|
|
59
|
+
/**
|
|
60
|
+
* The outcome vocabulary, six values. There is deliberately no `unknown`,
|
|
61
|
+
* no `skipped` and no `warn`: a soft state is where a false green hides
|
|
62
|
+
* (M2-C-3).
|
|
63
|
+
*/
|
|
64
|
+
export type VerificationOutcome = "satisfied" | "failed" | "pending" | "absent" | "not-applicable" | "error";
|
|
65
|
+
export declare const VERIFICATION_OUTCOMES: readonly VerificationOutcome[];
|
|
66
|
+
/**
|
|
67
|
+
* THE TOTAL MAPPING to GateResult status, implemented in exactly one place
|
|
68
|
+
* (plan step 3). `satisfied` is green with `units` 1 per verification
|
|
69
|
+
* satisfied (or the adapter's own examined count, D-p7-3). `pending` and
|
|
70
|
+
* `absent` are NEVER terminal: they are loop states, and the two entries
|
|
71
|
+
* below are reachable only through the deadline conversion in
|
|
72
|
+
* `runVerification`, which turns both into red with TEXTUALLY DISTINCT
|
|
73
|
+
* reasons: `deadline reached, last observed <value>` for pending and
|
|
74
|
+
* `deadline reached, no release object for subject` for absent. An adapter
|
|
75
|
+
* cannot make pending mean pass.
|
|
76
|
+
*/
|
|
77
|
+
export declare const OUTCOME_TO_STATUS: Readonly<Record<VerificationOutcome, GateStatus>>;
|
|
78
|
+
export declare const DEADLINE_REASON_ABSENT = "deadline reached, no release object for subject";
|
|
79
|
+
export declare function deadlineReasonPending(lastObserved: string): string;
|
|
80
|
+
/** The kernel's clock. No defaults anywhere: the numbers are the project's. */
|
|
81
|
+
export interface VerificationClock {
|
|
82
|
+
intervalMs: number;
|
|
83
|
+
deadlineMs: number;
|
|
84
|
+
attemptTimeoutMs: number;
|
|
85
|
+
maxAttempts?: number;
|
|
86
|
+
}
|
|
87
|
+
/** What the adapter wrote, after the seven rules accepted it. */
|
|
88
|
+
export interface AdapterResponse {
|
|
89
|
+
contractVersion: string;
|
|
90
|
+
adapter: string;
|
|
91
|
+
subject: ReleaseSubject;
|
|
92
|
+
outcome: VerificationOutcome;
|
|
93
|
+
resolved?: {
|
|
94
|
+
kind: string;
|
|
95
|
+
id: string;
|
|
96
|
+
createdAt?: unknown;
|
|
97
|
+
} & Record<string, unknown>;
|
|
98
|
+
observedAt: string;
|
|
99
|
+
observation?: {
|
|
100
|
+
raw?: unknown;
|
|
101
|
+
detail: string;
|
|
102
|
+
};
|
|
103
|
+
reason?: string;
|
|
104
|
+
units?: number;
|
|
105
|
+
precondition?: {
|
|
106
|
+
id: string;
|
|
107
|
+
evidence?: string[];
|
|
108
|
+
};
|
|
109
|
+
transport?: {
|
|
110
|
+
httpStatus?: number;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** One attempt's record: number, instant, outcome, identity, transport. */
|
|
114
|
+
export interface AttemptRecord {
|
|
115
|
+
attempt: number;
|
|
116
|
+
at: string;
|
|
117
|
+
outcome: VerificationOutcome | "invalid";
|
|
118
|
+
detail: string;
|
|
119
|
+
resolved?: unknown;
|
|
120
|
+
transport: {
|
|
121
|
+
exitCode: number | null;
|
|
122
|
+
signal: string | null;
|
|
123
|
+
terminatedByTimeout: boolean;
|
|
124
|
+
httpStatus?: number;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The older-than-the-merge observation (investigation guarantee 9,
|
|
128
|
+
* section 8 item 8): recorded, deliberately NOT promoted to an error
|
|
129
|
+
* until one real counter-example settles whether a platform reuses or
|
|
130
|
+
* backdates a record on redeploy.
|
|
131
|
+
*/
|
|
132
|
+
releaseObjectOlderThanMerge?: boolean;
|
|
133
|
+
}
|
|
134
|
+
export type VerificationVerdict = {
|
|
135
|
+
kind: "satisfied";
|
|
136
|
+
units: number;
|
|
137
|
+
detail: string;
|
|
138
|
+
resolved: unknown;
|
|
139
|
+
} | {
|
|
140
|
+
kind: "failed";
|
|
141
|
+
reason: string;
|
|
142
|
+
} | {
|
|
143
|
+
kind: "not-applicable";
|
|
144
|
+
declared: boolean;
|
|
145
|
+
reason: string;
|
|
146
|
+
preconditionId: string;
|
|
147
|
+
evidence: string[];
|
|
148
|
+
} | {
|
|
149
|
+
kind: "error";
|
|
150
|
+
reason: string;
|
|
151
|
+
} | {
|
|
152
|
+
kind: "deadline";
|
|
153
|
+
lastOutcome: "pending" | "absent";
|
|
154
|
+
reason: string;
|
|
155
|
+
};
|
|
156
|
+
export interface VerificationRun {
|
|
157
|
+
verdict: VerificationVerdict;
|
|
158
|
+
attempts: AttemptRecord[];
|
|
159
|
+
/** Paths relative to evidenceDir, in creation order. */
|
|
160
|
+
evidence: string[];
|
|
161
|
+
}
|
|
162
|
+
export declare function responseSchema(): SchemaDocument;
|
|
163
|
+
export declare function declarationSchema(): SchemaDocument;
|
|
164
|
+
/**
|
|
165
|
+
* THE SEVEN FAIL-CLOSED RULES on an adapter response (plan step 3), each
|
|
166
|
+
* corresponding to a way a verifier can be fooled. Rule 1 (exit 0 with no
|
|
167
|
+
* response written) is enforced by the caller, which owns the file's
|
|
168
|
+
* existence; rules 2 to 7 are here. The subject echo (rule 3) is checked
|
|
169
|
+
* field by field BEFORE the outcome is read, so an adapter that verified
|
|
170
|
+
* something else cannot have its outcome looked at for this subject.
|
|
171
|
+
*/
|
|
172
|
+
export type ResponseValidation = {
|
|
173
|
+
ok: true;
|
|
174
|
+
response: AdapterResponse;
|
|
175
|
+
} | {
|
|
176
|
+
ok: false;
|
|
177
|
+
rule: number;
|
|
178
|
+
reason: string;
|
|
179
|
+
};
|
|
180
|
+
export declare function validateAdapterResponse(body: string, subject: ReleaseSubject): ResponseValidation;
|
|
181
|
+
/**
|
|
182
|
+
* The encoded forms of a credential value the kernel can derive from the
|
|
183
|
+
* value alone (CR-P7H-3). Redacting only the verbatim bytes let a trivially
|
|
184
|
+
* reversible copy through: an adapter emitting the token as a standalone
|
|
185
|
+
* base64 blob (an HTTP Basic `Authorization: Basic <base64(token)>` of the
|
|
186
|
+
* token) leaked a recoverable secret into the stderr evidence. Each form here
|
|
187
|
+
* is a DETERMINISTIC, enumerable transform of the same value, so the set is
|
|
188
|
+
* bounded and cheap.
|
|
189
|
+
*
|
|
190
|
+
* WHAT THIS DOES NOT COVER, stated so a green is auditable rather than
|
|
191
|
+
* silently partial (never soften a work history): forms that fold in bytes
|
|
192
|
+
* the kernel does not hold, e.g. base64 of `"user:" + value` for a full Basic
|
|
193
|
+
* credential PAIR (the username is the project's, not the kernel's), or a
|
|
194
|
+
* value re-encoded by a transport the kernel never sees (gzip, hex, a second
|
|
195
|
+
* base64 round). Those are residue the reference adapters do not produce; a
|
|
196
|
+
* third-party adapter that composes a credential with unknown surrounding
|
|
197
|
+
* bytes owns that redaction, and the guarantee scoped here is the value and
|
|
198
|
+
* its own single-step base64 and percent encodings.
|
|
199
|
+
*/
|
|
200
|
+
export declare function secretForms(value: string): string[];
|
|
201
|
+
/**
|
|
202
|
+
* Replace every resolved credential VALUE, and its enumerable encoded forms
|
|
203
|
+
* (see secretForms), with a named placeholder, everywhere in the text.
|
|
204
|
+
*/
|
|
205
|
+
export declare function redactSecrets(text: string, secrets: readonly {
|
|
206
|
+
name: string;
|
|
207
|
+
value: string;
|
|
208
|
+
}[]): string;
|
|
209
|
+
export interface RunVerificationOptions {
|
|
210
|
+
verification: string;
|
|
211
|
+
subject: ReleaseSubject;
|
|
212
|
+
adapter: string[];
|
|
213
|
+
config: unknown;
|
|
214
|
+
clock: VerificationClock;
|
|
215
|
+
/** Absolute directory the attempt evidence is written into. */
|
|
216
|
+
evidenceDir: string;
|
|
217
|
+
/** Resolved credential values, for redaction only. Never written. */
|
|
218
|
+
secrets?: readonly {
|
|
219
|
+
name: string;
|
|
220
|
+
value: string;
|
|
221
|
+
}[];
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* THE KERNEL-OWNED LOOP. One bounded adapter observation per attempt, one
|
|
225
|
+
* record per attempt, foreground polling (C-3), verdict at the deadline.
|
|
226
|
+
* `pending` and `absent` loop; everything else is terminal, including every
|
|
227
|
+
* fail-closed violation (design decision D-p7-5: a broken adapter cannot
|
|
228
|
+
* reach a verdict, and M2-C-3 makes that `error` now, not red later).
|
|
229
|
+
*/
|
|
230
|
+
export declare function runVerification(options: RunVerificationOptions): Promise<VerificationRun>;
|
|
231
|
+
export interface DeclaredVerification {
|
|
232
|
+
mode: "none" | "adapter";
|
|
233
|
+
reason?: string;
|
|
234
|
+
adapter?: string[];
|
|
235
|
+
config?: unknown;
|
|
236
|
+
clock?: VerificationClock;
|
|
237
|
+
credentials?: string[];
|
|
238
|
+
}
|
|
239
|
+
export interface Declaration {
|
|
240
|
+
version: number;
|
|
241
|
+
repository: string;
|
|
242
|
+
integrationRef: string;
|
|
243
|
+
verifications: {
|
|
244
|
+
deploy?: DeclaredVerification;
|
|
245
|
+
migrations?: DeclaredVerification;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
export type DeclarationLoad = {
|
|
249
|
+
ok: true;
|
|
250
|
+
declaration: Declaration;
|
|
251
|
+
/** sha256 hex of the blob bytes read from the governing ref. */
|
|
252
|
+
sha256: string;
|
|
253
|
+
/** The resolved commit sha of the governing ref. */
|
|
254
|
+
ref: string;
|
|
255
|
+
refSha: string;
|
|
256
|
+
} | {
|
|
257
|
+
ok: false;
|
|
258
|
+
reason: string;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Read the declaration from a COMMITTED ref, never from the working tree
|
|
262
|
+
* (design decision D-p7-2; the anti-widening rule of plan step 7, same as
|
|
263
|
+
* the scope auditor's: a phase must not be able to switch off, inside its
|
|
264
|
+
* own branch, the check that would have caught it). The record carries the
|
|
265
|
+
* declaration blob's sha256 so a reviewer can see which text authorized
|
|
266
|
+
* whatever happened.
|
|
267
|
+
*/
|
|
268
|
+
export declare function loadDeclaration(ref: string, cwd: string): DeclarationLoad;
|
|
269
|
+
/**
|
|
270
|
+
* THE GATE ENTRY, shared by the two thin entry points. The manifest keeps
|
|
271
|
+
* two static entries exactly as section 1.4 declares them; this function is
|
|
272
|
+
* what each names. Returns the process exit code.
|
|
273
|
+
*
|
|
274
|
+
* The governing ref is `--base` when supplied (the anti-widening read),
|
|
275
|
+
* else HEAD: always a COMMITTED state, so the subject's mergedSha and
|
|
276
|
+
* mergedAt are the resolved commit's, and an uncommitted edit can neither
|
|
277
|
+
* enable, disable nor reconfigure a verification. R-032's blocking half:
|
|
278
|
+
* the verdict record this gate writes is keyed to that sha in its detail
|
|
279
|
+
* line, and the consumption contract is that THE NEXT DISPATCH REQUIRES A
|
|
280
|
+
* GREEN VERDICT RECORD FOR THE MERGED SHA; the enforcement is wired at M4
|
|
281
|
+
* with the pilot (M2-D-11), and M2 adds no dispatch block to spawn.
|
|
282
|
+
*/
|
|
283
|
+
export declare function runReleaseGate(name: "deploy" | "migrations", args: string[]): Promise<number>;
|