@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,192 @@
|
|
|
1
|
+
import { buildArtifactCreationContract } from '../../../schemas/creation.contracts.js';
|
|
2
|
+
import { parseArtifactMarkdown } from '../../../artifacts/artifact.parse.js';
|
|
3
|
+
import { createPortableLocalDraft } from '../draft/draft.create.js';
|
|
4
|
+
import { portableFinding } from '../findings.js';
|
|
5
|
+
import { projectPortableLoadedParentRecord, resolvePortableLoadedParentReference } from '../materialization/loaded.parent.js';
|
|
6
|
+
import { allocateContinuationPath, allocateRootArtifactPath } from '../../../transitions/record.transitions.js';
|
|
7
|
+
|
|
8
|
+
export function materializeLiveArtifact({ current, change, material, artifacts, findings, input, options }) {
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(change, 'bodyMarkdown') && String(change.bodyMarkdown || '').trim()) {
|
|
10
|
+
findings.push(portableFinding('error', 'live-lineage.body-markdown.blocked', 'Use schema-owned values and sections; raw Markdown replacement is blocked.', { artifactId: change.id }));
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const schemaId = clean(change.schemaId || current?.schemaId || '');
|
|
14
|
+
const transitionType = change.parentRef || current?.parentRef ? 'continue-from-record' : 'create-artifact';
|
|
15
|
+
const contract = buildArtifactCreationContract({ schemaId, transitionType });
|
|
16
|
+
if (contract.status !== 'ready') {
|
|
17
|
+
findings.push(...(contract.findings || []).map((finding) => portableFinding(finding.severity, finding.code, finding.message, { ...finding, artifactId: change.id })));
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
if (current && schemaId !== current.schemaId) {
|
|
21
|
+
findings.push(portableFinding('error', 'live-lineage.schema-change.blocked', 'Create a new artifact to change schema.', { artifactId: change.id, before: current.schemaId, after: schemaId }));
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const parentRef = exact(change.parentRef !== undefined ? change.parentRef : current?.parentRef || '');
|
|
26
|
+
if (current && parentRef !== current.parentRef) {
|
|
27
|
+
findings.push(portableFinding('error', 'live-lineage.parent-change.blocked', 'Parent cannot change; create a child or repair continuity.', { artifactId: change.id, before: current.parentRef, after: parentRef }));
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const parentRecord = resolveParentRecord(parentRef, material, artifacts, findings);
|
|
31
|
+
if (parentRef && !parentRecord) return null;
|
|
32
|
+
|
|
33
|
+
const explicitOrCurrentPath = change.path || current?.path || '';
|
|
34
|
+
const allocationOptions = Object.freeze({
|
|
35
|
+
existingPaths: Object.freeze([
|
|
36
|
+
...(material.records || []).map((record) => String(record?.path || '')),
|
|
37
|
+
...[...artifacts.values()].map((artifact) => String(artifact?.path || ''))
|
|
38
|
+
].filter(Boolean))
|
|
39
|
+
});
|
|
40
|
+
const allocatedPath = explicitOrCurrentPath || (parentRecord
|
|
41
|
+
? allocateContinuationPath({ parentRecord, targetId: schemaId, targetLabel: schemaId, title: change.title || current?.title || change.id }, allocationOptions).path
|
|
42
|
+
: allocateRootArtifactPath({ targetId: schemaId, targetLabel: schemaId, title: change.title || current?.title || change.id }, allocationOptions).path);
|
|
43
|
+
const requestedPath = explicitOrCurrentPath || allocatedPath;
|
|
44
|
+
const pathValue = normalizeArtifactPath(requestedPath);
|
|
45
|
+
if (!pathValue) {
|
|
46
|
+
findings.push(portableFinding('error', 'live-lineage.path.reserved-or-invalid', 'Artifact path is invalid or transport-reserved.', { artifactId: change.id, path: String(requestedPath || '') }));
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
if (current && pathValue !== current.path) {
|
|
50
|
+
findings.push(portableFinding('error', 'live-lineage.path-change.blocked', 'Path is immutable.', { artifactId: change.id, before: current.path, after: pathValue }));
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const evidenceRefs = mergeStrings(current?.evidenceRefs, change.evidenceRefs);
|
|
54
|
+
const knownEvidence = new Set([
|
|
55
|
+
...(input.state?.evidence || []).map((entry) => entry.id),
|
|
56
|
+
clean(input.turn?.id),
|
|
57
|
+
...(material.files || []).map((file) => `loaded:${file.path}`),
|
|
58
|
+
...(material.records || []).map((record) => `loaded:${record.path}`)
|
|
59
|
+
].filter(Boolean));
|
|
60
|
+
for (const ref of evidenceRefs) {
|
|
61
|
+
if (!knownEvidence.has(ref) && !ref.startsWith('loaded:') && !ref.startsWith('dialogue:')) findings.push(portableFinding('error', 'live-lineage.evidence.unresolved', 'Evidence reference is not declared by dialogue or loaded material.', { artifactId: change.id, evidenceRef: ref }));
|
|
62
|
+
}
|
|
63
|
+
if (findings.some((finding) => finding.severity === 'error' && finding.artifactId === change.id)) return null;
|
|
64
|
+
|
|
65
|
+
const values = mergeObjects(current?.values, change.values || change.valuesPatch);
|
|
66
|
+
const sections = mergeObjects(current?.sections, change.sections || change.sectionsPatch);
|
|
67
|
+
const title = clean(change.title || current?.title || change.id);
|
|
68
|
+
const summary = clean(change.summary || current?.summary || title);
|
|
69
|
+
const why = clean(change.why || change.rationale || current?.why || 'Maintained as live local Tiinex lineage.');
|
|
70
|
+
const runtimeObservedAt = timestamp(input.runtimeObservedAt || runtimeTimestamp(options));
|
|
71
|
+
const createdAt = current?.createdAt || runtimeObservedAt;
|
|
72
|
+
const result = createPortableLocalDraft({
|
|
73
|
+
...material,
|
|
74
|
+
schemaId,
|
|
75
|
+
id: change.id,
|
|
76
|
+
path: pathValue,
|
|
77
|
+
title,
|
|
78
|
+
summary,
|
|
79
|
+
why,
|
|
80
|
+
values,
|
|
81
|
+
sections,
|
|
82
|
+
createdAt,
|
|
83
|
+
schemaReferences: change.schemaReferences || input.schemaReferences || null,
|
|
84
|
+
transitionType: contract.transitionType || transitionType,
|
|
85
|
+
parentRecord: parentRecord || {},
|
|
86
|
+
allowIncomplete: change.allowIncomplete !== false
|
|
87
|
+
}, options);
|
|
88
|
+
const creationErrors = (result.findings || []).filter((finding) => finding.severity === 'error');
|
|
89
|
+
if (!result.draft) {
|
|
90
|
+
findings.push(...creationErrors.map((finding) => portableFinding(finding.severity, finding.code, finding.message, { ...finding, artifactId: change.id })));
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const retainedLocalContinuity = result.status === 'created-local-continuity' && result.qualification?.localContinuityUsable === true;
|
|
94
|
+
if (!retainedLocalContinuity) findings.push(...creationErrors.map((finding) => portableFinding(finding.severity, finding.code, finding.message, { ...finding, artifactId: change.id })));
|
|
95
|
+
|
|
96
|
+
const revision = current ? current.revision + 1 : 1;
|
|
97
|
+
const exportReady = result.status === 'created-clean' && result.qualification?.exactRuntimeValidation === true;
|
|
98
|
+
return freezeArtifact({
|
|
99
|
+
id: change.id,
|
|
100
|
+
schemaId,
|
|
101
|
+
path: pathValue,
|
|
102
|
+
parentRef,
|
|
103
|
+
title,
|
|
104
|
+
summary,
|
|
105
|
+
why,
|
|
106
|
+
values,
|
|
107
|
+
sections,
|
|
108
|
+
evidenceRefs,
|
|
109
|
+
rationale: clean(change.rationale || current?.rationale || ''),
|
|
110
|
+
status: exportReady ? 'live-clean' : 'live-incomplete',
|
|
111
|
+
exportReady,
|
|
112
|
+
revision,
|
|
113
|
+
createdAt,
|
|
114
|
+
updatedAt: runtimeObservedAt,
|
|
115
|
+
draft: result.draft,
|
|
116
|
+
validation: result.validation,
|
|
117
|
+
qualification: result.qualification,
|
|
118
|
+
changeRole: current?.changeRole || 'created',
|
|
119
|
+
baseSha256: current?.baseSha256 || ''
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function resolveParentRecord(parentRef, material, artifacts, findings) {
|
|
124
|
+
if (!parentRef) return null;
|
|
125
|
+
if (parentRef.startsWith('live:')) {
|
|
126
|
+
const id = parentRef.slice(5);
|
|
127
|
+
const parent = artifacts.get(id);
|
|
128
|
+
if (!parent || parent.status === 'withdrawn') {
|
|
129
|
+
findings.push(portableFinding('error', 'live-lineage.parent.live-missing', 'Declared live Parent does not exist.', { parentRef }));
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const parsed = safeParse(parent.draft?.markdown || '');
|
|
133
|
+
const currentSchema = parsed?.envelope?.current?.schema || {};
|
|
134
|
+
return Object.freeze({
|
|
135
|
+
id: parent.id,
|
|
136
|
+
path: parent.path,
|
|
137
|
+
schemaId: parent.schemaId,
|
|
138
|
+
createdAt: parent.draft?.createdAt || parent.createdAt,
|
|
139
|
+
continuationTrace: '',
|
|
140
|
+
schemaReferenceAuthority: currentSchema.target ? Object.freeze({
|
|
141
|
+
schemaId: currentSchema.id || parent.schemaId,
|
|
142
|
+
preferredTarget: currentSchema.target,
|
|
143
|
+
exactTargets: Object.freeze([currentSchema.target]),
|
|
144
|
+
resolutionState: 'qualified',
|
|
145
|
+
evidence: Object.freeze({ source: 'live-parent-rendered-current-schema-reference' })
|
|
146
|
+
}) : null,
|
|
147
|
+
boundary: 'portable local artifact; no remote provenance',
|
|
148
|
+
sourceMode: 'local-portable-live',
|
|
149
|
+
source: null,
|
|
150
|
+
markdown: String(parent.draft?.markdown || ''),
|
|
151
|
+
integrity: parsed?.integrity || null
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (parentRef.startsWith('loaded:')) {
|
|
155
|
+
const wanted = parentRef.slice(7);
|
|
156
|
+
const resolved = resolvePortableLoadedParentReference(wanted, material.records || []);
|
|
157
|
+
if (resolved.status !== 'resolved') {
|
|
158
|
+
findings.push(portableFinding('error', resolved.status === 'ambiguous' ? 'live-lineage.parent.loaded-ambiguous' : 'live-lineage.parent.loaded-missing', resolved.status === 'ambiguous' ? 'Declared loaded Parent is ambiguous.' : 'Loaded Parent is unavailable.', { parentRef, matches: resolved.candidates.length }));
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
return projectPortableLoadedParentRecord(resolved.record);
|
|
162
|
+
}
|
|
163
|
+
findings.push(portableFinding('error', 'live-lineage.parent.ref-invalid', 'Use live:<id> or loaded:<exact-path-or-id> for Parent.', { parentRef }));
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function safeParse(markdown = '') {
|
|
168
|
+
try { return parseArtifactMarkdown(markdown); }
|
|
169
|
+
catch { return null; }
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function freezeArtifact(value = {}) {
|
|
173
|
+
return Object.freeze({
|
|
174
|
+
...value,
|
|
175
|
+
id: clean(value.id), schemaId: clean(value.schemaId), path: normalizeArtifactPath(value.path || ''), parentRef: exact(value.parentRef), title: clean(value.title), summary: clean(value.summary), why: clean(value.why),
|
|
176
|
+
values: Object.freeze(clone(value.values || {})), sections: Object.freeze(clone(value.sections || {})), evidenceRefs: Object.freeze(normalizeStrings(value.evidenceRefs)),
|
|
177
|
+
revision: Math.max(1, Number(value.revision || 1)), status: clean(value.status || 'live-incomplete'), exportReady: value.exportReady === true,
|
|
178
|
+
draft: value.draft ? Object.freeze({ ...value.draft }) : null, validation: value.validation ? Object.freeze({ ...value.validation }) : null, qualification: value.qualification ? Object.freeze({ ...value.qualification }) : null
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function defaultArtifactPath(id, title) { const stem = slug(id || title || 'topic'); return `.topics/${slug(title || id || 'lineage')}/${stem}.trace.md`; }
|
|
182
|
+
function normalizeArtifactPath(value) { const cleanPath = String(value || '').replace(/\\/g, '/').replace(/^\/+/, '').replace(/\.\.(?:\/|$)/g, '').trim(); if (!cleanPath) return ''; const withSuffix = cleanPath.toLowerCase().endsWith('.trace.md') ? cleanPath : cleanPath.replace(/\.md$/i, '') + '.trace.md'; return withSuffix.startsWith('.bootstrap/') || withSuffix === '.bootstrap' ? '' : withSuffix; }
|
|
183
|
+
function mergeObjects(before, patch) { return { ...clone(before || {}), ...clone(patch || {}) }; }
|
|
184
|
+
function mergeStrings(...values) { return normalizeStrings(values.flatMap((value) => normalizeArray(value))); }
|
|
185
|
+
function normalizeStrings(value) { return [...new Set(normalizeArray(value).map(clean).filter(Boolean))].sort(); }
|
|
186
|
+
function normalizeArray(value) { return Array.isArray(value) ? value : value == null ? [] : [value]; }
|
|
187
|
+
function clean(value) { return String(value || '').replace(/\s+/g, ' ').trim(); }
|
|
188
|
+
function exact(value) { return String(value ?? ''); }
|
|
189
|
+
function slug(value) { return clean(value).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 80) || 'artifact'; }
|
|
190
|
+
function timestamp(value) { const text = String(value || '').trim(); return text || new Date().toISOString(); }
|
|
191
|
+
function runtimeTimestamp(options = {}) { const value = typeof options.clock === 'function' ? options.clock() : new Date().toISOString(); const date = value instanceof Date ? value : new Date(value); return Number.isNaN(date.getTime()) ? new Date().toISOString() : date.toISOString(); }
|
|
192
|
+
function clone(value) { return value == null ? {} : JSON.parse(JSON.stringify(value)); }
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { validatePortableDraft } from '../draft/draft.operations.js';
|
|
2
|
+
import { normalizePortableInput } from '../input/portable.input.js';
|
|
3
|
+
import { portableFinding, summarizePortableFindings } from '../findings.js';
|
|
4
|
+
import { buildPortableLiveLineageClosure } from './live.lineage.closure.js';
|
|
5
|
+
import { normalizePortableLiveLineageState } from './live.lineage.js';
|
|
6
|
+
import { appendLiveOperationReceipt, summarizeLiveOperationChain } from './live.protocol.js';
|
|
7
|
+
|
|
8
|
+
export const PORTABLE_LIVE_LINEAGE_EXPORT_SCHEMA_ID = 'tiinex.portable.live-lineage.export.v1';
|
|
9
|
+
|
|
10
|
+
export function exportPortableLiveLineage(input = {}, options = {}) {
|
|
11
|
+
const findings = [];
|
|
12
|
+
const state = normalizePortableLiveLineageState(input.state || input.liveLineage || {}, findings);
|
|
13
|
+
const material = normalizePortableInput(input.materials || input);
|
|
14
|
+
const selectedIds = new Set(normalizeStrings(input.artifactIds));
|
|
15
|
+
const selected = state.artifacts.filter((entry) => entry.status !== 'withdrawn' && (!selectedIds.size || selectedIds.has(entry.id)));
|
|
16
|
+
const updateReceipts = state.receipts.filter((entry) => entry.operation === 'update-live-lineage');
|
|
17
|
+
const prepareReceipts = state.receipts.filter((entry) => entry.operation === 'prepare-live-response');
|
|
18
|
+
const dialogueMode = classifyDialogueMode(updateReceipts, prepareReceipts);
|
|
19
|
+
|
|
20
|
+
if (!selected.length) findings.push(portableFinding('error', 'live-lineage.export.empty', 'No active live artifacts are available for export.'));
|
|
21
|
+
if (state.protocol.latestTurnSequence > state.protocol.preparedTurnSequence) findings.push(portableFinding('error', 'live-lineage.export.response-preflight-pending', 'Export is blocked because the latest dialogue turn was not processed into bounded response context.', { latestTurnSequence: state.protocol.latestTurnSequence, preparedTurnSequence: state.protocol.preparedTurnSequence }));
|
|
22
|
+
if (!updateReceipts.length) findings.push(portableFinding('error', 'live-lineage.export.turn-receipt-missing', 'Export requires at least one recorded dialogue-turn transaction.'));
|
|
23
|
+
if (prepareReceipts.length !== updateReceipts.length) findings.push(portableFinding('error', 'live-lineage.export.turn-pair-incomplete', 'Every recorded dialogue turn must have one response-preflight receipt before export.', { turnReceipts: updateReceipts.length, responseReceipts: prepareReceipts.length }));
|
|
24
|
+
if (!updateReceipts.some((entry) => entry.decision === 'artifact-change')) findings.push(portableFinding('error', 'live-lineage.export.artifact-change-receipt-missing', 'Export requires an artifact change recorded during a dialogue-turn transaction.'));
|
|
25
|
+
if (input.requireInterleaved === true && dialogueMode !== 'live-interleaved') findings.push(portableFinding('error', 'live-lineage.export.interleaved-required', 'This acceptance profile requires at least two processed dialogue turns before export.', { dialogueMode, turns: updateReceipts.length }));
|
|
26
|
+
|
|
27
|
+
const artifacts = [];
|
|
28
|
+
for (const entry of selected) {
|
|
29
|
+
const validation = validatePortableDraft({ ...material, ...entry.draft, schemaId: entry.schemaId }, options);
|
|
30
|
+
findings.push(...(validation.findings || []).filter((finding) => finding.severity === 'error').map((finding) => portableFinding(finding.severity, finding.code, finding.message, { ...finding, artifactId: entry.id })));
|
|
31
|
+
if (validation.status !== 'clean') findings.push(portableFinding('error', 'live-lineage.export.validation-blocked', 'Live artifact is not clean under the shared validator and cannot be exported.', { artifactId: entry.id, validationStatus: validation.status }));
|
|
32
|
+
artifacts.push(Object.freeze({
|
|
33
|
+
proposalId: entry.id,
|
|
34
|
+
parentProposalId: entry.parentRef.startsWith('live:') ? entry.parentRef.slice(5) : '',
|
|
35
|
+
parentLoadedRef: entry.parentRef.startsWith('loaded:') ? entry.parentRef.slice(7) : '',
|
|
36
|
+
draft: Object.freeze({ ...entry.draft, changeRole: entry.changeRole || 'created', baseSha256: entry.baseSha256 || '' }),
|
|
37
|
+
validation
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const lineageClosure = buildPortableLiveLineageClosure(material, selected);
|
|
42
|
+
const hasErrors = findings.some((finding) => finding.severity === 'error');
|
|
43
|
+
let operationReceipt = summarizeLiveOperationChain({ protocol: state.protocol, receipts: state.receipts });
|
|
44
|
+
if (!hasErrors) {
|
|
45
|
+
const appended = appendLiveOperationReceipt({
|
|
46
|
+
protocol: state.protocol,
|
|
47
|
+
receipts: state.receipts,
|
|
48
|
+
operation: 'export-live-lineage',
|
|
49
|
+
eventSequence: state.protocol.latestEventSequence,
|
|
50
|
+
coversThroughEventSequence: state.protocol.preparedEventSequence,
|
|
51
|
+
turnSequence: state.protocol.latestTurnSequence,
|
|
52
|
+
coversThroughTurnSequence: state.protocol.preparedTurnSequence,
|
|
53
|
+
latestEventSequence: state.protocol.latestEventSequence,
|
|
54
|
+
preparedEventSequence: state.protocol.preparedEventSequence,
|
|
55
|
+
latestTurnSequence: state.protocol.latestTurnSequence,
|
|
56
|
+
preparedTurnSequence: state.protocol.preparedTurnSequence,
|
|
57
|
+
exportCount: state.protocol.exportCount + 1,
|
|
58
|
+
artifactIds: selected.map((entry) => entry.id),
|
|
59
|
+
clock: options.clock,
|
|
60
|
+
decision: dialogueMode,
|
|
61
|
+
details: { artifactCount: selected.length, genericFileFallback: false, dialogueMode, processedTurns: updateReceipts.length }
|
|
62
|
+
});
|
|
63
|
+
operationReceipt = summarizeLiveOperationChain({ protocol: appended.protocol, receipts: appended.receipts });
|
|
64
|
+
}
|
|
65
|
+
return Object.freeze({
|
|
66
|
+
schema: PORTABLE_LIVE_LINEAGE_EXPORT_SCHEMA_ID,
|
|
67
|
+
status: hasErrors ? 'blocked' : 'created-clean',
|
|
68
|
+
dialogueMode,
|
|
69
|
+
artifacts: Object.freeze(artifacts),
|
|
70
|
+
lineageClosure,
|
|
71
|
+
assets: Object.freeze(normalizeAssets(input.assets)),
|
|
72
|
+
state: Object.freeze({ schema: state.schema, version: state.version, focusArtifactId: state.focusArtifactId, artifactIds: Object.freeze(selected.map((entry) => entry.id)), protocol: state.protocol }),
|
|
73
|
+
operationReceipt,
|
|
74
|
+
boundary: Object.freeze({
|
|
75
|
+
dialogueMode,
|
|
76
|
+
processedDialogueTurns: updateReceipts.length,
|
|
77
|
+
artifactsChangedBeforeExport: updateReceipts.some((entry) => entry.decision === 'artifact-change'),
|
|
78
|
+
retrospectiveArtifactSynthesis: dialogueMode === 'export-time-synthesis',
|
|
79
|
+
everyRecordedTurnPrepared: prepareReceipts.length === updateReceipts.length,
|
|
80
|
+
provesEveryProviderTurnObserved: false,
|
|
81
|
+
portableOperationReceiptsRecorded: !hasErrors,
|
|
82
|
+
genericFileFallback: false,
|
|
83
|
+
sourceMutation: false,
|
|
84
|
+
remoteWrite: false,
|
|
85
|
+
bootstrapIncluded: false
|
|
86
|
+
}),
|
|
87
|
+
findings: Object.freeze(findings),
|
|
88
|
+
findingSummary: summarizePortableFindings(findings)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function classifyDialogueMode(updateReceipts, prepareReceipts) {
|
|
93
|
+
if (!updateReceipts.length) return 'export-time-synthesis';
|
|
94
|
+
if (prepareReceipts.length !== updateReceipts.length) return 'unverified';
|
|
95
|
+
if (updateReceipts.length === 1) return 'single-turn';
|
|
96
|
+
return 'live-interleaved';
|
|
97
|
+
}
|
|
98
|
+
function normalizeAssets(value) {
|
|
99
|
+
return normalizeArray(value).filter((entry) => entry && typeof entry === 'object' && (
|
|
100
|
+
String(entry.path || '').trim()
|
|
101
|
+
|| String(entry.content ?? entry.data ?? '').length
|
|
102
|
+
|| Number(entry.bytes || 0) > 0
|
|
103
|
+
));
|
|
104
|
+
}
|
|
105
|
+
function normalizeStrings(value) { return [...new Set(normalizeArray(value).map(clean).filter(Boolean))].sort(); }
|
|
106
|
+
function normalizeArray(value) { return Array.isArray(value) ? value : value == null ? [] : [value]; }
|
|
107
|
+
function clean(value) { return String(value || '').replace(/\s+/g, ' ').trim(); }
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { resolveLineage } from '../../../lineage/lineage.resolve.js';
|
|
2
|
+
|
|
3
|
+
export function buildPortableLiveLineageClosure(material = {}, selected = []) {
|
|
4
|
+
const records = (material.records || []).filter((record) => record.path && record.markdown && (record.hasContinuityContext || record.schemaId || String(record.kind || '').startsWith('tiinex.')));
|
|
5
|
+
const lineage = resolveLineage(records, { depth: 'portable-live-lineage-export' });
|
|
6
|
+
const nodeById = new Map((lineage.nodes || []).map((node) => [node.id, node]));
|
|
7
|
+
const nodeByPath = new Map((lineage.nodes || []).map((node) => [String(node.path || ''), node]));
|
|
8
|
+
const selectedLoaded = collectLoadedParents(selected, lineage, nodeById, nodeByPath);
|
|
9
|
+
const context = [...selectedLoaded]
|
|
10
|
+
.map((id) => nodeById.get(id))
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
.map((node) => Object.freeze({
|
|
13
|
+
id: node.id,
|
|
14
|
+
path: node.path,
|
|
15
|
+
schemaId: node.schemaId,
|
|
16
|
+
markdown: String(node.record?.markdown || ''),
|
|
17
|
+
trace: String(node.trace || ''),
|
|
18
|
+
parentSchemaId: String(node.parentSchemaId || ''),
|
|
19
|
+
sourceMode: String(node.sourceMode || ''),
|
|
20
|
+
boundary: String(node.boundary || '')
|
|
21
|
+
}))
|
|
22
|
+
.sort((a, b) => a.path.localeCompare(b.path));
|
|
23
|
+
const edges = collectEdges(selected, lineage, selectedLoaded, nodeById, nodeByPath);
|
|
24
|
+
return Object.freeze({
|
|
25
|
+
schema: 'tiinex.portable.lineage-closure.v1',
|
|
26
|
+
context: Object.freeze(context),
|
|
27
|
+
edges: Object.freeze(uniqueEdges(edges)),
|
|
28
|
+
boundary: 'Minimum known Parent closure for live artifacts. Exact loaded Parent bytes are preserved as unchanged context.'
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function collectLoadedParents(selected, lineage, nodeById, nodeByPath) {
|
|
33
|
+
const selectedLoaded = new Set();
|
|
34
|
+
const queue = selected.filter((entry) => entry.parentRef.startsWith('loaded:')).map((entry) => entry.parentRef.slice(7));
|
|
35
|
+
while (queue.length) {
|
|
36
|
+
const ref = queue.shift();
|
|
37
|
+
const node = nodeByPath.get(ref) || nodeById.get(ref);
|
|
38
|
+
if (!node || selectedLoaded.has(node.id)) continue;
|
|
39
|
+
selectedLoaded.add(node.id);
|
|
40
|
+
for (const edge of lineage.edges || []) if (edge.kind === 'parent' && edge.to === node.id && edge.from) queue.push(edge.from);
|
|
41
|
+
}
|
|
42
|
+
return selectedLoaded;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function collectEdges(selected, lineage, selectedLoaded, nodeById, nodeByPath) {
|
|
46
|
+
const selectedById = new Map(selected.map((entry) => [entry.id, entry]));
|
|
47
|
+
const edges = [];
|
|
48
|
+
for (const edge of lineage.edges || []) {
|
|
49
|
+
if (edge.kind !== 'parent' || !selectedLoaded.has(edge.from) || !selectedLoaded.has(edge.to)) continue;
|
|
50
|
+
const parent = nodeById.get(edge.from);
|
|
51
|
+
const child = nodeById.get(edge.to);
|
|
52
|
+
if (parent?.path && child?.path) edges.push({ childPath: child.path, parentPath: parent.path, parentKind: 'loaded-context' });
|
|
53
|
+
}
|
|
54
|
+
for (const entry of selected) {
|
|
55
|
+
if (entry.parentRef.startsWith('live:')) {
|
|
56
|
+
const parent = selectedById.get(entry.parentRef.slice(5));
|
|
57
|
+
if (parent) edges.push({ childPath: entry.path, parentPath: parent.path, parentKind: 'created-live' });
|
|
58
|
+
} else if (entry.parentRef.startsWith('loaded:')) {
|
|
59
|
+
const ref = entry.parentRef.slice(7);
|
|
60
|
+
const parent = nodeByPath.get(ref) || nodeById.get(ref);
|
|
61
|
+
if (parent?.path) edges.push({ childPath: entry.path, parentPath: parent.path, parentKind: 'loaded-context' });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return edges;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function uniqueEdges(edges) {
|
|
68
|
+
const map = new Map();
|
|
69
|
+
for (const edge of edges) map.set(`${edge.childPath}\0${edge.parentPath}`, Object.freeze(edge));
|
|
70
|
+
return [...map.values()].sort((a, b) => `${a.childPath}\0${a.parentPath}`.localeCompare(`${b.childPath}\0${b.parentPath}`));
|
|
71
|
+
}
|