@tiinex/core 0.12.0 → 0.14.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.
Files changed (54) hide show
  1. package/package.json +6 -5
  2. package/src/audit/audit.run.js +1 -1
  3. package/src/public/index.js +18 -0
  4. package/src/public/node.js +1 -0
  5. package/src/schemas/creation.contracts.js +1 -1
  6. package/src/schemas/creation.schemaReferences.js +28 -8
  7. package/src/schemas/schema.reference.js +30 -4
  8. package/src/schemas/tiinex.root.v1.schema.json +2 -1
  9. package/src/tooling/portable/adapters/cli/cli.command-input.js +5 -0
  10. package/src/tooling/portable/adapters/cli/cli.common-output.js +23 -0
  11. package/src/tooling/portable/adapters/cli/cli.handoff-manufacture.js +52 -11
  12. package/src/tooling/portable/adapters/cli/cli.help.js +15 -2
  13. package/src/tooling/portable/adapters/cli/cli.run.js +1 -1
  14. package/src/tooling/portable/adapters/cli/cli.source-frontier-comparison.js +6 -6
  15. package/src/tooling/portable/adapters/cli/cli.source-frontier-reconciliation.js +18 -0
  16. package/src/tooling/portable/adapters/node/bootstrapCarrier.manufacture.js +18 -0
  17. package/src/tooling/portable/adapters/node/handoff.manufacture.enumeration.js +27 -8
  18. package/src/tooling/portable/adapters/node/handoff.manufacture.js +17 -0
  19. package/src/tooling/portable/adapters/node/sourceFrontierComparison.js +2 -1
  20. package/src/tooling/portable/adapters/node/sourceFrontierReconciliationProof.js +23 -0
  21. package/src/tooling/portable/adapters/node/workspaceCarrier.manufacture.js +14 -3
  22. package/src/tooling/portable/audit/audit.capability.js +2 -1
  23. package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.md +2 -2
  24. package/src/tooling/portable/comparison/sourceFrontierComparison.js +54 -4
  25. package/src/tooling/portable/comparison/sourceFrontierReconciliationProof.js +569 -0
  26. package/src/tooling/portable/draft/draft.create.js +3 -0
  27. package/src/tooling/portable/draft/draft.operations.js +1 -1
  28. package/src/tooling/portable/editor/editor.assistance.js +2 -25
  29. package/src/tooling/portable/handoff/bootstrapCarrier.manufacture.js +56 -0
  30. package/src/tooling/portable/handoff/contracts/tiinex.handoff.package.v1.schema.md +340 -77
  31. package/src/tooling/portable/handoff/manufacture.js +17 -3
  32. package/src/tooling/portable/handoff/pointerEntrypoint.js +4 -1
  33. package/src/tooling/portable/handoff/recipientV2.artifactFirst.build.js +73 -32
  34. package/src/tooling/portable/handoff/recipientV2.artifactFirst.closure.js +1 -1
  35. package/src/tooling/portable/handoff/recipientV2.artifactFirst.inspect.js +9 -1
  36. package/src/tooling/portable/handoff/recipientV2.artifactFirst.materials.js +28 -6
  37. package/src/tooling/portable/handoff/recipientV2.artifactFirst.shared.js +8 -0
  38. package/src/tooling/portable/handoff/recipientV2.coldProjection.js +11 -6
  39. package/src/tooling/portable/handoff/recipientV2.entryContract.js +12 -0
  40. package/src/tooling/portable/handoff/recipientV2.humanOutput.js +48 -6
  41. package/src/tooling/portable/handoff/recipientV2.packageV1.build.js +55 -43
  42. package/src/tooling/portable/handoff/recipientV2.packageV1.contract.js +57 -31
  43. package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.helpers.js +63 -10
  44. package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.js +55 -16
  45. package/src/tooling/portable/handoff/recipientV2.packageV1.workspaceProjection.js +14 -1
  46. package/src/tooling/portable/handoff/recipientV2.topology.js +3 -4
  47. package/src/tooling/portable/handoff/recipientV2.topology.materials.js +14 -0
  48. package/src/tooling/portable/handoff/schemaReferencePreflight.js +26 -0
  49. package/src/tooling/portable/handoff/transportEnvelopeV1.js +5 -0
  50. package/src/tooling/portable/handoff/workspaceCarrier.manufacture.js +42 -13
  51. package/src/tooling/portable/index.js +1 -0
  52. package/src/tooling/portable/operation.catalog.js +8 -0
  53. package/src/tooling/portable/source/sourceEligibility.js +108 -0
  54. package/src/validation/validateArtifact.js +62 -6
