@tiinex/core 0.26.0 → 0.27.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiinex/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Shared host-neutral Tiinex implementation core for artifacts, schemas, validation, lineage, grounding, Handoffs, provenance and deterministic workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": true,
|
|
@@ -173,12 +173,12 @@
|
|
|
173
173
|
"type": "git",
|
|
174
174
|
"url": "git+https://github.com/Tiinex/core.git"
|
|
175
175
|
},
|
|
176
|
-
"gitHead": "
|
|
176
|
+
"gitHead": "a7e75e17b1b95c022875c2006d2957d8cce580ae",
|
|
177
177
|
"tiinexRelease": {
|
|
178
178
|
"policy": "tiinex.master-npm-release.v1",
|
|
179
|
-
"sourceCommit": "
|
|
180
|
-
"sourceTree": "
|
|
179
|
+
"sourceCommit": "a7e75e17b1b95c022875c2006d2957d8cce580ae",
|
|
180
|
+
"sourceTree": "e86d119618fcd9cdc48bff5b016546f79bb7bcaa",
|
|
181
181
|
"repository": "Tiinex/core",
|
|
182
|
-
"previousVersion": "0.
|
|
182
|
+
"previousVersion": "0.26.0"
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -9,22 +9,26 @@ const BOOTSTRAP_CODE_PREFIXES = Object.freeze([
|
|
|
9
9
|
export function projectPortableBootstrapRecovery(bundle = {}, inspection = {}) {
|
|
10
10
|
const findings = Array.isArray(inspection.findings) ? inspection.findings : [];
|
|
11
11
|
const errors = findings.filter((item) => String(item?.severity || '') === 'error');
|
|
12
|
-
const
|
|
12
|
+
const bootstrapPaths = recoveryBootstrapArtifactPaths(bundle, inspection);
|
|
13
13
|
const packageBootstrapValid = String(inspection.bootstrapInspection?.status || '') === 'valid';
|
|
14
14
|
if (packageBootstrapValid) return freeze({
|
|
15
15
|
schema: 'tiinex.portable.bootstrap-recovery.v1',
|
|
16
16
|
state: 'not-needed',
|
|
17
17
|
eligibleWithQualifiedHostBootstrap: false,
|
|
18
|
-
packageBootstrap: Object.freeze({ state: 'qualified', artifactPath:
|
|
18
|
+
packageBootstrap: Object.freeze({ state: 'qualified', artifactPath: bootstrapPaths[0] || '' }),
|
|
19
19
|
ignoredFindingCodes: Object.freeze([]),
|
|
20
20
|
blockingFindingCodes: Object.freeze([]),
|
|
21
21
|
boundary: boundary()
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const bootstrapArtifacts = bootstrapPaths.map((artifactPath) => Object.freeze({ artifactPath, file: findFile(bundle, artifactPath) })).filter((item) => item.artifactPath);
|
|
25
|
+
const payloadPaths = [...new Set(bootstrapArtifacts.flatMap((item) => {
|
|
26
|
+
if (!item.file) return [];
|
|
27
|
+
const markdown = decodeUtf8(packageFileBytes(item.file));
|
|
28
|
+
const target = recoveryPayloadPath(markdown);
|
|
29
|
+
return target ? [target] : [];
|
|
30
|
+
}))];
|
|
31
|
+
const bootstrapOwnedPaths = new Set([...bootstrapPaths, ...payloadPaths].filter(Boolean));
|
|
28
32
|
const ignored = [];
|
|
29
33
|
const blocking = [];
|
|
30
34
|
for (const item of errors) {
|
|
@@ -37,14 +41,17 @@ export function projectPortableBootstrapRecovery(bundle = {}, inspection = {}) {
|
|
|
37
41
|
const packageStructurePresent = Boolean(inspection.rootArtifact && inspection.readArtifact && inspection.carrierProjection);
|
|
38
42
|
const carrierReady = String(inspection.carrierProjection?.status || '') === 'ready';
|
|
39
43
|
const eligible = packageStructurePresent && carrierReady && ignored.length > 0 && blocking.length === 0;
|
|
44
|
+
const primaryPath = bootstrapPaths.find((artifactPath) => Boolean(findFile(bundle, artifactPath))) || bootstrapPaths[0] || '';
|
|
40
45
|
return freeze({
|
|
41
46
|
schema: 'tiinex.portable.bootstrap-recovery.v1',
|
|
42
47
|
state: eligible ? 'eligible' : 'ineligible',
|
|
43
48
|
eligibleWithQualifiedHostBootstrap: eligible,
|
|
44
49
|
packageBootstrap: Object.freeze({
|
|
45
|
-
state:
|
|
46
|
-
artifactPath:
|
|
47
|
-
|
|
50
|
+
state: primaryPath ? (findFile(bundle, primaryPath) ? 'unqualified' : 'missing') : 'undeclared',
|
|
51
|
+
artifactPath: primaryPath,
|
|
52
|
+
artifactCandidates: Object.freeze([...bootstrapPaths]),
|
|
53
|
+
payloadPath: payloadPaths[0] || '',
|
|
54
|
+
payloadCandidates: Object.freeze([...payloadPaths])
|
|
48
55
|
}),
|
|
49
56
|
ignoredFindingCodes: Object.freeze(ignored.map((item) => String(item?.code || '')).filter(Boolean)),
|
|
50
57
|
blockingFindingCodes: Object.freeze(blocking.map((item) => String(item?.code || '')).filter(Boolean)),
|
|
@@ -52,6 +59,37 @@ export function projectPortableBootstrapRecovery(bundle = {}, inspection = {}) {
|
|
|
52
59
|
});
|
|
53
60
|
}
|
|
54
61
|
|
|
62
|
+
function recoveryBootstrapArtifactPaths(bundle = {}, inspection = {}) {
|
|
63
|
+
const out = [];
|
|
64
|
+
const declared = String(inspection.packageContract?.bootstrapPath || '').trim();
|
|
65
|
+
if (declared) out.push(declared);
|
|
66
|
+
|
|
67
|
+
// Recovery may need to operate precisely when the bootstrap External Payload
|
|
68
|
+
// no longer qualifies strongly enough to reach normal package-contract
|
|
69
|
+
// projection. Use only explicit package-local bootstrap references from the
|
|
70
|
+
// already-identified package root/Start artifacts as recovery hints. These
|
|
71
|
+
// hints bound malformed bootstrap bytes; they do not grant bootstrap authority.
|
|
72
|
+
const candidates = [inspection.rootArtifact?.path, inspection.readArtifact?.path]
|
|
73
|
+
.map((value) => String(value || '').trim())
|
|
74
|
+
.filter(Boolean);
|
|
75
|
+
for (const artifactPath of candidates) {
|
|
76
|
+
const file = findFile(bundle, artifactPath);
|
|
77
|
+
if (!file) continue;
|
|
78
|
+
const markdown = decodeUtf8(packageFileBytes(file));
|
|
79
|
+
for (const target of explicitBootstrapMarkdownTargets(markdown)) out.push(target);
|
|
80
|
+
}
|
|
81
|
+
return Object.freeze([...new Set(out.filter(Boolean))]);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function explicitBootstrapMarkdownTargets(markdown = '') {
|
|
85
|
+
const out = [];
|
|
86
|
+
for (const line of String(markdown || '').split(/\r?\n/)) {
|
|
87
|
+
if (!/bootstrap/i.test(line)) continue;
|
|
88
|
+
for (const match of line.matchAll(/\[[^\]]+\]\(([^)]+\.md)\)/ig)) if (match?.[1]) out.push(match[1].trim());
|
|
89
|
+
}
|
|
90
|
+
return [...new Set(out.filter(Boolean))];
|
|
91
|
+
}
|
|
92
|
+
|
|
55
93
|
function recoveryPayloadPath(markdown = '') {
|
|
56
94
|
const lines = String(markdown || '').split(/\r?\n/);
|
|
57
95
|
for (const line of lines) {
|