@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,80 @@
|
|
|
1
|
+
export function provenanceTargetKeysForValue(value = '') {
|
|
2
|
+
const raw = String(value || '').trim();
|
|
3
|
+
if (!raw) return [];
|
|
4
|
+
const keys = [];
|
|
5
|
+
const add = (item = '') => {
|
|
6
|
+
const clean = String(item || '').trim().toLowerCase();
|
|
7
|
+
if (clean && !keys.includes(clean)) keys.push(clean);
|
|
8
|
+
};
|
|
9
|
+
add(`raw:${raw}`);
|
|
10
|
+
const commentId = raw.match(/(?:issuecomment-|issues\/comments\/)(\d+)/i)?.[1] || '';
|
|
11
|
+
if (commentId) add(`github-comment:${commentId}`);
|
|
12
|
+
try {
|
|
13
|
+
const url = new URL(raw);
|
|
14
|
+
const host = url.hostname.toLowerCase();
|
|
15
|
+
const parts = url.pathname.split('/').filter(Boolean);
|
|
16
|
+
const hash = url.hash || '';
|
|
17
|
+
if ((host === 'github.com' || host.endsWith('.github.com')) && parts.length >= 4 && parts[2] === 'issues') {
|
|
18
|
+
const repo = normalizeRepoKey(`${parts[0]}/${parts[1]}`);
|
|
19
|
+
const number = String(parts[3] || '').trim();
|
|
20
|
+
if (repo && number) {
|
|
21
|
+
add(`github-issue:${repo}#${number}`);
|
|
22
|
+
if (hash) add(`github-issue:${repo}#${number}${hash.toLowerCase()}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (host === 'api.github.com' && parts.length >= 5 && parts[0] === 'repos' && parts[3] === 'issues') {
|
|
26
|
+
const repo = normalizeRepoKey(`${parts[1]}/${parts[2]}`);
|
|
27
|
+
const number = String(parts[4] || '').trim();
|
|
28
|
+
if (repo && number) add(`github-issue:${repo}#${number}`);
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
}
|
|
32
|
+
return keys;
|
|
33
|
+
}
|
|
34
|
+
export function githubRepoRelativePathFromUrl(value = '') {
|
|
35
|
+
try { const u = new URL(String(value || '').trim()), p = u.pathname.split('/').filter(Boolean), h = u.hostname.toLowerCase();
|
|
36
|
+
if (h === 'raw.githubusercontent.com' && p.length >= 4) return p.slice(3).join('/');
|
|
37
|
+
if ((h === 'github.com' || h.endsWith('.github.com')) && p.length >= 5 && p[2] === 'blob') return p.slice(4).join('/');
|
|
38
|
+
} catch (_) {}
|
|
39
|
+
return '';
|
|
40
|
+
}
|
|
41
|
+
export function sourceKeyFromTarget(value = '') {
|
|
42
|
+
try {
|
|
43
|
+
const url = new URL(String(value || ''));
|
|
44
|
+
const parts = url.pathname.split('/').filter(Boolean);
|
|
45
|
+
if (url.hostname === 'raw.githubusercontent.com' && parts.length >= 2) return normalizeRepoKey(`${parts[0]}/${parts[1]}`);
|
|
46
|
+
if (url.hostname.endsWith('github.com') && parts.length >= 2) return normalizeRepoKey(`${parts[0]}/${parts[1]}`);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
}
|
|
49
|
+
return '';
|
|
50
|
+
}
|
|
51
|
+
export function normalizeRepoKey(value = '') {
|
|
52
|
+
const parts = String(value || '').trim().toLowerCase().split('/').filter(Boolean);
|
|
53
|
+
return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : '';
|
|
54
|
+
}
|
|
55
|
+
export function normalizeRef(value = '') {
|
|
56
|
+
return String(value || '').trim().toLowerCase();
|
|
57
|
+
}
|
|
58
|
+
export function canonicalToken(value = '') {
|
|
59
|
+
return String(value || '').trim().replace(/^record:/i, 'record:').replace(/\s+/g, '');
|
|
60
|
+
}
|
|
61
|
+
export function canonicalPath(value = '') {
|
|
62
|
+
let raw = String(value || '').trim();
|
|
63
|
+
if (!raw) return '';
|
|
64
|
+
raw = raw.replace(/^record:/i, '');
|
|
65
|
+
const githubPath = githubRepoRelativePathFromUrl(raw);
|
|
66
|
+
if (githubPath) raw = githubPath;
|
|
67
|
+
else {
|
|
68
|
+
try {
|
|
69
|
+
const url = new URL(raw);
|
|
70
|
+
raw = url.pathname.replace(/^\/+/, '');
|
|
71
|
+
} catch (e) {}
|
|
72
|
+
}
|
|
73
|
+
const out = [];
|
|
74
|
+
for (const part of raw.replace(/\\/g, '/').split('/')) {
|
|
75
|
+
if (!part || part === '.') continue;
|
|
76
|
+
if (part === '..') out.pop();
|
|
77
|
+
else out.push(part);
|
|
78
|
+
}
|
|
79
|
+
return out.join('/');
|
|
80
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { resolveLineage } from './lineage.resolve.js';
|
|
2
|
+
|
|
3
|
+
export const LINEAGE_TRAVERSAL_SCHEMA_ID = 'tiinex.lineage.traversal.v1';
|
|
4
|
+
|
|
5
|
+
export function traverseLoadedLineage(artifacts = [], options = {}) {
|
|
6
|
+
const resolved = options.resolvedLineage || resolveLineage(artifacts, { depth: 'loaded-workspace' });
|
|
7
|
+
const maxDepth = normalizeDepth(options.maxDepth ?? options.depth ?? 3);
|
|
8
|
+
const direction = normalizeDirection(options.direction || 'ancestors');
|
|
9
|
+
const startIds = normalizeStartIds(options.startIds || options.startId || options.selectedId, resolved.nodes);
|
|
10
|
+
const nodeMap = new Map((resolved.nodes || []).map((node) => [node.id, node]));
|
|
11
|
+
const outgoing = new Map();
|
|
12
|
+
const incoming = new Map();
|
|
13
|
+
for (const edge of resolved.edges || []) {
|
|
14
|
+
if (edge.status === 'missing') {
|
|
15
|
+
addEdge(incoming, edge.to, edge);
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
addEdge(outgoing, edge.from, edge);
|
|
19
|
+
addEdge(incoming, edge.to, edge);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const visited = new Map();
|
|
23
|
+
const edgeIds = new Set();
|
|
24
|
+
const missingEdges = [];
|
|
25
|
+
const findings = [];
|
|
26
|
+
const queue = [];
|
|
27
|
+
|
|
28
|
+
for (const id of startIds) {
|
|
29
|
+
if (!nodeMap.has(id)) {
|
|
30
|
+
findings.push(finding('warning', 'lineage.traversal.start.missing', 'Traversal start node is not loaded.', { nodeId: id }));
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
visited.set(id, { node: nodeMap.get(id), depth: 0, role: 'start' });
|
|
34
|
+
queue.push({ id, depth: 0 });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
while (queue.length) {
|
|
38
|
+
const item = queue.shift();
|
|
39
|
+
if (item.depth >= maxDepth) continue;
|
|
40
|
+
const edges = edgesForDirection({ incoming, outgoing, id: item.id, direction });
|
|
41
|
+
for (const edge of edges) {
|
|
42
|
+
if (edge.status === 'missing') {
|
|
43
|
+
if (!missingEdges.some((existing) => existing.id === edge.id)) missingEdges.push(edge);
|
|
44
|
+
findings.push(finding('warning', 'lineage.traversal.missingTarget', 'Declared lineage target is not loaded; traversal stops at this boundary.', { nodeId: edge.to, target: edge.target }));
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
edgeIds.add(edge.id);
|
|
48
|
+
const nextId = edge.from === item.id ? edge.to : edge.from;
|
|
49
|
+
if (!nextId || !nodeMap.has(nextId)) continue;
|
|
50
|
+
const nextDepth = item.depth + 1;
|
|
51
|
+
if (!visited.has(nextId) || nextDepth < visited.get(nextId).depth) {
|
|
52
|
+
visited.set(nextId, { node: nodeMap.get(nextId), depth: nextDepth, role: edge.from === nextId ? 'ancestor' : 'descendant' });
|
|
53
|
+
queue.push({ id: nextId, depth: nextDepth });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const nodes = Array.from(visited.values()).sort((a, b) => a.depth - b.depth || String(a.node.path || a.node.id).localeCompare(String(b.node.path || b.node.id)));
|
|
59
|
+
const edges = (resolved.edges || []).filter((edge) => edgeIds.has(edge.id));
|
|
60
|
+
if (!nodes.length) findings.push(finding('info', 'lineage.traversal.empty', 'No loaded lineage nodes matched traversal start options.', {}));
|
|
61
|
+
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
schema: LINEAGE_TRAVERSAL_SCHEMA_ID,
|
|
64
|
+
boundary: 'loaded-only; no remote fetch; no inferred edges',
|
|
65
|
+
direction,
|
|
66
|
+
maxDepth,
|
|
67
|
+
startIds: Object.freeze(startIds),
|
|
68
|
+
nodes: Object.freeze(nodes.map(({ node, depth, role }) => Object.freeze({ id: node.id, title: node.title, path: node.path, schemaId: node.schemaId, depth, role, trace: node.trace || '', origin: node.origin || '' }))),
|
|
69
|
+
edges: Object.freeze(edges),
|
|
70
|
+
missingEdges: Object.freeze(missingEdges),
|
|
71
|
+
findings: Object.freeze(dedupeFindings(findings)),
|
|
72
|
+
resolvedLineage: resolved,
|
|
73
|
+
stats: Object.freeze({
|
|
74
|
+
loadedNodes: resolved.nodes?.length || 0,
|
|
75
|
+
visitedNodes: nodes.length,
|
|
76
|
+
traversedEdges: edges.length,
|
|
77
|
+
missingEdges: missingEdges.length,
|
|
78
|
+
findings: dedupeFindings(findings).length,
|
|
79
|
+
stoppedAtDepth: nodes.some((entry) => entry.depth >= maxDepth)
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function edgesForDirection({ incoming, outgoing, id, direction }) {
|
|
85
|
+
if (direction === 'ancestors') return ancestorEdges(incoming.get(id) || []);
|
|
86
|
+
if (direction === 'descendants') return outgoing.get(id) || [];
|
|
87
|
+
return [...ancestorEdges(incoming.get(id) || []), ...(outgoing.get(id) || [])];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function ancestorEdges(edges = []) {
|
|
91
|
+
const list = Array.isArray(edges) ? edges : [];
|
|
92
|
+
const parentEdges = list.filter((edge) => edge.kind === 'parent');
|
|
93
|
+
if (parentEdges.length) return parentEdges;
|
|
94
|
+
return list;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function normalizeStartIds(value, nodes = []) {
|
|
98
|
+
const values = Array.isArray(value) ? value : [value];
|
|
99
|
+
const out = values.map((item) => String(item || '').trim()).filter(Boolean);
|
|
100
|
+
return out.length ? out : (nodes[0]?.id ? [nodes[0].id] : []);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function normalizeDirection(value = '') {
|
|
104
|
+
const text = String(value || '').toLowerCase();
|
|
105
|
+
if (text === 'descendants' || text === 'children') return 'descendants';
|
|
106
|
+
if (text === 'both' || text === 'all') return 'both';
|
|
107
|
+
return 'ancestors';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function normalizeDepth(value) {
|
|
111
|
+
const number = Number.parseInt(value, 10);
|
|
112
|
+
if (!Number.isFinite(number)) return 3;
|
|
113
|
+
return Math.max(0, Math.min(32, number));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function addEdge(map, key, edge) {
|
|
117
|
+
if (!key) return;
|
|
118
|
+
if (!map.has(key)) map.set(key, []);
|
|
119
|
+
map.get(key).push(edge);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function dedupeFindings(findings = []) {
|
|
123
|
+
const seen = new Set();
|
|
124
|
+
return findings.filter((entry) => {
|
|
125
|
+
const key = `${entry.code}:${entry.nodeId || ''}:${entry.target || ''}`;
|
|
126
|
+
if (seen.has(key)) return false;
|
|
127
|
+
seen.add(key);
|
|
128
|
+
return true;
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function finding(severity, code, message, extra = {}) { return Object.freeze(Object.assign({ severity, code, message, source: LINEAGE_TRAVERSAL_SCHEMA_ID }, extra)); }
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { parseArtifactMarkdown } from '../artifacts/artifact.parse.js';
|
|
2
|
+
|
|
3
|
+
export const APPLICATION_DATA_SCHEMA_ID = 'tiinex.core.application-data.v1';
|
|
4
|
+
|
|
5
|
+
export function projectApplicationData(input = {}) {
|
|
6
|
+
const workspaces = Array.isArray(input) ? input : Array.isArray(input.workspaces) ? input.workspaces : [];
|
|
7
|
+
const findings = [];
|
|
8
|
+
const projectedWorkspaces = workspaces.map((workspace, index) => projectWorkspace(workspace, index, findings));
|
|
9
|
+
const locator = buildLocator(projectedWorkspaces);
|
|
10
|
+
|
|
11
|
+
const records = projectedWorkspaces.flatMap((workspace) => workspace.records.map((record) => finalizeRecord(record, workspace, locator, findings)));
|
|
12
|
+
const byWorkspace = new Map();
|
|
13
|
+
for (const record of records) {
|
|
14
|
+
if (!byWorkspace.has(record.workspaceId)) byWorkspace.set(record.workspaceId, []);
|
|
15
|
+
byWorkspace.get(record.workspaceId).push(record);
|
|
16
|
+
}
|
|
17
|
+
const finalizedWorkspaces = projectedWorkspaces.map((workspace) => freeze({
|
|
18
|
+
...workspace,
|
|
19
|
+
records: freeze((byWorkspace.get(workspace.id) || []).sort(compareHistorical))
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
return freeze({
|
|
23
|
+
schema: APPLICATION_DATA_SCHEMA_ID,
|
|
24
|
+
workspaces: finalizedWorkspaces,
|
|
25
|
+
records: freeze([...records].sort(compareHistorical)),
|
|
26
|
+
relations: freeze(records.flatMap((record) => record.relation ? [record.relation] : [])),
|
|
27
|
+
findings,
|
|
28
|
+
boundary: 'Read-only declared-data projection; parsing and exact-reference resolution do not certify schema validity or authority. Parent and endpoint links use exact declared references only; titles, filenames, chronology and repository basenames never infer semantic relations or authority.'
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function toPlaythingsStoryRecords(applicationData = {}) {
|
|
33
|
+
const records = Array.isArray(applicationData.records) ? applicationData.records : [];
|
|
34
|
+
const counts = new Map();
|
|
35
|
+
for (const record of records) counts.set(record.id, (counts.get(record.id) || 0) + 1);
|
|
36
|
+
return freeze(records.flatMap((record) => {
|
|
37
|
+
if (!Number.isFinite(record.historicalTimeMs) || counts.get(record.id) !== 1) return [];
|
|
38
|
+
const story = {
|
|
39
|
+
id: record.id,
|
|
40
|
+
historicalTimeMs: record.historicalTimeMs,
|
|
41
|
+
authors: record.authors,
|
|
42
|
+
actionStatus: record.actionStatus || 'unknown'
|
|
43
|
+
};
|
|
44
|
+
if (record.parent.state === 'resolved') story.parentId = record.parent.id;
|
|
45
|
+
else if (record.parent.state === 'root') story.parentId = null;
|
|
46
|
+
// Unknown/unresolved Parent deliberately omits parentId.
|
|
47
|
+
if (record.participants !== undefined) story.participants = record.participants;
|
|
48
|
+
if (record.handoff) story.handoff = { from: record.handoff.from, to: record.handoff.to };
|
|
49
|
+
return [freeze(story)];
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function projectWorkspace(workspace = {}, index, findings) {
|
|
54
|
+
const id = text(workspace.id || workspace.workspaceId);
|
|
55
|
+
if (!id || id.includes('::')) throw new TypeError('An explicit unambiguous Workspace id is required.');
|
|
56
|
+
const title = text(workspace.title || workspace.name || id);
|
|
57
|
+
const sourceIdentity = freeze({
|
|
58
|
+
workspaceId: id,
|
|
59
|
+
repository: text(workspace.repository || workspace.repo || workspace.source?.repository || ''),
|
|
60
|
+
revision: text(workspace.revision || workspace.commit || workspace.source?.revision || ''),
|
|
61
|
+
sourceMode: text(workspace.sourceMode || workspace.source?.adapterId || ''),
|
|
62
|
+
origin: text(workspace.origin || workspace.source?.origin || '')
|
|
63
|
+
});
|
|
64
|
+
const rawRecords = Array.isArray(workspace.records) ? workspace.records : [];
|
|
65
|
+
const records = rawRecords.map((record, recordIndex) => projectRecord(record, { id, title, sourceIdentity }, recordIndex, findings));
|
|
66
|
+
return freeze({ id, title, sourceIdentity, records, assets: freeze(Array.isArray(workspace.assets) ? workspace.assets.map(safeAssetProjection) : []) });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function projectRecord(record = {}, workspace, index, findings) {
|
|
70
|
+
const path = normPath(record.path || record.id);
|
|
71
|
+
if (!path) throw new TypeError('An explicit artifact path or id is required.');
|
|
72
|
+
const id = `${workspace.id}::${path}`;
|
|
73
|
+
let parsed = null;
|
|
74
|
+
if (typeof record.markdown === 'string' && record.markdown.trim()) {
|
|
75
|
+
try { parsed = parseArtifactMarkdown(record.markdown); }
|
|
76
|
+
catch (error) { findings.push(finding('warning', 'application-data.parse.failed', 'Artifact Markdown could not be projected.', { id, message: String(error?.message || error) })); }
|
|
77
|
+
}
|
|
78
|
+
const schemaId = text(parsed?.envelope?.current?.schema?.id || record.currentSchemaId || record.schemaId || record.kind || '');
|
|
79
|
+
const createdAt = text(record.currentCreatedAt || record.createdAt || parsed?.envelope?.current?.createdAt || '');
|
|
80
|
+
const historicalTimeMs = createdAt ? Date.parse(createdAt.replace(' ', 'T') + (/Z$|[+-]\d\d:?\d\d$/.test(createdAt) ? '' : 'Z')) : NaN;
|
|
81
|
+
if (createdAt && !Number.isFinite(historicalTimeMs)) findings.push(finding('warning', 'application-data.created-at.invalid', 'Created At is present but cannot be represented as a deterministic historical timestamp.', { id, createdAt }));
|
|
82
|
+
const authors = splitIdentities(record.authors ?? parsed?.envelope?.current?.authors ?? '');
|
|
83
|
+
const parentTarget = text(parsed?.envelope?.parent?.trace || record.parentRef || record.trace || '');
|
|
84
|
+
const explicitParticipants = Array.isArray(record.participants) ? freeze(record.participants.map(identityString).filter(Boolean)) : undefined;
|
|
85
|
+
const actionStatus = ['unknown', 'planned', 'occurred', 'cancelled'].includes(text(record.actionStatus).toLowerCase()) ? text(record.actionStatus).toLowerCase() : 'unknown';
|
|
86
|
+
return freeze({
|
|
87
|
+
id,
|
|
88
|
+
workspaceId: workspace.id,
|
|
89
|
+
path,
|
|
90
|
+
title: text(record.title || parsed?.title || path),
|
|
91
|
+
schemaId,
|
|
92
|
+
createdAt,
|
|
93
|
+
historicalTimeMs: Number.isFinite(historicalTimeMs) ? historicalTimeMs : null,
|
|
94
|
+
authors,
|
|
95
|
+
participants: explicitParticipants,
|
|
96
|
+
actionStatus,
|
|
97
|
+
parentTarget,
|
|
98
|
+
parentDeclared: Boolean(parsed?.hasContinuityContext && /^\s*- Parent\s*$/m.test(record.markdown || '')),
|
|
99
|
+
hasEnvelope: Boolean(parsed?.hasContinuityContext),
|
|
100
|
+
parsed,
|
|
101
|
+
source: freeze({ ...workspace.sourceIdentity, recordSourceMode: text(record.sourceMode || record.source?.adapterId || '') }),
|
|
102
|
+
raw: record
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function finalizeRecord(record, workspace, locator, findings) {
|
|
107
|
+
const parent = resolveParent(record, workspace, locator, findings);
|
|
108
|
+
const handoff = record.schemaId === 'tiinex.handoff.v1' ? projectHandoff(record, workspace, locator, findings) : null;
|
|
109
|
+
const relation = record.schemaId === 'tiinex.relation.v1' ? projectRelation(record, workspace, locator, findings) : null;
|
|
110
|
+
const result = {
|
|
111
|
+
id: record.id,
|
|
112
|
+
workspaceId: record.workspaceId,
|
|
113
|
+
path: record.path,
|
|
114
|
+
title: record.title,
|
|
115
|
+
schemaId: record.schemaId,
|
|
116
|
+
createdAt: record.createdAt,
|
|
117
|
+
historicalTimeMs: record.historicalTimeMs,
|
|
118
|
+
authors: record.authors,
|
|
119
|
+
actionStatus: record.actionStatus,
|
|
120
|
+
parent,
|
|
121
|
+
source: record.source,
|
|
122
|
+
qualification: { schema: 'not-validated-by-this-projection', integrity: 'not-checked-by-this-projection' },
|
|
123
|
+
handoff,
|
|
124
|
+
relation
|
|
125
|
+
};
|
|
126
|
+
if (record.participants !== undefined) result.participants = record.participants;
|
|
127
|
+
return freeze(result);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function buildLocator(workspaces) {
|
|
131
|
+
const exact = new Map();
|
|
132
|
+
for (const workspace of workspaces) {
|
|
133
|
+
for (const record of workspace.records) { const matches = exact.get(record.id) || []; matches.push(record); exact.set(record.id, matches); }
|
|
134
|
+
}
|
|
135
|
+
return { exact };
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function resolveParent(record, workspace, locator, findings) {
|
|
139
|
+
if (!record.parentTarget) return freeze({ state: record.hasEnvelope && !record.parentDeclared ? 'root' : 'unresolved', id: null, target: '', basis: 'declared-envelope-not-semantic-qualification' });
|
|
140
|
+
const resolved = resolveReference(record.parentTarget, record, workspace, locator);
|
|
141
|
+
if (resolved.state === 'resolved') return freeze({ state: 'resolved', id: resolved.record.id, target: record.parentTarget, method: resolved.method });
|
|
142
|
+
findings.push(finding(resolved.state === 'ambiguous' ? 'error' : 'warning', `application-data.parent.${resolved.state}`, 'Declared Parent reference did not resolve to exactly one loaded artifact.', { id: record.id, target: record.parentTarget, candidates: resolved.candidates || [] }));
|
|
143
|
+
return freeze({ state: resolved.state, id: null, target: record.parentTarget });
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function projectHandoff(record, workspace, locator, findings) {
|
|
147
|
+
const body = record.parsed?.body?.text || '';
|
|
148
|
+
const from = field(body, 'From');
|
|
149
|
+
const to = field(body, 'To');
|
|
150
|
+
const fromRef = markdownTarget(field(body, 'From Reference'));
|
|
151
|
+
const toRef = markdownTarget(field(body, 'To Reference'));
|
|
152
|
+
const fromProjection = resolveEndpoint(from, fromRef, record, workspace, locator, findings, 'from');
|
|
153
|
+
const toProjection = resolveEndpoint(to, toRef, record, workspace, locator, findings, 'to');
|
|
154
|
+
return freeze({
|
|
155
|
+
declaration: freeze({ from: text(from), to: text(to), fromReference: fromRef, toReference: toRef }),
|
|
156
|
+
from: freeze(fromProjection.ids),
|
|
157
|
+
to: freeze(toProjection.ids),
|
|
158
|
+
endpoints: freeze([fromProjection, toProjection]),
|
|
159
|
+
impliesAcceptance: false
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function resolveEndpoint(label, reference, record, workspace, locator, findings, side) {
|
|
164
|
+
if (!reference) return freeze({ side, state: 'unresolved', ids: [], label: text(label), reference: '' });
|
|
165
|
+
const resolved = resolveReference(reference, record, workspace, locator);
|
|
166
|
+
if (resolved.state === 'resolved') return freeze({ side, state: 'resolved', ids: [resolved.record.id], label: text(label), reference, artifactId: resolved.record.id });
|
|
167
|
+
findings.push(finding(resolved.state === 'ambiguous' ? 'error' : 'warning', `application-data.handoff.${side}.${resolved.state}`, 'Handoff endpoint reference did not resolve to exactly one loaded artifact. Display name was not used as identity.', { id: record.id, reference }));
|
|
168
|
+
return freeze({ side, state: resolved.state, ids: [], label: text(label), reference });
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function projectRelation(record, workspace, locator, findings) {
|
|
172
|
+
const body = record.parsed?.body?.text || '';
|
|
173
|
+
const sourceRef = markdownTarget(field(body, 'Source'));
|
|
174
|
+
const targetRef = markdownTarget(field(body, 'Target'));
|
|
175
|
+
const source = sourceRef ? resolveReference(sourceRef, record, workspace, locator) : { state: 'unresolved' };
|
|
176
|
+
const target = targetRef ? resolveReference(targetRef, record, workspace, locator) : { state: 'unresolved' };
|
|
177
|
+
if (sourceRef && source.state !== 'resolved') findings.push(finding('warning', `application-data.relation.source.${source.state}`, 'Relation Source did not resolve exactly in loaded application data.', { id: record.id, reference: sourceRef }));
|
|
178
|
+
if (targetRef && target.state !== 'resolved') findings.push(finding('warning', `application-data.relation.target.${target.state}`, 'Relation Target did not resolve exactly in loaded application data.', { id: record.id, reference: targetRef }));
|
|
179
|
+
return freeze({
|
|
180
|
+
id: record.id,
|
|
181
|
+
type: text(field(body, 'Relation Type')),
|
|
182
|
+
direction: text(field(body, 'Relation Direction')),
|
|
183
|
+
scope: text(field(body, 'Relation Scope')),
|
|
184
|
+
source: freeze({ reference: sourceRef, state: source.state, artifactId: source.record?.id || null }),
|
|
185
|
+
target: freeze({ reference: targetRef, state: target.state, artifactId: target.record?.id || null })
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function resolveReference(value, record, workspace, locator) {
|
|
190
|
+
const target = text(value);
|
|
191
|
+
if (!target) return { state: 'unresolved', candidates: [] };
|
|
192
|
+
const workspaceQualified = target.match(/^([^:]+)::(.+)$/);
|
|
193
|
+
if (workspaceQualified) {
|
|
194
|
+
const id = `${text(workspaceQualified[1])}::${normPath(workspaceQualified[2])}`;
|
|
195
|
+
const hit = locator.exact.get(id);
|
|
196
|
+
return exactCandidateResult(hit || [], 'workspace-qualified');
|
|
197
|
+
}
|
|
198
|
+
if (/^[a-z]+:\/\//i.test(target)) {
|
|
199
|
+
const candidates = [...locator.exact.values()].flat().filter((candidate) => [candidate.raw?.browseUrl, candidate.raw?.rawUrl, candidate.raw?.sourceUrl, candidate.raw?.source?.url].map(text).includes(target));
|
|
200
|
+
return exactCandidateResult(candidates, 'exact-url');
|
|
201
|
+
}
|
|
202
|
+
const resolvedPath = target.startsWith('/') ? normPath(target) : resolveRelative(record.path, target);
|
|
203
|
+
const hit = locator.exact.get(`${workspace.id}::${resolvedPath}`);
|
|
204
|
+
return exactCandidateResult(hit || [], 'relative-path');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function exactCandidateResult(candidates, method) {
|
|
208
|
+
if (candidates.length === 1) return { state: 'resolved', record: candidates[0], method };
|
|
209
|
+
if (candidates.length > 1) return { state: 'ambiguous', candidates: candidates.map((candidate) => candidate.id) };
|
|
210
|
+
return { state: 'unresolved', candidates: [] };
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function resolveRelative(currentPath, target) {
|
|
214
|
+
const base = normPath(currentPath).split('/'); base.pop();
|
|
215
|
+
for (const part of normPath(target).split('/')) {
|
|
216
|
+
if (!part || part === '.') continue;
|
|
217
|
+
if (part === '..') { if (!base.length) return ''; base.pop(); } else base.push(part);
|
|
218
|
+
}
|
|
219
|
+
return base.join('/');
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function field(markdown, label) {
|
|
223
|
+
const escaped = label.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
224
|
+
const match = String(markdown || '').match(new RegExp(`^\\s*-\\s*${escaped}:\\s*(.+?)\\s*$`, 'mi'));
|
|
225
|
+
return match?.[1]?.trim() || '';
|
|
226
|
+
}
|
|
227
|
+
function markdownTarget(value) { const match = text(value).match(/^\[[^\]]+\]\(([^)]+)\)$/); return match ? match[1].trim() : text(value); }
|
|
228
|
+
function splitIdentities(value) { if (Array.isArray(value)) return freeze(value.map(identityString).filter(Boolean)); return freeze(text(value).split(/[;,]/).map(identityString).filter(Boolean)); }
|
|
229
|
+
function identityString(value) { if (value && typeof value === 'object') return text(value.id || value.reference || value.target || value.label); return text(value); }
|
|
230
|
+
function safeAssetProjection(asset = {}) { return freeze({ id: text(asset.id || asset.path), path: normPath(asset.path || asset.id), mediaType: text(asset.mediaType || asset.type || ''), ownerArtifactPath: normPath(asset.ownerArtifactPath || ''), sha256: text(asset.sha256 || '') }); }
|
|
231
|
+
function compareHistorical(a, b) { const ta = Number.isFinite(a.historicalTimeMs) ? a.historicalTimeMs : Number.POSITIVE_INFINITY; const tb = Number.isFinite(b.historicalTimeMs) ? b.historicalTimeMs : Number.POSITIVE_INFINITY; return ta - tb || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0); }
|
|
232
|
+
function normPath(value = '') { return text(value).replace(/\\/g, '/').replace(/^\.\//, '').replace(/^\/+|\/+$/g, ''); }
|
|
233
|
+
function token(value = '') { return text(value).toLowerCase().replace(/[^a-z0-9._-]+/g, '-').replace(/^-+|-+$/g, ''); }
|
|
234
|
+
function text(value) { return String(value ?? '').trim(); }
|
|
235
|
+
function finding(severity, code, message, details = {}) { return freeze({ severity, code, message, details }); }
|
|
236
|
+
function freeze(value) { if (Array.isArray(value)) return Object.freeze(value.map(freeze)); if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value; return Object.freeze(Object.fromEntries(Object.entries(value).map(([key, item]) => [key, freeze(item)]))); }
|