@cat-factory/kernel 0.328.0 → 0.330.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/domain/environment-reachability.logic.d.ts +122 -35
- package/dist/domain/environment-reachability.logic.d.ts.map +1 -1
- package/dist/domain/environment-reachability.logic.js +246 -61
- package/dist/domain/environment-reachability.logic.js.map +1 -1
- package/dist/domain/monorepo-adoption.logic.d.ts +87 -0
- package/dist/domain/monorepo-adoption.logic.d.ts.map +1 -0
- package/dist/domain/monorepo-adoption.logic.js +323 -0
- package/dist/domain/monorepo-adoption.logic.js.map +1 -0
- package/dist/domain/pr-report.d.ts +27 -3
- package/dist/domain/pr-report.d.ts.map +1 -1
- package/dist/domain/pr-report.js +28 -10
- package/dist/domain/pr-report.js.map +1 -1
- package/dist/domain/service-registration.d.ts +11 -3
- package/dist/domain/service-registration.d.ts.map +1 -1
- package/dist/domain/service-registration.js +9 -1
- package/dist/domain/service-registration.js.map +1 -1
- package/dist/domain/types.d.ts +1 -1
- package/dist/domain/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/ports/agent-runs.d.ts +4 -1
- package/dist/ports/agent-runs.d.ts.map +1 -1
- package/dist/ports/bootstrap-repositories.d.ts +49 -2
- package/dist/ports/bootstrap-repositories.d.ts.map +1 -1
- package/dist/ports/bootstrap-runner.d.ts +15 -8
- package/dist/ports/bootstrap-runner.d.ts.map +1 -1
- package/dist/ports/bootstrap-runner.js.map +1 -1
- package/dist/ports/environment-investigation.d.ts +6 -6
- package/dist/ports/environment-investigation.d.ts.map +1 -1
- package/dist/ports/environment-provider.d.ts +9 -3
- package/dist/ports/environment-provider.d.ts.map +1 -1
- package/dist/ports/host-resolver.d.ts +59 -0
- package/dist/ports/host-resolver.d.ts.map +1 -0
- package/dist/ports/host-resolver.js +2 -0
- package/dist/ports/host-resolver.js.map +1 -0
- package/dist/ports/index.d.ts +4 -2
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js.map +1 -1
- package/dist/ports/monorepo-adoption.d.ts +37 -0
- package/dist/ports/monorepo-adoption.d.ts.map +1 -0
- package/dist/ports/monorepo-adoption.js +2 -0
- package/dist/ports/monorepo-adoption.js.map +1 -0
- package/dist/ports/repo-bootstrapper.d.ts +89 -3
- package/dist/ports/repo-bootstrapper.d.ts.map +1 -1
- package/dist/ports/repo-files.d.ts +16 -0
- package/dist/ports/repo-files.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Proving that a `ready` environment can be reached: what to try, in what order,
|
|
2
|
-
// answers add up to.
|
|
1
|
+
// Proving that a `ready` environment can be reached: what to look up, what to try, in what order,
|
|
2
|
+
// and what the answers add up to.
|
|
3
3
|
//
|
|
4
4
|
// The rule lives here rather than in the provisioning service because two layers act on the
|
|
5
5
|
// result and neither may re-derive it: the DEPLOYER settles a frame on the verdict, and the
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// `deploy-health` gate that would have probed the environment handle, on the grounds that the
|
|
12
12
|
// deployer owns provisioning through to a terminal verdict, and this is that verdict getting one
|
|
13
13
|
// more fact behind it.
|
|
14
|
-
import { environmentUnreachableReasonSchema } from '@cat-factory/contracts';
|
|
14
|
+
import { environmentUnreachableReasonSchema, statedRouteTarget } from '@cat-factory/contracts';
|
|
15
15
|
import { isBridgeableAddress } from '../shared/environment-host-bridge.logic.js';
|
|
16
16
|
/** How much of a probe's own error message is kept on the attempt it explains. */
|
|
17
17
|
const MAX_PROBE_DETAIL_CHARS = 200;
|
|
@@ -27,68 +27,221 @@ export const ROUTE_PROBE_TIMEOUT_MS = 4000;
|
|
|
27
27
|
* 162ms, so the ceiling is well under a second of ordinary cost.
|
|
28
28
|
*/
|
|
29
29
|
export const MAX_PROBED_ADDRESSES = 4;
|
|
30
|
+
/**
|
|
31
|
+
* How long one stated NAME gets to resolve before the lookup counts as one the platform could not
|
|
32
|
+
* complete.
|
|
33
|
+
*
|
|
34
|
+
* Much tighter than {@link ROUTE_PROBE_TIMEOUT_MS}, because the two wait on different things: a
|
|
35
|
+
* connect legitimately hangs against a route that does not carry, which is the finding, whereas a
|
|
36
|
+
* resolver that has not answered in two seconds is not about to.
|
|
37
|
+
*/
|
|
38
|
+
export const HOST_RESOLVE_TIMEOUT_MS = 2000;
|
|
39
|
+
/**
|
|
40
|
+
* How many stated NAMES a proof will look up.
|
|
41
|
+
*
|
|
42
|
+
* Its own bound rather than a share of {@link MAX_PROBED_ADDRESSES}, because they cap different
|
|
43
|
+
* costs: that one caps sockets opened, this one caps lookups made, and one name can expand into
|
|
44
|
+
* several addresses so neither implies the other. The same four, sized for the same shape (an
|
|
45
|
+
* internal and a public balancer, with room for a second availability zone).
|
|
46
|
+
*/
|
|
47
|
+
export const MAX_RESOLVED_HOSTS = 4;
|
|
48
|
+
/**
|
|
49
|
+
* The stated NAMES a proof will resolve, in the provider's order, deduplicated and bounded.
|
|
50
|
+
*
|
|
51
|
+
* Exported because the caller does the I/O and the plan consumes the answers, so both have to
|
|
52
|
+
* agree about exactly which names are in scope. Stated ONCE here and read twice rather than
|
|
53
|
+
* recomputed on each side: two copies of a bound is how a name beyond it comes to be reported as a
|
|
54
|
+
* name nothing could resolve.
|
|
55
|
+
*/
|
|
56
|
+
export function planHostResolutions(candidates = []) {
|
|
57
|
+
const hosts = [];
|
|
58
|
+
const seen = new Set();
|
|
59
|
+
for (const candidate of candidates) {
|
|
60
|
+
const stated = statedRouteTarget(candidate);
|
|
61
|
+
if (stated.kind !== 'host' || seen.has(stated.host))
|
|
62
|
+
continue;
|
|
63
|
+
seen.add(stated.host);
|
|
64
|
+
hosts.push(stated.host);
|
|
65
|
+
if (hosts.length >= MAX_RESOLVED_HOSTS)
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
return hosts;
|
|
69
|
+
}
|
|
30
70
|
/**
|
|
31
71
|
* The targets a proof tries for one environment, in order: the URL's own name first, then each
|
|
32
|
-
* stated
|
|
72
|
+
* stated candidate in the PROVIDER'S preference order, a stated NAME expanded IN PLACE into the
|
|
73
|
+
* addresses it resolved to.
|
|
74
|
+
*
|
|
75
|
+
* The URL's name goes first because it is the answer that needs no bridge, and a deployment where
|
|
76
|
+
* it works must not start paying for `--add-host` entries and the warm-pool evictions they cost.
|
|
77
|
+
* The candidates keep the provider's order because the provider is the only thing that knows which
|
|
78
|
+
* of its balancers is the one it wants used; the platform decides only which one CARRIED. A name is
|
|
79
|
+
* expanded in place rather than having its addresses appended, so that order still means something
|
|
80
|
+
* when a provider states a name and an address side by side.
|
|
33
81
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
82
|
+
* **Every dialled target is an address a bridge could NAME**, whether the provider stated it or the
|
|
83
|
+
* platform resolved it. The rule is `isBridgeableAddress`, and applying it HERE rather than only at
|
|
84
|
+
* bridge-build time is the whole safety property of the probe: candidates are provider-authored
|
|
85
|
+
* data, so without it the orchestrator opens sockets wherever a manifest says and records the
|
|
86
|
+
* results on a row a workspace can read back, which is a liveness oracle against the deployment's
|
|
87
|
+
* own private network. Resolving first and grading each answer is what keeps that property intact
|
|
88
|
+
* for a name: the destination a bridge is built from is still an IP the platform itself proved, and
|
|
89
|
+
* a name answering with something unbridgeable is refused per address.
|
|
38
90
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
91
|
+
* The refusal costs nothing real either, because an address no bridge may name is an address no
|
|
92
|
+
* container could be pointed at, so proving it would prove something unusable. Refused and
|
|
93
|
+
* unresolvable targets are RECORDED (`kind: 'undialled'`) rather than dropped: a shortened list
|
|
94
|
+
* nobody is told about is how a provider's bad candidate becomes an unexplained `name_unresolved`.
|
|
95
|
+
*
|
|
96
|
+
* **Every cap this plan applies reports what it passed over**, in one final `not_attempted`
|
|
97
|
+
* target. Three of them bite (names beyond {@link MAX_RESOLVED_HOSTS}, addresses beyond the dial
|
|
98
|
+
* budget, records beyond the recording budget) and each ends the list early, so without that
|
|
99
|
+
* report a proof over a longer list is a prefix presented as the whole thing. It is not a
|
|
100
|
+
* cosmetic omission: {@link reduceRouteProof} grades `not_reached` only when every attempt
|
|
101
|
+
* established something, and a silently shortened list is how the deployer comes to fail a frame
|
|
102
|
+
* on a verdict about candidates the platform never looked at.
|
|
48
103
|
*
|
|
49
104
|
* Empty when there is no host or port to dial, which the caller reads as `no_candidate`: an
|
|
50
105
|
* environment with no URL was never going to be reached, and that is a different fact from one
|
|
51
106
|
* that was tried and failed.
|
|
52
107
|
*/
|
|
53
|
-
export function planRouteProbes(host, port, candidates = [],
|
|
108
|
+
export function planRouteProbes(host, port, candidates = [], plan = {}) {
|
|
54
109
|
if (!host || !port)
|
|
55
110
|
return [];
|
|
111
|
+
const timeoutMs = plan.timeoutMs ?? ROUTE_PROBE_TIMEOUT_MS;
|
|
56
112
|
const targets = [
|
|
57
113
|
{ kind: 'dial', request: { host, port, timeoutMs }, address: null, label: `${host}:${port}` },
|
|
58
114
|
];
|
|
115
|
+
const inScope = new Set(planHostResolutions(candidates));
|
|
59
116
|
const seen = new Set();
|
|
60
|
-
|
|
61
|
-
|
|
117
|
+
const budget = { dialable: 0, undialled: 0, passedOver: 0 };
|
|
118
|
+
// Bounded by `return` rather than `break`, so a manifest listing four refused addresses ahead of
|
|
119
|
+
// a good one still gets the good one dialled. Recording costs no I/O; the dial budget is what the
|
|
120
|
+
// deployer's settle path is actually waiting on.
|
|
121
|
+
const record = (label, reason, detail) => {
|
|
122
|
+
if (budget.undialled >= MAX_PROBED_ADDRESSES) {
|
|
123
|
+
budget.passedOver += 1;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
budget.undialled += 1;
|
|
127
|
+
targets.push({ kind: 'undialled', label, reason, ...(detail ? { detail } : {}) });
|
|
128
|
+
};
|
|
129
|
+
const dial = (address, statedHost) => {
|
|
130
|
+
const label = statedHost
|
|
131
|
+
? `${host}@${address}:${port} (${statedHost})`
|
|
132
|
+
: `${host}@${address}:${port}`;
|
|
133
|
+
if (!isBridgeableAddress(address))
|
|
134
|
+
return record(label, 'address_refused');
|
|
135
|
+
if (budget.dialable >= MAX_PROBED_ADDRESSES) {
|
|
136
|
+
budget.passedOver += 1;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
budget.dialable += 1;
|
|
140
|
+
targets.push({
|
|
141
|
+
kind: 'dial',
|
|
142
|
+
request: { host, address, port, timeoutMs },
|
|
143
|
+
address,
|
|
144
|
+
...(statedHost ? { statedHost } : {}),
|
|
145
|
+
label,
|
|
146
|
+
});
|
|
147
|
+
};
|
|
62
148
|
for (const candidate of candidates) {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
149
|
+
const stated = statedRouteTarget(candidate);
|
|
150
|
+
if (stated.kind === 'unusable') {
|
|
151
|
+
// No target to name, so the label names the position instead of inventing a value: a
|
|
152
|
+
// candidate stating nothing is still an omission the operator has to be able to see.
|
|
153
|
+
record(`${host}@(no target stated):${port}`, 'address_refused');
|
|
65
154
|
continue;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (refused < MAX_PROBED_ADDRESSES) {
|
|
73
|
-
refused += 1;
|
|
74
|
-
targets.push({ kind: 'refused', address, label, reason: 'address_refused' });
|
|
75
|
-
}
|
|
155
|
+
}
|
|
156
|
+
if (stated.kind === 'address') {
|
|
157
|
+
if (seen.has(`a:${stated.address}`))
|
|
158
|
+
continue;
|
|
159
|
+
seen.add(`a:${stated.address}`);
|
|
160
|
+
dial(stated.address);
|
|
76
161
|
continue;
|
|
77
162
|
}
|
|
78
|
-
if (
|
|
163
|
+
if (seen.has(`h:${stated.host}`))
|
|
79
164
|
continue;
|
|
80
|
-
|
|
81
|
-
|
|
165
|
+
seen.add(`h:${stated.host}`);
|
|
166
|
+
// Beyond the resolution bound. Counted rather than dropped, because the platform is not about
|
|
167
|
+
// to look this name up: nothing is established about the candidate, and a proof that omits it
|
|
168
|
+
// reads as one taken against everything the provider offered.
|
|
169
|
+
if (!inScope.has(stated.host)) {
|
|
170
|
+
budget.passedOver += 1;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
expandHost(stated.host, plan.resolutions?.get(stated.host), `${host}@${stated.host}:${port}`, {
|
|
174
|
+
record,
|
|
175
|
+
dial,
|
|
176
|
+
seen,
|
|
177
|
+
});
|
|
82
178
|
}
|
|
179
|
+
if (budget.passedOver > 0)
|
|
180
|
+
targets.push(passedOverTarget(budget.passedOver));
|
|
83
181
|
return targets;
|
|
84
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* The one target that says the plan above is a PREFIX of what the provider stated.
|
|
185
|
+
*
|
|
186
|
+
* ONE entry naming the count, never one per passed-over candidate: what a reader needs is whether
|
|
187
|
+
* anything was left unlooked-at, and N copies of the same admission would spend the attempt log
|
|
188
|
+
* the real attempts live in (which is itself capped, so the copies would crowd out the evidence).
|
|
189
|
+
*
|
|
190
|
+
* Appended LAST, which keeps two rules intact. `reduceRouteProof` reports the FIRST attempt's
|
|
191
|
+
* reason for a determinate proof, and that must stay the URL's own name; and the dials ahead of it
|
|
192
|
+
* are what the settle path waits on, so a target that opens no socket may not delay them.
|
|
193
|
+
*/
|
|
194
|
+
function passedOverTarget(count) {
|
|
195
|
+
return {
|
|
196
|
+
kind: 'undialled',
|
|
197
|
+
label: count === 1
|
|
198
|
+
? '1 further target the provider stated'
|
|
199
|
+
: `${count} further targets the provider stated`,
|
|
200
|
+
reason: 'not_attempted',
|
|
201
|
+
detail: `The platform resolves at most ${MAX_RESOLVED_HOSTS} stated names and dials at most ` +
|
|
202
|
+
`${MAX_PROBED_ADDRESSES} addresses per environment, and this environment's provider stated ` +
|
|
203
|
+
'more than that.',
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Turn one stated name's resolution into dialled targets, or into the one attempt that says why
|
|
208
|
+
* there are none.
|
|
209
|
+
*
|
|
210
|
+
* The three failures stay apart because they name different owners, which is the same split the
|
|
211
|
+
* resolver port itself draws: nothing wired to resolve is an admission about the DEPLOYMENT, a name
|
|
212
|
+
* that answered nothing is a fact about the NAME, and a lookup that failed is "we could not tell".
|
|
213
|
+
* Only the middle one establishes anything, and a resolution answering an empty address list is
|
|
214
|
+
* that same middle fact rather than a fourth one.
|
|
215
|
+
*/
|
|
216
|
+
function expandHost(statedHost, resolution, label, sink) {
|
|
217
|
+
if (!resolution)
|
|
218
|
+
return sink.record(label, 'resolver_unavailable');
|
|
219
|
+
if (resolution.state === 'failed')
|
|
220
|
+
return sink.record(label, 'probe_failed', resolution.detail);
|
|
221
|
+
const addresses = resolution.state === 'resolved'
|
|
222
|
+
? resolution.addresses.map((address) => address.trim()).filter(Boolean)
|
|
223
|
+
: [];
|
|
224
|
+
if (addresses.length === 0)
|
|
225
|
+
return sink.record(label, 'name_unresolved');
|
|
226
|
+
for (const address of addresses) {
|
|
227
|
+
// Deduplicated against stated addresses and against the other names, because two balancers in
|
|
228
|
+
// one zone routinely answer with an overlapping set and dialling the same literal twice spends
|
|
229
|
+
// the bound on a target already tried.
|
|
230
|
+
if (sink.seen.has(`a:${address}`))
|
|
231
|
+
continue;
|
|
232
|
+
sink.seen.add(`a:${address}`);
|
|
233
|
+
sink.dial(address, statedHost);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
85
236
|
/**
|
|
86
237
|
* The user-facing reason one probe outcome states, for the target it was tried against.
|
|
87
238
|
*
|
|
88
239
|
* A NAME that does not resolve and an ADDRESS that does not resolve are not the same event, and
|
|
89
240
|
* only the first can happen: an address is dialled, never looked up. A resolver answering
|
|
90
241
|
* `unresolved` for a literal is a probe malfunction, so it is reported as `probe_failed` rather
|
|
91
|
-
* than as a claim about DNS that would send a reader to the wrong zone.
|
|
242
|
+
* than as a claim about DNS that would send a reader to the wrong zone. That holds for an address
|
|
243
|
+
* the platform RESOLVED a stated name into as much as for a stated one: the name's own lookup
|
|
244
|
+
* already happened and was recorded, and this attempt dials a literal.
|
|
92
245
|
*/
|
|
93
246
|
function reasonFor(outcome, address) {
|
|
94
247
|
switch (outcome.state) {
|
|
@@ -124,9 +277,21 @@ export function recordRouteAttempt(target, outcome) {
|
|
|
124
277
|
...(detail ? { detail: detail.slice(0, MAX_PROBE_DETAIL_CHARS) } : {}),
|
|
125
278
|
};
|
|
126
279
|
}
|
|
127
|
-
/**
|
|
128
|
-
|
|
129
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Record a target the platform never DIALLED, so the omission is on the proof rather than lost.
|
|
282
|
+
*
|
|
283
|
+
* Carries the same `detail` a dialled attempt does, because one of the causes that lands here says
|
|
284
|
+
* nothing on its own: a lookup that failed rather than answering nothing is `probe_failed`, and
|
|
285
|
+
* without the resolver's own words a reader cannot tell a DNS timeout from a resolver outage from a
|
|
286
|
+
* bug in the adapter.
|
|
287
|
+
*/
|
|
288
|
+
export function recordUndialledAttempt(target) {
|
|
289
|
+
const detail = target.detail?.trim() ?? '';
|
|
290
|
+
return {
|
|
291
|
+
target: target.label,
|
|
292
|
+
outcome: target.reason,
|
|
293
|
+
...(detail ? { detail: detail.slice(0, MAX_PROBE_DETAIL_CHARS) } : {}),
|
|
294
|
+
};
|
|
130
295
|
}
|
|
131
296
|
/**
|
|
132
297
|
* Whether one attempt's outcome leaves a route the platform never actually RULED OUT.
|
|
@@ -144,6 +309,14 @@ const LEAVES_ROUTE_UNKNOWN = {
|
|
|
144
309
|
no_route: false,
|
|
145
310
|
connection_refused: false,
|
|
146
311
|
address_refused: false,
|
|
312
|
+
// A deployment with nothing to resolve a name with has not ruled that candidate out; it has
|
|
313
|
+
// declined to look at it. Grading it as established is how a facade missing a resolver would
|
|
314
|
+
// start failing deploys for environments it never dialled.
|
|
315
|
+
resolver_unavailable: true,
|
|
316
|
+
// The same shape of admission, from the platform's own bounds rather than its wiring: a
|
|
317
|
+
// candidate past the cap was passed over, so it is not ruled out, so the list as a whole cannot
|
|
318
|
+
// add up to "nothing reaches this environment".
|
|
319
|
+
not_attempted: true,
|
|
147
320
|
probe_failed: true,
|
|
148
321
|
};
|
|
149
322
|
/**
|
|
@@ -171,18 +344,27 @@ function leavesRouteUnknown(outcome) {
|
|
|
171
344
|
*
|
|
172
345
|
* - **`reached`** as soon as any attempt carried, publishing the target that did.
|
|
173
346
|
* - **`inconclusive`** when nothing carried AND some attempt left a route unruled-out: a probe
|
|
174
|
-
* that could not classify its own failure,
|
|
175
|
-
* matching none of that facade's markers, or a Node errno
|
|
176
|
-
* here, and reading either as a verdict about the environment
|
|
177
|
-
* second way for a healthy deploy to die. The reason names the
|
|
347
|
+
* that could not classify its own failure, a candidate the plan passed over, or nothing to try
|
|
348
|
+
* at all. A workerd connect message matching none of that facade's markers, or a Node errno
|
|
349
|
+
* outside the mapped five, arrives here, and reading either as a verdict about the environment
|
|
350
|
+
* is how a diagnostic becomes a second way for a healthy deploy to die. The reason names the
|
|
351
|
+
* attempt that left it unknown.
|
|
178
352
|
* - **`not_reached`** only when EVERY attempt established something and none of them carried.
|
|
179
353
|
* The reported reason is then the FIRST attempt's, which is always the name, so a reader is
|
|
180
354
|
* told what happened to the address they were given rather than what happened to the last
|
|
181
355
|
* balancer in someone's preference list. The attempt log carries the rest, in order.
|
|
182
356
|
*/
|
|
183
|
-
export function reduceRouteProof(attempts,
|
|
184
|
-
if (attempts.some((attempt) => attempt.outcome === 'carried'))
|
|
185
|
-
return {
|
|
357
|
+
export function reduceRouteProof(attempts, carried, checkedAt) {
|
|
358
|
+
if (attempts.some((attempt) => attempt.outcome === 'carried')) {
|
|
359
|
+
return {
|
|
360
|
+
state: 'reached',
|
|
361
|
+
via: carried?.address ?? null,
|
|
362
|
+
...(carried?.statedHost ? { viaHost: carried.statedHost } : {}),
|
|
363
|
+
reason: null,
|
|
364
|
+
attempts: [...attempts],
|
|
365
|
+
checkedAt,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
186
368
|
if (attempts.length === 0) {
|
|
187
369
|
return {
|
|
188
370
|
state: 'inconclusive',
|
|
@@ -216,7 +398,9 @@ const UNREACHABLE_CAUSES = {
|
|
|
216
398
|
name_unresolved: 'its hostname resolves nowhere from this deployment, and no address the provider stated for it carried either',
|
|
217
399
|
no_route: 'nothing answered within the probe window, so no route reaches it',
|
|
218
400
|
connection_refused: 'the route reaches it and nothing is listening on that port',
|
|
219
|
-
address_refused: 'every
|
|
401
|
+
address_refused: 'every target its provider stated is one no host bridge may name (loopback, link-local or vendor metadata, or a non-canonical literal, or a candidate naming nothing at all), so none could be dialled',
|
|
402
|
+
resolver_unavailable: 'its provider identified the environment by NAME and this deployment has nothing wired to turn a name into an address, so nothing was established either way',
|
|
403
|
+
not_attempted: 'its provider stated more targets than the platform will look up and dial for one environment, so at least one of them was never tried and nothing was established either way',
|
|
220
404
|
probe_failed: 'the probe could not complete, so nothing was established either way',
|
|
221
405
|
};
|
|
222
406
|
/**
|
|
@@ -303,10 +487,10 @@ export function determinateRouteCause(candidates, proof) {
|
|
|
303
487
|
if (proof.reason === 'no_candidate') {
|
|
304
488
|
if (candidates.length === 0) {
|
|
305
489
|
return ('This environment carries no address to dial at all: no URL with a host and port, and no ' +
|
|
306
|
-
'address stated for one. Nothing was tried because there was nothing to try, so
|
|
307
|
-
'fact about what the provider published, never a verdict about the environment.
|
|
308
|
-
'maps this provider onto a URL (and onto stated addresses
|
|
309
|
-
'from this deployment) owns the fix.');
|
|
490
|
+
'address or name stated for one. Nothing was tried because there was nothing to try, so ' +
|
|
491
|
+
'this is a fact about what the provider published, never a verdict about the environment. ' +
|
|
492
|
+
'Whoever maps this provider onto a URL (and onto stated addresses or balancer names, if ' +
|
|
493
|
+
'the URL is not resolvable from this deployment) owns the fix.');
|
|
310
494
|
}
|
|
311
495
|
// The SAME reason, a different fact, and telling a reader the provider stated no addresses
|
|
312
496
|
// when it stated several is the misdirection this whole function exists to prevent. A stated
|
|
@@ -314,21 +498,22 @@ export function determinateRouteCause(candidates, proof) {
|
|
|
314
498
|
// before it will plan anything), so an environment with addresses and no parseable URL had
|
|
315
499
|
// nothing to dial them ON, and the fix is one field over from where the empty-list wording
|
|
316
500
|
// would send someone.
|
|
317
|
-
const count = candidates.length === 1 ? '1
|
|
501
|
+
const count = candidates.length === 1 ? '1 candidate' : `${candidates.length} candidates`;
|
|
318
502
|
return (`This environment published no URL with a host and port, so the ${count} its provider DID ` +
|
|
319
|
-
'state could not be dialled either:
|
|
320
|
-
'
|
|
321
|
-
'
|
|
322
|
-
"maps this provider onto the environment's URL
|
|
323
|
-
'the gap here.');
|
|
503
|
+
'state could not be dialled either: a stated address (or an address a stated name resolves ' +
|
|
504
|
+
'to) is tried on the port the URL names, and there was none. Nothing was tried because ' +
|
|
505
|
+
'there was nothing to try it on, so this is a fact about what the provider published, never ' +
|
|
506
|
+
"a verdict about the environment. Whoever maps this provider onto the environment's URL " +
|
|
507
|
+
'owns the fix; the stated candidates are not the gap here.');
|
|
324
508
|
}
|
|
325
509
|
if (proof.state !== 'not_reached' || candidates.length > 0)
|
|
326
510
|
return null;
|
|
327
511
|
return ("The only target that ever existed was the environment's own name, because the provider " +
|
|
328
|
-
'stated no addresses for it. Nothing else was tried because there was
|
|
329
|
-
'the empty candidate list means
|
|
330
|
-
'tried and failed. Whoever maps this provider onto stated addresses
|
|
331
|
-
'ranks ahead of any fault inferred from the ORDER platform events
|
|
512
|
+
'stated no addresses and no balancer names for it. Nothing else was tried because there was ' +
|
|
513
|
+
'nothing else to try: the empty candidate list means candidates were never STATED, not that ' +
|
|
514
|
+
'stated ones were tried and failed. Whoever maps this provider onto stated addresses or names ' +
|
|
515
|
+
'owns the fix, and this ranks ahead of any fault inferred from the ORDER platform events ' +
|
|
516
|
+
'appear to have happened in.');
|
|
332
517
|
}
|
|
333
518
|
/**
|
|
334
519
|
* The proof recorded when nothing was wired to open a socket.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-reachability.logic.js","sourceRoot":"","sources":["../../src/domain/environment-reachability.logic.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,qBAAqB;AACrB,EAAE;AACF,4FAA4F;AAC5F,4FAA4F;AAC5F,gGAAgG;AAChG,+FAA+F;AAC/F,mEAAmE;AACnE,EAAE;AACF,2FAA2F;AAC3F,8FAA8F;AAC9F,iGAAiG;AACjG,uBAAuB;AAQvB,OAAO,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAA;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAEhF,kFAAkF;AAClF,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAElC,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAE1C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAgBrC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,eAAe,CAC7B,IAA+B,EAC/B,IAA+B,EAC/B,UAAU,GAAkC,EAAE,EAC9C,SAAS,GAAW,sBAAsB;IAE1C,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IAC7B,MAAM,OAAO,GAAuB;QAClC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,IAAI,IAAI,EAAE,EAAE;KAC9F,CAAA;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,IAAI,QAAQ,GAAG,CAAC,CAAA;IAChB,IAAI,OAAO,GAAG,CAAC,CAAA;IACf,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,OAAO,GAAG,SAAS,CAAC,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,UAAU,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IACvE,OAAO,CACL,yFAAyF;QACzF,4FAA4F;QAC5F,6FAA6F;QAC7F,4FAA4F;QAC5F,8FAA8F,CAC/F,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,CAAA;AAChF,CAAC"}
|
|
1
|
+
{"version":3,"file":"environment-reachability.logic.js","sourceRoot":"","sources":["../../src/domain/environment-reachability.logic.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,kCAAkC;AAClC,EAAE;AACF,4FAA4F;AAC5F,4FAA4F;AAC5F,gGAAgG;AAChG,+FAA+F;AAC/F,mEAAmE;AACnE,EAAE;AACF,2FAA2F;AAC3F,8FAA8F;AAC9F,iGAAiG;AACjG,uBAAuB;AAQvB,OAAO,EAAE,kCAAkC,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAEhF,kFAAkF;AAClF,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAElC,gFAAgF;AAChF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAE1C;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAErC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAE3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAU,GAAyC,EAAE;IAErD,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,MAAM,IAAI,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FAA6F;QAC7F,6FAA6F;QAC7F,+FAA+F;QAC/F,0FAA0F;QAC1F,6BAA6B,CAC9B,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,CAAA;AAChF,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type AdoptionArea, type AdoptionChoice, type AdoptionDecision, type AdoptionPlan, type AdoptionSource, type AdoptionSurvey, type ResolvedAdoption } from '@cat-factory/contracts';
|
|
2
|
+
/** Cap on how many decisions one plan may carry, so a runaway reply can't produce a wall of them. */
|
|
3
|
+
export declare const MAX_ADOPTION_DECISIONS = 24;
|
|
4
|
+
/**
|
|
5
|
+
* One convention area, in the words the review UI and the agent brief both use.
|
|
6
|
+
*
|
|
7
|
+
* The `default` is unreachable while the type is honoured, which is the point: adding a member
|
|
8
|
+
* fails the build here, and a member RETIRED after a plan was stored still renders honestly
|
|
9
|
+
* instead of splicing `undefined` into the sentence a human is deciding from.
|
|
10
|
+
*/
|
|
11
|
+
export declare function describeAdoptionArea(area: AdoptionArea): string;
|
|
12
|
+
/** One side of the decision, as an instruction an agent can act on without further inference. */
|
|
13
|
+
export declare function describeAdoptionSource(source: AdoptionSource): string;
|
|
14
|
+
/** Whether a stored string is an area THIS build defines, narrowed from the schema's own options. */
|
|
15
|
+
export declare function isAdoptionArea(value: unknown): value is AdoptionArea;
|
|
16
|
+
/** Whether a stored string is a choice THIS build defines, narrowed from the schema's own options. */
|
|
17
|
+
export declare function isAdoptionSource(value: unknown): value is AdoptionSource;
|
|
18
|
+
/** What {@link parseAdoptionDecisions} produced, plus what it refused to carry through. */
|
|
19
|
+
export interface ParsedAdoptionDecisions {
|
|
20
|
+
decisions: AdoptionDecision[];
|
|
21
|
+
/** One line per dropped recommendation, naming it and why. Rendered to the reviewer. */
|
|
22
|
+
dropped: string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read a model's raw reply into the stored decision list, keeping only what it can support.
|
|
26
|
+
*
|
|
27
|
+
* The model is asked for `{ decisions: [...] }`; anything else is not a plan. Each decision has
|
|
28
|
+
* to survive three checks, and each one is a way the review would otherwise mislead:
|
|
29
|
+
*
|
|
30
|
+
* - a duplicate or missing `id` makes the human's answer unaddressable, so the line is dropped;
|
|
31
|
+
* - an area or recommendation outside the CURRENT vocabulary cannot be rendered or acted on;
|
|
32
|
+
* - evidence that names no path the survey actually read means the claim about the monorepo
|
|
33
|
+
* has nothing behind it. The line is dropped rather than shown unmarked, because a reviewer
|
|
34
|
+
* reads an unmarked line as something the platform checked.
|
|
35
|
+
*
|
|
36
|
+
* Every drop is REPORTED, never silent: a plan that lost half its lines to invention looks
|
|
37
|
+
* exactly like a monorepo with few conventions, and those need opposite reactions.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseAdoptionDecisions(raw: unknown, survey: AdoptionSurvey): ParsedAdoptionDecisions;
|
|
40
|
+
/**
|
|
41
|
+
* Settle a human review against the plan it answers, or throw the refusal naming what is wrong.
|
|
42
|
+
*
|
|
43
|
+
* Refuses rather than repairs, on both sides of the mismatch. An UNANSWERED decision cannot be
|
|
44
|
+
* defaulted to the recommendation without erasing the difference between agreeing with it and
|
|
45
|
+
* never having read it, which is the single fact this whole step exists to record. An answer
|
|
46
|
+
* naming a decision the plan does not have means the reviewer was looking at a different plan
|
|
47
|
+
* (a stale tab, a re-run survey), and applying the rest of it would build under a review that
|
|
48
|
+
* was never given for this proposal.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveAdoptionReview(plan: AdoptionPlan, choices: readonly AdoptionChoice[], context: {
|
|
51
|
+
reviewedByUserId: string | null;
|
|
52
|
+
reviewedAt: number;
|
|
53
|
+
notes?: string | undefined;
|
|
54
|
+
}): ResolvedAdoption;
|
|
55
|
+
/**
|
|
56
|
+
* Render the settled review as the adoption section of the apply phase's brief.
|
|
57
|
+
*
|
|
58
|
+
* Every decision is stated as a SIDE plus the reviewer's own words where they left any, and the
|
|
59
|
+
* overrides are called out: an agent told only "use the monorepo's test runner" cannot tell a
|
|
60
|
+
* default it may reason around from a human who deliberately overruled the recommendation, and
|
|
61
|
+
* the second is not negotiable. The list is exhaustive on purpose: an area the reviewer settled
|
|
62
|
+
* and the brief omits is an area the agent decides again, unreviewed.
|
|
63
|
+
*
|
|
64
|
+
* The holes are VERBATIM here. {@link renderAdoptionPrSection} is the rendering for the pull
|
|
65
|
+
* request; do not send this one to a host.
|
|
66
|
+
*/
|
|
67
|
+
export declare function renderAdoptionBrief(resolved: ResolvedAdoption, directory: string): string;
|
|
68
|
+
/**
|
|
69
|
+
* Render the settled review for the PULL REQUEST the apply phase opens.
|
|
70
|
+
*
|
|
71
|
+
* The same list, addressed to the human reviewing the change rather than to the agent making it:
|
|
72
|
+
* what a reviewer of a bootstrap PR is being asked is whether the service fits the monorepo, and
|
|
73
|
+
* what settles that is which side each area came from and who chose it, which the diff cannot
|
|
74
|
+
* show. Every hole crosses {@link HOST_SINK}, because both the titles (model-authored) and the
|
|
75
|
+
* notes (reviewer-authored) are untrusted text landing on a parsed surface. The caller scrubs
|
|
76
|
+
* secrets at compose time, before any of this is capped.
|
|
77
|
+
*/
|
|
78
|
+
export declare function renderAdoptionPrSection(resolved: ResolvedAdoption, directory: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* The default branch name for a monorepo bootstrap's pull request.
|
|
81
|
+
*
|
|
82
|
+
* Derived from the run's own id rather than the service name so two bootstraps of similarly
|
|
83
|
+
* named services can never collide on one branch, and stable per run so a retry of the SAME run
|
|
84
|
+
* resumes its branch instead of opening a second pull request against the monorepo.
|
|
85
|
+
*/
|
|
86
|
+
export declare function monorepoBootstrapBranch(jobId: string): string;
|
|
87
|
+
//# sourceMappingURL=monorepo-adoption.logic.d.ts.map
|
|
@@ -0,0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