@@ -0,0 +1,56 @@
1
+ import { finalizeFile } from '../../../export/package.fileMap.js';
2
+ import { summarizePortableFindings } from '../findings.js';
3
+ import { inspectPortableToolingBootstrap } from './toolingBootstrap.js';
4
+ import { renderRecipientV2Pointer } from './recipientV2.artifacts.js';
5
+ import { RECIPIENT_V2_READ_PATH, RECIPIENT_V2_FORMAT_ID } from './recipientV2.topology.js';
6
+ import { recipientV2BootstrapEntryCurrentRead } from './recipientV2.entryContract.js';
7
+ import { recipientV2TransportFacts } from './recipientV2.transportManifest.js';
8
+ import { buildRecipientV2BootstrapCarrier, recipientV2ParentAuthority } from './recipientV2.topology.workspaces.js';
9
+ import { RECIPIENT_V2_PACKAGE_V1_ROOT_PATH, RECIPIENT_V2_PACKAGE_V1_SCHEMA_ID, RECIPIENT_V2_PACKAGE_V1_SCHEMA_TARGET } from './recipientV2.packageV1.constants.js';
10
+ import { BOOTSTRAP_PACKAGE_ROLE, renderHandoffPackageV1 } from './recipientV2.packageV1.contract.js';
11
+ import { deepFreeze } from './recipientV2.packageV1.shared.js';
12
+ import { inspectRecipientFacingV2Topology, roundTripRecipientFacingV2Topology } from './recipientV2.inspect.js';
13
+
14
+ export function manufactureRecipientRelativeBootstrapPackage(input = {}) {
15
+ const findings = [];
16
+ const createdAt = String(input.createdAt || '1970-01-01 00:00:00');
17
+ const bootstrapSource = (input.additionalTransportFiles || []).filter((file) => String(file.path || '').startsWith('tiinex.bootstrap/'));
18
+ const sourceInspection = inspectPortableToolingBootstrap({ files: bootstrapSource });
19
+ if (sourceInspection.status !== 'valid') findings.push(...(sourceInspection.findings || []));
20
+ if (!bootstrapSource.length) findings.push(Object.freeze({ severity: 'error', code: 'portable.bootstrap-carrier.bootstrap-missing', message: 'Bootstrap-only carrier requires one qualified portable Tooling bootstrap source.' }));
21
+ const packageFile = finalizeFile({
22
+ path: RECIPIENT_V2_PACKAGE_V1_ROOT_PATH,
23
+ kind: 'tiinex-handoff-package-artifact', logicalKind: 'recipient-v2-package-v1-root', mediaType: 'text/markdown',
24
+ content: renderHandoffPackageV1({ createdAt, packageRole: BOOTSTRAP_PACKAGE_ROLE, workspaces: [], materialRepresentations: [], carrierLineage: input.carrierLineage || {}, carrierProfile: input.carrierProfile || null, startPath: RECIPIENT_V2_READ_PATH, bootstrapPath: '001-2-bootstrap.trace.md' })
25
+ });
26
+ const packageParent = recipientV2ParentAuthority(packageFile, RECIPIENT_V2_PACKAGE_V1_SCHEMA_ID, RECIPIENT_V2_PACKAGE_V1_SCHEMA_TARGET, createdAt);
27
+ const files = [packageFile];
28
+ const bootstrap = bootstrapSource.length ? buildRecipientV2BootstrapCarrier(bootstrapSource, createdAt, findings, packageParent) : null;
29
+ if (bootstrap) files.push(bootstrap.artifact, bootstrap.payload);
30
+ const readFacts = recipientV2TransportFacts('recovery-orientation', {
31
+ format: 'tiinex-recipient-facing-handoff-package-v1', packageRole: BOOTSTRAP_PACKAGE_ROLE,
32
+ packageRootPath: RECIPIENT_V2_PACKAGE_V1_ROOT_PATH, entryArtifactPath: RECIPIENT_V2_READ_PATH,
33
+ artifactSurface: 'tiinex.handoff.package.v1-plus-qualified-bootstrap-only', routeAuthority: 'none', routeSelectionAuthority: 'none', siblingRouteInference: false,
34
+ carrierLineage: input.carrierLineage || null, pathParentProjection: true, pathAuthority: false
35
+ });
36
+ const readFile = finalizeFile({
37
+ path: RECIPIENT_V2_READ_PATH, kind: 'handoff-recovery-pointer', logicalKind: 'recipient-v2-package-v1-bootstrap-recovery-orientation', mediaType: 'text/markdown', transportFacts: readFacts,
38
+ content: renderRecipientV2Pointer({ createdAt, parent: packageParent, role: 'recovery-orientation', title: 'READ BEFORE PROCEEDING — Tiinex Bootstrap Carrier', summary: 'Qualified recovery/orientation Pointer for a bootstrap-only package-v1 carrier.', prose: 'Read this Start artifact first and qualify the declared Tooling bootstrap. This carrier intentionally contains no project/source Workspace material and no Handoff route. Do not infer recipient, holder, Role, current-work, participation, delegation, or grounded-to-act authority from transport.', currentRead: [...recipientV2BootstrapEntryCurrentRead(), { label: 'Package Artifact', value: `[Bootstrap Package](${RECIPIENT_V2_PACKAGE_V1_ROOT_PATH})` }, { label: 'Carrier Dimension', value: `\`${String(input.carrierLineage?.dimension || '001')}\`` }], destinations: [{ label: 'Bootstrap Package contract', target: RECIPIENT_V2_PACKAGE_V1_ROOT_PATH }, ...(bootstrap ? [{ label: 'Portable Tooling bootstrap', target: bootstrap.projection.artifactPath }] : [])], facts: readFacts })
39
+ });
40
+ files.push(readFile);
41
+ const sortedFiles = Object.freeze([...files].sort((a, b) => String(a.path || '').localeCompare(String(b.path || ''))));
42
+ const bundle = deepFreeze({ status: 'ready', files: sortedFiles, handoffClosure: null, transportFormat: RECIPIENT_V2_FORMAT_ID, boundary: 'Bootstrap-only recipient carrier. Start/bootstrap qualification creates no Workspace, Role, Handoff, recipient, holder, work, or action authority.' });
43
+ const inspection = inspectRecipientFacingV2Topology(bundle);
44
+ const roundtrip = input.verifyRoundtrip === false ? null : roundTripRecipientFacingV2Topology(bundle, inspection);
45
+ const toolingBootstrapInspection = inspection.bootstrapInspection || sourceInspection;
46
+ const allFindings = [...findings, ...(inspection.findings || []), ...(roundtrip?.findings || [])];
47
+ const ready = inspection.status === 'valid' && inspection.carrierProjection?.mode === 'bootstrap' && inspection.carrierProjection?.status === 'ready' && (!roundtrip || roundtrip.status === 'passed') && toolingBootstrapInspection.status === 'valid' && !allFindings.some((item) => item.severity === 'error');
48
+ return deepFreeze({
49
+ schema: 'tiinex.portable.handoff-manufacturing.v2', status: ready ? 'ready' : 'blocked', executable: ready, transportExecutable: ready,
50
+ verification: Object.freeze({ baselineManufacture: 'ready', manufacturePath: 'qualified-bootstrap-to-zero-material-package-v1', packageInspection: inspection.status, closureInspection: 'not-applicable', carrierInspection: inspection.status, selectedHandoffConformance: 'not-applicable', pointerEntrypointInspection: 'not-applicable', coldConsumerEntrypointInspection: inspection.status, companionInspection: 'not-applicable', roundtrip: roundtrip?.status || 'not-requested', toolingBootstrap: toolingBootstrapInspection.status }),
51
+ plan: Object.freeze({ status: ready ? 'ready' : 'blocked', requiredClosureReady: true, semanticHandoffStatus: 'not-declared', workspaceMaterializations: Object.freeze([]), requirements: Object.freeze({ required: Object.freeze([]), reference: Object.freeze([]) }) }),
52
+ bundle, inspection, carrierProjection: inspection.carrierProjection, roundtrip, toolingBootstrapInspection, toolingBootstrap: input.toolingBootstrap || null, carrierLineage: input.carrierLineage || inspection.carrierProjection?.lineage || null, manufacturingEvidence: input.manufacturingEvidence || null,
53
+ findings: Object.freeze(allFindings), findingSummary: summarizePortableFindings(allFindings), operationBoundary: Object.freeze({ sourceMutation: false, remoteWrite: false, handoffSemantics: false, recipientAuthority: false, holderAuthority: false, workAuthority: false }),
54
+ boundary: 'Canonical bootstrap-only carrier manufacture. Qualified Start/bootstrap mechanics only; no project/source material or Handoff/Role/recipient/holder/work authority is created.'
55
+ });
56
+ }