@superbee/core 0.2.0-pre.32 → 0.2.0-pre.33
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 +5 -0
- package/dist/backend.d.ts +3 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +76 -8
- package/dist/backend.js.map +1 -1
- package/dist/bundle-health/report.d.ts +5 -0
- package/dist/bundle-health/report.d.ts.map +1 -1
- package/dist/bundle-health/report.js +4 -0
- package/dist/bundle-health/report.js.map +1 -1
- package/dist/bundle-ops.d.ts +1 -1
- package/dist/bundle-ops.d.ts.map +1 -1
- package/dist/bundle-ops.js +2 -2
- package/dist/bundle-ops.js.map +1 -1
- package/dist/document-mutation.d.ts +3 -0
- package/dist/document-mutation.d.ts.map +1 -1
- package/dist/document-mutation.js +24 -2
- package/dist/document-mutation.js.map +1 -1
- package/dist/engine.d.ts +3 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +16 -4
- package/dist/engine.js.map +1 -1
- package/dist/filesystem-identity.d.ts +9 -7
- package/dist/filesystem-identity.d.ts.map +1 -1
- package/dist/filesystem-identity.js +58 -5
- package/dist/filesystem-identity.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/inventory-guard.d.ts +58 -0
- package/dist/inventory-guard.d.ts.map +1 -0
- package/dist/inventory-guard.js +169 -0
- package/dist/inventory-guard.js.map +1 -0
- package/dist/kind-authoring.d.ts.map +1 -1
- package/dist/kind-authoring.js +1 -0
- package/dist/kind-authoring.js.map +1 -1
- package/dist/kind-deprecation.d.ts +32 -0
- package/dist/kind-deprecation.d.ts.map +1 -0
- package/dist/kind-deprecation.js +141 -0
- package/dist/kind-deprecation.js.map +1 -0
- package/dist/kinds.d.ts +31 -1
- package/dist/kinds.d.ts.map +1 -1
- package/dist/kinds.js +13 -0
- package/dist/kinds.js.map +1 -1
- package/dist/memory-backend.d.ts +3 -0
- package/dist/memory-backend.d.ts.map +1 -1
- package/dist/memory-backend.js +38 -0
- package/dist/memory-backend.js.map +1 -1
- package/dist/okf-standard-fields.d.ts +3 -0
- package/dist/okf-standard-fields.d.ts.map +1 -1
- package/dist/okf-standard-fields.js +3 -0
- package/dist/okf-standard-fields.js.map +1 -1
- package/dist/recipe-lifecycle/evolution.d.ts +13 -1
- package/dist/recipe-lifecycle/evolution.d.ts.map +1 -1
- package/dist/recipe-lifecycle/evolution.js +88 -9
- package/dist/recipe-lifecycle/evolution.js.map +1 -1
- package/dist/recipe-lifecycle/index.d.ts +4 -0
- package/dist/recipe-lifecycle/index.d.ts.map +1 -1
- package/dist/recipe-lifecycle/index.js +2 -0
- package/dist/recipe-lifecycle/index.js.map +1 -1
- package/dist/recipe-lifecycle/install.d.ts.map +1 -1
- package/dist/recipe-lifecycle/install.js +11 -1
- package/dist/recipe-lifecycle/install.js.map +1 -1
- package/dist/recipe-lifecycle/retirement-apply.d.ts +59 -0
- package/dist/recipe-lifecycle/retirement-apply.d.ts.map +1 -0
- package/dist/recipe-lifecycle/retirement-apply.js +165 -0
- package/dist/recipe-lifecycle/retirement-apply.js.map +1 -0
- package/dist/recipe-lifecycle/retirement.d.ts +89 -0
- package/dist/recipe-lifecycle/retirement.d.ts.map +1 -0
- package/dist/recipe-lifecycle/retirement.js +347 -0
- package/dist/recipe-lifecycle/retirement.js.map +1 -0
- package/dist/source-profiles/index.d.ts +1 -1
- package/dist/source-profiles/index.js +1 -1
- package/dist/storage.d.ts +2 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +1 -0
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { INVENTORY_GUARD_DOMAIN, type InventoryGuardTarget } from "../inventory-guard.js";
|
|
2
|
+
import type { LoadedRecipe } from "../recipes.js";
|
|
3
|
+
import type { Bundle } from "../types.js";
|
|
4
|
+
import { type RecipeDeclarationRetirementPlan, type RetirementDeclaration, type RetirementIssue } from "./retirement.js";
|
|
5
|
+
export interface RecipeRetirementApplyOptions {
|
|
6
|
+
scope?: typeof INVENTORY_GUARD_DOMAIN;
|
|
7
|
+
definitionId?: string;
|
|
8
|
+
consumerEvidence?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface RecipeDeclarationRetirementApplyPlan {
|
|
11
|
+
recipe: "declaration retirement apply";
|
|
12
|
+
id: string;
|
|
13
|
+
version: string;
|
|
14
|
+
source: string;
|
|
15
|
+
source_digest: string;
|
|
16
|
+
scope: typeof INVENTORY_GUARD_DOMAIN;
|
|
17
|
+
ready_for_next_stage: boolean;
|
|
18
|
+
next_definition: string | null;
|
|
19
|
+
pending_definitions: string[];
|
|
20
|
+
declarations: RetirementDeclaration[];
|
|
21
|
+
blockers: RetirementIssue[];
|
|
22
|
+
target?: InventoryGuardTarget;
|
|
23
|
+
plan_token?: string;
|
|
24
|
+
consumers: RecipeDeclarationRetirementPlan["consumers"];
|
|
25
|
+
external_consumers: RecipeDeclarationRetirementPlan["external_consumers"];
|
|
26
|
+
}
|
|
27
|
+
export interface RecipeDeclarationRetirementApplyResult {
|
|
28
|
+
recipe: "declaration retirement apply";
|
|
29
|
+
id: string;
|
|
30
|
+
version: string;
|
|
31
|
+
scope: typeof INVENTORY_GUARD_DOMAIN;
|
|
32
|
+
completed: Array<{
|
|
33
|
+
id: string;
|
|
34
|
+
version: string;
|
|
35
|
+
changed: boolean;
|
|
36
|
+
stamped: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
pending_definitions: string[];
|
|
39
|
+
complete: boolean;
|
|
40
|
+
refresh_needed: boolean;
|
|
41
|
+
consumers: RecipeDeclarationRetirementPlan["consumers"];
|
|
42
|
+
external_consumers: RecipeDeclarationRetirementPlan["external_consumers"];
|
|
43
|
+
}
|
|
44
|
+
export declare class RecipeRetirementApplyError extends Error {
|
|
45
|
+
readonly reason: "plan_changed" | "blocked" | "interrupted" | "outcome_unknown";
|
|
46
|
+
readonly plan: RecipeDeclarationRetirementApplyPlan;
|
|
47
|
+
readonly completed: [];
|
|
48
|
+
readonly failed: {
|
|
49
|
+
id: string | null;
|
|
50
|
+
reason: string;
|
|
51
|
+
};
|
|
52
|
+
readonly pending_definitions: string[];
|
|
53
|
+
constructor(reason: RecipeRetirementApplyError["reason"], plan: RecipeDeclarationRetirementApplyPlan, cause?: unknown);
|
|
54
|
+
}
|
|
55
|
+
export declare function planRecipeDeclarationRetirementApply(bundle: Bundle, source: LoadedRecipe, options?: RecipeRetirementApplyOptions): Promise<RecipeDeclarationRetirementApplyPlan>;
|
|
56
|
+
export declare function applyRecipeDeclarationRetirement(bundle: Bundle, source: LoadedRecipe, expectedApplyToken: string, options?: RecipeRetirementApplyOptions & {
|
|
57
|
+
actor?: string;
|
|
58
|
+
}): Promise<RecipeDeclarationRetirementApplyResult>;
|
|
59
|
+
//# sourceMappingURL=retirement-apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retirement-apply.d.ts","sourceRoot":"","sources":["../../src/recipe-lifecycle/retirement-apply.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgC,sBAAsB,EAAwE,KAAK,oBAAoB,EAAuB,MAAM,uBAAuB,CAAC;AAGnN,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC;AAIvD,OAAO,EAAsC,KAAK,+BAA+B,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE7J,MAAM,WAAW,4BAA4B;IAC3C,KAAK,CAAC,EAAE,OAAO,sBAAsB,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,oCAAoC;IACnD,MAAM,E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AAI,EAAE,oCAAoC,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAM;IAC5B,QAAQ,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,QAAQ,CAAC,mBAAmB,EAAE,MAAM,EAAE,CAAC;gBAC3B,MAAM,EAAE,0BAA0B,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,oCAAoC,EAAE,KAAK,CAAC,EAAE,OAAO;CAOtH;AA+ED,wBAAsB,oCAAoC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,4BAAiC,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAE1L;AACD,wBAAsB,gCAAgC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,EAAE,OAAO,GAAE,4BAA4B,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,sCAAsC,CAAC,CA4BzO"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/** One explicitly selected actual-source retirement stage; storage remains the commit authority. */
|
|
2
|
+
import { InvalidInputError } from "../errors.js";
|
|
3
|
+
import { compareStorageKeys } from "../paths.js";
|
|
4
|
+
import { VersionConflict } from "../versioning.js";
|
|
5
|
+
import { backendFor } from "../bundle-ops.js";
|
|
6
|
+
import { DocumentNotFoundError, mutateDocument } from "../document-mutation.js";
|
|
7
|
+
import { captureInventoryGuardRequest, INVENTORY_GUARD_DOMAIN, InventoryGuardConflict, InventoryGuardUnsupported, inventoryGuardFor } from "../inventory-guard.js";
|
|
8
|
+
import { buildKindRegistry } from "../kinds.js";
|
|
9
|
+
import { recipePreflightDigest } from "../recipe-set-preflight.js";
|
|
10
|
+
import { prepareRecipeRetirementStage } from "./evolution.js";
|
|
11
|
+
import { inspectRecipeInstallTarget, recipeDocumentForApply } from "./install.js";
|
|
12
|
+
import { definitionDigest } from "./stamp.js";
|
|
13
|
+
import { prepareRecipeDeclarationRetirement } from "./retirement.js";
|
|
14
|
+
export class RecipeRetirementApplyError extends Error {
|
|
15
|
+
reason;
|
|
16
|
+
plan;
|
|
17
|
+
completed = [];
|
|
18
|
+
failed;
|
|
19
|
+
pending_definitions;
|
|
20
|
+
constructor(reason, plan, cause) {
|
|
21
|
+
super(`Recipe retirement ${reason}; inspect a fresh stage plan before continuing.`, cause === undefined ? undefined : { cause });
|
|
22
|
+
this.name = "RecipeRetirementApplyError";
|
|
23
|
+
this.reason = reason;
|
|
24
|
+
this.plan = plan;
|
|
25
|
+
this.failed = { id: plan.next_definition, reason };
|
|
26
|
+
this.pending_definitions = [...(plan.next_definition ? [plan.next_definition] : []), ...plan.pending_definitions];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
30
|
+
async function prepareStage(bundle, source, options) {
|
|
31
|
+
source = structuredClone(source);
|
|
32
|
+
options = { ...options };
|
|
33
|
+
if (Object.hasOwn(options, "consumerEvidence")) {
|
|
34
|
+
try {
|
|
35
|
+
options.consumerEvidence = structuredClone(options.consumerEvidence);
|
|
36
|
+
}
|
|
37
|
+
catch { /* The owning preflight returns unsupported input as a refusal. */ }
|
|
38
|
+
}
|
|
39
|
+
const bound = { root: bundle.root, backend: backendFor(bundle) };
|
|
40
|
+
let target, guardIssue;
|
|
41
|
+
try {
|
|
42
|
+
target = await inventoryGuardFor(bound.backend).observeTarget();
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
guardIssue = error instanceof Error ? error.message : String(error);
|
|
46
|
+
}
|
|
47
|
+
const prepared = await prepareRecipeDeclarationRetirement(bound, source, options);
|
|
48
|
+
const report = prepared.report;
|
|
49
|
+
const ids = [...new Set(report.declarations.map(row => row.definition))].sort(compareStorageKeys);
|
|
50
|
+
const next = options.definitionId ?? ids[0] ?? null;
|
|
51
|
+
const selected = report.declarations.filter(row => row.definition === next);
|
|
52
|
+
const blockers = [...report.blockers];
|
|
53
|
+
const block = (code, message) => blockers.push({ code, id: next ?? report.id, message });
|
|
54
|
+
if (options.scope !== INVENTORY_GUARD_DOMAIN)
|
|
55
|
+
block("RETIREMENT_SCOPE_REQUIRED", "Explicit exact-root cooperating-local-writers-v1, local-only and consumer-unassessed limits are required.");
|
|
56
|
+
if (!next || !selected.length)
|
|
57
|
+
block("RETIREMENT_NO_ELIGIBLE_STAGE", "No eligible deprecated omission exists in the selected definition.");
|
|
58
|
+
if (!report.local.complete || report.local.issues.length)
|
|
59
|
+
block("RETIREMENT_LOCAL_UNKNOWN", "Complete readable stable local inventory is required.");
|
|
60
|
+
if (selected.some(row => row.usage.some(usage => usage.unknown || usage.count > 0)))
|
|
61
|
+
block("RETIREMENT_DECLARATION_USED_OR_UNKNOWN", "The selected definition has used or unknown retired coordinates.");
|
|
62
|
+
if (guardIssue || !target)
|
|
63
|
+
block("RETIREMENT_GUARD_UNAVAILABLE", guardIssue ?? "The actual backend has no supported guard.");
|
|
64
|
+
if (target && (target.edition !== report.local.okf_version || target.root_version !== report.local.root_index_version))
|
|
65
|
+
block("RETIREMENT_TARGET_CHANGED", "Guard target metadata differs from the inspected local scope.");
|
|
66
|
+
const inventory = report.local.inventory.filter((row) => row.version !== null).sort((a, b) => compareStorageKeys(a.id, b.id));
|
|
67
|
+
let candidate;
|
|
68
|
+
if (next && selected.length && report.local.complete) {
|
|
69
|
+
try {
|
|
70
|
+
const stage = await prepareRecipeRetirementStage(bound, prepared.source, next, selected);
|
|
71
|
+
blockers.push(...stage.plan.blockers);
|
|
72
|
+
candidate = stage.writes.get(next);
|
|
73
|
+
if (!candidate)
|
|
74
|
+
block("RETIREMENT_STAGE_UNCHANGED", "No actual-source retirement write was prepared.");
|
|
75
|
+
if (stage.plan.definitions.some(row => row.id === next && row.expected_version !== prepared.snapshots.get(next)?.version))
|
|
76
|
+
block("RETIREMENT_TARGET_CHANGED", "The stage target changed after the scan.");
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
block("RETIREMENT_STAGE_UNAVAILABLE", error instanceof Error ? error.message : String(error));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (Object.hasOwn(options, "consumerEvidence")) {
|
|
83
|
+
if (report.consumers.status === "partial" || report.consumers.status === "refused" || report.consumers.binding_issues.length || report.consumers.result?.verdict !== "valid")
|
|
84
|
+
block("RETIREMENT_CONSUMER_EVIDENCE_UNSUPPORTED", "Supplied consumer evidence must be valid and exactly bound; it cannot be downgraded to unassessed.");
|
|
85
|
+
// B assessed the final source. It certifies this stage only when all other owned concepts
|
|
86
|
+
// already match, and this actual evolution-owned candidate matches its assessed projection.
|
|
87
|
+
const owned = prepared.installation ? [...prepared.installation.docs, ...prepared.installation.connectors.map(row => row.doc), ...prepared.installation.references.map(row => row.doc), ...prepared.installation.pages.map(row => row.registry)] : [];
|
|
88
|
+
if (!candidate || !owned.length || owned.some(wanted => {
|
|
89
|
+
const actual = wanted.id === next ? candidate : prepared.snapshots.get(wanted.id)?.doc;
|
|
90
|
+
if (!actual || !prepared.installation)
|
|
91
|
+
return true;
|
|
92
|
+
const inspection = inspectRecipeInstallTarget(actual, wanted, prepared.installation);
|
|
93
|
+
return !inspection.sameContent || inspection.stamp !== "current" || inspection.stampIntegrity !== "current";
|
|
94
|
+
}))
|
|
95
|
+
block("RETIREMENT_STAGE_CONSUMER_UNREPRESENTABLE", "Final-source evidence does not represent this concrete intermediate stage; supply an actual staged source/evidence or inspect a later stage.");
|
|
96
|
+
}
|
|
97
|
+
if (target) {
|
|
98
|
+
try {
|
|
99
|
+
if (recipePreflightDigest(await inventoryGuardFor(bound.backend).observeTarget()) !== recipePreflightDigest(target))
|
|
100
|
+
block("RETIREMENT_TARGET_CHANGED", "Guard target changed while planning.");
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
block("RETIREMENT_GUARD_UNAVAILABLE", error instanceof Error ? error.message : String(error));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (target && candidate && next) {
|
|
107
|
+
try {
|
|
108
|
+
captureInventoryGuardRequest({ target, domain: INVENTORY_GUARD_DOMAIN, inventory, id: next,
|
|
109
|
+
expectedVersion: prepared.snapshots.get(next).version, doc: candidate });
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
block("RETIREMENT_GUARD_UNAVAILABLE", error instanceof Error ? error.message : String(error));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
blockers.sort((a, b) => compare(JSON.stringify(a), JSON.stringify(b)));
|
|
116
|
+
const plan = {
|
|
117
|
+
recipe: "declaration retirement apply", id: report.id, version: report.version, source: report.source, source_digest: report.source_digest,
|
|
118
|
+
scope: INVENTORY_GUARD_DOMAIN, ready_for_next_stage: blockers.length === 0,
|
|
119
|
+
next_definition: next, pending_definitions: ids.filter(id => id !== next), declarations: selected, blockers,
|
|
120
|
+
...(target ? { target } : {}), consumers: report.consumers, external_consumers: report.external_consumers,
|
|
121
|
+
};
|
|
122
|
+
if (plan.ready_for_next_stage && candidate) {
|
|
123
|
+
plan.plan_token = `retirement-apply/v1:${recipePreflightDigest({ plan, inventory, observation_digest: report.local.observation_digest,
|
|
124
|
+
candidate: definitionDigest(candidate), stamp: candidate.frontmatter.x_recipe })}`;
|
|
125
|
+
}
|
|
126
|
+
return { plan, bundle: bound, candidate, inventory, expectedVersion: next ? prepared.snapshots.get(next)?.version : undefined };
|
|
127
|
+
}
|
|
128
|
+
export async function planRecipeDeclarationRetirementApply(bundle, source, options = {}) {
|
|
129
|
+
return (await prepareStage(bundle, source, options)).plan;
|
|
130
|
+
}
|
|
131
|
+
export async function applyRecipeDeclarationRetirement(bundle, source, expectedApplyToken, options = {}) {
|
|
132
|
+
options = { ...options };
|
|
133
|
+
const stage = await prepareStage(bundle, source, options);
|
|
134
|
+
const { plan } = stage;
|
|
135
|
+
if (!plan.ready_for_next_stage)
|
|
136
|
+
throw new RecipeRetirementApplyError("blocked", plan);
|
|
137
|
+
if (!/^retirement-apply\/v1:sha256:[0-9a-f]{64}$/.test(expectedApplyToken) || expectedApplyToken !== plan.plan_token)
|
|
138
|
+
throw new RecipeRetirementApplyError("plan_changed", plan);
|
|
139
|
+
const now = new Date().toISOString();
|
|
140
|
+
const desired = recipeDocumentForApply(stage.candidate, plan.target.edition, now);
|
|
141
|
+
try {
|
|
142
|
+
const result = await mutateDocument({ bundle: stage.bundle, id: plan.next_definition, mode: "replace-document", onAbsent: "fail",
|
|
143
|
+
expectedVersion: stage.expectedVersion, maxAttempts: 1, registry: buildKindRegistry([], [], { okfVersion: plan.target.edition }), strict: false,
|
|
144
|
+
seedGenerationClock: false, persistActor: false, actor: options.actor, now: () => now,
|
|
145
|
+
inventoryGuard: { target: plan.target, domain: plan.scope, inventory: stage.inventory },
|
|
146
|
+
buildCandidate: (_existing, context) => {
|
|
147
|
+
if (context.okfVersion !== plan.target.edition)
|
|
148
|
+
throw new InventoryGuardConflict("edition");
|
|
149
|
+
return { frontmatter: desired.frontmatter, body: desired.body };
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
return { recipe: "declaration retirement apply", id: plan.id, version: plan.version, scope: plan.scope,
|
|
153
|
+
completed: [{ id: plan.next_definition, version: result.version, changed: result.changed, stamped: true }],
|
|
154
|
+
pending_definitions: plan.pending_definitions, complete: plan.pending_definitions.length === 0, refresh_needed: plan.pending_definitions.length > 0,
|
|
155
|
+
consumers: plan.consumers, external_consumers: plan.external_consumers };
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
// These owning typed refusals establish that publication did not occur. Keep their
|
|
159
|
+
// authority; only an unclassified persistence failure has an uncertain outcome.
|
|
160
|
+
if (error instanceof InventoryGuardUnsupported || error instanceof InvalidInputError || error instanceof VersionConflict || error instanceof DocumentNotFoundError)
|
|
161
|
+
throw error;
|
|
162
|
+
throw new RecipeRetirementApplyError(error instanceof InventoryGuardConflict ? "interrupted" : "outcome_unknown", plan, error);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=retirement-apply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retirement-apply.js","sourceRoot":"","sources":["../../src/recipe-lifecycle/retirement-apply.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,iBAAiB,EAAkD,MAAM,uBAAuB,CAAC;AACnN,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,kCAAkC,EAA0F,MAAM,iBAAiB,CAAC;AAoC7J,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC1C,MAAM,CAAiE;IACvE,IAAI,CAAuC;IAC3C,SAAS,GAAO,EAAE,CAAC;IACnB,MAAM,CAAwC;IAC9C,mBAAmB,CAAW;IACvC,YAAY,MAA4C,EAAE,IAA0C,EAAE,KAAe;QACnH,KAAK,CAAC,qBAAqB,MAAM,iDAAiD,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC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
|
|
2
|
+
import { type PreflightResult } from "../recipe-set-preflight.js";
|
|
3
|
+
import type { Bundle, ReadResult } from "../types.js";
|
|
4
|
+
import { type PreparedRecipeInstall } from "./install.js";
|
|
5
|
+
export interface RetirementIssue {
|
|
6
|
+
code: string;
|
|
7
|
+
id: string;
|
|
8
|
+
message: string;
|
|
9
|
+
field?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RetirementDeclaration {
|
|
12
|
+
definition: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
coordinate: "field" | "value" | "link";
|
|
15
|
+
name: string;
|
|
16
|
+
value?: string;
|
|
17
|
+
installed_version: string;
|
|
18
|
+
proposed_definition_digest: string;
|
|
19
|
+
usage: Array<{
|
|
20
|
+
id: string;
|
|
21
|
+
count: number;
|
|
22
|
+
unknown?: true;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface RecipeDeclarationRetirementPlan {
|
|
26
|
+
recipe: "declaration retirement inspection";
|
|
27
|
+
id: string;
|
|
28
|
+
version: string;
|
|
29
|
+
source: string;
|
|
30
|
+
source_digest: string;
|
|
31
|
+
scope: "observed-local-concepts-and-supplied-structural-consumers";
|
|
32
|
+
can_apply: false;
|
|
33
|
+
apply_blocker: "RETIREMENT_APPLY_NOT_IMPLEMENTED";
|
|
34
|
+
analysis: "complete" | "partial" | "refused";
|
|
35
|
+
declarations: RetirementDeclaration[];
|
|
36
|
+
blockers: RetirementIssue[];
|
|
37
|
+
local: {
|
|
38
|
+
verdict: "complete-clean" | "used" | "unknown";
|
|
39
|
+
complete: boolean;
|
|
40
|
+
consistency: "observed-stable-reads-not-an-atomic-snapshot";
|
|
41
|
+
target_root: string;
|
|
42
|
+
bundle_id?: string;
|
|
43
|
+
okf_version: string;
|
|
44
|
+
root_index_version: string | null;
|
|
45
|
+
initial_ids: string[];
|
|
46
|
+
final_ids: string[];
|
|
47
|
+
inventory: Array<{
|
|
48
|
+
id: string;
|
|
49
|
+
version: string | null;
|
|
50
|
+
}>;
|
|
51
|
+
observation_digest: string;
|
|
52
|
+
issues: RetirementIssue[];
|
|
53
|
+
};
|
|
54
|
+
consumers: {
|
|
55
|
+
status: "unassessed" | "valid" | "partial" | "refused";
|
|
56
|
+
scope: "supplied-declared-structural-only";
|
|
57
|
+
model: "final-selected-source-hypothesis";
|
|
58
|
+
evidence_digest?: string;
|
|
59
|
+
binding_issues: Array<{
|
|
60
|
+
level: "partial" | "refused";
|
|
61
|
+
code: string;
|
|
62
|
+
at: string;
|
|
63
|
+
}>;
|
|
64
|
+
result?: PreflightResult;
|
|
65
|
+
unsupported_semantics: readonly ["enum-value-compatibility", "type-compatibility", "write-intent-compatibility"];
|
|
66
|
+
};
|
|
67
|
+
external_consumers: "unknown-unenumerated-offline-and-arbitrary-code";
|
|
68
|
+
proposed_definitions: Array<{
|
|
69
|
+
id: string;
|
|
70
|
+
definition_digest: string;
|
|
71
|
+
hypothetical_content_version: string;
|
|
72
|
+
}>;
|
|
73
|
+
}
|
|
74
|
+
/** Internal reusable preparation for future guarded lifecycle application. The report alone
|
|
75
|
+
* remains non-authoritative; this data carries no permission or committing operation. */
|
|
76
|
+
export interface PreparedRecipeDeclarationRetirement {
|
|
77
|
+
report: RecipeDeclarationRetirementPlan;
|
|
78
|
+
source: LoadedRecipe;
|
|
79
|
+
installation?: PreparedRecipeInstall;
|
|
80
|
+
snapshots: ReadonlyMap<string, ReadResult>;
|
|
81
|
+
bundle: Bundle;
|
|
82
|
+
}
|
|
83
|
+
export declare function prepareRecipeDeclarationRetirement(bundle: Bundle, recipe: LoadedRecipe, options?: {
|
|
84
|
+
consumerEvidence?: unknown;
|
|
85
|
+
}): Promise<PreparedRecipeDeclarationRetirement>;
|
|
86
|
+
export declare function planRecipeDeclarationRetirement(bundle: Bundle, source: LoadedRecipe, options?: {
|
|
87
|
+
consumerEvidence?: unknown;
|
|
88
|
+
}): Promise<RecipeDeclarationRetirementPlan>;
|
|
89
|
+
//# sourceMappingURL=retirement.d.ts.map
|
|
@@ -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