@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,158 @@
|
|
|
1
|
+
import { portableFinding } from '../findings.js';
|
|
2
|
+
import {
|
|
3
|
+
extractQualifiedMarkdownLinkTarget,
|
|
4
|
+
isAbsoluteReference,
|
|
5
|
+
materialIsSchemaDocument,
|
|
6
|
+
portableFieldDomainOccurrenceQualification,
|
|
7
|
+
relativePathEscapesBoundary,
|
|
8
|
+
resolvePortableMaterialReference
|
|
9
|
+
} from './material.graph.js';
|
|
10
|
+
import { packageContainingMaterial } from './semantic.package.graph.js';
|
|
11
|
+
|
|
12
|
+
export function compileSemanticPackageSchemaResolution(input = {}) {
|
|
13
|
+
const state = {
|
|
14
|
+
nodes: input.nodes || [],
|
|
15
|
+
materialIndex: input.materialIndex,
|
|
16
|
+
findings: []
|
|
17
|
+
};
|
|
18
|
+
const index = new Map();
|
|
19
|
+
const nodeByKey = new Map(state.nodes.map((node) => [node.manifestKey, node]));
|
|
20
|
+
|
|
21
|
+
for (const node of state.nodes) {
|
|
22
|
+
const reachable = new Set(node.reachablePackageKeys);
|
|
23
|
+
const candidates = new Map();
|
|
24
|
+
for (const packageKey of reachable) {
|
|
25
|
+
const targetNode = nodeByKey.get(packageKey);
|
|
26
|
+
for (const key of targetNode?.localSchemaKeys || []) {
|
|
27
|
+
const material = state.materialIndex.byKey.get(key);
|
|
28
|
+
if (!material?.schemaId) continue;
|
|
29
|
+
if (!candidates.has(material.schemaId)) candidates.set(material.schemaId, []);
|
|
30
|
+
candidates.get(material.schemaId).push(Object.freeze({ material, packageKey }));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const bindingsById = new Map();
|
|
35
|
+
for (const binding of node.schemaBindingDeclarations || []) {
|
|
36
|
+
if (binding.name === 'none') continue;
|
|
37
|
+
if (!bindingsById.has(binding.name)) bindingsById.set(binding.name, []);
|
|
38
|
+
bindingsById.get(binding.name).push(binding);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const ids = new Set([...candidates.keys(), ...bindingsById.keys()]);
|
|
42
|
+
for (const schemaId of ids) {
|
|
43
|
+
const key = resolutionKey(node.manifestKey, schemaId);
|
|
44
|
+
const bindings = bindingsById.get(schemaId) || [];
|
|
45
|
+
let resolution;
|
|
46
|
+
if (bindings.length > 1) {
|
|
47
|
+
resolution = schemaResolution(node, schemaId, 'ambiguous', null, candidates.get(schemaId) || [], bindings, ['Duplicate/conflicting Schema Resolution Bindings.']);
|
|
48
|
+
state.findings.push(portableFinding('error', 'portable.semantic-package.schema-binding.duplicate', `Duplicate Schema Resolution Bindings for ${schemaId}.`, { ref: node.manifestPath, schemaId }));
|
|
49
|
+
} else if (bindings.length === 1) {
|
|
50
|
+
resolution = resolveExplicitSchemaBinding(node, schemaId, bindings[0], candidates.get(schemaId) || [], state);
|
|
51
|
+
} else {
|
|
52
|
+
const available = candidates.get(schemaId) || [];
|
|
53
|
+
if (available.length === 1) resolution = schemaResolution(node, schemaId, 'resolved', available[0], available, [], []);
|
|
54
|
+
else if (!available.length) resolution = schemaResolution(node, schemaId, 'unresolved', null, available, [], ['No resolvable schema candidate exists in the reachable package graph.']);
|
|
55
|
+
else resolution = schemaResolution(node, schemaId, 'ambiguous', null, available, [], [`${available.length} competing schema candidates exist without one exact manifest binding.`]);
|
|
56
|
+
}
|
|
57
|
+
index.set(key, resolution);
|
|
58
|
+
appendResolutionFinding(resolution, node, state.findings);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return Object.freeze({ index, findings: Object.freeze(state.findings) });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function resolveCompanionSchemaReference(node, fromMaterial, target, input = {}) {
|
|
66
|
+
if (!isAbsoluteReference(target) && relativePathEscapesBoundary(fromMaterial, target, node.packageRoot)) {
|
|
67
|
+
return Object.freeze({ qualification: 'invalid', candidates: Object.freeze([]), finding: 'Companion Schema Reference must not escape its selected package boundary through a relative path.' });
|
|
68
|
+
}
|
|
69
|
+
const resolved = resolvePortableMaterialReference(input.materialIndex, fromMaterial, target);
|
|
70
|
+
if (resolved.qualification !== 'resolved') return resolved;
|
|
71
|
+
const material = resolved.candidates[0];
|
|
72
|
+
if (!node.localMaterialKeys.includes(material.representationKey)) return Object.freeze({ qualification: 'unresolved', candidates: Object.freeze([]), finding: 'Companion Schema Reference must resolve inside its own selected package boundary.' });
|
|
73
|
+
if (!materialIsSchemaDocument(material)) return Object.freeze({ qualification: 'unresolved', candidates: Object.freeze([]), finding: 'Companion Schema Reference target is not a schema document.' });
|
|
74
|
+
return Object.freeze({ qualification: 'resolved', candidates: Object.freeze([material]), material, finding: '' });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function schemaResolutionFor(index, packageKey, schemaId) {
|
|
78
|
+
return index.get(resolutionKey(packageKey, schemaId)) || Object.freeze({ qualification: 'unresolved', target: null });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function projectSchemaResolutions(index = new Map()) {
|
|
82
|
+
return Object.freeze([...index.values()].sort((a, b) => compare(`${a.packageKey}\u0000${a.schemaId}`, `${b.packageKey}\u0000${b.schemaId}`)));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function resolveExplicitSchemaBinding(node, schemaId, binding, candidates, state) {
|
|
86
|
+
const schemaReference = String(binding.fields?.['Schema Reference'] || '');
|
|
87
|
+
const schemaShape = portableFieldDomainOccurrenceQualification(node.manifestProjection, 'Schema Resolution Binding Declaration', 'Schema Reference', schemaReference, binding.name);
|
|
88
|
+
if (schemaShape !== 'core') return schemaResolution(node, schemaId, 'unresolved', null, candidates, [binding], ['Schema Reference shape authority is unresolved or invalid.']);
|
|
89
|
+
|
|
90
|
+
const schemaTarget = extractQualifiedMarkdownLinkTarget(schemaReference);
|
|
91
|
+
const manifestMaterial = state.materialIndex.byKey.get(node.manifestKey);
|
|
92
|
+
if (!isAbsoluteReference(schemaTarget) && relativePathEscapesBoundary(manifestMaterial, schemaTarget, node.packageRoot)) {
|
|
93
|
+
return schemaResolution(node, schemaId, 'invalid', null, candidates, [binding], ['Relative Schema Reference escapes the selected package boundary.']);
|
|
94
|
+
}
|
|
95
|
+
const schemaResolved = resolvePortableMaterialReference(state.materialIndex, manifestMaterial, schemaTarget);
|
|
96
|
+
if (schemaResolved.qualification !== 'resolved') return schemaResolution(node, schemaId, schemaResolved.qualification, null, candidates, [binding], [schemaResolved.finding]);
|
|
97
|
+
const targetMaterial = schemaResolved.candidates[0];
|
|
98
|
+
if (!isAbsoluteReference(schemaTarget) && !node.localMaterialKeys.includes(targetMaterial.representationKey)) {
|
|
99
|
+
return schemaResolution(node, schemaId, 'invalid', null, candidates, [binding], ['Relative Schema Reference crosses a declared semantic package boundary; cross-package schema bindings require an explicit non-relative Schema Reference plus Package Reference.']);
|
|
100
|
+
}
|
|
101
|
+
if (!materialIsSchemaDocument(targetMaterial) || targetMaterial.schemaId !== schemaId) {
|
|
102
|
+
state.findings.push(portableFinding('error', 'portable.semantic-package.schema-binding.target.invalid', `Schema binding for ${schemaId} does not resolve to exactly that schema document.`, { ref: node.manifestPath, schemaId, target: schemaTarget }));
|
|
103
|
+
return schemaResolution(node, schemaId, 'invalid', null, candidates, [binding], ['Resolved Schema Reference does not identify the declared exact schema artifact.']);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const packageReference = String(binding.fields?.['Package Reference'] || '');
|
|
107
|
+
if (!packageReference) {
|
|
108
|
+
if (!node.localMaterialKeys.includes(targetMaterial.representationKey)) return schemaResolution(node, schemaId, 'invalid', null, candidates, [binding], ['Package-external Schema Reference requires an explicit Package Reference.']);
|
|
109
|
+
} else {
|
|
110
|
+
const packageShape = portableFieldDomainOccurrenceQualification(node.manifestProjection, 'Schema Resolution Binding Declaration', 'Package Reference', packageReference, binding.name);
|
|
111
|
+
if (packageShape !== 'core') return schemaResolution(node, schemaId, 'unresolved', null, candidates, [binding], ['Package Reference shape authority is unresolved or invalid.']);
|
|
112
|
+
const packageTarget = extractQualifiedMarkdownLinkTarget(packageReference);
|
|
113
|
+
if (!isAbsoluteReference(packageTarget) && relativePathEscapesBoundary(manifestMaterial, packageTarget, node.packageRoot)) {
|
|
114
|
+
return schemaResolution(node, schemaId, 'invalid', null, candidates, [binding], ['Relative Package Reference escapes the selected package boundary.']);
|
|
115
|
+
}
|
|
116
|
+
const packageResolved = resolvePortableMaterialReference(state.materialIndex, manifestMaterial, packageTarget);
|
|
117
|
+
if (packageResolved.qualification !== 'resolved') return schemaResolution(node, schemaId, packageResolved.qualification, null, candidates, [binding], [packageResolved.finding]);
|
|
118
|
+
const targetPackageKey = packageResolved.candidates[0].representationKey;
|
|
119
|
+
const directTarget = node.outgoingEdges.some((edge) => edge.qualification === 'resolved' && edge.targetPackageKey === targetPackageKey);
|
|
120
|
+
if (!directTarget) return schemaResolution(node, schemaId, 'invalid', null, candidates, [binding], ['Package Reference is not one of the package authorities explicitly declared by this manifest.']);
|
|
121
|
+
const targetNode = state.nodes.find((candidate) => candidate.manifestKey === targetPackageKey);
|
|
122
|
+
if (!targetNode?.localMaterialKeys.includes(targetMaterial.representationKey)) return schemaResolution(node, schemaId, 'invalid', null, candidates, [binding], ['Schema Reference does not resolve inside the explicitly referenced package boundary.']);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const packageKey = packageContainingMaterial(targetMaterial.representationKey, state.nodes);
|
|
126
|
+
return schemaResolution(node, schemaId, 'resolved', Object.freeze({ material: targetMaterial, packageKey }), candidates, [binding], []);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function appendResolutionFinding(resolution, node, findings) {
|
|
130
|
+
if (resolution.qualification === 'ambiguous' || resolution.qualification === 'invalid') {
|
|
131
|
+
findings.push(portableFinding('error', 'portable.semantic-package.schema-resolution.fail-closed', `Schema resolution for ${resolution.schemaId} is ${resolution.qualification}.`, { ref: node.manifestPath, schemaId: resolution.schemaId, qualification: resolution.qualification }));
|
|
132
|
+
} else if (resolution.qualification === 'unresolved') {
|
|
133
|
+
findings.push(portableFinding('warning', 'portable.semantic-package.schema-resolution.unresolved', `Schema resolution for ${resolution.schemaId} is unresolved.`, { ref: node.manifestPath, schemaId: resolution.schemaId }));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function schemaResolution(node, schemaId, qualification, target, candidates, bindings, findings) {
|
|
138
|
+
return Object.freeze({
|
|
139
|
+
packageKey: node.manifestKey,
|
|
140
|
+
packagePath: node.manifestPath,
|
|
141
|
+
schemaId,
|
|
142
|
+
qualification,
|
|
143
|
+
target: target ? Object.freeze({ representationKey: target.material.representationKey, path: target.material.path, packageKey: target.packageKey }) : null,
|
|
144
|
+
candidates: Object.freeze((candidates || []).map((item) => Object.freeze({ representationKey: item.material.representationKey, path: item.material.path, packageKey: item.packageKey }))),
|
|
145
|
+
bindingCount: (bindings || []).length,
|
|
146
|
+
bindingProvenance: Object.freeze((bindings || []).map((binding) => Object.freeze({
|
|
147
|
+
schemaId: String(binding.name || ''),
|
|
148
|
+
schemaReference: String(binding.fields?.['Schema Reference'] || ''),
|
|
149
|
+
packageReference: String(binding.fields?.['Package Reference'] || ''),
|
|
150
|
+
note: String(binding.fields?.Note || ''),
|
|
151
|
+
source: binding.source || null
|
|
152
|
+
}))),
|
|
153
|
+
findings: Object.freeze([...(findings || [])])
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function resolutionKey(packageKey, schemaId) { return `${packageKey}\u0000${String(schemaId || '').trim()}`; }
|
|
158
|
+
function compare(a = '', b = '') { const left = String(a); const right = String(b); return left < right ? -1 : left > right ? 1 : 0; }
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { portableFinding } from '../findings.js';
|
|
2
|
+
import { projectPortableContractInstance } from '../schema/contract.project.js';
|
|
3
|
+
import {
|
|
4
|
+
isAbsoluteReference,
|
|
5
|
+
relativePathEscapesBoundary,
|
|
6
|
+
resolvePortableMaterialReference
|
|
7
|
+
} from './material.graph.js';
|
|
8
|
+
import { packageContainingMaterial } from './semantic.package.graph.js';
|
|
9
|
+
import { schemaResolutionFor } from './semantic.package.schema-resolution.js';
|
|
10
|
+
import { isTransitionArtifact } from './semantic.package.types.js';
|
|
11
|
+
|
|
12
|
+
export function resolvePackageTransitionReference(node, fromMaterial, target, input = {}) {
|
|
13
|
+
const relative = !isAbsoluteReference(target);
|
|
14
|
+
if (relative && relativePathEscapesBoundary(fromMaterial, target, node.packageRoot)) {
|
|
15
|
+
return Object.freeze({ qualification: 'invalid', candidates: Object.freeze([]), finding: 'Relative Transition Reference must remain inside the companion package boundary; cross-package attachments require an explicit non-relative reference reachable through the package graph.' });
|
|
16
|
+
}
|
|
17
|
+
const resolved = resolvePortableMaterialReference(input.materialIndex, fromMaterial, target);
|
|
18
|
+
if (resolved.qualification !== 'resolved') return resolved;
|
|
19
|
+
const material = resolved.candidates[0];
|
|
20
|
+
if (!isTransitionArtifact(material)) return Object.freeze({ qualification: 'unresolved', candidates: Object.freeze([]), finding: 'Transition Reference target is not a canonical Transition Definition artifact.' });
|
|
21
|
+
const containing = packageContainingMaterial(material.representationKey, input.nodes || []);
|
|
22
|
+
if (relative && containing !== node.manifestKey) {
|
|
23
|
+
return Object.freeze({ qualification: 'invalid', candidates: Object.freeze([material]), finding: 'Relative Transition Reference crosses a declared semantic package boundary; cross-package attachments require an explicit non-relative reference.' });
|
|
24
|
+
}
|
|
25
|
+
if (!containing || !node.reachablePackageKeys.includes(containing)) return Object.freeze({ qualification: 'unresolved', candidates: Object.freeze([]), finding: 'Transition Reference target is not reachable through the active explicit package graph.' });
|
|
26
|
+
return Object.freeze({ qualification: 'resolved', candidates: Object.freeze([material]), material, packageKey: containing, finding: '' });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function ensureTransitionRegistryEntry(registry, material, node, discoveryKind, input = {}) {
|
|
30
|
+
if (!material) return null;
|
|
31
|
+
let entry = registry.get(material.representationKey);
|
|
32
|
+
if (!entry) {
|
|
33
|
+
const projection = projectPortableContractInstance({ markdown: material.markdown, compiledContract: input.transitionContract, resolvers: input.resolvers || {} });
|
|
34
|
+
const identity = ordinaryGroupMap(projection, 'Transition Identity');
|
|
35
|
+
entry = {
|
|
36
|
+
representationKey: material.representationKey,
|
|
37
|
+
path: material.path,
|
|
38
|
+
source: material.source,
|
|
39
|
+
references: Object.freeze([...(material.referenceAliases || [])]),
|
|
40
|
+
schemaId: material.schemaId,
|
|
41
|
+
representationQualification: projection.validation.status,
|
|
42
|
+
transitionIdentity: Object.freeze(identity),
|
|
43
|
+
canonicalIdentifier: String(identity['Canonical Identifier'] || ''),
|
|
44
|
+
version: String(identity.Version || ''),
|
|
45
|
+
projection,
|
|
46
|
+
discoveryProvenance: [],
|
|
47
|
+
attachmentProvenance: []
|
|
48
|
+
};
|
|
49
|
+
registry.set(material.representationKey, entry);
|
|
50
|
+
}
|
|
51
|
+
const containingPackageKey = packageContainingMaterial(material.representationKey, input.nodes || []);
|
|
52
|
+
const route = Object.freeze({
|
|
53
|
+
kind: discoveryKind,
|
|
54
|
+
packageKey: node.manifestKey,
|
|
55
|
+
packagePath: node.manifestPath,
|
|
56
|
+
containingPackageKey,
|
|
57
|
+
materialPath: material.path,
|
|
58
|
+
packageRoutes: Object.freeze([...(node.routes || [])].sort(compareObject))
|
|
59
|
+
});
|
|
60
|
+
if (!entry.discoveryProvenance.some((item) => JSON.stringify(item) === JSON.stringify(route))) entry.discoveryProvenance.push(route);
|
|
61
|
+
return entry;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function qualifyAttachmentParticipation(input = {}) {
|
|
65
|
+
const { schemaBinding, transitionMaterial, packageNode } = input;
|
|
66
|
+
if (schemaBinding?.qualification !== 'resolved' || !schemaBinding.material?.representationKey) return Object.freeze({ qualification: 'unresolved', evidence: Object.freeze([]) });
|
|
67
|
+
const entry = ensureTransitionRegistryEntry(input.transitionRegistry, transitionMaterial, packageNode, 'participation-check', input);
|
|
68
|
+
const boundKey = schemaBinding.material.representationKey;
|
|
69
|
+
const evidence = [];
|
|
70
|
+
let unresolved = false;
|
|
71
|
+
const roles = transitionRoleEntries(entry.projection);
|
|
72
|
+
if (!roles.length) return Object.freeze({ qualification: 'contradictory', evidence: Object.freeze([]) });
|
|
73
|
+
|
|
74
|
+
for (const role of roles) {
|
|
75
|
+
const targetKind = String(role.fields?.['Target Kind'] || '');
|
|
76
|
+
const constraint = String(role.fields?.['Schema Constraint'] || '');
|
|
77
|
+
if (!constraint) {
|
|
78
|
+
if (targetKind === 'non-artifact') evidence.push(Object.freeze({ group: role.group, entry: role.name, qualification: 'excluded-non-artifact' }));
|
|
79
|
+
else unresolved = true;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const resolved = resolveRoleSchemaConstraint(constraint, packageNode, transitionMaterial, input);
|
|
83
|
+
if (resolved.qualification === 'resolved') {
|
|
84
|
+
const representationKey = resolved.target?.representationKey || resolved.target?.material?.representationKey || '';
|
|
85
|
+
evidence.push(Object.freeze({ group: role.group, entry: role.name, schemaConstraint: constraint, qualification: representationKey === boundKey ? 'match' : 'resolved-other', representationKey }));
|
|
86
|
+
if (representationKey === boundKey) return Object.freeze({ qualification: 'consistent', evidence: Object.freeze(evidence) });
|
|
87
|
+
} else {
|
|
88
|
+
unresolved = true;
|
|
89
|
+
evidence.push(Object.freeze({ group: role.group, entry: role.name, schemaConstraint: constraint, qualification: resolved.qualification }));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return Object.freeze({ qualification: unresolved ? 'unresolved' : 'contradictory', evidence: Object.freeze(evidence) });
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function detectCompanionConflicts(companions, findings) {
|
|
96
|
+
const bySchema = new Map();
|
|
97
|
+
for (const companion of companions) {
|
|
98
|
+
const key = String(companion.schemaBinding?.representationKey || '');
|
|
99
|
+
if (companion.schemaBinding?.qualification !== 'resolved' || !key) continue;
|
|
100
|
+
if (!bySchema.has(key)) bySchema.set(key, []);
|
|
101
|
+
bySchema.get(key).push(companion);
|
|
102
|
+
}
|
|
103
|
+
const conflicts = new Set();
|
|
104
|
+
for (const [schemaKey, values] of bySchema) {
|
|
105
|
+
if (values.length <= 1) continue;
|
|
106
|
+
conflicts.add(schemaKey);
|
|
107
|
+
findings.push(portableFinding('error', 'portable.companion.binding.competing', 'More than one companion resolves to the same exact schema artifact inside one package compilation.', { schemaRepresentationKey: schemaKey, companions: values.map((item) => item.representationKey) }));
|
|
108
|
+
}
|
|
109
|
+
return conflicts;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function compileAttachmentStates(nodes, companions, conflicts, materialIndex) {
|
|
113
|
+
const bySchema = new Map();
|
|
114
|
+
for (const companion of companions) {
|
|
115
|
+
if (companion.schemaBinding?.qualification !== 'resolved') continue;
|
|
116
|
+
const key = String(companion.schemaBinding?.representationKey || '');
|
|
117
|
+
if (!key) continue;
|
|
118
|
+
if (!bySchema.has(key)) bySchema.set(key, []);
|
|
119
|
+
bySchema.get(key).push(companion);
|
|
120
|
+
}
|
|
121
|
+
const schemaKeys = unique(nodes.flatMap((node) => node.localSchemaKeys || []));
|
|
122
|
+
return Object.freeze(schemaKeys.map((schemaKey) => {
|
|
123
|
+
const material = materialIndex.byKey.get(schemaKey);
|
|
124
|
+
const bound = bySchema.get(schemaKey) || [];
|
|
125
|
+
let state = 'absent';
|
|
126
|
+
if (conflicts.has(schemaKey)) state = 'competing';
|
|
127
|
+
else if (bound.length === 1) state = bound[0].attachmentSet.explicitEmpty ? 'explicit-empty' : 'declared';
|
|
128
|
+
return Object.freeze({
|
|
129
|
+
schemaRepresentationKey: schemaKey,
|
|
130
|
+
schemaId: material?.schemaId || '',
|
|
131
|
+
path: material?.path || '',
|
|
132
|
+
state,
|
|
133
|
+
companions: Object.freeze(bound.map((item) => item.representationKey).sort(compare)),
|
|
134
|
+
attachments: Object.freeze(bound.flatMap((item) => item.attachmentSet.attachments || []))
|
|
135
|
+
});
|
|
136
|
+
}).sort((a, b) => compare(a.schemaRepresentationKey, b.schemaRepresentationKey)));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function finalizeTransitionRegistry(registry) {
|
|
140
|
+
return Object.freeze([...registry.values()].map((entry) => Object.freeze({
|
|
141
|
+
representationKey: entry.representationKey,
|
|
142
|
+
path: entry.path,
|
|
143
|
+
source: entry.source,
|
|
144
|
+
references: entry.references,
|
|
145
|
+
schemaId: entry.schemaId,
|
|
146
|
+
representationQualification: entry.representationQualification,
|
|
147
|
+
transitionIdentity: entry.transitionIdentity,
|
|
148
|
+
canonicalIdentifier: entry.canonicalIdentifier,
|
|
149
|
+
version: entry.version,
|
|
150
|
+
projection: entry.projection,
|
|
151
|
+
discoveryProvenance: Object.freeze([...entry.discoveryProvenance].sort(compareObject)),
|
|
152
|
+
attachmentProvenance: Object.freeze([...entry.attachmentProvenance].sort(compareObject))
|
|
153
|
+
})).sort((a, b) => compare(a.representationKey, b.representationKey)));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function resolveRoleSchemaConstraint(value, packageNode, transitionMaterial, input) {
|
|
157
|
+
if (typeof input.resolveSchemaConstraint === 'function') {
|
|
158
|
+
const custom = input.resolveSchemaConstraint({ value, packageNode, transitionMaterial, schemaResolutionIndex: input.schemaResolutionIndex, materials: input.materialIndex.materials });
|
|
159
|
+
if (custom) return custom;
|
|
160
|
+
}
|
|
161
|
+
const resolution = schemaResolutionFor(input.schemaResolutionIndex, packageNode.manifestKey, String(value || '').trim());
|
|
162
|
+
return Object.freeze({ qualification: resolution.qualification, target: resolution.target });
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function transitionRoleEntries(projection = {}) {
|
|
166
|
+
const groups = ['Input Role Declaration', 'Output Role Declaration'];
|
|
167
|
+
const out = [];
|
|
168
|
+
for (const parsed of projection.validation?.declarations || []) {
|
|
169
|
+
const group = String(parsed.contract?.group || '');
|
|
170
|
+
if (!groups.includes(group)) continue;
|
|
171
|
+
for (const section of parsed.sections || []) {
|
|
172
|
+
if (!section.present) continue;
|
|
173
|
+
for (const entry of section.entries || []) if (entry.name !== 'none') out.push(Object.freeze({ group, name: entry.name, fields: entry.fields }));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return out;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function ordinaryGroupMap(projection, groupName) {
|
|
180
|
+
const group = (projection.ordinaryGroups || []).find((item) => exact(item.group) === exact(groupName));
|
|
181
|
+
const out = {};
|
|
182
|
+
for (const field of group?.fields || []) if (field.occurrences?.length === 1) out[field.label] = String(field.occurrences[0].value ?? '');
|
|
183
|
+
return out;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function unique(values = []) { return [...new Set(values.map(String).filter(Boolean))]; }
|
|
187
|
+
function compare(a = '', b = '') { const left = String(a); const right = String(b); return left < right ? -1 : left > right ? 1 : 0; }
|
|
188
|
+
function compareObject(a = {}, b = {}) { return compare(JSON.stringify(a), JSON.stringify(b)); }
|
|
189
|
+
function exact(value = '') { return String(value || '').trim(); }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { materialIsSchemaDocument } from './material.graph.js';
|
|
2
|
+
|
|
3
|
+
export const PORTABLE_SEMANTIC_PACKAGE_COMPILATION_SCHEMA_ID = 'tiinex.portable.semantic-package-compilation.v1';
|
|
4
|
+
export const SEMANTIC_PACKAGE_SCHEMA_ID = 'tiinex.semantic.package.v1';
|
|
5
|
+
export const SCHEMA_TRANSITION_COMPANION_SCHEMA_ID = 'tiinex.schema.transition.companion.v1';
|
|
6
|
+
export const TRANSITION_DEFINITION_SCHEMA_ID = 'tiinex.transition.definition.v1';
|
|
7
|
+
|
|
8
|
+
export function isPackageManifestArtifact(material) {
|
|
9
|
+
return material?.schemaId === SEMANTIC_PACKAGE_SCHEMA_ID && !materialIsSchemaDocument(material);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function isCompanionArtifact(material) {
|
|
13
|
+
return material?.schemaId === SCHEMA_TRANSITION_COMPANION_SCHEMA_ID && !materialIsSchemaDocument(material);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function isTransitionArtifact(material) {
|
|
17
|
+
return material?.schemaId === TRANSITION_DEFINITION_SCHEMA_ID && !materialIsSchemaDocument(material);
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const runtimeOwnedBootstrapSources = new WeakSet();
|
|
2
|
+
|
|
3
|
+
export function markPortableBootstrapCanonicalSource(source = {}) {
|
|
4
|
+
if (source && typeof source === 'object') runtimeOwnedBootstrapSources.add(source);
|
|
5
|
+
return source;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function hasPortableBootstrapCanonicalProvenance(source = null) {
|
|
9
|
+
return Boolean(source && typeof source === 'object' && runtimeOwnedBootstrapSources.has(source));
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { canonicalC14nV2SelfState } from '../../../integrity/integrity.c14nV2.js';
|
|
2
|
+
|
|
3
|
+
export function qualifyPortableSchemaMaterial({ path = '', source = {}, binding = null, checksum = '', markdown = '', runtimeBootstrapProvenance = false } = {}) {
|
|
4
|
+
const integrity = canonicalC14nV2SelfState(markdown || '');
|
|
5
|
+
const bundledCanonicalSnapshot = Boolean(
|
|
6
|
+
runtimeBootstrapProvenance === true
|
|
7
|
+
&& source.providerId === 'bootstrap-canonical-schema-pack'
|
|
8
|
+
&& source.qualification === 'bundled-byte-bound-canonical-snapshot'
|
|
9
|
+
&& source.repository
|
|
10
|
+
&& source.commit
|
|
11
|
+
&& source.path
|
|
12
|
+
&& integrity.state === 'verified'
|
|
13
|
+
);
|
|
14
|
+
const repositoryMatch = Boolean(binding?.sourceRepository && source.repository && binding.sourceRepository === source.repository);
|
|
15
|
+
const pathMatch = Boolean(binding?.sourcePath && normalizePath(binding.sourcePath) === normalizePath(path));
|
|
16
|
+
const commitMatch = Boolean(binding?.sourceCommit && source.commit && binding.sourceCommit === source.commit);
|
|
17
|
+
const expectedChecksum = String(binding?.checksum?.value || binding?.checksum || '');
|
|
18
|
+
const checksumMatch = Boolean(expectedChecksum && checksum && expectedChecksum === checksum);
|
|
19
|
+
const bindingMatch = Boolean(binding && repositoryMatch && pathMatch && commitMatch && (!checksum || checksumMatch));
|
|
20
|
+
const authority = bindingMatch
|
|
21
|
+
? 'canonical-binding-match'
|
|
22
|
+
: bundledCanonicalSnapshot
|
|
23
|
+
? 'bundled-canonical-self-verified'
|
|
24
|
+
: source.authority === 'canonical-core'
|
|
25
|
+
? 'provider-declared-canonical-unverified'
|
|
26
|
+
: source.cached
|
|
27
|
+
? 'cache-preserved-source-qualification'
|
|
28
|
+
: 'supplied-unverified';
|
|
29
|
+
const limitations = [];
|
|
30
|
+
if (!bindingMatch && binding) limitations.push('Registered binding was not fully matched by explicit repository, commit, path, and optional checksum metadata.');
|
|
31
|
+
if (!binding) limitations.push('Schema is not registered in the current site runtime; readable schema material is available but executable child tooling may be unavailable.');
|
|
32
|
+
if (source.qualification === 'bundled-byte-bound-canonical-snapshot' && !bundledCanonicalSnapshot) limitations.push('Bundled canonical snapshot metadata was present but runtime-owned bootstrap provenance, c14n-v2 self-integrity, or required source identity could not be verified.');
|
|
33
|
+
if (!source.repository && source.remoteFetch) limitations.push('Remote material lacks explicit repository identity.');
|
|
34
|
+
return Object.freeze({
|
|
35
|
+
exactSchemaIdentity: true,
|
|
36
|
+
authority,
|
|
37
|
+
sourceQualified: Boolean(bindingMatch || bundledCanonicalSnapshot),
|
|
38
|
+
representationIntegrity: integrity.state,
|
|
39
|
+
bindingMatch,
|
|
40
|
+
registered: Boolean(binding),
|
|
41
|
+
repositoryMatch,
|
|
42
|
+
pathMatch,
|
|
43
|
+
commitMatch,
|
|
44
|
+
checksumMatch,
|
|
45
|
+
remoteFetch: Boolean(source.remoteFetch),
|
|
46
|
+
cached: Boolean(source.cached),
|
|
47
|
+
runtimeBootstrapProvenance: Boolean(runtimeBootstrapProvenance),
|
|
48
|
+
limitations: Object.freeze(limitations)
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function normalizePath(value = '') { return String(value || '').replace(/\\/g, '/').replace(/^\.\//, '').replace(/\/{2,}/g, '/'); }
|