@tiinex/core 0.17.0 → 0.19.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 +7 -5
- package/src/tooling/portable/adapters/cli/cli.command-input.js +8 -1
- package/src/tooling/portable/adapters/cli/cli.common-author.js +29 -5
- package/src/tooling/portable/adapters/cli/cli.common-output.js +38 -3
- package/src/tooling/portable/adapters/cli/cli.handoff-manufacture.js +33 -17
- package/src/tooling/portable/adapters/cli/cli.handoff-sibling-allocation.js +139 -2
- package/src/tooling/portable/adapters/cli/cli.help.js +1 -1
- package/src/tooling/portable/adapters/cli/cli.run.js +4 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.js +25 -12
- package/src/tooling/portable/adapters/node/handoff.manufacture.packageParent.js +43 -0
- package/src/tooling/portable/grounding/grounding.capsule.js +22 -3
- package/src/tooling/portable/grounding/grounding.holderBindingAuthorization.js +81 -0
- package/src/tooling/portable/grounding/grounding.implementationSourceAuthority.js +109 -0
- package/src/tooling/portable/grounding/grounding.orchestrationReadiness.js +33 -0
- package/src/tooling/portable/grounding/grounding.participantAuthority.js +1 -1
- package/src/tooling/portable/grounding/grounding.participantContext.js +58 -0
- package/src/tooling/portable/grounding/grounding.processApplicability.js +38 -0
- package/src/tooling/portable/grounding/grounding.readiness.authority.js +63 -3
- package/src/tooling/portable/grounding/grounding.readiness.js +72 -12
- package/src/tooling/portable/grounding/grounding.readiness.support.js +5 -1
- package/src/tooling/portable/grounding/grounding.sourceEvidence.js +151 -9
- package/src/tooling/portable/handoff/carrierProjection.routeQualification.js +12 -1
- package/src/tooling/portable/handoff/coldStartQualification.grounding.js +62 -3
- package/src/tooling/portable/handoff/coldStartQualification.materials.js +19 -1
- package/src/tooling/portable/handoff/contextAudit.js +1 -1
- package/src/tooling/portable/handoff/delegationReturnReservation.js +4 -2
- package/src/tooling/portable/handoff/manufacture.js +1 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.projection.js +3 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.js +1 -1
- package/src/tooling/portable/handoff/recoveryAcceptanceAudit.js +5 -3
- package/src/tooling/portable/schema/contract.field-domain.js +43 -2
|
@@ -32,14 +32,16 @@ export function qualifyDelegationReturnReservation(input = {}) {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
const rawSupplied = rawIndex !== undefined && rawIndex !== null && String(rawIndex).trim() !== '';
|
|
35
36
|
const siblingIndex = parseSiblingIndex(rawIndex);
|
|
36
|
-
if (siblingIndex === null) findings.push(finding('error', 'portable.delegation-return-reservation.sibling-index.
|
|
37
|
+
if (rawSupplied && siblingIndex === null) findings.push(finding('error', 'portable.delegation-return-reservation.sibling-index.invalid', 'Explicit return package sibling override must be an integer in the supported range 1..9999.'));
|
|
37
38
|
return freeze({
|
|
38
39
|
schema: PORTABLE_DELEGATION_RETURN_RESERVATION_SCHEMA_ID,
|
|
39
40
|
state: findings.length ? 'blocked' : 'qualified',
|
|
40
41
|
returnExpected: true,
|
|
41
42
|
carrierKind: 'non-major',
|
|
42
43
|
siblingIndex,
|
|
44
|
+
allocationMode: siblingIndex === null ? 'derive-from-qualified-recipient-selected-pointer' : 'explicit-advanced-override',
|
|
43
45
|
findings,
|
|
44
46
|
boundary: boundary()
|
|
45
47
|
});
|
|
@@ -95,7 +97,7 @@ function field(section = '', name = '') {
|
|
|
95
97
|
const match = String(section || '').match(new RegExp(`^\\s*-\\s+${escapeRegExp(name)}\\s*:\\s*(.+?)\\s*$`, 'mi'));
|
|
96
98
|
return String(match?.[1] || '').trim();
|
|
97
99
|
}
|
|
98
|
-
function boundary() { return 'Transport preflight only.
|
|
100
|
+
function boundary() { return 'Transport preflight only. Ordinary non-Major return allocation is derived later from the exact qualified selected parent Handoff Pointer ordinal; an explicit return sibling index is an advanced compatibility override only. This projection never promotes transport allocation into semantic Parent, Workspace, Role, acceptance, completion, participant, process, or source authority.'; }
|
|
99
101
|
function finding(severity, code, message) { return Object.freeze({ severity, code, message }); }
|
|
100
102
|
function escapeRegExp(value = '') { return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); }
|
|
101
103
|
function freeze(value) { if (Array.isArray(value)) return Object.freeze(value.map(freeze)); if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value; return Object.freeze(Object.fromEntries(Object.entries(value).map(([key, item]) => [key, freeze(item)]))); }
|
|
@@ -77,6 +77,7 @@ export function manufactureRecipientRelativeHandoffPackage(input = {}, options =
|
|
|
77
77
|
roundtrip: upgraded.roundtrip || null,
|
|
78
78
|
toolingBootstrap: input.toolingBootstrap || null,
|
|
79
79
|
manufacturingEvidence: input.manufacturingEvidence || null,
|
|
80
|
+
carrierAllocation: input.carrierAllocation || input.manufacturingEvidence?.carrierAllocation || null,
|
|
80
81
|
schemaReferencePreflight,
|
|
81
82
|
returnCarrierReservationPreflight,
|
|
82
83
|
reconciliationProofQualification,
|
|
@@ -5,6 +5,7 @@ export function projectRecipientV2Routes(routePointers = [], endpointPointers =
|
|
|
5
5
|
const qualified = (qualifiedRoutes || []).find((route) => String(route.workspaceId || '') === String(item.facts?.workspaceId || '') && String(route.workspaceRelativePath || '') === String(item.facts?.workspaceRelativeHandoffPath || '')) || null;
|
|
6
6
|
return Object.freeze({
|
|
7
7
|
pointerPath: item.path,
|
|
8
|
+
routeId: String(item.facts?.routeId || qualified?.id || ''),
|
|
8
9
|
workspaceId: String(item.facts?.workspaceId || ''),
|
|
9
10
|
workspaceRelativeHandoffPath: String(item.facts?.workspaceRelativeHandoffPath || ''),
|
|
10
11
|
returnCarrierReservation: item.facts?.returnCarrierReservation || qualified?.returnCarrierReservation || null,
|
|
@@ -17,6 +18,7 @@ export function projectRecipientV2Routes(routePointers = [], endpointPointers =
|
|
|
17
18
|
export function projectRecipientV2EndpointRoles(pointers = []) {
|
|
18
19
|
return Object.freeze(pointers.map((item) => Object.freeze({
|
|
19
20
|
pointerPath: item.path,
|
|
21
|
+
routeId: String(item.facts?.routeId || qualified?.id || ''),
|
|
20
22
|
workspaceId: String(item.facts?.workspaceId || ''),
|
|
21
23
|
routeId: String(item.facts?.routeId || ''),
|
|
22
24
|
requirementId: String(item.facts?.endpointRequirementId || ''),
|
|
@@ -36,6 +38,7 @@ export function projectRecipientV2EndpointRoles(pointers = []) {
|
|
|
36
38
|
export function projectRecipientV2ParticipantRoles(pointers = []) {
|
|
37
39
|
return Object.freeze(pointers.map((item) => Object.freeze({
|
|
38
40
|
pointerPath: item.path,
|
|
41
|
+
routeId: String(item.facts?.routeId || qualified?.id || ''),
|
|
39
42
|
workspaceId: String(item.facts?.workspaceId || ''),
|
|
40
43
|
routeId: String(item.facts?.routeId || ''),
|
|
41
44
|
roleLabelHint: String(item.facts?.roleLabelHint || ''),
|
|
@@ -256,7 +256,7 @@ export function inspectRecipientFacingV2PackageV1(bundle = {}, options = {}) {
|
|
|
256
256
|
return deepFreeze({
|
|
257
257
|
schema: 'tiinex.portable.recipient-facing-handoff-package-v1.inspection.v1', detected: Boolean(packageFile), status, format: RECIPIENT_V2_PACKAGE_V1_FORMAT_ID,
|
|
258
258
|
rootArtifact: packageFile ? Object.freeze({ path: packageFile.path, schemaId: RECIPIENT_V2_PACKAGE_V1_SCHEMA_ID, sha256: sha256Hex(packageFileBytes(packageFile)), carrierLineage: lineage }) : null,
|
|
259
|
-
readArtifact, workspaces: Object.freeze(workspaceParts.map((item) => Object.freeze({ workspaceId: item.workspaceId, coverage: String(item.representation?.coverage || item.facts?.coverage || 'complete'), bindingState: item.bindingState || String(item.representation?.bindingState || 'verified'), workspaceArtifactPath: item.artifact.path, workspaceArchivePath: item.archiveFile?.path || '', sourceWorkspaceTargetInnerPath: item.facts.sourceWorkspaceTargetInnerPath, sourceWorkspaceTargetSha256: item.facts.sourceWorkspaceTargetSha256 }))), sealedWorkspaces: Object.freeze(sealedWorkspaceBindings),
|
|
259
|
+
readArtifact, workspaces: Object.freeze(workspaceParts.map((item) => Object.freeze({ workspaceId: item.workspaceId, coverage: String(item.representation?.coverage || item.facts?.coverage || 'complete'), bindingState: item.bindingState || String(item.representation?.bindingState || 'verified'), workspaceArtifactPath: item.artifact.path, workspaceRepresentationArtifactPath: String(item.representationArtifact?.path || ''), workspacePayloadArtifactPath: String(item.payloadArtifact?.path || item.protectedPayloadArtifact?.path || ''), workspaceArchivePath: item.archiveFile?.path || '', sourceWorkspaceTargetInnerPath: item.facts.sourceWorkspaceTargetInnerPath, sourceWorkspaceTargetSha256: item.facts.sourceWorkspaceTargetSha256 }))), sealedWorkspaces: Object.freeze(sealedWorkspaceBindings),
|
|
260
260
|
routes: projectRecipientV2Routes(routePointers, endpointRolePointers, participantRolePointers, carrierProjection?.routes || []), endpointRoles: projectRecipientV2EndpointRoles(endpointRolePointers), participantRoles: projectRecipientV2ParticipantRoles(participantRolePointers),
|
|
261
261
|
caches: Object.freeze(caches.map((cache) => Object.freeze({ workspaceId: String(cache.facts?.workspaceId || ''), artifactPath: cache.artifact.path, archivePath: cache.file.path, materials: cache.facts.materials || [] }))),
|
|
262
262
|
bootstrapInspection, transportManifest: null, artifactFacts: Object.freeze(generatedArtifacts.map((item) => Object.freeze({ path: item.path, facts: item.facts }))), descriptor, workspaceByteProvider, carrierProjection, coldConsumerProjection,
|
|
@@ -8,8 +8,8 @@ export function auditPortableRecoveryAcceptance(input = {}) {
|
|
|
8
8
|
const basisInspection = inspectRecipientFacingV2Topology(input.basis?.bundle || input.basis || {});
|
|
9
9
|
const candidateInspection = inspectRecipientFacingV2Topology(input.candidate?.bundle || input.candidate || {});
|
|
10
10
|
const findings = [];
|
|
11
|
-
if (String(basisInspection.status || '') !== 'valid') findings.push(finding('error', 'portable.recovery-acceptance.basis-unqualified', 'Recovery acceptance audit requires one independently qualified accepted-basis Handoff
|
|
12
|
-
if (String(candidateInspection.status || '') !== 'valid') findings.push(finding('error', 'portable.recovery-acceptance.candidate-unqualified', 'Recovery acceptance audit requires one independently qualified candidate
|
|
11
|
+
if (String(basisInspection.status || '') !== 'valid') findings.push(finding('error', 'portable.recovery-acceptance.basis-unqualified', 'Recovery acceptance audit requires one independently qualified accepted-basis recipient-facing carrier. A qualified pointerless Workspace package is permitted; Handoff routing is not required for the accepted basis.'));
|
|
12
|
+
if (String(candidateInspection.status || '') !== 'valid') findings.push(finding('error', 'portable.recovery-acceptance.candidate-unqualified', 'Recovery acceptance audit requires one independently qualified candidate recipient-facing carrier. Candidate restart suitability still requires complete selected Workspace coverage.'));
|
|
13
13
|
if (findings.some((item) => item.severity === 'error')) return auditResult('blocked', [], findings, basisInspection, candidateInspection, input);
|
|
14
14
|
|
|
15
15
|
const candidateIds = [...new Set((candidateInspection.workspaces || []).map((item) => normalizeId(item.workspaceId)).filter(Boolean))].sort();
|
|
@@ -92,7 +92,9 @@ function auditResult(status, workspaces, findings, basisInspection, candidateIns
|
|
|
92
92
|
status,
|
|
93
93
|
state: status === 'ready' && allReady ? 'acceptance-audit-ready' : 'acceptance-audit-blocked',
|
|
94
94
|
basisQualification: String(basisInspection.status || 'invalid'),
|
|
95
|
+
basisCarrierRole: String(basisInspection.packageContract?.packageRole || ''),
|
|
95
96
|
candidateQualification: String(candidateInspection.status || 'invalid'),
|
|
97
|
+
candidateCarrierRole: String(candidateInspection.packageContract?.packageRole || ''),
|
|
96
98
|
selectionMode: (input.workspaceIds || input.selectedWorkspaceIds || []).length ? 'explicit-workspace-set' : 'all-candidate-workspaces',
|
|
97
99
|
workspaces: freeze(workspaces),
|
|
98
100
|
counts: freeze({ workspaces: workspaces.length, readyWorkspaces: workspaces.filter((item) => item.state === 'ready').length, completeWorkspaces: completeWorkspaceCount, unexplainedRemovals: unexplainedRemovalCount }),
|
|
@@ -106,7 +108,7 @@ function auditResult(status, workspaces, findings, basisInspection, candidateIns
|
|
|
106
108
|
semanticAcceptanceGranted: false
|
|
107
109
|
}),
|
|
108
110
|
findings: freeze(findings),
|
|
109
|
-
boundary: 'Coarse Recovery acceptance audit over already-qualified carrier bytes. It decodes the exact candidate Workspace representations, compares them to one explicit accepted basis, and fails on unexplained source removals or incomplete coverage. It does not inspect a live checkout, prove Git cleanliness/committability, decide semantic correctness, authorize deletion, or grant Master Recovery acceptance; target landing still requires the separate exact source preflight.'
|
|
111
|
+
boundary: 'Coarse Recovery acceptance audit over already-qualified recipient-facing carrier bytes. The accepted basis may be a routed Handoff carrier or a qualified pointerless Workspace carrier; route authority is not required merely to establish exact basis bytes. It decodes the exact candidate Workspace representations, compares them to one explicit accepted basis, and fails on unexplained source removals or incomplete candidate coverage. It does not inspect a live checkout, prove Git cleanliness/committability, decide semantic correctness, authorize deletion, or grant Master Recovery acceptance; target landing still requires the separate exact source preflight.'
|
|
110
112
|
});
|
|
111
113
|
}
|
|
112
114
|
|
|
@@ -52,12 +52,13 @@ export function validatePortableFieldDomains(input = {}) {
|
|
|
52
52
|
}));
|
|
53
53
|
|
|
54
54
|
if (qualification === 'invalid') {
|
|
55
|
+
const contractGuidance = fieldDomainContractGuidance(results);
|
|
55
56
|
findings.push(fieldDomainFinding(
|
|
56
57
|
'error',
|
|
57
58
|
'portable.contract.field-domain.value.invalid',
|
|
58
|
-
|
|
59
|
+
invalidFieldDomainMessage(bucket.group, bucket.field, occurrence.value, contractGuidance),
|
|
59
60
|
'structurally-invalid',
|
|
60
|
-
{ group: bucket.group, field: bucket.field, value: occurrence.value, owner: occurrence.owner, contributions: results }
|
|
61
|
+
{ group: bucket.group, field: bucket.field, value: occurrence.value, owner: occurrence.owner, contributions: results, contractGuidance }
|
|
61
62
|
));
|
|
62
63
|
} else if (qualification === 'extension-candidate') {
|
|
63
64
|
findings.push(fieldDomainFinding(
|
|
@@ -242,6 +243,46 @@ function fieldDomainFinding(severity, code, message, state, extra = {}) {
|
|
|
242
243
|
return portableFinding(severity, code, message, { ...extra, state });
|
|
243
244
|
}
|
|
244
245
|
|
|
246
|
+
function fieldDomainContractGuidance(results = []) {
|
|
247
|
+
const contributions = (results || []).map((item) => Object.freeze({
|
|
248
|
+
sourceSchemaId: String(item.sourceSchemaId || ''),
|
|
249
|
+
sourceGroup: String(item.sourceGroup || ''),
|
|
250
|
+
field: String(item.field || ''),
|
|
251
|
+
allowedValues: Object.freeze([...(item.allowedValues || [])].map(String)),
|
|
252
|
+
allowedShapes: Object.freeze([...(item.allowedShapes || [])].map(String)),
|
|
253
|
+
domainPolicy: String(item.domainPolicy || ''),
|
|
254
|
+
declarationLine: Number(item.declarationLine || 0),
|
|
255
|
+
contractPath: [
|
|
256
|
+
String(item.sourceSchemaId || ''),
|
|
257
|
+
String(item.sourceGroup || ''),
|
|
258
|
+
'Field Value Constraints',
|
|
259
|
+
String(item.field || '')
|
|
260
|
+
].filter(Boolean).join(' :: ')
|
|
261
|
+
}));
|
|
262
|
+
return Object.freeze({
|
|
263
|
+
contributions: Object.freeze(contributions),
|
|
264
|
+
nextAction: contributions.length === 1
|
|
265
|
+
? `Use one value/shape allowed by ${contributions[0].contractPath || 'the cited field-domain contract'}; do not invent an extension unless the declared domain policy authorizes one.`
|
|
266
|
+
: 'Satisfy every contributing field-domain authority. Review each exact contractPath below; do not treat values from separate contributions as a union unless the contracts themselves establish that.'
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function invalidFieldDomainMessage(group, field, value, guidance = {}) {
|
|
271
|
+
const contributions = guidance.contributions || [];
|
|
272
|
+
if (contributions.length === 1) {
|
|
273
|
+
const item = contributions[0];
|
|
274
|
+
const allowed = item.allowedValues || [];
|
|
275
|
+
const shapes = item.allowedShapes || [];
|
|
276
|
+
const domain = [
|
|
277
|
+
allowed.length ? `Allowed values: ${allowed.join(', ')}` : '',
|
|
278
|
+
shapes.length ? `Allowed shapes: ${shapes.join(', ')}` : ''
|
|
279
|
+
].filter(Boolean).join('; ');
|
|
280
|
+
const path = item.contractPath ? ` Contract: ${item.contractPath}${item.declarationLine ? ` (line ${item.declarationLine})` : ''}.` : '';
|
|
281
|
+
return `Value is outside the allowed field domain for ${group}.${field}: ${value}.${domain ? ` ${domain}.` : ''}${path}`;
|
|
282
|
+
}
|
|
283
|
+
return `Value is outside the allowed field domain for ${group}.${field}: ${value}. Multiple field-domain authorities apply; see contractGuidance for each exact contract path and allowed values/shapes.`;
|
|
284
|
+
}
|
|
285
|
+
|
|
245
286
|
function exact(value = '') {
|
|
246
287
|
return String(value || '').trim();
|
|
247
288
|
}
|