@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,233 @@
|
|
|
1
|
+
import type { GateStatus } from "./result.ts";
|
|
2
|
+
/** What one source probe concluded. */
|
|
3
|
+
export interface SourceProbe {
|
|
4
|
+
/** The credential source's stable name. */
|
|
5
|
+
source: string;
|
|
6
|
+
outcome: "clean" | "resolvable" | "error";
|
|
7
|
+
detail: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* THIS VOCABULARY IS NOW READ BY THE KERNEL AS WELL AS BY THIS GATE
|
|
11
|
+
* (M4-P8 step 4, and this comment IS the record that step requires).
|
|
12
|
+
*
|
|
13
|
+
* `src/exec/env.ts` imports `GH_TOKEN_VARIABLES` and `isDangerousEnvName`
|
|
14
|
+
* from here to refuse a per-invocation allowlist extension naming one of
|
|
15
|
+
* them. The plan offered two shapes, move the vocabulary to a third module
|
|
16
|
+
* or export it from here, and the choice taken is EXPORT FROM HERE: the
|
|
17
|
+
* walk above, the per-name sources below and the constants stay in one
|
|
18
|
+
* file, so a future editor extending the vocabulary cannot extend it
|
|
19
|
+
* somewhere the other reader does not see. What is forbidden is a second
|
|
20
|
+
* copy: two lists drift, and they drift silently toward the permissive
|
|
21
|
+
* side.
|
|
22
|
+
*
|
|
23
|
+
* NOTHING ABOUT WHAT EITHER GATE DECIDES CHANGES WITH THAT IMPORT. The
|
|
24
|
+
* constants, the pattern and `isDangerousEnvName` are byte-identical to
|
|
25
|
+
* their M2-P8 form; the only difference is that a second module now reads
|
|
26
|
+
* them.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* gh's documented token vocabulary (see the module comment for the walk).
|
|
30
|
+
* Never permitted in a child environment, allowlisted or not.
|
|
31
|
+
*/
|
|
32
|
+
export declare const GH_TOKEN_VARIABLES: readonly string[];
|
|
33
|
+
/**
|
|
34
|
+
* The credential- or code-execution-capable environment vocabulary of the
|
|
35
|
+
* programs a scrubbed child runs, walked from each program's own
|
|
36
|
+
* documentation. A child environment must contain NONE of these,
|
|
37
|
+
* allowlisted or not; the environment probe reddens if any is present.
|
|
38
|
+
* This is a BOUNDED denylist (it cannot list every dangerous name any
|
|
39
|
+
* program will ever read); the allowlist in src/exec/env.ts remains the
|
|
40
|
+
* real defense. Per-name source:
|
|
41
|
+
*
|
|
42
|
+
* git (git-config(1), git(1)):
|
|
43
|
+
* GIT_ASKPASS - program git runs to obtain a password.
|
|
44
|
+
* GIT_SSH_COMMAND - shell command git uses for its ssh transport.
|
|
45
|
+
* GIT_PROXY_COMMAND - external program for git:// connections.
|
|
46
|
+
* GIT_CONFIG_COUNT - trigger of the environment config-injection
|
|
47
|
+
* family; with GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n
|
|
48
|
+
* it injects arbitrary config (e.g. a
|
|
49
|
+
* credential.helper) at a scope --global/--system
|
|
50
|
+
* cannot see. The numbered KEY_n / VALUE_n members
|
|
51
|
+
* are matched by isDangerousEnvName's pattern.
|
|
52
|
+
* ssh (ssh(1), ssh-add(1)):
|
|
53
|
+
* SSH_ASKPASS - program ssh runs to obtain a passphrase.
|
|
54
|
+
* SSH_AUTH_SOCK - the agent socket. ADDED BY THE DR-0047 SWEEP FIX
|
|
55
|
+
* ROUND, and the basis is stated here rather than
|
|
56
|
+
* implied because HALF OF IT IS UNVERIFIED. What was
|
|
57
|
+
* MEASURED in this container: the name sat in neither
|
|
58
|
+
* walked vocabulary, so the audited route ACCEPTED it
|
|
59
|
+
* (clean-room-final-credential-criteria CR-F-CRED-004),
|
|
60
|
+
* and buildChildEnv's default child does not carry it,
|
|
61
|
+
* so refusing an extension that names it withdraws
|
|
62
|
+
* nothing the default grants. What could NOT be
|
|
63
|
+
* verified here: this container has no ssh binary and
|
|
64
|
+
* no man page (`ssh -V` -> command not found, `man 1
|
|
65
|
+
* ssh` -> nothing), so the claim that ssh(1)'s own
|
|
66
|
+
* ENVIRONMENT section documents it was NOT read from
|
|
67
|
+
* the page. The row therefore rests on capability
|
|
68
|
+
* reasoning, not on the walk: the socket is a SIGNING
|
|
69
|
+
* channel (any holder can authenticate as the owner to
|
|
70
|
+
* any host the agent holds a key for), which is
|
|
71
|
+
* strictly stronger than SSH_ASKPASS, a passphrase
|
|
72
|
+
* PROMPT, which the same row already refuses. A later
|
|
73
|
+
* round with the page should either confirm this row
|
|
74
|
+
* from ssh(1) or move it and say why.
|
|
75
|
+
* node / dynamic loader / shell startup (node(1), ld.so(8), bash(1)):
|
|
76
|
+
* NODE_OPTIONS - options node applies at startup (can require
|
|
77
|
+
* arbitrary modules), arbitrary code execution.
|
|
78
|
+
* NODE_EXTRA_CA_CERTS- extra CAs node trusts, a TLS-trust channel.
|
|
79
|
+
* LD_PRELOAD - shared objects the loader injects into every
|
|
80
|
+
* dynamically linked program, arbitrary code.
|
|
81
|
+
* BASH_ENV - script bash sources at non-interactive startup.
|
|
82
|
+
* ENV - script the POSIX shell sources at startup.
|
|
83
|
+
*
|
|
84
|
+
* GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM are DELIBERATELY absent: they are
|
|
85
|
+
* redirected (CREDENTIAL_STORE_REDIRECTIONS) to empty harness-owned targets
|
|
86
|
+
* and the override runs last in buildChildEnv, so their mere presence is
|
|
87
|
+
* expected and neutralized; flagging them would false-positive on every
|
|
88
|
+
* real run.
|
|
89
|
+
*/
|
|
90
|
+
export declare const DANGEROUS_ENV_VOCABULARY: readonly string[];
|
|
91
|
+
/**
|
|
92
|
+
* THE EGRESS VOCABULARY (M4-P29, and this comment is the record of why it
|
|
93
|
+
* exists as a SEPARATE list rather than as more rows of the one above).
|
|
94
|
+
*
|
|
95
|
+
* WHAT WAS MEASURED. delivery/verification/m4-prototype-probes.md:46
|
|
96
|
+
* recorded that this gate's verdict is INVERTED with respect to real
|
|
97
|
+
* capability: it reddens `GIT_CONFIG_*`, which in that container bought
|
|
98
|
+
* only URL rewriting, and it greens `HTTPS_PROXY`, which bought full
|
|
99
|
+
* GitHub reach. M4-P8 then measured the same thing from the other side,
|
|
100
|
+
* four arms through `spawnTask` differing only in the allowlist extension
|
|
101
|
+
* (delivery/work-history/m4-p8.md:116): arm A, ten variables, HTTP 403
|
|
102
|
+
* from `api.github.com/user`; arm B, the same ten plus `HTTPS_PROXY`,
|
|
103
|
+
* HTTP 200. One variable, and it is the one nothing in this module knew
|
|
104
|
+
* about. A gate that cannot go red for the case that matters is the shape
|
|
105
|
+
* this repository keeps paying for.
|
|
106
|
+
*
|
|
107
|
+
* WHAT THIS FIXES AND WHAT IT DOES NOT, stated here rather than left to be
|
|
108
|
+
* discovered. It closes the case where the DEFAULT allowlist in
|
|
109
|
+
* src/exec/env.ts gains an egress name: this tripwire is
|
|
110
|
+
* allowlist-INDEPENDENT, exactly like the two above it, so the widening
|
|
111
|
+
* costs a red instead of buying a green. It does NOT close the case
|
|
112
|
+
* M4-P8's arm B actually used, which is a PER-INVOCATION
|
|
113
|
+
* `extraAllowlist`: that argument is runtime data of one spawn, this gate
|
|
114
|
+
* probes the constructed default child, and no probe of a default can see
|
|
115
|
+
* an argument a caller has not passed yet. Closing that half means
|
|
116
|
+
* auditing the extension record a task writes, which is a different gate
|
|
117
|
+
* and a different phase.
|
|
118
|
+
*
|
|
119
|
+
* WHY A SEPARATE LIST, AND WHAT DR-0048 CHANGED ABOUT ITS CONSEQUENCE.
|
|
120
|
+
* M4-P29 kept these names out of `DANGEROUS_ENV_VOCABULARY` so that a data
|
|
121
|
+
* edit in this file would not, as a side effect, refuse M4-P8's audited
|
|
122
|
+
* extension in a module that phase did not touch. It named the underlying
|
|
123
|
+
* question (whether an egress name may ever be extended) as a kernel design
|
|
124
|
+
* question with an owner-facing cost, and routed it onward rather than
|
|
125
|
+
* taking it by accident.
|
|
126
|
+
*
|
|
127
|
+
* DR-0048 answered that question: the audited route REFUSES egress names.
|
|
128
|
+
* The two lists still stay separate, because they are walked from different
|
|
129
|
+
* programs' documentation and their per-name evidence is different, and
|
|
130
|
+
* `isDangerousEnvName` is still byte-for-byte what it was. What changed is
|
|
131
|
+
* that the refusal in src/exec/env.ts no longer walks a HAND-PICKED PAIR of
|
|
132
|
+
* vocabularies: it walks `REFUSED_CHILD_ENV_VOCABULARIES` below, which is
|
|
133
|
+
* the declared list of every vocabulary in this module, this one included.
|
|
134
|
+
*
|
|
135
|
+
* THE WALK, per name, from the consuming programs' own documentation
|
|
136
|
+
* (curl(1) "ENVIRONMENT", git(1) "http_proxy", wget(1) "ENVIRONMENT"):
|
|
137
|
+
* each of these names a proxy a child's HTTP client will route through,
|
|
138
|
+
* in both the upper-case and lower-case spellings those pages document.
|
|
139
|
+
*
|
|
140
|
+
* HTTP_PROXY / http_proxy - proxy for http:// requests.
|
|
141
|
+
* HTTPS_PROXY / https_proxy - proxy for https:// requests. THE MEASURED
|
|
142
|
+
* NAME: arm A 403 against arm B 200.
|
|
143
|
+
* ALL_PROXY / all_proxy - proxy for every scheme.
|
|
144
|
+
* FTP_PROXY / ftp_proxy - proxy for ftp:// requests.
|
|
145
|
+
*
|
|
146
|
+
* TWO NAMES ARE DELIBERATELY ABSENT, and both absences are measured rather
|
|
147
|
+
* than assumed. `NO_PROXY` / `no_proxy` NARROW reach instead of granting
|
|
148
|
+
* it, so listing them would redden a child that is strictly less capable.
|
|
149
|
+
* `CURL_CA_BUNDLE` is a TLS-trust channel and not an egress grant: M4-P8's
|
|
150
|
+
* arm C added it on top of arm B and measured the same HTTP 200 arm B
|
|
151
|
+
* already had (delivery/work-history/m4-p8.md:117), so it buys no reach,
|
|
152
|
+
* and its node-side sibling `NODE_EXTRA_CA_CERTS` is already covered by
|
|
153
|
+
* `DANGEROUS_ENV_VOCABULARY` above.
|
|
154
|
+
*
|
|
155
|
+
* LIKE THE LIST ABOVE THIS IS A BOUNDED DENYLIST. The allowlist in
|
|
156
|
+
* src/exec/env.ts is still the real defense; this makes a widening cost a
|
|
157
|
+
* red for the names walked here, it does not enumerate every way a child
|
|
158
|
+
* could be handed network reach.
|
|
159
|
+
*/
|
|
160
|
+
export declare const EGRESS_ENV_VOCABULARY: readonly string[];
|
|
161
|
+
/** Whether a variable name is in the walked egress vocabulary. */
|
|
162
|
+
export declare function isEgressEnvName(name: string): boolean;
|
|
163
|
+
/** Whether a variable name is in the walked dangerous vocabulary. */
|
|
164
|
+
export declare function isDangerousEnvName(name: string): boolean;
|
|
165
|
+
/** One walked vocabulary, as a refusal walks it. */
|
|
166
|
+
export interface RefusedEnvVocabulary {
|
|
167
|
+
/** Stable id, used in tests and in nothing an operator reads. */
|
|
168
|
+
id: string;
|
|
169
|
+
/** The exported constant this row stands for, named for the drift test. */
|
|
170
|
+
constantName: string;
|
|
171
|
+
/** Whether this vocabulary claims the name. */
|
|
172
|
+
includes: (name: string) => boolean;
|
|
173
|
+
/**
|
|
174
|
+
* The middle of the refusal sentence: "the allowlist extension entry X "
|
|
175
|
+
* + this + " and may never cross into a child environment".
|
|
176
|
+
*/
|
|
177
|
+
clause: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* EVERY VOCABULARY A CHILD-ENVIRONMENT REFUSAL MUST WALK, IN ONE PLACE.
|
|
181
|
+
*
|
|
182
|
+
* THE MECHANISM THIS EXISTS AGAINST (CH-001 high, CR-F-CRED-003, CR-F-CRED-004;
|
|
183
|
+
* DR-0048): a refusal that walks ONE vocabulary, or a hand-picked subset of
|
|
184
|
+
* them, while several exist. `refuseExtraAllowlist` (src/exec/env.ts) named
|
|
185
|
+
* `GH_TOKEN_VARIABLES` and `isDangerousEnvName` as two literal `if` arms and
|
|
186
|
+
* therefore could not see `EGRESS_ENV_VOCABULARY`, which this module had held
|
|
187
|
+
* since M4-P29. The defect is not that the third name was forgotten once; it
|
|
188
|
+
* is that ADDING a vocabulary to this module left every consumer's coverage
|
|
189
|
+
* unchanged and silent, so the subset could only be discovered by probing a
|
|
190
|
+
* name.
|
|
191
|
+
*
|
|
192
|
+
* So the list of vocabularies is data, exported from the module that owns
|
|
193
|
+
* them, and a consumer walks the LIST rather than naming members of it. A
|
|
194
|
+
* fourth vocabulary added below is walked by every consumer of this array the
|
|
195
|
+
* moment it gains a row here, and `test/payload-credentials.test.ts` reddens
|
|
196
|
+
* if a `*_VOCABULARY` or `*_VARIABLES` export of this module has NO row,
|
|
197
|
+
* which is the case a reader cannot see by reading either file alone.
|
|
198
|
+
*
|
|
199
|
+
* `probeCredentialSources` deliberately does NOT walk this array: it reports a
|
|
200
|
+
* different sentence per vocabulary in one fixed order, strongest first, and the three
|
|
201
|
+
* sentences are read by operators. It is covered by the same drift test from
|
|
202
|
+
* the other side.
|
|
203
|
+
*/
|
|
204
|
+
export declare const REFUSED_CHILD_ENV_VOCABULARIES: readonly RefusedEnvVocabulary[];
|
|
205
|
+
/**
|
|
206
|
+
* The first vocabulary claiming `name`, or undefined. The ORDER of
|
|
207
|
+
* `REFUSED_CHILD_ENV_VOCABULARIES` is the order the refusal reports, and it
|
|
208
|
+
* is narrowest-first so that a name in two vocabularies is reported as the
|
|
209
|
+
* more specific one.
|
|
210
|
+
*/
|
|
211
|
+
export declare function refusedEnvVocabulary(name: string): RefusedEnvVocabulary | undefined;
|
|
212
|
+
/** The names credential-scrub probes, in probe order. */
|
|
213
|
+
export declare const CREDENTIAL_SOURCES: readonly string[];
|
|
214
|
+
export interface ProbeOptions {
|
|
215
|
+
/**
|
|
216
|
+
* The variable names the environment source accepts. Defaults to the
|
|
217
|
+
* constructed contract (allowlist plus redirections). Passed explicitly
|
|
218
|
+
* by tests staging dangerous states.
|
|
219
|
+
*/
|
|
220
|
+
permittedNames?: ReadonlySet<string>;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Probe every credential source FROM INSIDE the given child environment.
|
|
224
|
+
* The environment is the one under test: every subprocess probe below runs
|
|
225
|
+
* with `env` as its entire environment, so what is asserted is what a
|
|
226
|
+
* child launched with this environment could actually resolve.
|
|
227
|
+
*/
|
|
228
|
+
export declare function probeCredentialSources(env: Record<string, string | undefined>, options?: ProbeOptions): SourceProbe[];
|
|
229
|
+
/** Fold probes into a gate verdict. Any error wins over any red. */
|
|
230
|
+
export declare function verdictFromProbes(probes: SourceProbe[]): {
|
|
231
|
+
status: GateStatus;
|
|
232
|
+
detail: string;
|
|
233
|
+
};
|