@superbee/core 0.2.0-pre.16 → 0.2.0-pre.17
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/README.md +107 -4
- package/dist/bundle-health/index.d.ts +14 -0
- package/dist/bundle-health/index.d.ts.map +1 -0
- package/dist/bundle-health/index.js +12 -0
- package/dist/bundle-health/index.js.map +1 -0
- package/dist/bundle-health/kind-findings.d.ts +44 -0
- package/dist/bundle-health/kind-findings.d.ts.map +1 -0
- package/dist/bundle-health/kind-findings.js +68 -0
- package/dist/bundle-health/kind-findings.js.map +1 -0
- package/dist/bundle-health/legacy-page.d.ts +39 -0
- package/dist/bundle-health/legacy-page.d.ts.map +1 -0
- package/dist/bundle-health/legacy-page.js +50 -0
- package/dist/bundle-health/legacy-page.js.map +1 -0
- package/dist/bundle-health/report.d.ts +202 -0
- package/dist/bundle-health/report.d.ts.map +1 -0
- package/dist/bundle-health/report.js +438 -0
- package/dist/bundle-health/report.js.map +1 -0
- package/dist/hosted-client/write.d.ts +10 -1
- package/dist/hosted-client/write.d.ts.map +1 -1
- package/dist/hosted-client/write.js +9 -4
- package/dist/hosted-client/write.js.map +1 -1
- package/dist/hosted-transport/answer-rows.d.ts +3 -2
- package/dist/hosted-transport/answer-rows.d.ts.map +1 -1
- package/dist/hosted-transport/answer-rows.js +1 -1
- package/dist/hosted-transport/answer-rows.js.map +1 -1
- package/dist/hosted-transport/whole-document-transport.d.ts +1 -1
- package/dist/hosted-transport/whole-document-transport.d.ts.map +1 -1
- package/dist/hosted-transport/whole-document-transport.js +20 -12
- package/dist/hosted-transport/whole-document-transport.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kinds-load.js +4 -4
- package/dist/kinds-load.js.map +1 -1
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +3 -2
- package/dist/kinds.js.map +1 -1
- package/dist/paths.d.ts +16 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +25 -0
- package/dist/paths.js.map +1 -1
- package/dist/query-filter.d.ts +9 -0
- package/dist/query-filter.d.ts.map +1 -1
- package/dist/query-filter.js +19 -3
- package/dist/query-filter.js.map +1 -1
- package/dist/record-overlay/apply.d.ts +43 -0
- package/dist/record-overlay/apply.d.ts.map +1 -0
- package/dist/record-overlay/apply.js +490 -0
- package/dist/record-overlay/apply.js.map +1 -0
- package/dist/record-overlay/canonical.d.ts +14 -0
- package/dist/record-overlay/canonical.d.ts.map +1 -0
- package/dist/record-overlay/canonical.js +31 -0
- package/dist/record-overlay/canonical.js.map +1 -0
- package/dist/record-overlay/digest.d.ts +4 -0
- package/dist/record-overlay/digest.d.ts.map +1 -0
- package/dist/record-overlay/digest.js +11 -0
- package/dist/record-overlay/digest.js.map +1 -0
- package/dist/record-overlay/errors.d.ts +40 -0
- package/dist/record-overlay/errors.d.ts.map +1 -0
- package/dist/record-overlay/errors.js +51 -0
- package/dist/record-overlay/errors.js.map +1 -0
- package/dist/record-overlay/findings.d.ts +5 -0
- package/dist/record-overlay/findings.d.ts.map +1 -0
- package/dist/record-overlay/findings.js +83 -0
- package/dist/record-overlay/findings.js.map +1 -0
- package/dist/record-overlay/index.d.ts +23 -0
- package/dist/record-overlay/index.d.ts.map +1 -0
- package/dist/record-overlay/index.js +21 -0
- package/dist/record-overlay/index.js.map +1 -0
- package/dist/record-overlay/plan.d.ts +12 -0
- package/dist/record-overlay/plan.d.ts.map +1 -0
- package/dist/record-overlay/plan.js +284 -0
- package/dist/record-overlay/plan.js.map +1 -0
- package/dist/record-overlay/policy.d.ts +60 -0
- package/dist/record-overlay/policy.d.ts.map +1 -0
- package/dist/record-overlay/policy.js +209 -0
- package/dist/record-overlay/policy.js.map +1 -0
- package/dist/record-overlay/redact.d.ts +3 -0
- package/dist/record-overlay/redact.d.ts.map +1 -0
- package/dist/record-overlay/redact.js +27 -0
- package/dist/record-overlay/redact.js.map +1 -0
- package/dist/record-overlay/signal-kind.d.ts +30 -0
- package/dist/record-overlay/signal-kind.d.ts.map +1 -0
- package/dist/record-overlay/signal-kind.js +38 -0
- package/dist/record-overlay/signal-kind.js.map +1 -0
- package/dist/record-overlay/signal-text.d.ts +45 -0
- package/dist/record-overlay/signal-text.d.ts.map +1 -0
- package/dist/record-overlay/signal-text.js +116 -0
- package/dist/record-overlay/signal-text.js.map +1 -0
- package/dist/record-overlay/source-index.d.ts +19 -0
- package/dist/record-overlay/source-index.d.ts.map +1 -0
- package/dist/record-overlay/source-index.js +102 -0
- package/dist/record-overlay/source-index.js.map +1 -0
- package/dist/record-overlay/types.d.ts +286 -0
- package/dist/record-overlay/types.d.ts.map +1 -0
- package/dist/record-overlay/types.js +2 -0
- package/dist/record-overlay/types.js.map +1 -0
- package/dist/remote-operations.js +5 -2
- package/dist/remote-operations.js.map +1 -1
- package/dist/storage.d.ts +2 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/uncertain-write.d.ts +39 -6
- package/dist/uncertain-write.d.ts.map +1 -1
- package/dist/uncertain-write.js +25 -3
- package/dist/uncertain-write.js.map +1 -1
- package/package.json +9 -1
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bundle health report: every finding `superbee status` prints, computed from one bundle read.
|
|
3
|
+
*
|
|
4
|
+
* Composition only: Kind conformance is `validateAgainstKind`, links are `parseLinksFromDoc` and
|
|
5
|
+
* `parseQualifiedLinks`, staleness is `freshness()`, View registrations are `parseRegistration`.
|
|
6
|
+
* One `loadKinds`, one lenient `query`, two prefix-scoped `listBlobs` and one root-index read per
|
|
7
|
+
* call; every finding derives in memory from those results. Orphans and both graph lints come from
|
|
8
|
+
* the edge sets built while scanning for unresolved links, never a per-document backlink query.
|
|
9
|
+
*
|
|
10
|
+
* Findings are data, never errors: a document whose frontmatter does not parse is a `malformed`
|
|
11
|
+
* row, and an unresolved link is information (OKF permits links to knowledge not yet written).
|
|
12
|
+
*
|
|
13
|
+
* Top-level report keys are camelCase; row keys are snake_case, the rows `superbee status` prints.
|
|
14
|
+
*/
|
|
15
|
+
import { listBlobs, query, readBundleOkfVersion } from "../bundle-ops.js";
|
|
16
|
+
import { createLocalResolver, resolveQualifiedLinks } from "../cross-bundle.js";
|
|
17
|
+
import { BUNDLE_NAME_DOC_ID, BUNDLE_NAME_DOC_TYPE, DEPENDENCIES_DOC_ID, DEPENDENCIES_DOC_TYPE, declaredBundleId, parseDependencies, } from "../dependencies.js";
|
|
18
|
+
import { freshness, invalidLegacyTimestamp, staleAfterInstant } from "../freshness.js";
|
|
19
|
+
import { MalformedDocumentError } from "../frontmatter-contract.js";
|
|
20
|
+
import { freshnessHorizonMs, isKindFieldValidationWarning, isTerminal, projectKindValidationWarnings, validateAgainstKind, } from "../kinds.js";
|
|
21
|
+
import { loadKinds } from "../kinds-load.js";
|
|
22
|
+
import { collectLinkDeclarations, localEdgeQualifiedDeclaration, qualifiedEdgeViolation } from "../link-types.js";
|
|
23
|
+
import { parseLinksFromDoc } from "../links.js";
|
|
24
|
+
import { isOkfLifecycleStatus } from "../okf-lifecycle.js";
|
|
25
|
+
import { invalidOkfTimestamps } from "../okf-timestamps.js";
|
|
26
|
+
import { isAnyEntryKey, isAnyRegistryId, isPageTypeName, isViewEntryVersion, parseRegistration, VIEW_ENTRY_PREFIX, } from "../page.js";
|
|
27
|
+
import { isQualifiedHref, parseQualifiedLinks } from "../qualified-links.js";
|
|
28
|
+
import { trustTierCounts } from "../verification.js";
|
|
29
|
+
import { hasLegacyBridgeField, isLegacyPageConvention, isLegacyPageDoc, isLegacyRegistryDocId, LEGACY_PAGE_BLOB_PREFIX, } from "./legacy-page.js";
|
|
30
|
+
/** A document's `type`, or "" when absent or not a string: the one place this coercion happens. */
|
|
31
|
+
function docType(doc) {
|
|
32
|
+
return typeof doc.frontmatter.type === "string" ? doc.frontmatter.type : "";
|
|
33
|
+
}
|
|
34
|
+
/** Preserve ordinary YAML value shapes while keeping unsupported JSON values legible. */
|
|
35
|
+
function diagnosticValue(value) {
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(JSON.stringify(value, (_key, item) => typeof item === "number" && !Number.isFinite(item) ? `<${String(item)}>` : item));
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// YAML aliases can form cycles; the report must still name the offending document.
|
|
41
|
+
return `<non-JSON ${Array.isArray(value) ? "array" : typeof value}: circular or too deeply nested>`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Documents that define the bundle's operating model or identity rather than participating as
|
|
46
|
+
* concept instances. Their lack of inbound concept links is intentional, so they are never orphans.
|
|
47
|
+
*/
|
|
48
|
+
function isGraphDefinition(doc) {
|
|
49
|
+
const type = docType(doc);
|
|
50
|
+
return type === "Convention" ||
|
|
51
|
+
isPageTypeName(type) ||
|
|
52
|
+
isLegacyPageDoc(doc.frontmatter) ||
|
|
53
|
+
(type === "Reference" && doc.id.startsWith("references/")) ||
|
|
54
|
+
(type === BUNDLE_NAME_DOC_TYPE && doc.id === BUNDLE_NAME_DOC_ID) ||
|
|
55
|
+
(type === DEPENDENCIES_DOC_TYPE && doc.id === DEPENDENCIES_DOC_ID);
|
|
56
|
+
}
|
|
57
|
+
function okfV02WorkflowStatusCollisions(registry, docs) {
|
|
58
|
+
const affectedByKind = new Map();
|
|
59
|
+
const observedValuesByKind = new Map();
|
|
60
|
+
for (const doc of docs) {
|
|
61
|
+
const value = doc.frontmatter.status;
|
|
62
|
+
if (value === undefined || isOkfLifecycleStatus(value))
|
|
63
|
+
continue;
|
|
64
|
+
const type = docType(doc);
|
|
65
|
+
affectedByKind.set(type, (affectedByKind.get(type) ?? 0) + 1);
|
|
66
|
+
const display = typeof value === "string" ? value : `<${Array.isArray(value) ? "array" : typeof value}>`;
|
|
67
|
+
const observed = observedValuesByKind.get(type) ?? new Set();
|
|
68
|
+
observed.add(display);
|
|
69
|
+
observedValuesByKind.set(type, observed);
|
|
70
|
+
}
|
|
71
|
+
const rows = [];
|
|
72
|
+
for (const kind of [...registry.kinds.values()].sort((a, b) => a.governs.localeCompare(b.governs))) {
|
|
73
|
+
const declaresStatus = kind.fields.required.includes("status") || kind.fields.optional.includes("status");
|
|
74
|
+
if (!declaresStatus)
|
|
75
|
+
continue;
|
|
76
|
+
const declaredValues = kind.fields.values.status;
|
|
77
|
+
const incompatibleValues = (declaredValues ?? []).filter((value) => !isOkfLifecycleStatus(value));
|
|
78
|
+
const affectedDocuments = affectedByKind.get(kind.governs) ?? 0;
|
|
79
|
+
if (declaredValues !== undefined && incompatibleValues.length === 0 && affectedDocuments === 0)
|
|
80
|
+
continue;
|
|
81
|
+
rows.push({
|
|
82
|
+
kind: kind.governs,
|
|
83
|
+
convention: kind.id,
|
|
84
|
+
declaration: declaredValues === undefined ? "unbounded" : "enumerated",
|
|
85
|
+
incompatible_values: incompatibleValues,
|
|
86
|
+
observed_incompatible_values: [...(observedValuesByKind.get(kind.governs) ?? [])].sort(),
|
|
87
|
+
affected_documents: affectedDocuments,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return rows;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Compute the health report for `bundle`. Read-only: it reads through the bundle's backend and
|
|
94
|
+
* never writes. It throws only what it propagates: `InvalidInputError` for a backend-less bundle in
|
|
95
|
+
* a runtime with no default, backend errors other than `MalformedDocumentError` (a finding), and
|
|
96
|
+
* whatever the `bindings` hook throws.
|
|
97
|
+
*/
|
|
98
|
+
export async function bundleHealth(bundle, options = {}) {
|
|
99
|
+
// A document whose frontmatter does not parse is its own finding, never an abort.
|
|
100
|
+
const malformed = [];
|
|
101
|
+
const [registry, docs, legacyBlobKeys, viewBlobKeys, okfVersionRead] = await Promise.all([
|
|
102
|
+
loadKinds(bundle),
|
|
103
|
+
query(bundle, {}, { onSkip: (s) => malformed.push({ id: s.id, reason: s.reason }) }),
|
|
104
|
+
// legacyNaming: blob keys still under the legacy pages/ prefix.
|
|
105
|
+
listBlobs(bundle, LEGACY_PAGE_BLOB_PREFIX),
|
|
106
|
+
// views: the views/ half of the entry-key existence set (the legacy listing is the other half).
|
|
107
|
+
listBlobs(bundle, VIEW_ENTRY_PREFIX),
|
|
108
|
+
readBundleOkfVersion(bundle)
|
|
109
|
+
.then((version) => ({ version }))
|
|
110
|
+
.catch((error) => {
|
|
111
|
+
if (!(error instanceof MalformedDocumentError))
|
|
112
|
+
throw error;
|
|
113
|
+
return { version: undefined, malformed: { id: "index.md", reason: error.message } };
|
|
114
|
+
}),
|
|
115
|
+
]);
|
|
116
|
+
if ("malformed" in okfVersionRead)
|
|
117
|
+
malformed.unshift(okfVersionRead.malformed);
|
|
118
|
+
const okfVersion = okfVersionRead.version;
|
|
119
|
+
const byId = new Set(docs.map((d) => d.id));
|
|
120
|
+
const docsById = new Map(docs.map((d) => [d.id, d]));
|
|
121
|
+
// Kind lint, per violation; conformance debt regroups the same pass by document and keeps only
|
|
122
|
+
// frontmatter-level codes (a missing body section names no field an update could set).
|
|
123
|
+
const kindLint = [];
|
|
124
|
+
const conformanceDebtDocs = new Map(); // id -> type, first seen (docs is id-sorted)
|
|
125
|
+
for (const doc of docs) {
|
|
126
|
+
const kind = registry.kinds.get(docType(doc));
|
|
127
|
+
if (!kind)
|
|
128
|
+
continue;
|
|
129
|
+
for (const w of projectKindValidationWarnings(okfVersion, kind, validateAgainstKind(doc, kind))) {
|
|
130
|
+
kindLint.push({ id: doc.id, field: w.field ?? "", code: w.code });
|
|
131
|
+
if (isKindFieldValidationWarning(w) && !conformanceDebtDocs.has(doc.id)) {
|
|
132
|
+
conformanceDebtDocs.set(doc.id, docType(doc));
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// The declared typed-edge vocabulary, shared with `link add`'s write-time lint.
|
|
137
|
+
const linkTypeDeclarations = collectLinkDeclarations(registry);
|
|
138
|
+
const unresolvedLinks = [];
|
|
139
|
+
const inbound = new Set();
|
|
140
|
+
const outbound = new Set();
|
|
141
|
+
// id -> resolved inbound edges from OTHER documents (a self-link rescues nothing).
|
|
142
|
+
const inboundEdges = new Map();
|
|
143
|
+
const linkTypeViolations = [];
|
|
144
|
+
const crossLinkTypeViolations = [];
|
|
145
|
+
for (const doc of docs) {
|
|
146
|
+
for (const l of parseLinksFromDoc(doc)) {
|
|
147
|
+
// A malformed `okf:` href without `//` also parses as a local link; it counts once, as a
|
|
148
|
+
// cross-bundle invalid_ref, never as a local edge.
|
|
149
|
+
if (isQualifiedHref(l.href))
|
|
150
|
+
continue;
|
|
151
|
+
// A local link under a qualified declaration is a cross-bundle type violation whether or not
|
|
152
|
+
// its local target exists.
|
|
153
|
+
const qualifiedDeclaration = localEdgeQualifiedDeclaration(linkTypeDeclarations.get(l.text), docType(doc));
|
|
154
|
+
if (qualifiedDeclaration) {
|
|
155
|
+
crossLinkTypeViolations.push({
|
|
156
|
+
from: doc.id,
|
|
157
|
+
href: l.href,
|
|
158
|
+
text: l.text,
|
|
159
|
+
expected: `${qualifiedDeclaration.governs} -> ${qualifiedDeclaration.target}`,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
// Any non-self link is an intentional outgoing edge; an unresolved one has its own finding,
|
|
163
|
+
// so it must not also make its source an orphan.
|
|
164
|
+
if (l.to !== doc.id)
|
|
165
|
+
outbound.add(doc.id);
|
|
166
|
+
if (!byId.has(l.to)) {
|
|
167
|
+
unresolvedLinks.push({ from: doc.id, href: l.href });
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (l.to !== doc.id) {
|
|
171
|
+
inbound.add(l.to);
|
|
172
|
+
const list = inboundEdges.get(l.to) ?? [];
|
|
173
|
+
list.push({ text: l.text, sourceType: docType(doc) });
|
|
174
|
+
inboundEdges.set(l.to, list);
|
|
175
|
+
}
|
|
176
|
+
// A resolved edge whose text is a declared link type its source or target does not conform to.
|
|
177
|
+
const declared = linkTypeDeclarations.get(l.text);
|
|
178
|
+
if (declared && declared.length > 0 && !qualifiedDeclaration) {
|
|
179
|
+
const sourceType = docType(doc);
|
|
180
|
+
const targetType = docType(docsById.get(l.to));
|
|
181
|
+
const matched = declared.find((d) => d.governs === sourceType) ?? declared[0];
|
|
182
|
+
const sourceOk = declared.some((d) => d.governs === sourceType);
|
|
183
|
+
const targetOk = targetType === matched.target;
|
|
184
|
+
if (!sourceOk || !targetOk) {
|
|
185
|
+
linkTypeViolations.push({
|
|
186
|
+
from: doc.id,
|
|
187
|
+
to: l.to,
|
|
188
|
+
text: l.text,
|
|
189
|
+
expected: `${matched.governs} -> ${matched.target}`,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Cross-bundle links, parsed from the documents already in hand.
|
|
196
|
+
const qualifiedLinks = [];
|
|
197
|
+
for (const doc of docs) {
|
|
198
|
+
for (const q of parseQualifiedLinks(doc)) {
|
|
199
|
+
qualifiedLinks.push(q);
|
|
200
|
+
if (!q.ref)
|
|
201
|
+
continue;
|
|
202
|
+
const violation = qualifiedEdgeViolation(linkTypeDeclarations.get(q.text), docType(doc), q.ref.alias);
|
|
203
|
+
if (violation) {
|
|
204
|
+
crossLinkTypeViolations.push({
|
|
205
|
+
from: doc.id,
|
|
206
|
+
href: q.href,
|
|
207
|
+
text: q.text,
|
|
208
|
+
expected: `${violation.governs} -> ${violation.target}`,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
const dependenciesDoc = docsById.get(DEPENDENCIES_DOC_ID);
|
|
214
|
+
const hasCrossBundle = dependenciesDoc !== undefined || qualifiedLinks.length > 0;
|
|
215
|
+
const selfBundleId = declaredBundleId(docsById.get(BUNDLE_NAME_DOC_ID)) ?? options.selfBundleId;
|
|
216
|
+
const declaredDeps = parseDependencies(dependenciesDoc, selfBundleId === undefined ? {} : { selfBundleId });
|
|
217
|
+
// Binding runs here, after every read and on this one parse, so a malformed or absent declaration
|
|
218
|
+
// stays a finding and a self alias is already dropped when the binder sees the declaration.
|
|
219
|
+
const bindings = typeof options.bindings === "function"
|
|
220
|
+
? await options.bindings(declaredDeps)
|
|
221
|
+
: options.bindings ?? new Map();
|
|
222
|
+
let crossBundle = null;
|
|
223
|
+
if (hasCrossBundle) {
|
|
224
|
+
let unchecked = 0;
|
|
225
|
+
const checked = qualifiedLinks.filter((q) => {
|
|
226
|
+
const unbound = q.ref !== null && declaredDeps.dependencies.has(q.ref.alias) && !bindings.has(q.ref.alias);
|
|
227
|
+
if (unbound)
|
|
228
|
+
unchecked++;
|
|
229
|
+
return !unbound;
|
|
230
|
+
});
|
|
231
|
+
const resolver = createLocalResolver({ dependencies: declaredDeps.dependencies, rejected: declaredDeps.rejected, bindings });
|
|
232
|
+
// One probe per bound alias rides the same resolve call, so each binding's verdict (identity,
|
|
233
|
+
// pin) comes from the resolver and its copy is still read in one batch.
|
|
234
|
+
const probeAliases = [...bindings.keys()];
|
|
235
|
+
const probes = probeAliases.map((alias) => {
|
|
236
|
+
const ref = { alias, id: BUNDLE_NAME_DOC_ID };
|
|
237
|
+
return { from: BUNDLE_NAME_DOC_ID, text: "", href: "", ref };
|
|
238
|
+
});
|
|
239
|
+
const results = await resolveQualifiedLinks(resolver, [...checked, ...probes]);
|
|
240
|
+
const verdictByAlias = new Map();
|
|
241
|
+
results.slice(checked.length).forEach((r, i) => {
|
|
242
|
+
const resolution = r.resolution;
|
|
243
|
+
const state = resolution.state === "resolved" || resolution.reason === "target_missing" ? "ok" : resolution.reason;
|
|
244
|
+
verdictByAlias.set(probeAliases[i], state);
|
|
245
|
+
});
|
|
246
|
+
const unresolved = [];
|
|
247
|
+
for (const { link, resolution } of results.slice(0, checked.length)) {
|
|
248
|
+
if (resolution.state === "resolved")
|
|
249
|
+
continue;
|
|
250
|
+
unresolved.push({ from: link.from, href: link.href, reason: resolution.reason, detail: resolution.detail });
|
|
251
|
+
}
|
|
252
|
+
const dependencies = [];
|
|
253
|
+
for (const entry of declaredDeps.dependencies.values()) {
|
|
254
|
+
dependencies.push({
|
|
255
|
+
alias: entry.alias,
|
|
256
|
+
bundle_id: entry.bundle_id,
|
|
257
|
+
state: verdictByAlias.get(entry.alias) ?? "unbound",
|
|
258
|
+
bound: bindings.get(entry.alias)?.label ?? null,
|
|
259
|
+
pin: entry.pin?.value ?? null,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
crossBundle = {
|
|
263
|
+
links: qualifiedLinks.length,
|
|
264
|
+
unchecked,
|
|
265
|
+
unresolved,
|
|
266
|
+
dependencies,
|
|
267
|
+
problems: declaredDeps.problems.map((p) => ({ code: p.code, alias: p.alias ?? null, detail: p.detail })),
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
// Orphans are isolated content documents inside an established graph: a bundle with no resolved
|
|
271
|
+
// edge has not adopted graph structure yet, roots with outbound edges are intentional, and
|
|
272
|
+
// definition documents are classified above.
|
|
273
|
+
const orphans = [];
|
|
274
|
+
if (inbound.size > 0) {
|
|
275
|
+
for (const doc of docs) {
|
|
276
|
+
if (!inbound.has(doc.id) && !outbound.has(doc.id) && !isGraphDefinition(doc)) {
|
|
277
|
+
orphans.push({ id: doc.id, type: docType(doc) });
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
// One freshness authority handles both standard v0.2 `stale_after` and optional Kind horizons.
|
|
282
|
+
const now = options.now ?? new Date();
|
|
283
|
+
const stale = [];
|
|
284
|
+
const noTimestamp = [];
|
|
285
|
+
const invalidStaleAfter = [];
|
|
286
|
+
const invalidTimestamps = [];
|
|
287
|
+
const invalidLegacyTimestamps = [];
|
|
288
|
+
for (const doc of docs) {
|
|
289
|
+
const invalidLegacy = invalidLegacyTimestamp(doc.frontmatter, okfVersion);
|
|
290
|
+
if (invalidLegacy) {
|
|
291
|
+
invalidLegacyTimestamps.push({ id: doc.id, type: docType(doc), field: invalidLegacy.field, value: diagnosticValue(invalidLegacy.value) });
|
|
292
|
+
}
|
|
293
|
+
if (okfVersion === "0.2") {
|
|
294
|
+
for (const { field, value } of invalidOkfTimestamps(doc.frontmatter)) {
|
|
295
|
+
invalidTimestamps.push({ id: doc.id, type: docType(doc), field, value: diagnosticValue(value) });
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
const kind = registry.kinds.get(docType(doc));
|
|
299
|
+
const horizonMs = kind ? freshnessHorizonMs(kind) : undefined;
|
|
300
|
+
const hasStaleAfter = okfVersion === "0.2" && Object.hasOwn(doc.frontmatter, "stale_after");
|
|
301
|
+
const staleAfterIsInvalid = hasStaleAfter && staleAfterInstant(doc.frontmatter.stale_after) === null;
|
|
302
|
+
if (staleAfterIsInvalid) {
|
|
303
|
+
invalidStaleAfter.push({ id: doc.id, type: docType(doc), value: diagnosticValue(doc.frontmatter.stale_after) });
|
|
304
|
+
}
|
|
305
|
+
// A readable stale_after is a string: staleAfterInstant accepts strings only.
|
|
306
|
+
const staleAfter = hasStaleAfter && !staleAfterIsInvalid
|
|
307
|
+
? doc.frontmatter.stale_after
|
|
308
|
+
: undefined;
|
|
309
|
+
if (horizonMs === undefined && staleAfter === undefined)
|
|
310
|
+
continue;
|
|
311
|
+
const result = freshness(doc, { maxAgeMs: horizonMs, now, okfVersion });
|
|
312
|
+
if (result.verdict === "empty" && horizonMs !== undefined) {
|
|
313
|
+
noTimestamp.push({ id: doc.id, type: docType(doc) });
|
|
314
|
+
}
|
|
315
|
+
else if (result.verdict === "stale") {
|
|
316
|
+
stale.push({
|
|
317
|
+
id: doc.id,
|
|
318
|
+
...(result.ageMs === undefined ? {} : { age_ms: result.ageMs }),
|
|
319
|
+
...(horizonMs === undefined ? {} : { horizon_ms: horizonMs }),
|
|
320
|
+
...(staleAfter === undefined ? {} : { stale_after: staleAfter }),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
// OKF v0.2 trust tiers (SPEC 5.3); v0.1 defines no trust family.
|
|
325
|
+
const trust = okfVersion === "0.2" && docs.length > 0 ? trustTierCounts(docs) : null;
|
|
326
|
+
// Inbound expectations: one row per instance of a Kind declaring `expects_inbound` that lacks a
|
|
327
|
+
// conforming inbound edge. An instance whose Kind declares a terminal set it currently matches is
|
|
328
|
+
// skipped and counted, never silently dropped.
|
|
329
|
+
const missingExpectedRanked = [];
|
|
330
|
+
let terminalSkipped = 0;
|
|
331
|
+
for (const doc of docs) {
|
|
332
|
+
const kind = registry.kinds.get(docType(doc));
|
|
333
|
+
if (!kind?.expectsInbound)
|
|
334
|
+
continue;
|
|
335
|
+
const terminalDeclared = Object.keys(kind.fields.terminal).length > 0;
|
|
336
|
+
if (terminalDeclared && isTerminal(kind, doc.frontmatter)) {
|
|
337
|
+
terminalSkipped++;
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
const edges = inboundEdges.get(doc.id) ?? [];
|
|
341
|
+
const missing = Object.entries(kind.expectsInbound)
|
|
342
|
+
.filter(([text, sourceKind]) => !edges.some((e) => e.text === text && e.sourceType === sourceKind))
|
|
343
|
+
.map(([text]) => text);
|
|
344
|
+
if (missing.length === 0)
|
|
345
|
+
continue;
|
|
346
|
+
const declaresStatus = kind.fields.required.includes("status") || kind.fields.optional.includes("status");
|
|
347
|
+
const row = declaresStatus
|
|
348
|
+
? { id: doc.id, status: doc.frontmatter.status, missing }
|
|
349
|
+
: { id: doc.id, missing };
|
|
350
|
+
// Non-terminal instances sort first: by the declared terminal set when the Kind has one, else
|
|
351
|
+
// by the historical status === "done" fallback.
|
|
352
|
+
const sortsFirst = terminalDeclared ? isTerminal(kind, doc.frontmatter) : row.status === "done";
|
|
353
|
+
missingExpectedRanked.push({ row, sortsFirst });
|
|
354
|
+
}
|
|
355
|
+
missingExpectedRanked.sort((a, b) => {
|
|
356
|
+
if (a.sortsFirst !== b.sortsFirst)
|
|
357
|
+
return a.sortsFirst ? 1 : -1;
|
|
358
|
+
return String(a.row.id).localeCompare(String(b.row.id));
|
|
359
|
+
});
|
|
360
|
+
const missingExpectedLinks = missingExpectedRanked.map((e) => e.row);
|
|
361
|
+
// legacyNaming: retired names the runtime no longer accepts, plus legacy locations (still
|
|
362
|
+
// recognized, reported as information). Documents count only under the legacy registry prefix,
|
|
363
|
+
// blob keys only under the legacy entry prefix.
|
|
364
|
+
const legacyNaming = {
|
|
365
|
+
pageTyped: docs.filter((doc) => isLegacyPageDoc(doc.frontmatter)).map((doc) => ({ id: doc.id })),
|
|
366
|
+
bridgeField: docs.filter((doc) => hasLegacyBridgeField(doc.frontmatter)).map((doc) => ({ id: doc.id })),
|
|
367
|
+
pageConvention: docs.filter((doc) => isLegacyPageConvention(doc.frontmatter)).map((doc) => ({ id: doc.id })),
|
|
368
|
+
legacyPrefix: [
|
|
369
|
+
...docs.filter((doc) => isLegacyRegistryDocId(doc.id)).map((doc) => ({ id: doc.id, store: "doc" })),
|
|
370
|
+
...legacyBlobKeys
|
|
371
|
+
.slice()
|
|
372
|
+
.sort()
|
|
373
|
+
.map((key) => ({ id: key, store: "blob" })),
|
|
374
|
+
],
|
|
375
|
+
};
|
|
376
|
+
// The View surface, recognized with the same predicates the ui launcher uses (legacy locations
|
|
377
|
+
// included; a Page-typed document is a legacyNaming finding instead). Entry existence derives
|
|
378
|
+
// from the two prefix-scoped listings above, never a per-registration probe.
|
|
379
|
+
const entryBlobKeys = new Set([...viewBlobKeys, ...legacyBlobKeys]);
|
|
380
|
+
const views = { typed: 0, danglingEntries: [], invalidRegistrations: [] };
|
|
381
|
+
for (const doc of docs) {
|
|
382
|
+
if (!isPageTypeName(doc.frontmatter.type))
|
|
383
|
+
continue;
|
|
384
|
+
views.typed++;
|
|
385
|
+
const registration = parseRegistration(doc.id, doc.frontmatter);
|
|
386
|
+
if (registration) {
|
|
387
|
+
if (!entryBlobKeys.has(registration.entry)) {
|
|
388
|
+
views.danglingEntries.push({ id: registration.id, entry: registration.entry });
|
|
389
|
+
}
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
// The document declares the View kind name but fails the registration grammar; name each
|
|
393
|
+
// failing leg with the grammar helpers parseRegistration composes.
|
|
394
|
+
const legs = [];
|
|
395
|
+
if (!isAnyRegistryId(doc.id))
|
|
396
|
+
legs.push("id");
|
|
397
|
+
if (!isAnyEntryKey(doc.frontmatter.entry))
|
|
398
|
+
legs.push("entry");
|
|
399
|
+
if (Object.hasOwn(doc.frontmatter, "entry_version") &&
|
|
400
|
+
!isViewEntryVersion(doc.frontmatter.entry_version)) {
|
|
401
|
+
legs.push("entry_version");
|
|
402
|
+
}
|
|
403
|
+
views.invalidRegistrations.push({ id: doc.id, problem: legs.join("+") });
|
|
404
|
+
}
|
|
405
|
+
const statusCollisions = okfV02WorkflowStatusCollisions(registry, docs);
|
|
406
|
+
const okfUpgrade = okfVersion === "0.1" && statusCollisions.length > 0
|
|
407
|
+
? {
|
|
408
|
+
statusFieldRows: statusCollisions,
|
|
409
|
+
affectedDocuments: statusCollisions.reduce((total, row) => total + row.affected_documents, 0),
|
|
410
|
+
}
|
|
411
|
+
: null;
|
|
412
|
+
return {
|
|
413
|
+
okfVersion,
|
|
414
|
+
docs: docs.length,
|
|
415
|
+
kinds: registry.kinds.size,
|
|
416
|
+
malformed,
|
|
417
|
+
kindLint,
|
|
418
|
+
conformanceDebt: registry.kinds.size > 0 ? [...conformanceDebtDocs].map(([id, type]) => ({ id, type })) : null,
|
|
419
|
+
registryWarnings: registry.warnings,
|
|
420
|
+
unresolvedLinks,
|
|
421
|
+
orphans,
|
|
422
|
+
linkTypeViolations,
|
|
423
|
+
crossLinkTypeViolations,
|
|
424
|
+
missingExpectedLinks,
|
|
425
|
+
terminalSkipped,
|
|
426
|
+
stale,
|
|
427
|
+
noTimestamp,
|
|
428
|
+
invalidStaleAfter,
|
|
429
|
+
invalidTimestamps,
|
|
430
|
+
invalidLegacyTimestamps,
|
|
431
|
+
trust,
|
|
432
|
+
views,
|
|
433
|
+
crossBundle,
|
|
434
|
+
okfUpgrade,
|
|
435
|
+
legacyNaming,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/bundle-health/report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAA6C,MAAM,oBAAoB,CAAC;AAC3H,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,UAAU,EACV,6BAA6B,EAC7B,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACL,aAAa,EACb,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAyC,MAAM,uBAAuB,CAAC;AAGpH,OAAO,EAAE,eAAe,EAAwB,MAAM,oBAAoB,CAAC;AAC3E,OA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B;QACvB,KAAK;QACL,KAAK;QACL,WAAW;QACX,UAAU;QACV,YAAY;KACb,CAAC;AACJ,CAAC"}
|
|
@@ -111,9 +111,18 @@ export type HostedWriteResult = (WriteResultBase & {
|
|
|
111
111
|
readonly code: HostedWriteRefusalCode;
|
|
112
112
|
readonly message: string;
|
|
113
113
|
})
|
|
114
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* The host may or may not hold the write. `lookupWrite` or `settleWrite` asks again later.
|
|
116
|
+
* `refusal` is the refusal of this call's resend, when one ended it: the resend was refused
|
|
117
|
+
* before it ran (access withdrawn, signed out, a spent quota, a malformed request) while an
|
|
118
|
+
* earlier delivery may still commit, so the write is kept. It says why settling must wait.
|
|
119
|
+
*/
|
|
115
120
|
| (WriteResultBase & {
|
|
116
121
|
readonly status: "unknown";
|
|
122
|
+
readonly refusal?: {
|
|
123
|
+
readonly code: string;
|
|
124
|
+
readonly message: string;
|
|
125
|
+
};
|
|
117
126
|
});
|
|
118
127
|
/**
|
|
119
128
|
* What `lookupWrite` and `settleWrite` answer: a write's result, or `unrecorded` when the intent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/hosted-client/write.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAIL,KAAK,cAAc,EAGpB,MAAM,uBAAuB,CAAC;AAI/B,sGAAsG;AACtG,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,YAAY,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@ -170,7 +170,7 @@ function resultOf(intent, outcome) {
|
|
|
170
170
|
return { ...base, status: "conflict", reason: "concurrent_change", message: outcome.message };
|
|
171
171
|
return { ...base, status: "refused", code: outcome.code, message: outcome.message };
|
|
172
172
|
case "unknown":
|
|
173
|
-
return { ...base, status: "unknown" };
|
|
173
|
+
return { ...base, status: "unknown", ...(outcome.refusal ? { refusal: { code: outcome.refusal.code, message: outcome.refusal.message } } : {}) };
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
/** The signal a write's requests run under: the client's, and the caller's when given. */
|
|
@@ -255,8 +255,8 @@ async function deliver(context, intent, reader, capabilities, callerSignal) {
|
|
|
255
255
|
if (storeFailure)
|
|
256
256
|
throw storeFailure.cause;
|
|
257
257
|
// A refusal after the caller aborted is the abort's (the carrier sends nothing once it has),
|
|
258
|
-
// never the host's verdict: the identity stays unknown and its record is kept.
|
|
259
|
-
const answer = callerSignal.aborted && outcome.kind === "refused" ? { kind: "unknown" } : outcome;
|
|
258
|
+
// never the host's verdict: the identity stays unknown and its record is kept, with no reason.
|
|
259
|
+
const answer = callerSignal.aborted && (outcome.kind === "refused" || outcome.kind === "unknown") ? { kind: "unknown" } : outcome;
|
|
260
260
|
await recordOutcome(context, intent, answer, settled.attempts);
|
|
261
261
|
return resultOf(intent, answer);
|
|
262
262
|
}
|
|
@@ -339,7 +339,8 @@ async function lookupOnly(context, intent, reader, capabilities, signal) {
|
|
|
339
339
|
const transport = transportFor(context, intent, reader, capabilities, signal);
|
|
340
340
|
let outcome;
|
|
341
341
|
try {
|
|
342
|
-
|
|
342
|
+
const recorded = await transport.lookup(intent.requestId);
|
|
343
|
+
outcome = recorded === null || recorded.kind === "pending" ? { kind: "unknown" } : recorded;
|
|
343
344
|
}
|
|
344
345
|
catch {
|
|
345
346
|
outcome = { kind: "unknown" };
|
|
@@ -356,6 +357,8 @@ export async function hostedLookupWrite(context, requestId, options = {}) {
|
|
|
356
357
|
const signal = writeSignal(context, options.signal);
|
|
357
358
|
signal.throwIfAborted();
|
|
358
359
|
return serialized(context, requestId, async () => {
|
|
360
|
+
// Aborted while an earlier call under this identity ran: this one sends nothing.
|
|
361
|
+
signal.throwIfAborted();
|
|
359
362
|
const held = await heldIntent(context, requestId);
|
|
360
363
|
if (!("intent" in held))
|
|
361
364
|
return held;
|
|
@@ -372,6 +375,8 @@ export async function hostedSettleWrite(context, requestId, options = {}) {
|
|
|
372
375
|
const signal = writeSignal(context, options.signal);
|
|
373
376
|
signal.throwIfAborted();
|
|
374
377
|
return serialized(context, requestId, async () => {
|
|
378
|
+
// Aborted while an earlier call under this identity ran: this one sends nothing.
|
|
379
|
+
signal.throwIfAborted();
|
|
375
380
|
const held = await heldIntent(context, requestId);
|
|
376
381
|
if (!("intent" in held))
|
|
377
382
|
return held;
|