@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,141 @@
|
|
|
1
|
+
import { portableFinding } from '../findings.js';
|
|
2
|
+
|
|
3
|
+
export function normalizeRepositoryFiles(normalized, findings, request = {}) {
|
|
4
|
+
const files = normalizeFiles(normalized);
|
|
5
|
+
const out = [];
|
|
6
|
+
for (const file of files) {
|
|
7
|
+
if (!file.path || typeof file.content !== 'string') {
|
|
8
|
+
findings.push(portableFinding('error', 'portable.host-receipt.repository-file.invalid', 'Repository read receipts require path and UTF-8 content.', { ref: file.path || '' }));
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
const source = file.source || normalized.source || {};
|
|
12
|
+
if (!source.repository) findings.push(portableFinding('error', 'portable.host-receipt.repository-source.missing', 'Repository read receipts require explicit repository identity.', { ref: file.path }));
|
|
13
|
+
if (!source.commit) findings.push(portableFinding('warning', 'portable.host-receipt.repository-commit.unpinned', 'Repository material was returned without a resolved commit and remains moving-ref qualified.', { ref: file.path, repository: source.repository || '' }));
|
|
14
|
+
const authority = source.authority === 'canonical-core' && !source.commit ? 'remote-repository-unpinned' : String(source.authority || 'remote-repository-unverified');
|
|
15
|
+
const normalizedFile = Object.freeze({
|
|
16
|
+
path: normalizePath(file.path),
|
|
17
|
+
content: file.content,
|
|
18
|
+
sourceMode: 'portable-host-repository',
|
|
19
|
+
source: Object.freeze({
|
|
20
|
+
repository: String(source.repository || ''),
|
|
21
|
+
ref: String(source.ref || ''),
|
|
22
|
+
commit: String(source.commit || ''),
|
|
23
|
+
path: normalizePath(source.path || file.path),
|
|
24
|
+
authority,
|
|
25
|
+
remoteFetch: true,
|
|
26
|
+
receiptQualification: 'accepted-host-repository-read',
|
|
27
|
+
provenanceQualification: source.commit ? 'accepted-host-repository-pinned' : 'accepted-host-repository-moving-ref',
|
|
28
|
+
...(source.permalink ? { permalink: String(source.permalink) } : {}),
|
|
29
|
+
...(source.durableLocator ? { durableLocator: String(source.durableLocator) } : {})
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
if (repositoryReadIdentityMatches(request, normalizedFile, findings)) out.push(normalizedFile);
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
function repositoryReadIdentityMatches(request = {}, file = {}, findings = []) {
|
|
39
|
+
const expectedRepository = concreteIdentity(request.repository);
|
|
40
|
+
const expectedRef = concreteIdentity(request.ref);
|
|
41
|
+
const expectedPath = concretePath(request.path);
|
|
42
|
+
const source = file?.source || {};
|
|
43
|
+
const actualRepository = concreteIdentity(source.repository);
|
|
44
|
+
const actualRef = concreteIdentity(source.ref);
|
|
45
|
+
const actualCommit = concreteIdentity(source.commit);
|
|
46
|
+
const actualFilePath = concretePath(file?.path);
|
|
47
|
+
const actualSourcePath = concretePath(source.path || file?.path);
|
|
48
|
+
let matches = true;
|
|
49
|
+
if (expectedRepository && expectedRepository.toLowerCase() !== actualRepository.toLowerCase()) {
|
|
50
|
+
matches = false;
|
|
51
|
+
findings.push(portableFinding('error', 'portable.host-receipt.repository-identity.mismatch', 'Repository read receipt does not match the exact requested repository identity.', { expected: expectedRepository, actual: actualRepository, ref: actualFilePath }));
|
|
52
|
+
}
|
|
53
|
+
if (expectedPath && (expectedPath !== actualFilePath || expectedPath !== actualSourcePath)) {
|
|
54
|
+
matches = false;
|
|
55
|
+
findings.push(portableFinding('error', 'portable.host-receipt.repository-path.mismatch', 'Repository read receipt does not match the exact requested repository path.', { expected: expectedPath, actual: actualSourcePath || actualFilePath, ref: actualFilePath }));
|
|
56
|
+
}
|
|
57
|
+
if (expectedRef) {
|
|
58
|
+
const pinned = /^[0-9a-f]{40}$/i.test(expectedRef);
|
|
59
|
+
const refMatches = pinned ? actualCommit.toLowerCase() === expectedRef.toLowerCase() : actualRef === expectedRef || actualCommit === expectedRef;
|
|
60
|
+
if (!refMatches) {
|
|
61
|
+
matches = false;
|
|
62
|
+
findings.push(portableFinding('error', 'portable.host-receipt.repository-ref.mismatch', 'Repository read receipt does not match the exact requested repository ref/commit identity.', { expected: expectedRef, actualRef, actualCommit, ref: actualFilePath }));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return matches;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function concreteIdentity(value = '') {
|
|
69
|
+
const text = String(value || '').trim();
|
|
70
|
+
return !text || /^<.*>$/.test(text) ? '' : text;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function concretePath(value = '') {
|
|
74
|
+
const text = concreteIdentity(value);
|
|
75
|
+
return text ? normalizePath(text) : '';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function normalizeLocalFiles(normalized, findings, capabilityName) {
|
|
79
|
+
const files = normalizeFiles(normalized);
|
|
80
|
+
return files.flatMap((file) => {
|
|
81
|
+
if (!file.path || (typeof file.content !== 'string' && !file.locator)) {
|
|
82
|
+
findings.push(portableFinding('error', 'portable.host-receipt.local-file.invalid', 'Local/archive read receipts require a path plus content or an explicit locator.', { ref: file.path || '' }));
|
|
83
|
+
return [];
|
|
84
|
+
}
|
|
85
|
+
if (file.source?.repository || normalized.source?.repository) findings.push(portableFinding('warning', 'portable.host-receipt.local-source.stripped', 'Repository source metadata was ignored for a local/archive read receipt.', { ref: file.path }));
|
|
86
|
+
return [Object.freeze({
|
|
87
|
+
path: normalizePath(file.path),
|
|
88
|
+
...(typeof file.content === 'string' ? { content: file.content } : {}),
|
|
89
|
+
...(file.locator ? { locator: sanitizeLocator(file.locator) } : {}),
|
|
90
|
+
sourceMode: capabilityName === 'archiveRead' ? 'portable-host-archive' : 'portable-host-local',
|
|
91
|
+
source: null
|
|
92
|
+
})];
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function normalizeInterpretations(normalized, findings, capabilityName) {
|
|
97
|
+
if (!normalized.assetPath || !normalized.description) {
|
|
98
|
+
findings.push(portableFinding('error', 'portable.host-receipt.interpretation.invalid', 'Multimodal receipts require assetPath and a generated description.'));
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
return [Object.freeze({
|
|
102
|
+
schema: 'tiinex.portable.asset-analysis-response.v1',
|
|
103
|
+
assetPath: normalizePath(normalized.assetPath),
|
|
104
|
+
description: String(normalized.description),
|
|
105
|
+
observations: Object.freeze(normalizeList(normalized.observations)),
|
|
106
|
+
qualification: Object.freeze({
|
|
107
|
+
mode: normalized.qualification?.mode || (capabilityName === 'images' ? 'host-multimodal-image' : 'host-multimodal-pdf'),
|
|
108
|
+
generatedInterpretation: true,
|
|
109
|
+
sourceAssetPreserved: true,
|
|
110
|
+
analysisIsNotSourceMaterial: true
|
|
111
|
+
})
|
|
112
|
+
})];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function normalizeFiles(value = {}) {
|
|
116
|
+
if (Array.isArray(value.files)) return value.files;
|
|
117
|
+
if (value.file && typeof value.file === 'object') return [value.file];
|
|
118
|
+
if (value.path || value.content) return [value];
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function normalizeList(value) {
|
|
123
|
+
const list = Array.isArray(value) ? value : value ? [value] : [];
|
|
124
|
+
return [...new Set(list.map((item) => String(item || '').trim()).filter(Boolean))];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function sanitizeLocator(locator = {}) {
|
|
128
|
+
return Object.freeze({
|
|
129
|
+
kind: String(locator.kind || ''),
|
|
130
|
+
archivePath: String(locator.archivePath || ''),
|
|
131
|
+
entryPath: normalizePath(locator.entryPath || ''),
|
|
132
|
+
localPath: String(locator.localPath || '')
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function serializableSchema(value) {
|
|
137
|
+
if (!value || typeof value !== 'object') return value || null;
|
|
138
|
+
try { return JSON.parse(JSON.stringify(value)); } catch { return null; }
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function normalizePath(value = '') { return String(value || '').replace(/\\/g, '/').replace(/^\/+/, '').replace(/\/+/g, '/'); }
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export * from './engine.facade.js';
|
|
2
|
+
export * from './materialization/materialization.facade.js';
|
|
3
|
+
export * from './findings.js';
|
|
4
|
+
export * from './qualification.js';
|
|
5
|
+
export * from './operation.catalog.js';
|
|
6
|
+
export * from './input/portable.input.js';
|
|
7
|
+
export * from './session/portable.session.js';
|
|
8
|
+
export * from './adapters/llm/llm.entrypoint.js';
|
|
9
|
+
export * from './schema/schema.contract.js';
|
|
10
|
+
export * from './schema/named.declarations.js';
|
|
11
|
+
export * from './schema/contract.compile.js';
|
|
12
|
+
export * from './schema/contract.validate.js';
|
|
13
|
+
export * from './schema/contract.field-domain.js';
|
|
14
|
+
export * from './schema/contract.machine-shape.js';
|
|
15
|
+
export * from './schema/lexical.shape.v1.js';
|
|
16
|
+
export * from './schema/contract.semantic-resolution.js';
|
|
17
|
+
export * from './schema/contract.project.js';
|
|
18
|
+
export * from './schema/ordinary.fields.js';
|
|
19
|
+
export * from './schema/schema.snapshot.js';
|
|
20
|
+
export * from './schema/schema.guide.js';
|
|
21
|
+
export * from './schema/llm.companion.js';
|
|
22
|
+
export * from './lineage/lineage.search.js';
|
|
23
|
+
export * from './overview/operatingOverview.js';
|
|
24
|
+
export * from './draft/draft.operations.js';
|
|
25
|
+
export * from './host/host.capabilities.js';
|
|
26
|
+
export * from './host/tool.bindings.js';
|
|
27
|
+
export * from './providers/schema.providers.js';
|
|
28
|
+
export * from './draft/draft.create.js';
|
|
29
|
+
export * from './draft/draft.crud.js';
|
|
30
|
+
export * from './draft/draft.set.js';
|
|
31
|
+
export * from './live/live.lineage.js';
|
|
32
|
+
export * from './live/live.export.js';
|
|
33
|
+
export * from './live/live.protocol.js';
|
|
34
|
+
export * from './materialization/epistemic.plan.js';
|
|
35
|
+
export * from './output/node.artifact-set.js';
|
|
36
|
+
export * from './assets/asset.operations.js';
|
|
37
|
+
export * from './orchestration/task.prepare.js';
|
|
38
|
+
export * from './checkpoint/portable.checkpoint.js';
|
|
39
|
+
export * from './materialization/durable.materialize.js';
|
|
40
|
+
export * from './package/runtime.package.js';
|
|
41
|
+
export * from './publication/runtime.publication.js';
|
|
42
|
+
export * from './package/schema.transition.companion.js';
|
|
43
|
+
export * from './package/semantic.package.js';
|
|
44
|
+
export * from './package/generation.binding.js';
|
|
45
|
+
export * from './conformance/checkpoint.qualification.js';
|
|
46
|
+
|
|
47
|
+
export * from './transfer/transfer.plan.js';
|
|
48
|
+
|
|
49
|
+
export * from './handoff/manufacture.js';
|
|
50
|
+
export * from './handoff/carrierProfile.js';
|
|
51
|
+
export * from './handoff/toolingBootstrap.js';
|
|
52
|
+
export * from './handoff/coldStartQualification.js';
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { lstat, readdir, readFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { zipBufferToImportEntries } from '../../../adapters/archive/archive.adapter.js';
|
|
4
|
+
import { portableFinding } from '../findings.js';
|
|
5
|
+
|
|
6
|
+
const DEFAULT_MAX_FILES = 4000;
|
|
7
|
+
const DEFAULT_MAX_TEXT_BYTES = 4 * 1024 * 1024;
|
|
8
|
+
const DEFAULT_EXCLUDED_DIRECTORIES = Object.freeze(['.git', 'node_modules', '.site-publish']);
|
|
9
|
+
const TEXT_RE = /\.(?:md|markdown|json|txt|yml|yaml|js|mjs|cjs|ts|tsx|jsx|html|css)$/i;
|
|
10
|
+
const PACKAGE_CONTROL_JSON_RE = /^tiinex\.package\/[^/]+\.json$/i;
|
|
11
|
+
|
|
12
|
+
export async function loadNodePortableInput(targets, options = {}) {
|
|
13
|
+
const list = normalizeTargets(targets);
|
|
14
|
+
const files = [];
|
|
15
|
+
const findings = [];
|
|
16
|
+
const maxFiles = positiveInteger(options.maxFiles, DEFAULT_MAX_FILES);
|
|
17
|
+
const maxTextBytes = positiveInteger(options.maxTextBytes, DEFAULT_MAX_TEXT_BYTES);
|
|
18
|
+
if (!list.length) findings.push(portableFinding('error', 'portable.node.target.required', 'At least one file, directory, or zip target is required.'));
|
|
19
|
+
|
|
20
|
+
for (const target of list) {
|
|
21
|
+
if (files.length >= maxFiles) break;
|
|
22
|
+
const absolute = path.resolve(target);
|
|
23
|
+
let info;
|
|
24
|
+
try { info = await lstat(absolute); }
|
|
25
|
+
catch (error) {
|
|
26
|
+
findings.push(portableFinding('error', 'portable.node.target.unavailable', 'Input target could not be read.', { ref: target, detail: String(error.message || error) }));
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (info.isSymbolicLink()) {
|
|
30
|
+
findings.push(portableFinding('warning', 'portable.node.symlink.skipped', 'Symbolic-link input was skipped to avoid crossing the supplied material boundary.', { ref: target }));
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (info.isDirectory()) await readDirectory(absolute, files, findings, { ...options, maxFiles, maxTextBytes });
|
|
34
|
+
else if (info.isFile()) await readSingleFile(absolute, files, findings, { ...options, maxFiles, maxTextBytes });
|
|
35
|
+
else findings.push(portableFinding('warning', 'portable.node.target.unsupported', 'Input target is neither a regular file nor a directory and was skipped.', { ref: target }));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (files.length >= maxFiles) findings.push(portableFinding('warning', 'portable.node.file-limit', 'Portable input stopped at the configured file limit.', { maxFiles }));
|
|
39
|
+
return Object.freeze({
|
|
40
|
+
files: Object.freeze(files.slice(0, maxFiles)),
|
|
41
|
+
findings: Object.freeze(findings),
|
|
42
|
+
sourceMode: 'portable-node-local'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function readDirectory(root, files, findings, options) {
|
|
47
|
+
let entries;
|
|
48
|
+
try { entries = await walk(root, options, findings); }
|
|
49
|
+
catch (error) {
|
|
50
|
+
findings.push(portableFinding('error', 'portable.node.directory.read-failed', 'Directory input could not be traversed.', { ref: root, detail: String(error.message || error) }));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
for (const absolute of entries) {
|
|
54
|
+
if (files.length >= options.maxFiles) break;
|
|
55
|
+
await readSingleFile(absolute, files, findings, { ...options, root });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function readSingleFile(absolute, files, findings, options = {}) {
|
|
60
|
+
if (files.length >= positiveInteger(options.maxFiles, DEFAULT_MAX_FILES)) return;
|
|
61
|
+
const relative = options.root ? path.relative(options.root, absolute) : path.basename(absolute);
|
|
62
|
+
const materialPath = relative.replace(/\\/g, '/');
|
|
63
|
+
let info;
|
|
64
|
+
try { info = await lstat(absolute); }
|
|
65
|
+
catch (error) {
|
|
66
|
+
findings.push(portableFinding('error', 'portable.node.file.unavailable', 'Input file could not be read.', { ref: materialPath, detail: String(error.message || error) }));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (info.isSymbolicLink()) {
|
|
70
|
+
findings.push(portableFinding('warning', 'portable.node.symlink.skipped', 'Symbolic-link material was skipped.', { ref: materialPath }));
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (/\.zip$/i.test(absolute)) {
|
|
75
|
+
await readZipFile(absolute, files, findings, options);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (!TEXT_RE.test(absolute)) {
|
|
79
|
+
files.push(Object.freeze({ path: materialPath, size: info.size, type: '', kind: 'asset', sourceMode: 'portable-node-local', locator: Object.freeze({ kind: 'node-file', localPath: absolute }) }));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (info.size > positiveInteger(options.maxTextBytes, DEFAULT_MAX_TEXT_BYTES)) {
|
|
83
|
+
files.push(Object.freeze({ path: materialPath, size: info.size, type: 'text/plain', kind: 'asset', sourceMode: 'portable-node-local', locator: Object.freeze({ kind: 'node-file', localPath: absolute }) }));
|
|
84
|
+
findings.push(portableFinding('warning', 'portable.node.text-too-large', 'Text-like input exceeded the configured text limit and was retained as metadata only.', { ref: materialPath, size: info.size }));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
files.push(Object.freeze({ path: materialPath, content: await readFile(absolute, 'utf8'), size: info.size, sourceMode: 'portable-node-local', locator: Object.freeze({ kind: 'node-file', localPath: absolute }) }));
|
|
89
|
+
} catch (error) {
|
|
90
|
+
findings.push(portableFinding('error', 'portable.node.file.read-failed', 'Text input could not be read.', { ref: materialPath, detail: String(error.message || error) }));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async function readZipFile(absolute, files, findings, options = {}) {
|
|
95
|
+
try {
|
|
96
|
+
const buffer = await readFile(absolute);
|
|
97
|
+
const result = await zipBufferToImportEntries(buffer, { source: 'portable-node-zip', excludeRepositoryInternals: true });
|
|
98
|
+
for (const entry of result.entries || []) {
|
|
99
|
+
if (files.length >= positiveInteger(options.maxFiles, DEFAULT_MAX_FILES)) break;
|
|
100
|
+
const maxTextBytes = positiveInteger(options.maxTextBytes, DEFAULT_MAX_TEXT_BYTES);
|
|
101
|
+
const packageControlContent = typeof entry.content !== 'string' && PACKAGE_CONTROL_JSON_RE.test(String(entry.path || '')) && Number(entry.size || 0) <= maxTextBytes && entry.bytes
|
|
102
|
+
? new TextDecoder().decode(entry.bytes)
|
|
103
|
+
: null;
|
|
104
|
+
const textContent = typeof entry.content === 'string' ? entry.content : packageControlContent;
|
|
105
|
+
const tooLargeText = Boolean((typeof entry.content === 'string' || PACKAGE_CONTROL_JSON_RE.test(String(entry.path || ''))) && Number(entry.size || 0) > maxTextBytes);
|
|
106
|
+
if (tooLargeText) {
|
|
107
|
+
files.push(Object.freeze({ path: entry.path, size: entry.size, type: entry.type, kind: 'asset', sourceMode: 'portable-node-zip', locator: Object.freeze({ kind: 'node-zip-entry', archivePath: absolute, entryPath: entry.path }) }));
|
|
108
|
+
findings.push(portableFinding('warning', 'portable.node.zip-text-too-large', 'Zip text material exceeded the configured text limit and was retained as metadata only.', { ref: entry.path, size: entry.size }));
|
|
109
|
+
} else {
|
|
110
|
+
files.push(Object.freeze({
|
|
111
|
+
path: entry.path,
|
|
112
|
+
...(typeof textContent === 'string' ? { content: textContent } : {}),
|
|
113
|
+
...(typeof textContent !== 'string' && entry.bytes ? { data: entry.bytes } : {}),
|
|
114
|
+
size: entry.size,
|
|
115
|
+
type: entry.type,
|
|
116
|
+
kind: entry.kind,
|
|
117
|
+
sourceMode: 'portable-node-zip',
|
|
118
|
+
locator: Object.freeze({ kind: 'node-zip-entry', archivePath: absolute, entryPath: entry.path })
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
findings.push(...(result.errors || []), ...(result.warnings || []));
|
|
123
|
+
} catch (error) {
|
|
124
|
+
findings.push(portableFinding('error', 'portable.node.zip.read-failed', 'Zip input could not be materialized.', { ref: absolute, detail: String(error.message || error) }));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async function walk(root, options = {}, findings = []) {
|
|
129
|
+
const out = [];
|
|
130
|
+
const excluded = new Set(options.excludeDirectories || DEFAULT_EXCLUDED_DIRECTORIES);
|
|
131
|
+
const excludedPathPrefixes = normalizeExcludedPathPrefixes(options.excludePathPrefixes);
|
|
132
|
+
const excludedPathRefs = new Set();
|
|
133
|
+
const queue = [root];
|
|
134
|
+
const maxFiles = positiveInteger(options.maxFiles, DEFAULT_MAX_FILES);
|
|
135
|
+
while (queue.length && out.length < maxFiles) {
|
|
136
|
+
const current = queue.shift();
|
|
137
|
+
let entries;
|
|
138
|
+
try { entries = await readdir(current, { withFileTypes: true }); }
|
|
139
|
+
catch (error) {
|
|
140
|
+
findings.push(portableFinding('warning', 'portable.node.directory.entry-unavailable', 'A directory entry could not be read and was skipped.', { ref: current, detail: String(error.message || error) }));
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
144
|
+
for (const entry of entries) {
|
|
145
|
+
if (excluded.has(entry.name)) continue;
|
|
146
|
+
const absolute = path.join(current, entry.name);
|
|
147
|
+
const relativePath = path.relative(root, absolute).replace(/\\/g, '/');
|
|
148
|
+
const excludedPrefix = excludedPathPrefixes.find((prefix) => relativePath === prefix.slice(0, -1) || relativePath.startsWith(prefix));
|
|
149
|
+
if (excludedPrefix) {
|
|
150
|
+
if (!excludedPathRefs.has(excludedPrefix)) {
|
|
151
|
+
excludedPathRefs.add(excludedPrefix);
|
|
152
|
+
findings.push(portableFinding('info', 'portable.node.directory.path-prefix-excluded', 'Configured directory material prefix was excluded from this read.', { ref: excludedPrefix.slice(0, -1) }));
|
|
153
|
+
}
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (entry.isSymbolicLink()) {
|
|
157
|
+
findings.push(portableFinding('info', 'portable.node.symlink.skipped', 'Symbolic link was skipped during directory traversal.', { ref: relativePath }));
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (entry.isDirectory()) queue.push(absolute);
|
|
161
|
+
else if (entry.isFile()) out.push(absolute);
|
|
162
|
+
if (out.length >= maxFiles) break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function normalizeExcludedPathPrefixes(value) {
|
|
169
|
+
const list = Array.isArray(value) ? value : value ? [value] : [];
|
|
170
|
+
return list
|
|
171
|
+
.map((entry) => String(entry || '').replace(/\\/g, '/').replace(/^\/+/, '').replace(/\/+$/, ''))
|
|
172
|
+
.filter(Boolean)
|
|
173
|
+
.map((entry) => `${entry}/`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function normalizeTargets(targets) {
|
|
177
|
+
const list = Array.isArray(targets) ? targets : [targets];
|
|
178
|
+
return list.map((value) => String(value || '').trim()).filter(Boolean);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function positiveInteger(value, fallback) {
|
|
182
|
+
const number = Number.parseInt(value, 10);
|
|
183
|
+
return Number.isFinite(number) && number > 0 ? number : fallback;
|
|
184
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { classifyArchiveEntry, safeArchivePath } from '../../../adapters/archive/archive.adapter.js';
|
|
2
|
+
import { createRecordFromMarkdown } from '../../../artifacts/artifact.record.js';
|
|
3
|
+
import { parseArtifactMarkdown } from '../../../artifacts/artifact.parse.js';
|
|
4
|
+
import { portableFinding } from '../findings.js';
|
|
5
|
+
|
|
6
|
+
export const PORTABLE_INPUT_SCHEMA_ID = 'tiinex.portable.input.v1';
|
|
7
|
+
|
|
8
|
+
export function normalizePortableInput(input = {}) {
|
|
9
|
+
const files = collectInputFiles(input);
|
|
10
|
+
const findings = [...(Array.isArray(input.findings) ? input.findings : [])];
|
|
11
|
+
const records = [];
|
|
12
|
+
const assets = [];
|
|
13
|
+
const workspaceEntries = [];
|
|
14
|
+
const seenPaths = new Set();
|
|
15
|
+
|
|
16
|
+
for (const [index, file] of files.entries()) {
|
|
17
|
+
const fallbackName = `material-${index + 1}.md`;
|
|
18
|
+
const materialPath = safeArchivePath(file.path || file.name || fallbackName);
|
|
19
|
+
if (!materialPath) {
|
|
20
|
+
findings.push(portableFinding('warning', 'portable.input.path.unsafe', 'Unsafe or empty material path was skipped.', { ref: file.path || file.name || '' }));
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
noteDuplicatePath(materialPath, seenPaths, findings);
|
|
24
|
+
const content = textContent(file);
|
|
25
|
+
const kind = file.kind || classifyArchiveEntry(materialPath, content || null);
|
|
26
|
+
const descriptor = Object.freeze({
|
|
27
|
+
path: materialPath,
|
|
28
|
+
kind,
|
|
29
|
+
size: Number(file.size || byteLengthOfText(content) || 0),
|
|
30
|
+
type: String(file.type || ''),
|
|
31
|
+
sourceMode: file.sourceMode || input.sourceMode || 'portable-local',
|
|
32
|
+
contentAvailable: Boolean(content || file.data || file.bytes || file.buffer),
|
|
33
|
+
locator: file.locator ? Object.freeze({ ...file.locator }) : null
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
if (kind === 'record' || kind === 'workspace') {
|
|
37
|
+
const record = recordFromFile(file, descriptor, content);
|
|
38
|
+
records.push(record);
|
|
39
|
+
if (kind === 'workspace') workspaceEntries.push(workspaceSummary(record));
|
|
40
|
+
} else {
|
|
41
|
+
assets.push(Object.freeze({ ...descriptor, previewState: content ? 'available' : 'metadata-only' }));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (const [index, raw] of (Array.isArray(input.records) ? input.records : []).entries()) {
|
|
46
|
+
const record = normalizeExistingRecord(raw || {}, index);
|
|
47
|
+
noteDuplicatePath(record.path, seenPaths, findings);
|
|
48
|
+
records.push(record);
|
|
49
|
+
}
|
|
50
|
+
for (const asset of Array.isArray(input.assets) ? input.assets : []) assets.push(Object.freeze({ ...asset }));
|
|
51
|
+
|
|
52
|
+
const containsExplicitSourceMetadata = records.some((record) => isAcceptedRepositorySource(record.source) || (record.source?.adapterId && record.source.adapterId !== 'local'));
|
|
53
|
+
return Object.freeze({
|
|
54
|
+
schema: PORTABLE_INPUT_SCHEMA_ID,
|
|
55
|
+
boundary: Object.freeze({
|
|
56
|
+
mode: 'supplied-material',
|
|
57
|
+
remoteFetch: false,
|
|
58
|
+
remoteWrite: false,
|
|
59
|
+
inferredGitHubSource: false,
|
|
60
|
+
sourceInterpretation: 'explicit-only',
|
|
61
|
+
containsExplicitSourceMetadata
|
|
62
|
+
}),
|
|
63
|
+
files: Object.freeze(files.map((file, index) => fileSummary(file, index)).filter((file) => file.path)),
|
|
64
|
+
records: Object.freeze(records),
|
|
65
|
+
assets: Object.freeze(assets),
|
|
66
|
+
workspaceEntries: Object.freeze(workspaceEntries),
|
|
67
|
+
findings: Object.freeze(findings)
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function findSchemaMaterial(schemaId = '', input = {}) {
|
|
72
|
+
const wanted = String(schemaId || '').trim();
|
|
73
|
+
if (!wanted) return null;
|
|
74
|
+
const exactName = `${wanted}.schema.md`.toLowerCase();
|
|
75
|
+
const candidates = schemaCandidateMaterials(input);
|
|
76
|
+
let match = candidates.find((file) => normalizedPath(file).endsWith(exactName));
|
|
77
|
+
if (!match) {
|
|
78
|
+
match = candidates.find((file) => {
|
|
79
|
+
const materialPath = normalizedPath(file);
|
|
80
|
+
const content = textContent(file);
|
|
81
|
+
if (!materialPath.endsWith('.schema.md') || !content) return false;
|
|
82
|
+
try { return parseArtifactMarkdown(content).envelope?.current?.schema?.id === wanted; }
|
|
83
|
+
catch { return content.includes(wanted); }
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (!match) return null;
|
|
87
|
+
const materialPath = safeArchivePath(match.path || match.name || exactName);
|
|
88
|
+
const source = match.source || {};
|
|
89
|
+
const canonical = source.authority === 'canonical-core' && source.repository && (source.commit || source.ref);
|
|
90
|
+
return Object.freeze({
|
|
91
|
+
schemaId: wanted,
|
|
92
|
+
path: materialPath,
|
|
93
|
+
markdown: textContent(match),
|
|
94
|
+
role: canonical ? 'bundled-canonical-readable-schema-material' : 'supplied-readable-schema-material',
|
|
95
|
+
authority: canonical
|
|
96
|
+
? `byte-bound canonical snapshot ${source.repository}@${source.commit || source.ref}`
|
|
97
|
+
: 'declared-by-material; verify against current Tiinex/docs',
|
|
98
|
+
source: canonical ? Object.freeze({
|
|
99
|
+
repository: source.repository,
|
|
100
|
+
commit: source.commit || source.ref,
|
|
101
|
+
path: source.path || materialPath,
|
|
102
|
+
qualification: source.qualification || 'bundled-byte-bound-canonical-snapshot'
|
|
103
|
+
}) : null
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function suppliedSchemaParentId(schemaId = '', input = {}) {
|
|
108
|
+
const material = findSchemaMaterial(schemaId, input);
|
|
109
|
+
if (!material?.markdown) return '';
|
|
110
|
+
try { return String(parseArtifactMarkdown(material.markdown).envelope?.parent?.schema?.id || '').trim(); }
|
|
111
|
+
catch { return ''; }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function portableInputFiles(input = {}) {
|
|
115
|
+
return collectInputFiles(input);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function recordFromFile(file, descriptor, content) {
|
|
119
|
+
const derived = createRecordFromMarkdown(content, {
|
|
120
|
+
path: descriptor.path,
|
|
121
|
+
name: file.name || descriptor.path,
|
|
122
|
+
sourceMode: descriptor.sourceMode,
|
|
123
|
+
lifecycleStatus: file.lifecycleStatus || ''
|
|
124
|
+
});
|
|
125
|
+
return Object.freeze({
|
|
126
|
+
...derived,
|
|
127
|
+
id: String(file.id || derived.id || descriptor.path),
|
|
128
|
+
source: normalizeSuppliedSource(file.source, descriptor.path),
|
|
129
|
+
locator: descriptor.locator ? Object.freeze({ ...descriptor.locator }) : null,
|
|
130
|
+
portableMaterialKind: descriptor.kind
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function normalizeExistingRecord(raw = {}, index = 0) {
|
|
135
|
+
const materialPath = safeArchivePath(raw.path || raw.name || `record-${index + 1}.md`) || `record-${index + 1}.md`;
|
|
136
|
+
const content = textContent(raw);
|
|
137
|
+
const derived = content ? createRecordFromMarkdown(content, {
|
|
138
|
+
path: materialPath,
|
|
139
|
+
name: raw.name || materialPath,
|
|
140
|
+
sourceMode: raw.sourceMode || 'portable-local',
|
|
141
|
+
lifecycleStatus: raw.lifecycleStatus || ''
|
|
142
|
+
}) : {};
|
|
143
|
+
return Object.freeze({
|
|
144
|
+
...derived,
|
|
145
|
+
...raw,
|
|
146
|
+
id: String(raw.id || derived.id || materialPath),
|
|
147
|
+
path: materialPath,
|
|
148
|
+
markdown: typeof raw.markdown === 'string' ? raw.markdown : (typeof raw.content === 'string' ? raw.content : derived.markdown || ''),
|
|
149
|
+
sourceMode: raw.sourceMode || derived.sourceMode || 'portable-local',
|
|
150
|
+
source: normalizeSuppliedSource(raw.source, materialPath),
|
|
151
|
+
locator: raw.locator ? Object.freeze({ ...raw.locator }) : null,
|
|
152
|
+
portableMaterialKind: raw.portableMaterialKind || (raw.kind === 'workspace' ? 'workspace' : 'record')
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function collectInputFiles(input = {}) {
|
|
157
|
+
const files = [];
|
|
158
|
+
if (typeof input.markdown === 'string') files.push({ path: input.path || 'attachment.md', content: input.markdown, sourceMode: input.sourceMode, source: input.source });
|
|
159
|
+
for (const file of Array.isArray(input.files) ? input.files : []) files.push(file || {});
|
|
160
|
+
return files;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function schemaCandidateMaterials(input = {}) {
|
|
164
|
+
const files = collectInputFiles(input);
|
|
165
|
+
for (const record of Array.isArray(input.records) ? input.records : []) {
|
|
166
|
+
if (typeof record?.markdown === 'string') files.push({ path: record.path || record.name || '', content: record.markdown, sourceMode: record.sourceMode, source: record.source });
|
|
167
|
+
}
|
|
168
|
+
return files;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function normalizeSuppliedSource(source = {}, materialPath = '') {
|
|
172
|
+
if (isAcceptedRepositorySource(source)) {
|
|
173
|
+
return Object.freeze({
|
|
174
|
+
repository: String(source.repository || ''),
|
|
175
|
+
ref: String(source.ref || ''),
|
|
176
|
+
commit: String(source.commit || ''),
|
|
177
|
+
path: safeArchivePath(source.path || materialPath) || materialPath,
|
|
178
|
+
authority: String(source.authority || 'remote-repository-unverified'),
|
|
179
|
+
remoteFetch: source.remoteFetch === true,
|
|
180
|
+
receiptQualification: 'accepted-host-repository-read',
|
|
181
|
+
provenanceQualification: source.commit ? 'accepted-host-repository-pinned' : 'accepted-host-repository-moving-ref',
|
|
182
|
+
...(source.permalink ? { permalink: String(source.permalink) } : {}),
|
|
183
|
+
...(source.durableLocator ? { durableLocator: String(source.durableLocator) } : {}),
|
|
184
|
+
boundary: source.boundary || 'Accepted host repository-read receipt material. Repository/ref/commit/path facts are preserved as receipt evidence only; portable input performs no remote fetch or provenance inference.'
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (source?.adapterId && source.adapterId !== 'local') {
|
|
188
|
+
return Object.freeze({
|
|
189
|
+
...source,
|
|
190
|
+
path: source.path || materialPath,
|
|
191
|
+
boundary: source.boundary || 'Explicitly supplied source metadata; portable tooling did not fetch or infer this provenance.',
|
|
192
|
+
provenanceQualification: source.provenanceQualification || 'explicit-supplied-unverified'
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return Object.freeze({
|
|
196
|
+
kind: source?.kind || 'local-session',
|
|
197
|
+
adapterId: source?.adapterId || 'local',
|
|
198
|
+
path: source?.path || materialPath,
|
|
199
|
+
boundary: source?.boundary || 'Portable local material; no GitHub provenance inferred.'
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function isAcceptedRepositorySource(source = {}) {
|
|
204
|
+
return Boolean(
|
|
205
|
+
source
|
|
206
|
+
&& source.receiptQualification === 'accepted-host-repository-read'
|
|
207
|
+
&& /^accepted-host-repository-(?:pinned|moving-ref)$/.test(String(source.provenanceQualification || ''))
|
|
208
|
+
&& source.repository
|
|
209
|
+
&& source.path
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function workspaceSummary(record = {}) {
|
|
214
|
+
return Object.freeze({ path: record.path, title: record.title, schemaId: record.schemaId, sourceMode: record.sourceMode });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function fileSummary(file = {}, index = 0) {
|
|
218
|
+
const materialPath = safeArchivePath(file.path || file.name || `material-${index + 1}`);
|
|
219
|
+
const content = textContent(file);
|
|
220
|
+
return Object.freeze({
|
|
221
|
+
path: materialPath,
|
|
222
|
+
size: Number(file.size || byteLengthOfText(content) || 0),
|
|
223
|
+
kind: file.kind || '',
|
|
224
|
+
type: String(file.type || ''),
|
|
225
|
+
contentAvailable: Boolean(content || file.data || file.bytes || file.buffer),
|
|
226
|
+
locator: file.locator ? Object.freeze({ ...file.locator }) : null
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function noteDuplicatePath(materialPath, seenPaths, findings) {
|
|
231
|
+
if (!materialPath) return;
|
|
232
|
+
if (seenPaths.has(materialPath)) findings.push(portableFinding('warning', 'portable.input.path.duplicate', 'Duplicate material path is present; lineage matching may be ambiguous.', { ref: materialPath }));
|
|
233
|
+
seenPaths.add(materialPath);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function normalizedPath(file = {}) {
|
|
237
|
+
return String(safeArchivePath(file.path || file.name || '') || '').toLowerCase();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function textContent(file = {}) {
|
|
241
|
+
if (typeof file.content === 'string') return file.content;
|
|
242
|
+
if (typeof file.markdown === 'string') return file.markdown;
|
|
243
|
+
return '';
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function byteLengthOfText(value = '') {
|
|
247
|
+
if (typeof Buffer !== 'undefined') return Buffer.byteLength(String(value || ''), 'utf8');
|
|
248
|
+
return new TextEncoder().encode(String(value || '')).byteLength;
|
|
249
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function nextLifecycleAction({ readiness, retest, closure, blockers, missingEvidence, ambiguities, controllingTask }) {
|
|
2
|
+
const target = controllingTask?.path || controllingTask?.id || '';
|
|
3
|
+
if (closure.state === 'closed') return Object.freeze({ kind: 'none-unless-authoritatively-reopened', target, basis: 'qualified explicit closure after authoritative pass' });
|
|
4
|
+
if (closure.state === 'unresolved') return Object.freeze({ kind: 'repair-closure-qualification', target, basis: 'apparent closure exists but exact scope/pass basis/authority/currentness does not qualify' });
|
|
5
|
+
if (retest.state === 'unresolved') return Object.freeze({ kind: 'repair-retest-qualification', target, basis: 'apparent re-test exists but exact scope/method/coverage/authority/currentness does not qualify' });
|
|
6
|
+
if (readiness.state === 'unresolved') return Object.freeze({ kind: 'repair-lifecycle-evidence', target, basis: [...missingEvidence, ...ambiguities].slice(0, 6).map((item) => item.code).join(', ') || 'unresolved lifecycle evidence' });
|
|
7
|
+
if (retest.state === 'failed') return Object.freeze({ kind: 'address-failed-criteria-with-bounded-work', target, basis: 'authoritative current re-test failed' });
|
|
8
|
+
if (readiness.state === 'not-ready-for-retest') return Object.freeze({ kind: 'resolve-blocking-work-or-evidence', target: blockers[0]?.target || target, basis: blockers[0]?.code || 'qualified current blocker' });
|
|
9
|
+
if (retest.state === 'passed' && closure.state === 'open') return Object.freeze({ kind: 'obtain-explicit-authoritative-closure', target, basis: 'authoritative pass is qualified but no explicit closure governs the Task' });
|
|
10
|
+
return Object.freeze({ kind: 'invoke-authorized-retest', target, basis: 'derived readiness is ready-for-retest and no authoritative current outcome is observed' });
|
|
11
|
+
}
|