@tiinex/core 0.1.1
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/LICENSE +201 -0
- package/NOTICE +31 -0
- package/README.md +45 -0
- package/package.json +176 -0
- package/src/actions/record.actions.js +312 -0
- package/src/adapters/adapter.contracts.js +143 -0
- package/src/adapters/archive/archive.adapter.js +502 -0
- package/src/adapters/archive/archive.portableChangeset.js +141 -0
- package/src/adapters/archive/archive.transport.js +124 -0
- package/src/artifacts/artifact.localDraft.js +27 -0
- package/src/artifacts/artifact.normalize.js +28 -0
- package/src/artifacts/artifact.parse.js +207 -0
- package/src/artifacts/artifact.record.js +83 -0
- package/src/audit/audit.run.js +103 -0
- package/src/audit/audit.summary.js +7 -0
- package/src/diagnostics/sourceBoundary.report.js +112 -0
- package/src/export/package.apply.js +349 -0
- package/src/export/package.builder.js +366 -0
- package/src/export/package.bytes.js +164 -0
- package/src/export/package.controlIntegrity.js +42 -0
- package/src/export/package.controlTopology.js +97 -0
- package/src/export/package.fileMap.js +174 -0
- package/src/export/package.manifest.js +401 -0
- package/src/export/package.preflight.js +204 -0
- package/src/export/package.sourceReference.js +81 -0
- package/src/export/package.workspaceContext.js +144 -0
- package/src/export/package.zip.js +128 -0
- package/src/export/tree.bundle.js +278 -0
- package/src/governance/governance.boundary.js +196 -0
- package/src/integrity/integrity.c14nV2.js +190 -0
- package/src/integrity/integrity.methodReference.js +73 -0
- package/src/integrity/integrity.validate.js +56 -0
- package/src/lineage/lineage.candidateResolution.js +46 -0
- package/src/lineage/lineage.githubIssueComment.js +106 -0
- package/src/lineage/lineage.githubIssueLocal.js +196 -0
- package/src/lineage/lineage.githubIssueTarget.js +89 -0
- package/src/lineage/lineage.integrity.js +133 -0
- package/src/lineage/lineage.materialPreference.js +26 -0
- package/src/lineage/lineage.model.js +63 -0
- package/src/lineage/lineage.parentAuthority.js +5 -0
- package/src/lineage/lineage.parentBinding.js +104 -0
- package/src/lineage/lineage.pathBasis.js +47 -0
- package/src/lineage/lineage.resolve.js +388 -0
- package/src/lineage/lineage.sourceScope.js +74 -0
- package/src/lineage/lineage.targetKeys.js +80 -0
- package/src/lineage/lineage.traverse.js +132 -0
- package/src/public/applicationProjection.js +236 -0
- package/src/public/companionResources.js +246 -0
- package/src/public/index.js +16 -0
- package/src/public/node.js +2 -0
- package/src/public/schemaAncestry.js +26 -0
- package/src/publication/publication.contract.js +196 -0
- package/src/publication/publication.preflight.js +159 -0
- package/src/publication/publication.targetContract.js +241 -0
- package/src/reingest/reingest.plan.js +162 -0
- package/src/release/plan.mjs +28 -0
- package/src/release/policy.mjs +100 -0
- package/src/release/run.mjs +74 -0
- package/src/schemas/capability.registry.js +226 -0
- package/src/schemas/companion.js +245 -0
- package/src/schemas/contracts.js +6 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.js +14 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.json +23 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.runtime.json +4283 -0
- package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.source.js +9 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.js +26 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.json +23 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.runtime.json +1985 -0
- package/src/schemas/coordination/project/tiinex.project.v1.schema.source.js +9 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.js +14 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.json +24 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.runtime.json +1700 -0
- package/src/schemas/core/decision/tiinex.decision.v1.schema.source.js +9 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.capabilities.js +14 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.en.i18n.json +6 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.findings.js +9 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.presenter.js +1 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.js +32 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.json +24 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.runtime.json +2184 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.schema.source.js +9 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.sv.i18n.json +6 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.transitions.js +1 -0
- package/src/schemas/core/evidence/tiinex.evidence.v1.validate.js +10 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.js +14 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.json +23 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.runtime.json +1773 -0
- package/src/schemas/core/feedback/tiinex.feedback.v1.schema.source.js +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.capabilities.js +11 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.contract.js +40 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.en.i18n.json +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.findings.js +12 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.localMaterialization.js +89 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.presenter.js +8 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.js +34 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.json +23 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.runtime.json +2029 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.source.js +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.sv.i18n.json +9 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.transitions.js +1 -0
- package/src/schemas/core/interpretation/tiinex.interpretation.v1.validate.js +25 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.capabilities.js +14 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.en.i18n.json +6 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.findings.js +9 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.presenter.js +1 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.js +31 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.json +23 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.runtime.json +2033 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.schema.source.js +9 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.sv.i18n.json +6 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.transitions.js +1 -0
- package/src/schemas/core/preservation/tiinex.preservation.v1.validate.js +10 -0
- package/src/schemas/core/relation/tiinex.relation.v1.capabilities.js +7 -0
- package/src/schemas/core/relation/tiinex.relation.v1.contract.js +3 -0
- package/src/schemas/core/relation/tiinex.relation.v1.en.i18n.json +4 -0
- package/src/schemas/core/relation/tiinex.relation.v1.findings.js +9 -0
- package/src/schemas/core/relation/tiinex.relation.v1.localMaterialization.js +153 -0
- package/src/schemas/core/relation/tiinex.relation.v1.presenter.js +3 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.js +20 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.json +23 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.runtime.json +1668 -0
- package/src/schemas/core/relation/tiinex.relation.v1.schema.source.js +9 -0
- package/src/schemas/core/relation/tiinex.relation.v1.sv.i18n.json +4 -0
- package/src/schemas/core/relation/tiinex.relation.v1.transitions.js +1 -0
- package/src/schemas/core/relation/tiinex.relation.v1.validate.js +36 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.capabilities.js +14 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.contract.js +57 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.en.i18n.json +4 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.findings.js +13 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.presenter.js +3 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.js +20 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.json +24 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.runtime.json +3315 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.source.js +9 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.sv.i18n.json +4 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.transitions.js +1 -0
- package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.validate.js +78 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.js +14 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.json +23 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.runtime.json +1733 -0
- package/src/schemas/core/signal/tiinex.signal.v1.schema.source.js +9 -0
- package/src/schemas/core/task/tiinex.task.v1.capabilities.js +11 -0
- package/src/schemas/core/task/tiinex.task.v1.contract.js +3 -0
- package/src/schemas/core/task/tiinex.task.v1.en.i18n.json +15 -0
- package/src/schemas/core/task/tiinex.task.v1.findings.js +18 -0
- package/src/schemas/core/task/tiinex.task.v1.localMaterialization.js +148 -0
- package/src/schemas/core/task/tiinex.task.v1.presenter.js +8 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.js +35 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.json +23 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.runtime.json +1708 -0
- package/src/schemas/core/task/tiinex.task.v1.schema.source.js +9 -0
- package/src/schemas/core/task/tiinex.task.v1.sv.i18n.json +15 -0
- package/src/schemas/core/task/tiinex.task.v1.transitions.js +3 -0
- package/src/schemas/core/task/tiinex.task.v1.validate.js +41 -0
- package/src/schemas/core/topic/tiinex.topic.v1.capabilities.js +14 -0
- package/src/schemas/core/topic/tiinex.topic.v1.creation.js +46 -0
- package/src/schemas/core/topic/tiinex.topic.v1.en.i18n.json +8 -0
- package/src/schemas/core/topic/tiinex.topic.v1.findings.js +11 -0
- package/src/schemas/core/topic/tiinex.topic.v1.localMaterialization.js +135 -0
- package/src/schemas/core/topic/tiinex.topic.v1.presenter.js +1 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.js +34 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.json +23 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.runtime.json +1699 -0
- package/src/schemas/core/topic/tiinex.topic.v1.schema.source.js +9 -0
- package/src/schemas/core/topic/tiinex.topic.v1.sv.i18n.json +8 -0
- package/src/schemas/core/topic/tiinex.topic.v1.transitions.js +31 -0
- package/src/schemas/core/topic/tiinex.topic.v1.validate.js +11 -0
- package/src/schemas/creation.capability.js +289 -0
- package/src/schemas/creation.contracts.js +334 -0
- package/src/schemas/creation.executionSnapshot.js +79 -0
- package/src/schemas/creation.factoryQualification.js +73 -0
- package/src/schemas/creation.renderer.js +244 -0
- package/src/schemas/creation.representation.js +279 -0
- package/src/schemas/creation.rootMetadata.js +6 -0
- package/src/schemas/creation.schemaReferences.js +65 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.js +14 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.json +23 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.runtime.json +1873 -0
- package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.source.js +9 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.js +14 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.json +23 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.runtime.json +1839 -0
- package/src/schemas/discovery/tiinex.discovery.v1.schema.source.js +9 -0
- package/src/schemas/generic.artifact.module.js +25 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.js +26 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.json +23 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.runtime.json +2249 -0
- package/src/schemas/party/organization/tiinex.party.organization.v1.schema.source.js +9 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.js +26 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.json +24 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.runtime.json +2091 -0
- package/src/schemas/party/role/tiinex.party.role.v1.schema.source.js +9 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.capabilities.js +14 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.en.i18n.json +4 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.findings.js +1 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.presenter.js +1 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.js +29 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.json +21 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.runtime.json +2180 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.source.js +9 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.sv.i18n.json +4 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.transitions.js +1 -0
- package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.validate.js +1 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.js +26 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.json +23 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.runtime.json +1733 -0
- package/src/schemas/reduction/tiinex.reduction.v1.schema.source.js +9 -0
- package/src/schemas/reference.shapes.js +33 -0
- package/src/schemas/registry.js +36 -0
- package/src/schemas/resolver.js +13 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.capabilities.js +14 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.en.i18n.json +4 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.findings.js +1 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.presenter.js +1 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.js +29 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.json +21 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.runtime.json +2093 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.schema.source.js +9 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.sv.i18n.json +4 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.transitions.js +1 -0
- package/src/schemas/schema/module/tiinex.schema.module.v1.validate.js +1 -0
- package/src/schemas/schema.factory.descriptor.js +104 -0
- package/src/schemas/schema.githubSourceTarget.js +131 -0
- package/src/schemas/schema.identity.js +10 -0
- package/src/schemas/schema.reference.js +133 -0
- package/src/schemas/schema.source.js +239 -0
- package/src/schemas/tiinex.root.v1.capabilities.js +14 -0
- package/src/schemas/tiinex.root.v1.classify.js +55 -0
- package/src/schemas/tiinex.root.v1.en.i18n.json +24 -0
- package/src/schemas/tiinex.root.v1.fallback.js +84 -0
- package/src/schemas/tiinex.root.v1.findings.js +19 -0
- package/src/schemas/tiinex.root.v1.presenter.js +5 -0
- package/src/schemas/tiinex.root.v1.schema.js +29 -0
- package/src/schemas/tiinex.root.v1.schema.json +24 -0
- package/src/schemas/tiinex.root.v1.schema.runtime.json +1574 -0
- package/src/schemas/tiinex.root.v1.schema.source.js +9 -0
- package/src/schemas/tiinex.root.v1.sv.i18n.json +24 -0
- package/src/schemas/tiinex.root.v1.transitions.js +1 -0
- package/src/schemas/tiinex.root.v1.validate.js +36 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.js +14 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.json +23 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.runtime.json +2027 -0
- package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.source.js +9 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.js +14 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.json +23 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.runtime.json +1848 -0
- package/src/schemas/validation/method/tiinex.validation.method.v1.schema.source.js +9 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.js +14 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.json +23 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.runtime.json +2015 -0
- package/src/schemas/validation/report/tiinex.validation.report.v1.schema.source.js +9 -0
- package/src/schemas/workspace/tiinex.workspace.v1.capabilities.js +12 -0
- package/src/schemas/workspace/tiinex.workspace.v1.en.i18n.json +7 -0
- package/src/schemas/workspace/tiinex.workspace.v1.findings.js +5 -0
- package/src/schemas/workspace/tiinex.workspace.v1.presenter.js +27 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.js +30 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.json +23 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.runtime.json +1596 -0
- package/src/schemas/workspace/tiinex.workspace.v1.schema.source.js +9 -0
- package/src/schemas/workspace/tiinex.workspace.v1.sv.i18n.json +7 -0
- package/src/schemas/workspace/tiinex.workspace.v1.transitions.js +10 -0
- package/src/schemas/workspace/tiinex.workspace.v1.validate.js +10 -0
- package/src/sources/github/github.issueTarget.js +127 -0
- package/src/sources/origin.references.js +249 -0
- package/src/sources/source.explicitTargets.js +49 -0
- package/src/sources/transport.levels.js +107 -0
- package/src/tooling/portable/adapters/cli/cli.cold-start-input.js +34 -0
- package/src/tooling/portable/adapters/cli/cli.command-input.js +455 -0
- package/src/tooling/portable/adapters/cli/cli.common-author.js +249 -0
- package/src/tooling/portable/adapters/cli/cli.common-output.js +330 -0
- package/src/tooling/portable/adapters/cli/cli.editor-assistance.js +13 -0
- package/src/tooling/portable/adapters/cli/cli.ground-materialize.js +96 -0
- package/src/tooling/portable/adapters/cli/cli.ground-recovery.js +99 -0
- package/src/tooling/portable/adapters/cli/cli.handoff-manufacture.js +345 -0
- package/src/tooling/portable/adapters/cli/cli.handoff-sibling-allocation.js +31 -0
- package/src/tooling/portable/adapters/cli/cli.help.js +80 -0
- package/src/tooling/portable/adapters/cli/cli.land.js +13 -0
- package/src/tooling/portable/adapters/cli/cli.local-output.js +72 -0
- package/src/tooling/portable/adapters/cli/cli.material-policy.js +6 -0
- package/src/tooling/portable/adapters/cli/cli.operator-bridge.js +18 -0
- package/src/tooling/portable/adapters/cli/cli.reduction-input.js +14 -0
- package/src/tooling/portable/adapters/cli/cli.run.js +434 -0
- package/src/tooling/portable/adapters/llm/llm.entrypoint.js +34 -0
- package/src/tooling/portable/adapters/node/checkpoint.verify.js +267 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.bootstrap.js +109 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.enumeration.js +94 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.js +193 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.multiRoot.js +49 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.packageParent.js +130 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.requirements.js +353 -0
- package/src/tooling/portable/adapters/node/handoff.manufacture.scope.js +147 -0
- package/src/tooling/portable/adapters/node/workspaceCarrier.manufacture.js +62 -0
- package/src/tooling/portable/assets/asset.operations.js +170 -0
- package/src/tooling/portable/audit/audit.capability.js +119 -0
- package/src/tooling/portable/bootstrap/artifact.result.selfverify.mjs +109 -0
- package/src/tooling/portable/bootstrap/bootstrap.case.mjs +43 -0
- package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.md +814 -0
- package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.pointer.json +25 -0
- package/src/tooling/portable/checkpoint/portable.checkpoint.js +89 -0
- package/src/tooling/portable/conformance/checkpoint.qualification.js +271 -0
- package/src/tooling/portable/draft/draft.create.js +389 -0
- package/src/tooling/portable/draft/draft.crud.js +175 -0
- package/src/tooling/portable/draft/draft.exact.js +173 -0
- package/src/tooling/portable/draft/draft.operations.js +265 -0
- package/src/tooling/portable/draft/draft.qualification.js +45 -0
- package/src/tooling/portable/draft/draft.set.js +193 -0
- package/src/tooling/portable/draft/draft.validation-context.js +7 -0
- package/src/tooling/portable/editor/authoring.parent.js +37 -0
- package/src/tooling/portable/editor/editor.assistance.js +221 -0
- package/src/tooling/portable/editor/staged.validation.js +96 -0
- package/src/tooling/portable/engine.facade.js +468 -0
- package/src/tooling/portable/findings.js +92 -0
- package/src/tooling/portable/grounding/grounding.capsule.js +128 -0
- package/src/tooling/portable/grounding/grounding.continuity.js +283 -0
- package/src/tooling/portable/grounding/grounding.participantAuthority.js +20 -0
- package/src/tooling/portable/grounding/grounding.planningContext.js +34 -0
- package/src/tooling/portable/grounding/grounding.readiness.authority.js +17 -0
- package/src/tooling/portable/grounding/grounding.readiness.js +316 -0
- package/src/tooling/portable/grounding/grounding.readiness.support.js +245 -0
- package/src/tooling/portable/grounding/grounding.sourceEvidence.js +71 -0
- package/src/tooling/portable/grounding/grounding.workContext.js +72 -0
- package/src/tooling/portable/grounding/grounding.workProvenance.js +153 -0
- package/src/tooling/portable/handoff/carrierLineage.js +214 -0
- package/src/tooling/portable/handoff/carrierProfile.js +54 -0
- package/src/tooling/portable/handoff/carrierProjection.js +193 -0
- package/src/tooling/portable/handoff/carrierProjection.routeQualification.js +228 -0
- package/src/tooling/portable/handoff/carrierProjection.shared.js +7 -0
- package/src/tooling/portable/handoff/carrierProjection.workspaces.js +54 -0
- package/src/tooling/portable/handoff/coldConsumerEntrypoint.js +185 -0
- package/src/tooling/portable/handoff/coldStartQualification.contract.js +184 -0
- package/src/tooling/portable/handoff/coldStartQualification.grounding.js +392 -0
- package/src/tooling/portable/handoff/coldStartQualification.js +22 -0
- package/src/tooling/portable/handoff/coldStartQualification.materials.js +364 -0
- package/src/tooling/portable/handoff/coldStartQualification.observation.js +220 -0
- package/src/tooling/portable/handoff/coldStartQualification.run.js +81 -0
- package/src/tooling/portable/handoff/coldStartQualification.shared.js +57 -0
- package/src/tooling/portable/handoff/coldStartRolePointers.js +39 -0
- package/src/tooling/portable/handoff/contextAudit.js +247 -0
- package/src/tooling/portable/handoff/contracts/tiinex.handoff.package.v1.schema.md +409 -0
- package/src/tooling/portable/handoff/handoffAuthoringPlan.js +35 -0
- package/src/tooling/portable/handoff/handoffEndpointProjection.js +61 -0
- package/src/tooling/portable/handoff/handoffLeafProjection.js +91 -0
- package/src/tooling/portable/handoff/humanOutputPresentation.js +21 -0
- package/src/tooling/portable/handoff/manufacture.js +84 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.binding.js +72 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.direct.js +160 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.indexes.js +36 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.js +247 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.projectionProvider.js +44 -0
- package/src/tooling/portable/handoff/materialClosure.archiveV2.workspace.js +226 -0
- package/src/tooling/portable/handoff/materialClosure.descriptor.js +169 -0
- package/src/tooling/portable/handoff/materialClosure.inputBinding.js +372 -0
- package/src/tooling/portable/handoff/materialClosure.inputBinding.support.js +62 -0
- package/src/tooling/portable/handoff/materialClosure.materialized.js +143 -0
- package/src/tooling/portable/handoff/materialClosure.materials.js +116 -0
- package/src/tooling/portable/handoff/materialClosure.package.js +181 -0
- package/src/tooling/portable/handoff/materialClosure.plan.js +204 -0
- package/src/tooling/portable/handoff/materialClosure.readiness.js +36 -0
- package/src/tooling/portable/handoff/materialClosure.requirements.js +137 -0
- package/src/tooling/portable/handoff/operatorContextProjection.js +105 -0
- package/src/tooling/portable/handoff/pointerEntrypoint.js +138 -0
- package/src/tooling/portable/handoff/qualifiedHandoffFixture.js +34 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.build.js +321 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.closure.js +126 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.inspect.js +194 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.materials.js +207 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.projection.js +69 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.roles.js +166 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.routes.js +113 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.shared.js +87 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirst.workspaces.js +160 -0
- package/src/tooling/portable/handoff/recipientV2.artifactFirstPhase1.js +44 -0
- package/src/tooling/portable/handoff/recipientV2.artifactInspection.js +55 -0
- package/src/tooling/portable/handoff/recipientV2.artifacts.js +174 -0
- package/src/tooling/portable/handoff/recipientV2.coldProjection.js +24 -0
- package/src/tooling/portable/handoff/recipientV2.delivery.js +48 -0
- package/src/tooling/portable/handoff/recipientV2.endpointRolePointers.js +179 -0
- package/src/tooling/portable/handoff/recipientV2.entryContract.js +28 -0
- package/src/tooling/portable/handoff/recipientV2.humanOutput.js +78 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.helpers.js +218 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.js +194 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.pathToken.js +9 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.projection.js +58 -0
- package/src/tooling/portable/handoff/recipientV2.inspect.workspaces.js +177 -0
- package/src/tooling/portable/handoff/recipientV2.lineage.js +142 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.build.js +147 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.constants.js +4 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.contract.js +101 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.helpers.js +126 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.js +185 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.js +12 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.shared.js +24 -0
- package/src/tooling/portable/handoff/recipientV2.packageV1.workspaceProjection.js +22 -0
- package/src/tooling/portable/handoff/recipientV2.pointer.js +40 -0
- package/src/tooling/portable/handoff/recipientV2.routeSelection.js +16 -0
- package/src/tooling/portable/handoff/recipientV2.topology.helpers.js +20 -0
- package/src/tooling/portable/handoff/recipientV2.topology.js +320 -0
- package/src/tooling/portable/handoff/recipientV2.topology.materials.js +70 -0
- package/src/tooling/portable/handoff/recipientV2.topology.workspaces.js +193 -0
- package/src/tooling/portable/handoff/recipientV2.transportManifest.js +123 -0
- package/src/tooling/portable/handoff/recipientV2.workspaceRepresentation.js +163 -0
- package/src/tooling/portable/handoff/routeArtifactConformance.js +130 -0
- package/src/tooling/portable/handoff/toolingBootstrap.js +67 -0
- package/src/tooling/portable/handoff/transportCompanion.js +175 -0
- package/src/tooling/portable/handoff/workspaceByteProvider.archive.js +95 -0
- package/src/tooling/portable/handoff/workspaceByteProvider.js +271 -0
- package/src/tooling/portable/handoff/workspaceCarrier.manufacture.js +93 -0
- package/src/tooling/portable/handoff/workspaceLandingPlan.js +142 -0
- package/src/tooling/portable/handoff/workspacePackageSources.js +105 -0
- package/src/tooling/portable/handoff/workspaceQualifiedReference.js +10 -0
- package/src/tooling/portable/handoff/workspaceSourceIdentity.js +52 -0
- package/src/tooling/portable/handoff/workspaceTargetConformance.js +134 -0
- package/src/tooling/portable/host/host.capabilities.js +181 -0
- package/src/tooling/portable/host/tool.bindings.js +357 -0
- package/src/tooling/portable/host/tool.receiptNormalization.js +141 -0
- package/src/tooling/portable/index.js +52 -0
- package/src/tooling/portable/input/node.input.js +184 -0
- package/src/tooling/portable/input/portable.input.js +249 -0
- package/src/tooling/portable/lifecycle/lifecycle.action.js +11 -0
- package/src/tooling/portable/lifecycle/lifecycle.material.js +173 -0
- package/src/tooling/portable/lifecycle/lifecycle.operations.js +34 -0
- package/src/tooling/portable/lifecycle/lifecycle.readiness.js +247 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.audit.js +22 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.evidence.js +36 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.js +306 -0
- package/src/tooling/portable/lineage/lineage.integrity.apply.structure.js +178 -0
- package/src/tooling/portable/lineage/lineage.integrity.plan.js +377 -0
- package/src/tooling/portable/lineage/lineage.integrity.projection.human.js +82 -0
- package/src/tooling/portable/lineage/lineage.integrity.projection.js +349 -0
- package/src/tooling/portable/lineage/lineage.operations.js +32 -0
- package/src/tooling/portable/lineage/lineage.print.js +398 -0
- package/src/tooling/portable/lineage/lineage.print.render.js +88 -0
- package/src/tooling/portable/lineage/lineage.print.utils.js +58 -0
- package/src/tooling/portable/lineage/lineage.publicationProviderReceipts.js +141 -0
- package/src/tooling/portable/lineage/lineage.publicationQualification.js +183 -0
- package/src/tooling/portable/lineage/lineage.search.js +301 -0
- package/src/tooling/portable/live/live.artifact.js +192 -0
- package/src/tooling/portable/live/live.export.js +107 -0
- package/src/tooling/portable/live/live.lineage.closure.js +71 -0
- package/src/tooling/portable/live/live.lineage.js +338 -0
- package/src/tooling/portable/live/live.protocol.js +181 -0
- package/src/tooling/portable/materialization/durable.materialize.js +162 -0
- package/src/tooling/portable/materialization/epistemic.plan.js +239 -0
- package/src/tooling/portable/materialization/loaded.parent.js +54 -0
- package/src/tooling/portable/materialization/materialization.facade.js +30 -0
- package/src/tooling/portable/operation.catalog.js +393 -0
- package/src/tooling/portable/operation.catalog.package.js +183 -0
- package/src/tooling/portable/operation.result.js +25 -0
- package/src/tooling/portable/orchestration/task.prepare.js +191 -0
- package/src/tooling/portable/output/artifact.result.package.js +308 -0
- package/src/tooling/portable/output/deterministic.zip.js +88 -0
- package/src/tooling/portable/output/node.artifact-set.js +223 -0
- package/src/tooling/portable/output/node.draft.js +41 -0
- package/src/tooling/portable/output/node.zip.js +39 -0
- package/src/tooling/portable/output/recipientV2.zip.js +59 -0
- package/src/tooling/portable/overview/blockingCue.js +16 -0
- package/src/tooling/portable/overview/operatingOverview.js +413 -0
- package/src/tooling/portable/package/generation.binding.js +314 -0
- package/src/tooling/portable/package/generation.binding.projection.js +128 -0
- package/src/tooling/portable/package/material.graph.js +236 -0
- package/src/tooling/portable/package/runtime.package.js +321 -0
- package/src/tooling/portable/package/schema.transition.companion.js +196 -0
- package/src/tooling/portable/package/semantic.package.graph.js +272 -0
- package/src/tooling/portable/package/semantic.package.js +203 -0
- package/src/tooling/portable/package/semantic.package.schema-resolution.js +158 -0
- package/src/tooling/portable/package/semantic.package.transition-registry.js +189 -0
- package/src/tooling/portable/package/semantic.package.types.js +18 -0
- package/src/tooling/portable/providers/schema.bootstrap.provenance.js +10 -0
- package/src/tooling/portable/providers/schema.provider.qualification.js +52 -0
- package/src/tooling/portable/providers/schema.providers.js +458 -0
- package/src/tooling/portable/publication/runtime.publication.js +53 -0
- package/src/tooling/portable/qualification.js +150 -0
- package/src/tooling/portable/reduction/reduction.composition.js +229 -0
- package/src/tooling/portable/reduction/reduction.eligibility.helpers.js +258 -0
- package/src/tooling/portable/reduction/reduction.eligibility.js +191 -0
- package/src/tooling/portable/reduction/reduction.operations.js +30 -0
- package/src/tooling/portable/reduction/reduction.preflight.js +85 -0
- package/src/tooling/portable/reduction/reduction.shared.js +173 -0
- package/src/tooling/portable/schema/bootstrap/canonical.pack.js +24 -0
- package/src/tooling/portable/schema/bootstrap/docs-3988951208eb9a8926e84ab42625d4b42fa00c2d/party/role/tiinex.party.role.v1.schema.md +289 -0
- package/src/tooling/portable/schema/bootstrap/docs-3988951208eb9a8926e84ab42625d4b42fa00c2d/validation/report/tiinex.validation.report.v1.schema.md +300 -0
- package/src/tooling/portable/schema/bootstrap/qualified-local-root/tiinex.root.v1.runtime-projection.json +48 -0
- package/src/tooling/portable/schema/bootstrap/qualified-local-root/tiinex.root.v1.schema.md +865 -0
- package/src/tooling/portable/schema/contract.compile.js +406 -0
- package/src/tooling/portable/schema/contract.compile.utils.js +9 -0
- package/src/tooling/portable/schema/contract.constraints.js +117 -0
- package/src/tooling/portable/schema/contract.envelope.validate.js +177 -0
- package/src/tooling/portable/schema/contract.field-domain.compile.js +399 -0
- package/src/tooling/portable/schema/contract.field-domain.js +247 -0
- package/src/tooling/portable/schema/contract.field-shape.compile.js +34 -0
- package/src/tooling/portable/schema/contract.inheritance.inline.js +103 -0
- package/src/tooling/portable/schema/contract.inheritance.js +210 -0
- package/src/tooling/portable/schema/contract.inheritance.record.js +76 -0
- package/src/tooling/portable/schema/contract.machine-shape.js +309 -0
- package/src/tooling/portable/schema/contract.project.js +81 -0
- package/src/tooling/portable/schema/contract.semantic-resolution.js +82 -0
- package/src/tooling/portable/schema/contract.validate.js +0 -0
- package/src/tooling/portable/schema/lexical.shape.v1.js +338 -0
- package/src/tooling/portable/schema/llm.companion.js +108 -0
- package/src/tooling/portable/schema/named.declarations.js +162 -0
- package/src/tooling/portable/schema/ordinary.contract.js +193 -0
- package/src/tooling/portable/schema/ordinary.fields.js +205 -0
- package/src/tooling/portable/schema/qualifiedLocalRoot.projection.js +70 -0
- package/src/tooling/portable/schema/qualifiedLocalRoot.runtime.js +170 -0
- package/src/tooling/portable/schema/schema.contract.js +465 -0
- package/src/tooling/portable/schema/schema.guide.js +326 -0
- package/src/tooling/portable/schema/schema.snapshot.js +119 -0
- package/src/tooling/portable/session/portable.session.js +145 -0
- package/src/tooling/portable/transfer/transfer.plan.js +102 -0
- package/src/transitions/record.transitions.js +484 -0
- package/src/transitions/transition.validate.js +129 -0
- package/src/validation/findings.js +76 -0
- package/src/validation/validateArtifact.js +216 -0
- package/src/workspaces/workspace.entrypointCapability.js +44 -0
- package/src/workspaces/workspace.materialRole.js +242 -0
- package/src/workspaces/workspace.recordPaths.js +426 -0
- package/tools/tiinex-portable.mjs +6 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export function correlateExternalPayloadFacts(markdown, facts, findings, path) {
|
|
2
|
+
if (!facts || facts.factsFormat !== 'portable-recipient-v2' || Number(facts.factsVersion || 0) !== 1) return;
|
|
3
|
+
const identity = sectionText(markdown, 'Payload Identity');
|
|
4
|
+
const location = sectionText(markdown, 'Payload Location');
|
|
5
|
+
const integrity = sectionText(markdown, 'Integrity Reference');
|
|
6
|
+
const visiblePath = markdownTarget(fieldValue(location, 'Location'));
|
|
7
|
+
if (facts.archivePath && visiblePath !== String(facts.archivePath)) findings.push(finding('error', 'portable.handoff-v2-surface.payload.visible-location-mismatch', 'External Payload visible Location diverges from its sealed machine facts.', { path }));
|
|
8
|
+
if (facts.archiveSha256 && fieldValue(integrity, 'Integrity Value') !== String(facts.archiveSha256)) findings.push(finding('error', 'portable.handoff-v2-surface.payload.visible-integrity-mismatch', 'External Payload visible integrity value diverges from its sealed machine facts.', { path }));
|
|
9
|
+
if (facts.archiveBytes !== undefined && Number(fieldValue(identity, 'Byte Size') || -1) !== Number(facts.archiveBytes)) findings.push(finding('error', 'portable.handoff-v2-surface.payload.visible-bytes-mismatch', 'External Payload visible byte size diverges from its sealed machine facts.', { path }));
|
|
10
|
+
}
|
|
11
|
+
export function correlateRelationFacts(markdown, facts, findings, path) {
|
|
12
|
+
if (!facts || facts.factsFormat !== 'portable-recipient-v2' || Number(facts.factsVersion || 0) !== 1) return;
|
|
13
|
+
const target = sectionText(markdown, 'Relation Target');
|
|
14
|
+
if (facts.relationDirection === 'payload artifact -> represented artifact') {
|
|
15
|
+
if (facts.payloadArtifactPath && markdownTarget(fieldValue(target, 'Source')) !== String(facts.payloadArtifactPath)) findings.push(finding('error', 'portable.handoff-v2-surface.relation.visible-source-mismatch', 'Relation visible Source diverges from its derived compatibility facts.', { path }));
|
|
16
|
+
if (facts.workspaceArtifactInnerPath && markdownTarget(fieldValue(target, 'Target')) !== String(facts.workspaceArtifactInnerPath)) findings.push(finding('error', 'portable.handoff-v2-surface.relation.visible-target-mismatch', 'Relation visible Target diverges from its derived compatibility facts.', { path }));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (facts.workspaceArtifactPath && markdownTarget(fieldValue(target, 'Source')) !== String(facts.workspaceArtifactPath)) findings.push(finding('error', 'portable.handoff-v2-surface.relation.visible-source-mismatch', 'Relation visible Source diverges from its sealed machine facts.', { path }));
|
|
20
|
+
if (facts.payloadArtifactPath && markdownTarget(fieldValue(target, 'Target')) !== String(facts.payloadArtifactPath)) findings.push(finding('error', 'portable.handoff-v2-surface.relation.visible-target-mismatch', 'Relation visible Target diverges from its sealed machine facts.', { path }));
|
|
21
|
+
}
|
|
22
|
+
export function correlatePointerFacts(markdown, facts, findings, path) {
|
|
23
|
+
if (!facts || facts.factsFormat !== 'portable-recipient-v2' || Number(facts.factsVersion || 0) !== 1) return;
|
|
24
|
+
if (facts.role !== 'handoff-route' || !facts.archivePath) return;
|
|
25
|
+
const targets = [...sectionText(markdown, 'Destinations').matchAll(/\[[^\]]*\]\(([^)]+)\)/g)].map((match) => match[1]);
|
|
26
|
+
if (targets.length !== 1 || targets[0] !== String(facts.archivePath)) findings.push(finding('error', 'portable.handoff-v2-surface.pointer.visible-destination-mismatch', 'Route Pointer visible Destination diverges from its sealed machine facts.', { path }));
|
|
27
|
+
}
|
|
28
|
+
export function markdownTarget(value = '') { return String(value || '').match(/\[[^\]]*\]\(([^)]+)\)/)?.[1] || String(value || '').trim(); }
|
|
29
|
+
export function inspectExternalPayloadShape(markdown, findings, path) {
|
|
30
|
+
for (const section of ['Payload Identity', 'Payload Location', 'Integrity Reference', 'Access Boundary', 'Interpretation Limits']) if (!sectionText(markdown, section)) findings.push(finding('error', 'portable.handoff-v2-surface.payload.section-missing', `External Payload artifact is missing required section ${section}.`, { path, section }));
|
|
31
|
+
const required = [['Payload Identity', 'Payload Label'], ['Payload Identity', 'Payload Kind'], ['Payload Location', 'Location'], ['Payload Location', 'Location Type'], ['Integrity Reference', 'Integrity Status'], ['Access Boundary', 'Access Boundary']];
|
|
32
|
+
for (const [section, field] of required) if (!fieldValue(sectionText(markdown, section), field)) findings.push(finding('error', 'portable.handoff-v2-surface.payload.field-missing', `External Payload artifact is missing required field ${field}.`, { path, section, field }));
|
|
33
|
+
}
|
|
34
|
+
export function inspectRelationShape(markdown, findings, path) {
|
|
35
|
+
for (const section of ['Relation Declaration', 'Relation Target', 'Relation Boundary']) if (!sectionText(markdown, section)) findings.push(finding('error', 'portable.handoff-v2-surface.relation.section-missing', `Relation artifact is missing required section ${section}.`, { path, section }));
|
|
36
|
+
for (const field of ['Relation Type', 'Relation Direction', 'Relation Scope']) if (!fieldValue(sectionText(markdown, 'Relation Declaration'), field)) findings.push(finding('error', 'portable.handoff-v2-surface.relation.field-missing', `Relation artifact is missing required field ${field}.`, { path, field }));
|
|
37
|
+
}
|
|
38
|
+
export function currentSchemaId(markdown = '') {
|
|
39
|
+
const match = String(markdown || '').match(/Current Schema:\s*(?:\[)?(tiinex\.[a-z0-9._-]+)(?:\])?/i);
|
|
40
|
+
return String(match?.[1] || '').toLowerCase();
|
|
41
|
+
}
|
|
42
|
+
export function sectionText(markdown = '', heading = '') {
|
|
43
|
+
const re = new RegExp(`^##\\s+${escapeRe(heading)}\\s*$`, 'mi');
|
|
44
|
+
const match = re.exec(String(markdown || ''));
|
|
45
|
+
if (!match) return '';
|
|
46
|
+
const rest = String(markdown || '').slice(match.index + match[0].length);
|
|
47
|
+
const next = /^##\s+/m.exec(rest);
|
|
48
|
+
return (next ? rest.slice(0, next.index) : rest).trim();
|
|
49
|
+
}
|
|
50
|
+
export function fieldValue(section = '', name = '') { const m = String(section || '').match(new RegExp(`^\\s*-\\s+${escapeRe(name)}:\\s*(.+?)\\s*$`, 'mi')); return String(m?.[1] || '').trim(); }
|
|
51
|
+
export function unquoteCode(value = '') { const text = String(value || '').trim(); return text.startsWith('`') && text.endsWith('`') ? text.slice(1, -1) : text; }
|
|
52
|
+
export function decodeUtf8(data) { try { return new TextDecoder('utf-8', { fatal: true }).decode(data); } catch { return ''; } }
|
|
53
|
+
export function escapeRe(value = '') { return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); }
|
|
54
|
+
export function finding(severity, code, message, extra = {}) { return Object.freeze({ severity, code, message, ...extra }); }
|
|
55
|
+
export function deepFreeze(value) { if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value; if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value; for (const child of Object.values(value)) deepFreeze(child); return Object.freeze(value); }
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { packageFileBytes, sha256Hex } from '../../../export/package.bytes.js';
|
|
2
|
+
import { sealC14nV2Self } from '../../../integrity/integrity.c14nV2.js';
|
|
3
|
+
import { C14N_V2_VALIDATOR_TARGET } from '../../../integrity/integrity.methodReference.js';
|
|
4
|
+
import { qualifyTiinexRouteArtifact } from './routeArtifactConformance.js';
|
|
5
|
+
import {
|
|
6
|
+
correlateExternalPayloadFacts,
|
|
7
|
+
correlatePointerFacts,
|
|
8
|
+
correlateRelationFacts,
|
|
9
|
+
currentSchemaId,
|
|
10
|
+
decodeUtf8,
|
|
11
|
+
deepFreeze,
|
|
12
|
+
fieldValue,
|
|
13
|
+
finding,
|
|
14
|
+
inspectExternalPayloadShape,
|
|
15
|
+
inspectRelationShape,
|
|
16
|
+
markdownTarget,
|
|
17
|
+
sectionText,
|
|
18
|
+
unquoteCode
|
|
19
|
+
} from './recipientV2.artifactInspection.js';
|
|
20
|
+
import {
|
|
21
|
+
RECIPIENT_V2_WORKSPACE_REPRESENTATION_SCHEMA_TARGET,
|
|
22
|
+
correlateWorkspaceRepresentationFacts,
|
|
23
|
+
inspectWorkspaceRepresentationShape,
|
|
24
|
+
parseRecipientV2WorkspaceRepresentation,
|
|
25
|
+
parseRecipientV2ExternalPayload,
|
|
26
|
+
renderRecipientV2WorkspaceRepresentation
|
|
27
|
+
} from './recipientV2.workspaceRepresentation.js';
|
|
28
|
+
export {
|
|
29
|
+
RECIPIENT_V2_WORKSPACE_REPRESENTATION_SCHEMA_TARGET,
|
|
30
|
+
parseRecipientV2WorkspaceRepresentation,
|
|
31
|
+
parseRecipientV2ExternalPayload,
|
|
32
|
+
renderRecipientV2WorkspaceRepresentation
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export const RECIPIENT_V2_ROOT_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/3988951208eb9a8926e84ab42625d4b42fa00c2d/.topics/.schemas/tiinex.root.v1.schema.md';
|
|
37
|
+
export const RECIPIENT_V2_POINTER_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/3988951208eb9a8926e84ab42625d4b42fa00c2d/.topics/.schemas/core/pointer/tiinex.pointer.v1.schema.md';
|
|
38
|
+
export const RECIPIENT_V2_EXTERNAL_PAYLOAD_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/3988951208eb9a8926e84ab42625d4b42fa00c2d/.topics/.schemas/external/payload/tiinex.external.payload.v1.schema.md';
|
|
39
|
+
export const RECIPIENT_V2_RELATION_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/3988951208eb9a8926e84ab42625d4b42fa00c2d/.topics/.schemas/relation/tiinex.relation.v1.schema.md';
|
|
40
|
+
export const RECIPIENT_V2_WORKSPACE_SCHEMA_TARGET = 'https://github.com/Tiinex/site/blob/17283cd2f0b9b0782a149a0cd113fb88a5a55ef3/src/schemas/workspace/tiinex.workspace.v1.schema.md';
|
|
41
|
+
export const RECIPIENT_V2_FACTS_BEGIN = '<!-- TIINEX-RECIPIENT-V2-FACTS:BEGIN -->';
|
|
42
|
+
export const RECIPIENT_V2_FACTS_END = '<!-- TIINEX-RECIPIENT-V2-FACTS:END -->';
|
|
43
|
+
|
|
44
|
+
export function renderRecipientV2Pointer(input = {}) {
|
|
45
|
+
const role = String(input.role || 'navigation');
|
|
46
|
+
const artifactFirst = input.artifactFirst === true;
|
|
47
|
+
const createdAt = normalizeCreatedAt(input.createdAt || '');
|
|
48
|
+
const destinations = (input.destinations || []).map((item) => `- ${String(item.label || 'Destination')}: [${String(item.display || item.target || '')}](${String(item.target || '')})`).join('\n');
|
|
49
|
+
const currentRead = (input.currentRead || []).map((item) => `- ${String(item.label || '')}: ${String(item.value || '')}`).join('\n');
|
|
50
|
+
const unsigned = `# Continuity Context\n\n- Envelope Schema: [tiinex.root.v1](${RECIPIENT_V2_ROOT_SCHEMA_TARGET})\n${renderParentEnvelope(input.parent)}- Current\n - Current Schema: [tiinex.pointer.v1](${RECIPIENT_V2_POINTER_SCHEMA_TARGET})\n - Created At: ${createdAt}\n - Summary: ${String(input.summary || 'Recipient-facing Handoff carrier navigation pointer.')}\n\n---\n\n# ${String(input.title || 'Handoff Carrier Pointer')}\n\n${String(input.prose || 'This pointer provides one bounded navigation surface.')}\n\n## Current Read\n\n- Carrier Role: ${role}\n${currentRead ? `${currentRead}\n` : ''}\n${artifactFirst ? 'Compatibility transport inventory may be derived from these qualified artifacts and exact payload bytes; it is not semantic authority.' : 'Transport topology and exact byte-map evidence is carried in the package transport manifest.'}\n\n## Destinations\n\n${destinations || '- none'}\n\n## Interpretation Notes\n\n${artifactFirst ? '- Destinations are navigation only; they do not create Parent, provenance, package membership, Handoff acceptance, transfer authority, or representation authority.\n- Numeric pathing, sibling placement, and package adjacency are presentation/container facts only.' : '- Numeric pathing is not generic Tiinex semantic authority. In this Handoff package, the generator deliberately projects the declared package-local Parent lineage into matching numeric pathing for readable random-access traversal.\n- Exact carried source artifact bytes and independently verified payload bytes retain their own authority; package-local lineage does not rewrite their historical provenance.'}\n\n---\n\n# Continuity Integrity\n\n${renderParentIntegrity(input.parent)}- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: self\n - Value: pending\n`;
|
|
51
|
+
return seal(unsigned);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function renderRecipientV2ExternalPayload(input = {}) {
|
|
55
|
+
const artifactFirst = input.artifactFirst === true;
|
|
56
|
+
const createdAt = normalizeCreatedAt(input.createdAt || '');
|
|
57
|
+
const materialBindings = renderPayloadMaterialBindings(input.materials || []);
|
|
58
|
+
const unsigned = `# Continuity Context\n\n- Envelope Schema: [tiinex.root.v1](${RECIPIENT_V2_ROOT_SCHEMA_TARGET})\n${renderParentEnvelope(input.parent)}- Current\n - Current Schema: [tiinex.external.payload.v1](${RECIPIENT_V2_EXTERNAL_PAYLOAD_SCHEMA_TARGET})\n - Created At: ${createdAt}\n - Summary: ${String(input.summary || 'Recipient-facing payload reference.')}\n\n---\n\n# ${String(input.title || 'Carrier Payload')}\n\n## Payload Identity\n\n- Payload Label: ${String(input.label || input.title || 'carrier payload')}\n- Payload Kind: ${String(input.kind || 'archive')}\n- Media Type: ${String(input.mediaType || 'application/zip')}\n- Format: ${String(input.format || 'deterministic stored ZIP')}\n- Byte Size: ${Number(input.bytes || 0)}\n- Payload Role: ${String(input.role || 'recipient-relative transport payload')}\n${input.workspaceId ? `- Workspace Id: ${String(input.workspaceId)}\n` : ''}\n## Payload Location\n\n- Location: [${String(input.location || '')}](${String(input.location || '')})\n- Location Type: local\n- Access Method: read exact package-local payload bytes after this artifact qualifies\n- Storage Boundary: recipient-relative Handoff carrier only\n\n## Integrity Reference\n\n- Integrity Status: verified\n- Integrity Method: sha256\n- Integrity Value: ${String(input.sha256 || '')}\n- Integrity Target: exact payload bytes as carried at the declared local Location\n- Validation Method: independent byte digest plus payload-format qualification\n${materialBindings ? `\n## Payload Material Bindings\n\n${materialBindings}\n` : ''}\n## Access Boundary\n\n- Access Boundary: recipient-local package read\n- Publicly Shareable: unknown\n- Retention Policy: disposable with this recipient-relative carrier unless separately preserved\n\n## Interpretation Limits\n\n${artifactFirst ? '- This artifact owns one explicitly located package-local payload and its exact payload-byte integrity. Package placement and adjacency do not create Parent or representation authority.\n- Payload integrity does not create Workspace identity, Handoff acceptance, completion, semantic truth, or remote provenance.' : '- This artifact owns one package-local payload node. Its Parent is package-local continuity; the ZIP companion cannot carry a Markdown envelope but participates in this node through this artifact.\n- Payload integrity does not create Workspace identity, Handoff acceptance, completion, semantic truth, or remote provenance.'}\n\n## Evidence Basis\n\n${artifactFirst ? 'Compatibility transport inventory may copy this visible payload metadata and mechanical byte identity, but cannot override this artifact or the exact payload bytes.' : 'Transport topology and exact byte-map evidence is carried in the package transport manifest.'}\n\n---\n\n# Continuity Integrity\n\n${renderParentIntegrity(input.parent)}- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: self\n - Value: pending\n`;
|
|
59
|
+
return seal(unsigned);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function renderRecipientV2Workspace(input = {}) {
|
|
63
|
+
const createdAt = normalizeCreatedAt(input.createdAt || '');
|
|
64
|
+
const workspaceId = String(input.workspaceId || input.title || 'workspace');
|
|
65
|
+
const unsigned = `# Continuity Context\n\n- Envelope Schema: [tiinex.root.v1](${RECIPIENT_V2_ROOT_SCHEMA_TARGET})\n${renderParentEnvelope(input.parent)}- Current\n - Current Schema: [tiinex.workspace.v1](${RECIPIENT_V2_WORKSPACE_SCHEMA_TARGET})\n - Created At: ${createdAt}\n - Summary: Package-local Workspace node for ${workspaceId}; its archive-backed provider authority is the explicit canonical Workspace Representation artifact while the durable source Workspace artifact remains unchanged inside the payload.\n\n---\n\n# ${String(input.title || workspaceId)}\n\nThis is the package-local Workspace lineage node for **${workspaceId}**. Its canonical archive-backed provider binding is [${String(input.representationPath || 'Workspace Representation')}](${String(input.representationPath || '')}). The exact durable Workspace source remains inside the bound representation payload at \`${String(input.sourceWorkspaceInnerPath || '')}\` and keeps its original bytes and provenance.\n\nTransport topology and exact byte-map evidence is carried in the package transport manifest.\n\n---\n\n# Continuity Integrity\n\n${renderParentIntegrity(input.parent)}- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: self\n - Value: pending\n`;
|
|
66
|
+
return seal(unsigned);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Retained for backward inspection compatibility; the corrected recipient-v2 topology no longer emits a visible relation artifact.
|
|
70
|
+
export function renderRecipientV2Relation(input = {}) {
|
|
71
|
+
const artifactFirst = input.artifactFirst === true;
|
|
72
|
+
const createdAt = normalizeCreatedAt(input.createdAt || '');
|
|
73
|
+
const unsigned = `# Continuity Context\n\n- Envelope Schema: [tiinex.root.v1](${RECIPIENT_V2_ROOT_SCHEMA_TARGET})\n${renderParentEnvelope(input.parent)}- Current\n - Current Schema: [tiinex.relation.v1](${RECIPIENT_V2_RELATION_SCHEMA_TARGET})\n - Created At: ${createdAt}\n - Summary: ${String(input.summary || 'Typed non-Parent carrier representation relation.')}\n\n---\n\n# ${String(input.title || 'Workspace Representation Relation')}\n\n## Relation Declaration\n\n- Relation Type: ${String(input.relationType || 'exact workspace archive representation')}\n- Relation Direction: ${String(input.direction || 'Workspace artifact -> archive representation payload')}\n- Relation Scope: ${String(input.scope || 'artifact-level recipient-relative package carriage representation')}\n\n## Relation Target\n\n- Source: [${String(input.sourceLabel || 'Relation source')}](${String(input.source || '')})\n${input.sourceWorkspaceId ? `- Source Workspace Id: ${String(input.sourceWorkspaceId)}\n` : ''}${input.sourceWorkspaceInnerPath ? `- Source Workspace Inner Path: \`${String(input.sourceWorkspaceInnerPath)}\`\n` : ''}- Target: [${String(input.targetLabel || 'Relation target')}](${String(input.target || '')})\n${input.targetWorkspaceId ? `- Target Workspace Id: ${String(input.targetWorkspaceId)}\n` : ''}${input.targetWorkspaceInnerPath ? `- Target Workspace Inner Path: \`${String(input.targetWorkspaceInnerPath)}\`\n` : ''}\n\n## Relation Boundary\n\n- The relation target is not Parent.\n\n## Evidence Basis\n\n${artifactFirst ? 'This relation is receiver-readable semantic meaning. Any compatibility transport projection is derived evidence only and cannot override the visible relation endpoints or scope.' : 'Transport topology and exact byte-map evidence is carried in the package transport manifest.'}\n\n---\n\n# Continuity Integrity\n\n${renderParentIntegrity(input.parent)}- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: self\n - Value: pending\n`;
|
|
74
|
+
return seal(unsigned);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function parseRecipientV2Relation(markdown = '') {
|
|
78
|
+
const declaration = sectionText(markdown, 'Relation Declaration');
|
|
79
|
+
const target = sectionText(markdown, 'Relation Target');
|
|
80
|
+
return Object.freeze({
|
|
81
|
+
relationType: fieldValue(declaration, 'Relation Type'),
|
|
82
|
+
direction: fieldValue(declaration, 'Relation Direction'),
|
|
83
|
+
scope: fieldValue(declaration, 'Relation Scope'),
|
|
84
|
+
source: markdownTarget(fieldValue(target, 'Source')),
|
|
85
|
+
sourceWorkspaceId: unquoteCode(fieldValue(target, 'Source Workspace Id')),
|
|
86
|
+
sourceWorkspaceInnerPath: unquoteCode(fieldValue(target, 'Source Workspace Inner Path')),
|
|
87
|
+
target: markdownTarget(fieldValue(target, 'Target')),
|
|
88
|
+
targetWorkspaceId: unquoteCode(fieldValue(target, 'Target Workspace Id')),
|
|
89
|
+
targetWorkspaceInnerPath: unquoteCode(fieldValue(target, 'Target Workspace Inner Path'))
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { parseRecipientV2Pointer } from './recipientV2.pointer.js';
|
|
94
|
+
export function inspectRecipientV2Artifact(file = {}, options = {}) {
|
|
95
|
+
const markdown = decodeUtf8(packageFileBytes(file));
|
|
96
|
+
const schemaId = currentSchemaId(markdown);
|
|
97
|
+
const facts = options.facts || parseFacts(markdown);
|
|
98
|
+
const findings = [];
|
|
99
|
+
const requireExactContract = options.requireExactContract === true || schemaId === 'tiinex.relation.v1' || schemaId === 'tiinex.workspace.representation.v1';
|
|
100
|
+
let conformance = null;
|
|
101
|
+
if (!schemaId) findings.push(finding('error', 'portable.handoff-v2-surface.artifact.schema-missing', 'Recipient-facing Markdown carrier lacks a Current Schema declaration.', { path: file.path || '' }));
|
|
102
|
+
else {
|
|
103
|
+
try {
|
|
104
|
+
conformance = qualifyTiinexRouteArtifact({
|
|
105
|
+
markdown,
|
|
106
|
+
expectedSchemaId: schemaId,
|
|
107
|
+
requireExactContract,
|
|
108
|
+
resolveParent: options.resolveParent,
|
|
109
|
+
parentMarkdown: options.parentMarkdown
|
|
110
|
+
});
|
|
111
|
+
} catch (error) {
|
|
112
|
+
findings.push(finding('error', 'portable.handoff-v2-surface.artifact.conformance-error', 'Recipient-facing Tiinex artifact conformance could not be evaluated.', { path: file.path || '', detail: String(error?.message || error || '') }));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (conformance && conformance.status !== 'qualified') findings.push(...(conformance.findings || []).map((item) => finding(item.severity || 'error', item.code || 'portable.handoff-v2-surface.artifact.unqualified', item.message || 'Recipient-facing artifact failed Tiinex conformance.', { path: file.path || '' })));
|
|
116
|
+
if (!markdown.startsWith(`# Continuity Context\n\n- Envelope Schema: [tiinex.root.v1](${RECIPIENT_V2_ROOT_SCHEMA_TARGET})\n`)) findings.push(finding('error', 'portable.handoff-v2-surface.artifact.root-reference-noncanonical', 'Generated recipient artifact does not begin with the maintained Root schema link.', { path: file.path || '' }));
|
|
117
|
+
if (!/\n---\n\n# Continuity Integrity\n/.test(markdown)) findings.push(finding('error', 'portable.handoff-v2-surface.artifact.footer-divider-missing', 'Generated recipient artifact is missing the canonical body/footer divider before Continuity Integrity.', { path: file.path || '' }));
|
|
118
|
+
if (schemaId === 'tiinex.external.payload.v1') { inspectExternalPayloadShape(markdown, findings, file.path || ''); correlateExternalPayloadFacts(markdown, facts, findings, file.path || ''); }
|
|
119
|
+
if (schemaId === 'tiinex.relation.v1') { inspectRelationShape(markdown, findings, file.path || ''); correlateRelationFacts(markdown, facts, findings, file.path || ''); }
|
|
120
|
+
if (schemaId === 'tiinex.workspace.representation.v1') { inspectWorkspaceRepresentationShape(markdown, findings, file.path || ''); correlateWorkspaceRepresentationFacts(markdown, facts, findings, file.path || ''); }
|
|
121
|
+
if (schemaId === 'tiinex.pointer.v1') correlatePointerFacts(markdown, facts, findings, file.path || '');
|
|
122
|
+
if (!facts) findings.push(finding('error', 'portable.handoff-v2-surface.artifact.facts-missing', 'Recipient-facing generated carrier artifact is missing its transport-owned machine facts record.', { path: file.path || '', schemaId }));
|
|
123
|
+
else if (facts.factsFormat !== 'portable-recipient-v2' || Number(facts.factsVersion || 0) !== 1) findings.push(finding('error', 'portable.handoff-v2-surface.artifact.facts-format-invalid', 'Recipient-facing generated carrier facts use an unsupported transport format.', { path: file.path || '', schemaId }));
|
|
124
|
+
return deepFreeze({ status: findings.some((item) => item.severity === 'error') ? 'invalid' : 'qualified', path: String(file.path || ''), markdown, schemaId, facts, conformance, sha256: sha256Hex(packageFileBytes(file)), findings: Object.freeze(findings) });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function parseRecipientV2Facts(markdown = '') { return parseFacts(markdown); }
|
|
128
|
+
|
|
129
|
+
function renderParentEnvelope(parent = null) {
|
|
130
|
+
if (!parent) return '';
|
|
131
|
+
const path = String(parent.path || '').trim();
|
|
132
|
+
const label = String(parent.label || path || 'Parent');
|
|
133
|
+
const schemaId = String(parent.schemaId || '').trim();
|
|
134
|
+
const schemaTarget = String(parent.schemaTarget || '').trim();
|
|
135
|
+
const createdAt = normalizeCreatedAt(parent.createdAt || '');
|
|
136
|
+
if (!path || !schemaId || !schemaTarget || !String(parent.selfDigest || '').trim()) throw new Error('portable.handoff-v2-surface.parent-authority-incomplete');
|
|
137
|
+
return `- Parent\n - Parent Schema: [${schemaId}](${schemaTarget})\n - Created At: ${createdAt}\n - Trace: [${label}](${path})\n - Origin:\n - [relative](${path})\n`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function renderParentIntegrity(parent = null) {
|
|
141
|
+
if (!parent) return '';
|
|
142
|
+
const path = String(parent.path || '').trim();
|
|
143
|
+
const label = String(parent.label || path || 'Parent');
|
|
144
|
+
const digest = String(parent.selfDigest || '').trim();
|
|
145
|
+
if (!path || !digest) throw new Error('portable.handoff-v2-surface.parent-integrity-incomplete');
|
|
146
|
+
return `- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: [${label}](${path})\n - Value: ${digest}\n\n`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
function renderPayloadMaterialBindings(materials = []) {
|
|
151
|
+
return [...materials].map((item) => {
|
|
152
|
+
const requirementId = String(item?.requirementId || '').trim();
|
|
153
|
+
const classification = String(item?.classification || '').trim();
|
|
154
|
+
const referenceTarget = String(item?.referenceTarget || '').trim();
|
|
155
|
+
const archiveEntry = String(item?.archiveEntry || '').trim();
|
|
156
|
+
if (!requirementId || !referenceTarget || !archiveEntry) return '';
|
|
157
|
+
return `- Requirement Id: ${requirementId}\n - Classification: ${classification || 'detached-material'}\n - Material Reference: ${referenceTarget}\n - Archive Entry: ${archiveEntry}${item?.routeWorkspaceId ? `\n - Route Workspace Id: ${String(item.routeWorkspaceId)}` : ''}${item?.routePath ? `\n - Route Path: ${String(item.routePath)}` : ''}${item?.sourceRequirementId ? `\n - Source Requirement Id: ${String(item.sourceRequirementId)}` : ''}${item?.originalPath ? `\n - Original Path: ${String(item.originalPath)}` : ''}${item?.bytes !== undefined ? `\n - Byte Size: ${Number(item.bytes || 0)}` : ''}${item?.sha256 ? `\n - SHA256: ${String(item.sha256)}` : ''}`;
|
|
158
|
+
}).filter(Boolean).join('\n');
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function parseFacts(markdown = '') {
|
|
162
|
+
const source = String(markdown || '');
|
|
163
|
+
const begin = source.indexOf(RECIPIENT_V2_FACTS_BEGIN);
|
|
164
|
+
const end = source.indexOf(RECIPIENT_V2_FACTS_END);
|
|
165
|
+
if (begin < 0 || end <= begin || source.indexOf(RECIPIENT_V2_FACTS_BEGIN, begin + RECIPIENT_V2_FACTS_BEGIN.length) >= 0) return null;
|
|
166
|
+
const bounded = source.slice(begin + RECIPIENT_V2_FACTS_BEGIN.length, end).trim();
|
|
167
|
+
const match = bounded.match(/^```json\s*\n([\s\S]*?)\n```$/);
|
|
168
|
+
if (!match) return null;
|
|
169
|
+
try { return JSON.parse(match[1]); } catch { return null; }
|
|
170
|
+
}
|
|
171
|
+
function seal(unsigned) { const result = sealC14nV2Self(unsigned); if (result.state !== 'sealed') throw new Error(`portable.handoff-v2-surface.integrity.seal-failed:${result.reason || result.state}`); return `${result.markdown}\n`; }
|
|
172
|
+
function normalizeCreatedAt(value = '') { const text = String(value || '').trim(); if (!text) return '1970-01-01 00:00:00'; return text.replace('T', ' ').replace(/\.\d{3}Z$/, '').replace(/Z$/, '').slice(0, 19); }
|
|
173
|
+
function stablePrettyJson(value) { return JSON.stringify(sortJson(value), null, 2); }
|
|
174
|
+
function sortJson(value) { if (Array.isArray(value)) return value.map(sortJson); if (!value || typeof value !== 'object') return value; return Object.fromEntries(Object.keys(value).sort().map((key) => [key, sortJson(value[key])])); }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export function recipientColdProjection(carrier = {}, readPath = '001-1-READ-BEFORE-PROCEEDING.trace.md') {
|
|
2
|
+
const routes = Object.freeze((carrier.routes || []).map((route) => Object.freeze({ id: String(route.id || ''), state: String(route.state || ''), workspaceId: String(route.workspaceId || ''), workspaceRelativeHandoffPath: String(route.workspaceRelativePath || ''), packagePath: String(route.packagePath || ''), sha256: String(route.sha256 || ''), from: String(route.parties?.from || ''), to: String(route.parties?.to || '') })));
|
|
3
|
+
const workspaces = Object.freeze((carrier.workspaces || []).map((workspace) => Object.freeze({ id: String(workspace.id || ''), title: String(workspace.title || workspace.id || ''), slug: String(workspace.slug || ''), qualification: String(workspace.qualification || '') })));
|
|
4
|
+
const qualified = routes.filter((route) => route.state === 'qualified');
|
|
5
|
+
const workspaceMode = String(carrier.mode || '') === 'workspace';
|
|
6
|
+
return deepFreeze({
|
|
7
|
+
schema: 'tiinex.portable.handoff-cold-consumer-projection.v1', version: 1,
|
|
8
|
+
status: carrier.status === 'ready' ? 'ready' : 'blocked',
|
|
9
|
+
controls: Object.freeze({ start: readPath, carrier: 'visible-qualified-artifacts', closure: 'visible-qualified-artifacts-plus-exact-payload-bytes', fileMap: 'not-exposed-in-v2', manifest: 'not-exposed-in-v2' }),
|
|
10
|
+
preferredPath: Object.freeze(workspaceMode
|
|
11
|
+
? { ingressKind: 'pointerless-workspace-package', firstSemanticOperation: 'orient-handoff-package', groundingOperation: 'none', qualificationOperation: 'workspace-qualification-after-orientation', minimalHostBootstrapActions: 1, nativeFallback: 'explicit-and-justified-only', providerSpecificSemanticAuthority: false }
|
|
12
|
+
: { ingressKind: 'routed-handoff-package', firstSemanticOperation: 'orient-handoff-package', groundingOperation: 'ground-cold-consumer', qualificationOperation: 'qualify-cold-start', minimalHostBootstrapActions: 1, nativeFallback: 'explicit-and-justified-only', providerSpecificSemanticAuthority: false }),
|
|
13
|
+
workspaces, routes,
|
|
14
|
+
selection: Object.freeze({ policy: String(carrier.selection?.policy || ''), qualifiedRouteCount: qualified.length, implicitRouteId: workspaceMode ? '' : qualified.length === 1 ? qualified[0].id : '' }),
|
|
15
|
+
authority: Object.freeze({ semanticAuthority: 'none', packageTruthRequired: true, routeBindingAuthority: workspaceMode ? 'none' : 'qualified-visible-artifact-plus-exact-payload-byte-truth-only' })
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function deepFreeze(value) {
|
|
20
|
+
if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value;
|
|
21
|
+
if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;
|
|
22
|
+
for (const child of Object.values(value)) deepFreeze(child);
|
|
23
|
+
return Object.freeze(value);
|
|
24
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { inspectRecipientFacingV2Topology } from './recipientV2.inspect.js';
|
|
2
|
+
import { RECIPIENT_V2_FORMAT_ID, RECIPIENT_V2_READ_PATH } from './recipientV2.topology.js';
|
|
3
|
+
import { buildRecipientV2TransportManifestFile } from './recipientV2.transportManifest.js';
|
|
4
|
+
|
|
5
|
+
export function selectRecipientFacingV2Delivery(bundle = {}, selector = '') {
|
|
6
|
+
const inspection = inspectRecipientFacingV2Topology(bundle);
|
|
7
|
+
if (inspection.status !== 'valid') return blocked(bundle, 'recipient-v2-source-unqualified', inspection.findings || []);
|
|
8
|
+
const route = selectRoute(inspection.carrierProjection?.routes || [], selector);
|
|
9
|
+
if (!route) return blocked(bundle, 'recipient-v2-route-selection-unresolved', []);
|
|
10
|
+
const routeMeta = (inspection.routes || []).find((item) => item.workspaceId === route.workspaceId && item.workspaceRelativeHandoffPath === route.workspaceRelativePath);
|
|
11
|
+
const workspace = (inspection.workspaces || []).find((item) => item.workspaceId === route.workspaceId);
|
|
12
|
+
if (!routeMeta || !workspace || !inspection.rootArtifact?.path) return blocked(bundle, 'recipient-v2-route-workspace-unresolved', []);
|
|
13
|
+
const byPath = new Map((bundle.files || []).map((file) => [String(file.path || ''), file]));
|
|
14
|
+
const factsByPath = new Map((inspection.artifactFacts || []).map((item) => [String(item.path || ''), item.facts || null]));
|
|
15
|
+
const pointerFile = byPath.get(routeMeta.pointerPath);
|
|
16
|
+
const pointerFacts = pointerFile ? factsByPath.get(String(pointerFile.path || '')) : null;
|
|
17
|
+
if (!pointerFile || !pointerFacts) return blocked(bundle, 'recipient-v2-route-pointer-unresolved', []);
|
|
18
|
+
|
|
19
|
+
// Preserve the original package root and READ artifact bytes so descendant Parent-target seals remain valid.
|
|
20
|
+
// Selected delivery prunes material branches; it does not rewrite the package-local lineage root in place.
|
|
21
|
+
const paths = new Set([
|
|
22
|
+
inspection.rootArtifact.path,
|
|
23
|
+
RECIPIENT_V2_READ_PATH,
|
|
24
|
+
routeMeta.pointerPath,
|
|
25
|
+
workspace.workspaceArtifactPath,
|
|
26
|
+
workspace.workspaceRepresentationArtifactPath,
|
|
27
|
+
workspace.workspacePayloadArtifactPath,
|
|
28
|
+
workspace.workspaceArchivePath
|
|
29
|
+
].filter(Boolean));
|
|
30
|
+
addPayloadRole(bundle, paths, factsByPath, (facts) => !facts.workspaceId && !Array.isArray(facts.materials) && facts.entryCount !== undefined);
|
|
31
|
+
if (pointerFacts.cacheArtifactPath) addPayloadArtifact(bundle, paths, factsByPath, String(pointerFacts.cacheArtifactPath));
|
|
32
|
+
const selectedMaterialFiles = [...paths].map((path) => byPath.get(path)).filter(Boolean).map((file) => {
|
|
33
|
+
const facts = factsByPath.get(String(file.path || ''));
|
|
34
|
+
return facts ? Object.freeze({ ...file, transportFacts: facts }) : file;
|
|
35
|
+
}).sort((a, b) => String(a.path || '').localeCompare(String(b.path || '')));
|
|
36
|
+
const manifest = buildRecipientV2TransportManifestFile(selectedMaterialFiles, { format: RECIPIENT_V2_FORMAT_ID, packageRootPath: inspection.rootArtifact.path, entryArtifactPath: RECIPIENT_V2_READ_PATH });
|
|
37
|
+
const files = Object.freeze([...selectedMaterialFiles, manifest].sort((a, b) => String(a.path || '').localeCompare(String(b.path || ''))));
|
|
38
|
+
const selectedBundle = Object.freeze({ ...bundle, files, transportFormat: RECIPIENT_V2_FORMAT_ID, boundary: `${bundle.boundary || ''} Selected recipient-relative v2 delivery preserves the sealed package root/READ lineage and carries exactly one qualified material route branch.` });
|
|
39
|
+
const selectedInspection = inspectRecipientFacingV2Topology(selectedBundle);
|
|
40
|
+
const siblingRoutes = (selectedInspection.carrierProjection?.routes || []).filter((item) => item.state === 'qualified');
|
|
41
|
+
const status = selectedInspection.status === 'valid' && siblingRoutes.length === 1 && siblingRoutes[0].id === route.id ? 'ready' : 'blocked';
|
|
42
|
+
return Object.freeze({ schema: 'tiinex.portable.recipient-facing-handoff-v2.delivery.v1', status, routeId: route.id, bundle: selectedBundle, inspection: selectedInspection, findings: selectedInspection.findings || Object.freeze([]) });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function addPayloadRole(bundle, paths, factsByPath, predicate) { for (const file of bundle.files || []) { const facts = factsByPath.get(String(file.path || '')); if (!facts || !predicate(facts)) continue; paths.add(String(file.path || '')); if (facts.archivePath) paths.add(String(facts.archivePath)); } }
|
|
46
|
+
function addPayloadArtifact(bundle, paths, factsByPath, artifactPath) { const file = (bundle.files || []).find((item) => String(item.path || '') === artifactPath); const facts = file ? factsByPath.get(String(file.path || '')) : null; if (!file || !facts) return; paths.add(artifactPath); if (facts.archivePath) paths.add(String(facts.archivePath)); }
|
|
47
|
+
function selectRoute(routes, selector) { if (selector && typeof selector === 'object') return routes.find((route) => route.id === selector.id && route.workspaceId === selector.workspaceId && route.workspaceRelativePath === selector.workspaceRelativePath) || null; const value = String(selector || ''); return routes.find((route) => route.id === value || route.workspaceRelativePath === value) || (routes.length === 1 ? routes[0] : null); }
|
|
48
|
+
function blocked(bundle, reason, findings) { return Object.freeze({ schema: 'tiinex.portable.recipient-facing-handoff-v2.delivery.v1', status: 'blocked', routeId: '', bundle, inspection: null, findings: Object.freeze([...(findings || []), Object.freeze({ severity: 'error', code: `portable.handoff-v2-delivery.${reason}`, message: 'Recipient-facing v2 selected delivery could not be qualified.' })]) }); }
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { finalizeFile } from '../../../export/package.fileMap.js';
|
|
2
|
+
import { RECIPIENT_V2_POINTER_SCHEMA_TARGET, renderRecipientV2Pointer } from './recipientV2.artifacts.js';
|
|
3
|
+
import { recipientV2TransportFacts } from './recipientV2.transportManifest.js';
|
|
4
|
+
|
|
5
|
+
export function buildEndpointRolePointerChain(input = {}) {
|
|
6
|
+
const files = [];
|
|
7
|
+
const roles = [];
|
|
8
|
+
const findings = [];
|
|
9
|
+
let lineageParent = input.lineageParent || null;
|
|
10
|
+
let nextDimension = String(input.nextDimension || '');
|
|
11
|
+
for (const requirement of input.requirements || []) {
|
|
12
|
+
const target = input.resolveRoleMaterialTarget(requirement, input.descriptor, input.workspaceById, input.cache, input.route);
|
|
13
|
+
if (target.state !== 'qualified') {
|
|
14
|
+
findings.push(finding('error', `portable.handoff-v2-surface.endpoint-role.${target.reason || 'unresolved'}`, 'Endpoint Role requirement did not resolve to one exact carried Workspace/cache representation.', { routeId: String(input.route?.id || ''), requirementId: String(requirement.id || '') }));
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const party = String(requirement.party || requirement.fields?.Side || '').toLowerCase() || 'endpoint';
|
|
18
|
+
const roleToken = safeToken(requirement.roleLabel || requirement.name || target.referenceTarget || `${party}-role`);
|
|
19
|
+
const rolePointerPath = `${nextDimension}-${party}-${roleToken}-endpoint-role-pointer.trace.md`;
|
|
20
|
+
const roleFacts = {
|
|
21
|
+
workspaceId: input.workspace.workspaceId,
|
|
22
|
+
routeId: String(input.route?.id || ''),
|
|
23
|
+
endpointRequirementId: String(requirement.id || ''),
|
|
24
|
+
endpointParty: party,
|
|
25
|
+
roleLabelHint: String(requirement.roleLabel || ''),
|
|
26
|
+
referenceTarget: String(target.referenceTarget || ''),
|
|
27
|
+
targetCarrierKind: target.carrierKind,
|
|
28
|
+
targetWorkspaceId: String(target.targetWorkspaceId || ''),
|
|
29
|
+
archivePath: target.archivePath,
|
|
30
|
+
archiveSha256: target.archiveSha256,
|
|
31
|
+
targetInnerPath: String(target.innerPath || ''),
|
|
32
|
+
targetArchiveEntry: String(target.archiveEntry || ''),
|
|
33
|
+
targetBytes: Number(target.bytes || 0),
|
|
34
|
+
targetSha256: String(target.sha256 || '')
|
|
35
|
+
};
|
|
36
|
+
const rolePointer = finalizeFile({
|
|
37
|
+
path: rolePointerPath,
|
|
38
|
+
kind: 'endpoint-role-pointer',
|
|
39
|
+
logicalKind: 'recipient-v2-endpoint-role-pointer',
|
|
40
|
+
mediaType: 'text/markdown',
|
|
41
|
+
transportFacts: recipientV2TransportFacts('endpoint-role', roleFacts),
|
|
42
|
+
content: renderRecipientV2Pointer({
|
|
43
|
+
createdAt: input.createdAt,
|
|
44
|
+
parent: lineageParent,
|
|
45
|
+
role: 'endpoint-role',
|
|
46
|
+
title: `Endpoint Role Pointer — ${String(requirement.roleLabel || requirement.name || 'Role')}`,
|
|
47
|
+
summary: 'Package-local Pointer to one exact Handoff endpoint Role artifact for the selected Handoff route.',
|
|
48
|
+
prose: 'This Pointer grounds one exact Handoff From/To Role endpoint in an explicit carried Workspace/cache representation. It does not prove a human holder, consent, Handoff acceptance, or Role authority beyond the referenced Role artifact.',
|
|
49
|
+
currentRead: [
|
|
50
|
+
{ label: 'Route Id', value: `\`${String(input.route?.id || '')}\`` },
|
|
51
|
+
{ label: 'Endpoint Requirement Id', value: `\`${String(requirement.id || '')}\`` },
|
|
52
|
+
{ label: 'Endpoint Party', value: party },
|
|
53
|
+
...(roleFacts.roleLabelHint ? [{ label: 'Role Label Hint', value: roleFacts.roleLabelHint }] : []),
|
|
54
|
+
{ label: 'Role Reference', value: roleFacts.referenceTarget ? `\`${roleFacts.referenceTarget}\`` : 'exact carried target' },
|
|
55
|
+
{ label: 'Target Carrier Kind', value: target.carrierKind },
|
|
56
|
+
{ label: 'Target Payload', value: `[payload](${target.archivePath})` },
|
|
57
|
+
...(target.carrierKind === 'workspace-archive-entry'
|
|
58
|
+
? [{ label: 'Target Workspace Id', value: `\`${String(target.targetWorkspaceId || '')}\`` }, { label: 'Target Inner Path', value: `\`${String(target.innerPath || '')}\`` }]
|
|
59
|
+
: []),
|
|
60
|
+
...(target.carrierKind === 'workspace-cache-entry'
|
|
61
|
+
? [{ label: 'Target Archive Entry', value: `\`${String(target.archiveEntry || '')}\`` }]
|
|
62
|
+
: [])
|
|
63
|
+
],
|
|
64
|
+
destinations: [{ label: 'Exact endpoint Role carrier', display: `${target.archivePath} :: ${target.innerPath || target.archiveEntry}`, target: target.archivePath }],
|
|
65
|
+
facts: roleFacts
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
files.push(rolePointer);
|
|
69
|
+
roles.push(Object.freeze({
|
|
70
|
+
pointerPath: rolePointerPath,
|
|
71
|
+
workspaceId: input.workspace.workspaceId,
|
|
72
|
+
routeId: String(input.route?.id || ''),
|
|
73
|
+
requirementId: String(requirement.id || ''),
|
|
74
|
+
endpointParty: party,
|
|
75
|
+
roleLabelHint: String(requirement.roleLabel || ''),
|
|
76
|
+
referenceTarget: String(target.referenceTarget || ''),
|
|
77
|
+
targetCarrierKind: target.carrierKind,
|
|
78
|
+
targetWorkspaceId: String(target.targetWorkspaceId || ''),
|
|
79
|
+
targetInnerPath: String(target.innerPath || target.archiveEntry || ''),
|
|
80
|
+
targetSha256: String(target.sha256 || '')
|
|
81
|
+
}));
|
|
82
|
+
lineageParent = input.parentAuthority(rolePointer, 'tiinex.pointer.v1', RECIPIENT_V2_POINTER_SCHEMA_TARGET, input.createdAt);
|
|
83
|
+
nextDimension = `${nextDimension}-1`;
|
|
84
|
+
}
|
|
85
|
+
return Object.freeze({
|
|
86
|
+
files: Object.freeze(files),
|
|
87
|
+
roles: Object.freeze(roles),
|
|
88
|
+
findings: Object.freeze(findings),
|
|
89
|
+
lineageParent,
|
|
90
|
+
nextDimension
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
export function buildParticipantRolePointerChain(input = {}) {
|
|
96
|
+
const files = [];
|
|
97
|
+
const roles = [];
|
|
98
|
+
const findings = [];
|
|
99
|
+
let lineageParent = input.lineageParent || null;
|
|
100
|
+
let nextDimension = String(input.nextDimension || '');
|
|
101
|
+
for (const requirement of input.requirements || []) {
|
|
102
|
+
const target = input.resolveRoleMaterialTarget(requirement, input.descriptor, input.workspaceById, input.cache, input.route);
|
|
103
|
+
if (target.state !== 'qualified') {
|
|
104
|
+
findings.push(finding('error', `portable.handoff-v2-surface.participant-role.${target.reason || 'unresolved'}`, 'Role grounding requirement did not resolve to one exact carried Workspace/cache representation.', { routeId: String(input.route?.id || ''), requirementId: String(requirement.id || '') }));
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const roleToken = safeToken(requirement.roleLabel || requirement.name || target.referenceTarget || 'participant-role');
|
|
108
|
+
const rolePointerPath = `${nextDimension}-${roleToken}-role-pointer.trace.md`;
|
|
109
|
+
const roleFacts = {
|
|
110
|
+
workspaceId: input.workspace.workspaceId,
|
|
111
|
+
routeId: String(input.route?.id || ''),
|
|
112
|
+
participantRequirementId: String(requirement.id || ''),
|
|
113
|
+
roleLabelHint: String(requirement.roleLabel || ''),
|
|
114
|
+
referenceTarget: String(target.referenceTarget || ''),
|
|
115
|
+
targetCarrierKind: target.carrierKind,
|
|
116
|
+
targetWorkspaceId: String(target.targetWorkspaceId || ''),
|
|
117
|
+
archivePath: target.archivePath,
|
|
118
|
+
archiveSha256: target.archiveSha256,
|
|
119
|
+
targetInnerPath: String(target.innerPath || ''),
|
|
120
|
+
targetArchiveEntry: String(target.archiveEntry || ''),
|
|
121
|
+
targetBytes: Number(target.bytes || 0),
|
|
122
|
+
targetSha256: String(target.sha256 || '')
|
|
123
|
+
};
|
|
124
|
+
const rolePointer = finalizeFile({
|
|
125
|
+
path: rolePointerPath,
|
|
126
|
+
kind: 'participant-role-pointer',
|
|
127
|
+
logicalKind: 'recipient-v2-participant-role-pointer',
|
|
128
|
+
mediaType: 'text/markdown',
|
|
129
|
+
transportFacts: recipientV2TransportFacts('participant-role', roleFacts),
|
|
130
|
+
content: renderRecipientV2Pointer({
|
|
131
|
+
createdAt: input.createdAt,
|
|
132
|
+
parent: lineageParent,
|
|
133
|
+
role: 'participant-role',
|
|
134
|
+
title: `Role Grounding Pointer — ${String(requirement.roleLabel || requirement.name || 'Role')}`,
|
|
135
|
+
summary: 'Package-local Pointer to one exact Role artifact required for recipient grounding before the selected Handoff route.',
|
|
136
|
+
prose: 'This Pointer is recipient discovery/grounding only. It does not declare semantic participation, change Handoff From/To, prove a human holder, or create Role authority; participation meaning remains owned by authoritative Handoff/Relation/context authority.',
|
|
137
|
+
currentRead: [
|
|
138
|
+
{ label: 'Route Id', value: `\`${String(input.route?.id || '')}\`` },
|
|
139
|
+
{ label: 'Grounding Requirement Id', value: `\`${String(requirement.id || '')}\`` },
|
|
140
|
+
...(roleFacts.roleLabelHint ? [{ label: 'Role Label Hint', value: roleFacts.roleLabelHint }] : []),
|
|
141
|
+
{ label: 'Role Reference', value: roleFacts.referenceTarget ? `\`${roleFacts.referenceTarget}\`` : 'exact carried target' },
|
|
142
|
+
{ label: 'Target Carrier Kind', value: target.carrierKind },
|
|
143
|
+
{ label: 'Target Payload', value: `[payload](${target.archivePath})` },
|
|
144
|
+
...(target.carrierKind === 'workspace-archive-entry'
|
|
145
|
+
? [{ label: 'Target Workspace Id', value: `\`${String(target.targetWorkspaceId || '')}\`` }, { label: 'Target Inner Path', value: `\`${String(target.innerPath || '')}\`` }]
|
|
146
|
+
: []),
|
|
147
|
+
...(target.carrierKind === 'workspace-cache-entry'
|
|
148
|
+
? [{ label: 'Target Archive Entry', value: `\`${String(target.archiveEntry || '')}\`` }]
|
|
149
|
+
: [])
|
|
150
|
+
],
|
|
151
|
+
destinations: [{ label: 'Exact Role grounding carrier', display: `${target.archivePath} :: ${target.innerPath || target.archiveEntry}`, target: target.archivePath }],
|
|
152
|
+
facts: roleFacts
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
files.push(rolePointer);
|
|
156
|
+
roles.push(Object.freeze({
|
|
157
|
+
pointerPath: rolePointerPath,
|
|
158
|
+
workspaceId: input.workspace.workspaceId,
|
|
159
|
+
routeId: String(input.route?.id || ''),
|
|
160
|
+
requirementId: String(requirement.id || ''),
|
|
161
|
+
targetCarrierKind: target.carrierKind,
|
|
162
|
+
targetWorkspaceId: String(target.targetWorkspaceId || ''),
|
|
163
|
+
targetInnerPath: String(target.innerPath || target.archiveEntry || ''),
|
|
164
|
+
targetSha256: String(target.sha256 || '')
|
|
165
|
+
}));
|
|
166
|
+
lineageParent = input.parentAuthority(rolePointer, 'tiinex.pointer.v1', RECIPIENT_V2_POINTER_SCHEMA_TARGET, input.createdAt);
|
|
167
|
+
nextDimension = `${nextDimension}-1`;
|
|
168
|
+
}
|
|
169
|
+
return Object.freeze({
|
|
170
|
+
files: Object.freeze(files),
|
|
171
|
+
roles: Object.freeze(roles),
|
|
172
|
+
findings: Object.freeze(findings),
|
|
173
|
+
lineageParent,
|
|
174
|
+
nextDimension
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function safeToken(value = '') { return String(value || '').trim().toLowerCase().normalize('NFKD').replace(/[\u0300-\u036f]/g, '').replace(/[^a-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 80) || 'workspace'; }
|
|
179
|
+
function finding(severity, code, message, extra = {}) { return Object.freeze({ severity, code, message, ...extra }); }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const RECIPIENT_V2_ROUTE_SELECTION_AUTHORITY = 'outer-invocation-exact-package-local-handoff-route-pointer';
|
|
2
|
+
export const RECIPIENT_V2_SIBLING_ROUTE_INFERENCE = false;
|
|
3
|
+
|
|
4
|
+
export function recipientV2EntryCurrentRead() {
|
|
5
|
+
return Object.freeze([
|
|
6
|
+
Object.freeze({ label: 'Bootstrap Exception', value: 'before Tiinex Tooling is available, use host capabilities only to read this entry/bootstrap node and extract the declared bootstrap ZIP into a writable runtime location; do not unpack Workspace/cache payloads or perform package archaeology' }),
|
|
7
|
+
Object.freeze({ label: 'Tooling Entrypoint', value: '`runtime/tools/tiinex-portable.mjs` relative to the chosen bootstrap extraction root; use this exact path and do not search/list the extracted runtime to discover it' }),
|
|
8
|
+
Object.freeze({ label: 'First Tooling Invocation', value: '`node <bootstrap-root>/runtime/tools/tiinex-portable.mjs orient-handoff-package <untouched-handoff-package.zip>`' }),
|
|
9
|
+
Object.freeze({ label: 'Continue From', value: 'do not read the outer Continue-from Pointer natively; keep that exact package-local path opaque until Tooling takeover' }),
|
|
10
|
+
Object.freeze({ label: 'Grounding', value: 'after orientation, run `node <bootstrap-root>/runtime/tools/tiinex-portable.mjs ground <untouched-handoff-package.zip> --route <Continue-from>`; this is the shared human/LLM decision-grounding path and returns bounded authority, exact Required Context pointers, selected-route Parent leaf, compact cold-start continuity-to-root proof, current-work frontier, blockers, and exact recovery guidance. Accepted pinned repository Parents may resolve only deterministic relative Parents in the same repository/ref context; repeated host recovery remains explicit through `accept-host-receipt --prior <previous-accepted.json>` and the same `ground --recovery <newest-accepted.json>` path' }),
|
|
11
|
+
Object.freeze({ label: 'Cold-start Qualification', value: '`qualify-cold-start <untouched-handoff-package.zip> --route <Continue-from> --pre-takeover ...` is only for qualifying or measuring the cold-start process itself; it is not a second normal grounding path' }),
|
|
12
|
+
Object.freeze({ label: 'Route Selection', value: 'the outer invocation must name exactly one package-local Handoff Route Pointer from this package; never infer among sibling Handoff routes' }),
|
|
13
|
+
Object.freeze({ label: 'Fallback', value: 'fail closed when Tooling cannot qualify the selected route or its declared dependency/integrity evidence; native package archaeology is not a preferred-path substitute' })
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export function recipientV2WorkspaceEntryCurrentRead() {
|
|
19
|
+
return Object.freeze([
|
|
20
|
+
Object.freeze({ label: 'Bootstrap Exception', value: 'before Tiinex Tooling is available, use host capabilities only to read this entry/bootstrap node and extract the declared bootstrap ZIP into a writable runtime location; do not unpack Workspace payloads or perform package archaeology' }),
|
|
21
|
+
Object.freeze({ label: 'Tooling Entrypoint', value: '`runtime/tools/tiinex-portable.mjs` relative to the chosen bootstrap extraction root; use this exact path and do not search/list the extracted runtime to discover it' }),
|
|
22
|
+
Object.freeze({ label: 'First Tooling Invocation', value: '`node <bootstrap-root>/runtime/tools/tiinex-portable.mjs orient-handoff-package <untouched-workspace-package.zip>`' }),
|
|
23
|
+
Object.freeze({ label: 'Carrier Mode', value: 'pointerless Workspace carrier; no Handoff route, Continue-from Pointer, endpoint Role, current work, transfer, acceptance, completion, or participation is declared or inferred' }),
|
|
24
|
+
Object.freeze({ label: 'Route Selection', value: 'none; the canonical package role requires Route Placement Rule, Continue-From Rule, and Pre-Handoff Closure Rule to all be exactly `none`' }),
|
|
25
|
+
Object.freeze({ label: 'Next Action', value: 'after Tooling orientation, use only the qualified carried Workspace identities and exact Workspace landing/inspection operations required by the consuming workflow' }),
|
|
26
|
+
Object.freeze({ label: 'Fallback', value: 'fail closed when Tooling cannot qualify the package role, exact Workspace bindings, bootstrap, or all-none Route Discovery profile; native package archaeology is not a preferred-path substitute' })
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { projectHandoffCarrierOutputFromPackage, projectHandoffHumanOutput } from './carrierProjection.js';
|
|
2
|
+
import { inspectRecipientFacingV2Topology } from './recipientV2.inspect.js';
|
|
3
|
+
import { RECIPIENT_V2_READ_PATH } from './recipientV2.topology.js';
|
|
4
|
+
|
|
5
|
+
export function recipientV2StandardInvocation(humanOutput = {}, inspection = {}) {
|
|
6
|
+
const route = humanOutput.selectedRoute || {};
|
|
7
|
+
return recipientV2InvocationForRoute(route, inspection);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function recipientV2InvocationForRoute(route = {}, inspection = {}) {
|
|
11
|
+
const routeMeta = (inspection.routes || []).find((item) => String(item.workspaceId || '') === String(route.workspaceId || '') && String(item.workspaceRelativeHandoffPath || '') === String(route.workspaceRelativePath || ''));
|
|
12
|
+
if (!routeMeta?.pointerPath || !route.workspaceRelativePath || !route.workspaceId) return '';
|
|
13
|
+
return [
|
|
14
|
+
'Handoff package attached.',
|
|
15
|
+
'',
|
|
16
|
+
'Cold start: read Start directly; do not list or extract this package.',
|
|
17
|
+
'',
|
|
18
|
+
'Start:',
|
|
19
|
+
RECIPIENT_V2_READ_PATH,
|
|
20
|
+
'Continue from (do not read native; pass to Tiinex after bootstrap):',
|
|
21
|
+
String(routeMeta.pointerPath),
|
|
22
|
+
''
|
|
23
|
+
].join('\n');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function projectRecipientV2HumanOutput(humanOutput = {}, inspection = {}) {
|
|
27
|
+
if (humanOutput.status !== 'ready' && humanOutput.status !== 'selection-required') return humanOutput;
|
|
28
|
+
const invocation = humanOutput.primary ? recipientV2StandardInvocation(humanOutput, inspection) : '';
|
|
29
|
+
if (humanOutput.primary && !invocation) return Object.freeze({ ...humanOutput, status: 'blocked', findings: Object.freeze([...(humanOutput.findings || []), Object.freeze({ severity: 'error', code: 'portable.handoff-v2-human-output.route-pointer.unresolved', message: 'Recipient-v2 human output requires one exact package-local Handoff route pointer for the selected semantic Handoff.' })]) });
|
|
30
|
+
const sharedRoutes = (humanOutput.sharedRouting?.routes || []).map((item) => {
|
|
31
|
+
const route = (inspection.carrierProjection?.routes || []).find((candidate) => String(candidate.id || '') === String(item.routeId || ''))
|
|
32
|
+
|| { id: item.routeId, workspaceId: item.workspaceId, workspaceRelativePath: item.workspaceRelativeHandoffPath };
|
|
33
|
+
const transportText = recipientV2InvocationForRoute(route, inspection);
|
|
34
|
+
return transportText ? Object.freeze({ ...item, transportText }) : null;
|
|
35
|
+
});
|
|
36
|
+
if (humanOutput.sharedRouting && sharedRoutes.some((item) => !item)) return Object.freeze({ ...humanOutput, status: 'blocked', findings: Object.freeze([...(humanOutput.findings || []), Object.freeze({ severity: 'error', code: 'portable.handoff-v2-human-output.shared-route-pointer.unresolved', message: 'Recipient-v2 shared human output requires one exact package-local Handoff route pointer for every qualified route.' })]) });
|
|
37
|
+
const sharedRouting = humanOutput.sharedRouting ? Object.freeze({ ...humanOutput.sharedRouting, routes: Object.freeze(sharedRoutes) }) : null;
|
|
38
|
+
return Object.freeze({
|
|
39
|
+
...humanOutput,
|
|
40
|
+
normalInlineRouting: humanOutput.normalInlineRouting ? Object.freeze({ ...humanOutput.normalInlineRouting, content: invocation }) : null,
|
|
41
|
+
sharedRouting,
|
|
42
|
+
fallbackTransportText: humanOutput.fallbackTransportText ? Object.freeze({ ...humanOutput.fallbackTransportText, content: invocation }) : null,
|
|
43
|
+
boundary: `${String(humanOutput.boundary || '')} Recipient-v2 host-layer routing is a deterministic address label only: the fixed package Start artifact and exact package-local Continue-from Handoff Route Pointers. Workspace, semantic Handoff path, Role, and Task stay package-owned; shared route texts are read-only addresses and sibling routes remain unselected until one exact qualified route is chosen.`
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function projectPortableHandoffCarrierOutputFromPackage(input = {}) {
|
|
48
|
+
const bundle = input.bundle || input;
|
|
49
|
+
const inspection = inspectRecipientFacingV2Topology(bundle);
|
|
50
|
+
if (inspection.detected !== true) return projectHandoffCarrierOutputFromPackage(input);
|
|
51
|
+
const humanOutput = projectRecipientV2HumanOutput(projectHandoffHumanOutput({ projection: inspection.carrierProjection || {}, route: input.route || input.routePath || input.routeId || '', collisionInstance: input.collisionInstance || input.instance || 1 }), inspection);
|
|
52
|
+
const findings = Object.freeze([...(inspection.findings || []), ...(humanOutput.findings || [])]);
|
|
53
|
+
const status = inspection.status === 'valid' && humanOutput.status === 'ready' ? 'ready' : humanOutput.status === 'selection-required' ? 'selection-required' : 'blocked';
|
|
54
|
+
const carrierInspection = boundedRecipientV2Inspection(inspection);
|
|
55
|
+
return deepFreeze({ schema: 'tiinex.portable.handoff-carrier-output-projection.v1', status, carrierInspection, humanOutput, findings, boundary: 'Read-only regeneration of recipient-v2 carrier filename and minimal Start/Continue-from transport address from package-qualified route truth. Package byte/provider internals are intentionally omitted from the human-output projection.' });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
function boundedRecipientV2Inspection(inspection = {}) {
|
|
60
|
+
return Object.freeze({
|
|
61
|
+
schema: String(inspection.schema || ''),
|
|
62
|
+
status: String(inspection.status || 'invalid'),
|
|
63
|
+
format: String(inspection.format || ''),
|
|
64
|
+
rootArtifact: inspection.rootArtifact ? Object.freeze({ ...inspection.rootArtifact }) : null,
|
|
65
|
+
entrypoint: inspection.readArtifact ? Object.freeze({ path: String(inspection.readArtifact.path || ''), status: String(inspection.readArtifact.status || '') }) : null,
|
|
66
|
+
workspaces: Object.freeze((inspection.workspaces || []).map((item) => Object.freeze({ workspaceId: String(item.workspaceId || ''), workspaceArtifactPath: String(item.workspaceArtifactPath || ''), workspaceArchivePath: String(item.workspaceArchivePath || '') }))),
|
|
67
|
+
routes: Object.freeze((inspection.routes || []).map((item) => Object.freeze({ pointerPath: String(item.pointerPath || ''), workspaceId: String(item.workspaceId || ''), workspaceRelativeHandoffPath: String(item.workspaceRelativeHandoffPath || '') }))),
|
|
68
|
+
findingSummary: Object.freeze({ ...(inspection.findingSummary || {}) }),
|
|
69
|
+
findings: Object.freeze([...(inspection.findings || [])])
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function deepFreeze(value) {
|
|
74
|
+
if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value;
|
|
75
|
+
if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value;
|
|
76
|
+
for (const child of Object.values(value)) deepFreeze(child);
|
|
77
|
+
return Object.freeze(value);
|
|
78
|
+
}
|