@sourcey/catalog-verifier 1.1.25 → 1.1.27
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/SOURCEY-CLOSURE.json +48 -48
- package/dist/contracts/agent-readiness/src/binding.d.ts.map +1 -1
- package/dist/contracts/agent-readiness/src/binding.js +1 -0
- package/dist/contracts/agent-readiness/src/binding.js.map +1 -1
- package/dist/contracts/agent-readiness/src/declaration-acquisition.d.ts +1 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.d.ts.map +1 -1
- package/dist/contracts/agent-readiness/src/declaration.d.ts +4 -0
- package/dist/contracts/agent-readiness/src/declaration.d.ts.map +1 -1
- package/dist/contracts/agent-readiness/src/offer-relations.d.ts +1 -0
- package/dist/contracts/agent-readiness/src/offer-relations.d.ts.map +1 -1
- package/dist/contracts/agent-readiness/src/operation.d.ts +12 -4
- package/dist/contracts/agent-readiness/src/operation.d.ts.map +1 -1
- package/dist/contracts/agent-readiness/src/operation.js +42 -7
- package/dist/contracts/agent-readiness/src/operation.js.map +1 -1
- package/dist/contracts/agent-readiness/src/release-index.d.ts +1 -0
- package/dist/contracts/agent-readiness/src/release-index.d.ts.map +1 -1
- package/dist/contracts/agent-readiness/src/revision.d.ts +1 -0
- package/dist/contracts/agent-readiness/src/revision.d.ts.map +1 -1
- package/dist/contracts/api/src/endpoints.d.ts +10 -2
- package/dist/contracts/api/src/endpoints.d.ts.map +1 -1
- package/dist/contracts/api/src/endpoints.js +1 -1
- package/dist/contracts/api/src/endpoints.js.map +1 -1
- package/dist/contracts/api/src/read.d.ts +3 -1
- package/dist/contracts/api/src/read.d.ts.map +1 -1
- package/dist/contracts/api/src/read.js +1 -1
- package/dist/contracts/api/src/routes.d.ts +1 -0
- package/dist/contracts/api/src/routes.d.ts.map +1 -1
- package/dist/contracts/api/src/routes.js +6 -1
- package/dist/contracts/api/src/routes.js.map +1 -1
- package/dist/contracts/api/src/submissions.d.ts +1 -0
- package/dist/contracts/api/src/submissions.d.ts.map +1 -1
- package/dist/modules/agent-readiness-engine/src/naming.d.ts +3 -1
- package/dist/modules/agent-readiness-engine/src/naming.d.ts.map +1 -1
- package/dist/modules/agent-readiness-engine/src/naming.js +3 -2
- package/dist/modules/agent-readiness-engine/src/naming.js.map +1 -1
- package/dist/modules/agent-readiness-engine/src/path.d.ts.map +1 -1
- package/dist/modules/agent-readiness-engine/src/path.js +12 -4
- package/dist/modules/agent-readiness-engine/src/path.js.map +1 -1
- package/dist/modules/agent-readiness-engine/src/records.d.ts +17 -2
- package/dist/modules/agent-readiness-engine/src/records.d.ts.map +1 -1
- package/dist/modules/agent-readiness-engine/src/records.js +59 -1
- package/dist/modules/agent-readiness-engine/src/records.js.map +1 -1
- package/dist/modules/agent-readiness-jobs/src/index.d.ts +949 -352
- package/dist/modules/agent-readiness-jobs/src/index.d.ts.map +1 -1
- package/dist/modules/agent-readiness-jobs/src/index.js +237 -300
- package/dist/modules/agent-readiness-jobs/src/index.js.map +1 -1
- package/dist/modules/agent-readiness-policy/src/grade-policy.js +1 -1
- package/dist/modules/agent-readiness-policy/src/grade-policy.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isAgentReadinessGrpcMediaType, } from "../../../contracts/agent-readiness/src/index.js";
|
|
1
2
|
/**
|
|
2
3
|
* What a sealed exchange record and a run record say without any response
|
|
3
4
|
* body: whether an exchange was answered, a header it kept, and whether a run
|
|
@@ -16,13 +17,70 @@ export const RESIDUE_FAILURES = new Set([
|
|
|
16
17
|
"tls_failure",
|
|
17
18
|
"other",
|
|
18
19
|
]);
|
|
19
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* The gRPC statuses that are residue, as a 429 or 5xx is (gRPC's own mapping
|
|
22
|
+
* to HTTP): unknown, deadline exceeded, resource exhausted, internal,
|
|
23
|
+
* unavailable and data loss. Unimplemented, which that mapping sends to 501,
|
|
24
|
+
* is a service's answer that it has no such method.
|
|
25
|
+
*/
|
|
26
|
+
const GRPC_RESIDUE = new Set([2, 4, 8, 13, 14, 15]);
|
|
27
|
+
/**
|
|
28
|
+
* A residue transport failure, 429 or 5xx, or a gRPC call's like: residue to
|
|
29
|
+
* retry, never the service's answer. A gRPC call's own status decides it,
|
|
30
|
+
* whatever its HTTP status; one whose status the exchange could not read is
|
|
31
|
+
* residue too, never a guess.
|
|
32
|
+
*/
|
|
20
33
|
export function unansweredRecord(record) {
|
|
21
34
|
if (record.outcome !== "responded")
|
|
22
35
|
return RESIDUE_FAILURES.has(record.reason);
|
|
36
|
+
const grpc = grpcStatus(record);
|
|
37
|
+
if (grpc !== null)
|
|
38
|
+
return GRPC_RESIDUE.has(grpc);
|
|
39
|
+
if (grpcStatusUnread(record))
|
|
40
|
+
return true;
|
|
23
41
|
const { status } = record.response;
|
|
24
42
|
return status === 429 || status >= 500;
|
|
25
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* A gRPC call's status (north star §5.4): an answer under a gRPC media type to
|
|
46
|
+
* a request that carried a gRPC message, read from the `grpc-status` it sent
|
|
47
|
+
* before any message, as a refusal does, whatever its HTTP status (a proxy may
|
|
48
|
+
* refuse with a 403). Null for any other exchange, an answer with no status
|
|
49
|
+
* there, or a `grpc-status` that is not a status. Only a gRPC call's answer is
|
|
50
|
+
* read so: a gRPC server answers other requests (a metadata read) under its
|
|
51
|
+
* media type too.
|
|
52
|
+
*/
|
|
53
|
+
export function grpcStatus(record) {
|
|
54
|
+
if (!grpcCall(record))
|
|
55
|
+
return null;
|
|
56
|
+
const sent = responseHeader(record, "grpc-status");
|
|
57
|
+
if (sent === null || !/^(?:0|[1-9][0-9]{0,2})$/u.test(sent))
|
|
58
|
+
return null;
|
|
59
|
+
// A success is a 2xx; a refusal's HTTP status claiming success is read as HTTP.
|
|
60
|
+
const status = Number(sent);
|
|
61
|
+
return status === 0 && !served(record) ? null : status;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A gRPC call served with no status before its body: the status came after
|
|
65
|
+
* it, in trailers the exchange does not keep, so the answer is unread (north
|
|
66
|
+
* star §5.4). Whether a message preceded it says nothing of the status that
|
|
67
|
+
* followed.
|
|
68
|
+
*/
|
|
69
|
+
function grpcStatusUnread(record) {
|
|
70
|
+
return grpcCall(record) && served(record) && responseHeader(record, "grpc-status") === null;
|
|
71
|
+
}
|
|
72
|
+
/** An answer under a gRPC media type to a request that carried a gRPC message. */
|
|
73
|
+
function grpcCall(record) {
|
|
74
|
+
if (record.outcome !== "responded")
|
|
75
|
+
return false;
|
|
76
|
+
const { request, response } = record;
|
|
77
|
+
return (request.body !== null &&
|
|
78
|
+
isAgentReadinessGrpcMediaType(request.body.media_type) &&
|
|
79
|
+
isAgentReadinessGrpcMediaType(response.body.media_type));
|
|
80
|
+
}
|
|
81
|
+
function served(record) {
|
|
82
|
+
return record.response.status >= 200 && record.response.status <= 299;
|
|
83
|
+
}
|
|
26
84
|
/** The exchanges that follow an *authority* answer to the agent's client and consent. */
|
|
27
85
|
const AUTHORITY_CHAIN = new Set([
|
|
28
86
|
"probe_resource_metadata",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../../../modules/agent-readiness-engine/src/records.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"records.js","sourceRoot":"","sources":["../../../../modules/agent-readiness-engine/src/records.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,6BAA6B,GAC9B,MAAM,iDAAiD,CAAC;AAEzD;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC;IAC3D,mBAAmB;IACnB,aAAa;IACb,aAAa;IACb,OAAO;CACR,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AAE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