@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,468 @@
|
|
|
1
|
+
import { parseArtifactMarkdown } from '../../artifacts/artifact.parse.js';
|
|
2
|
+
import { resolveLineage } from '../../lineage/lineage.resolve.js';
|
|
3
|
+
import { traverseLoadedLineage } from '../../lineage/lineage.traverse.js';
|
|
4
|
+
import { resolveSchemaCapabilities } from '../../schemas/capability.registry.js';
|
|
5
|
+
import { buildArtifactCreationContract, validateArtifactCreationContract } from '../../schemas/creation.contracts.js';
|
|
6
|
+
import { schemaCanonicalBinding, schemaReadPresentation } from '../../schemas/companion.js';
|
|
7
|
+
import { schemaRegistry } from '../../schemas/registry.js';
|
|
8
|
+
import { findSchemaMaterial, normalizePortableInput, suppliedSchemaParentId } from './input/portable.input.js';
|
|
9
|
+
import { portableFinding } from './findings.js';
|
|
10
|
+
import { normalizePortableDepth as normalizeDepth, normalizePortableSchemaIds as normalizeSchemaIds, portableOperationResult as operationResult } from './operation.result.js';
|
|
11
|
+
import { qualifyCapabilityResolution, qualifyCreationContract, qualifyWriterBrief } from './qualification.js';
|
|
12
|
+
import { buildPortableSchemaGuide, planPortableArtifact, readPortableSchemaGuideSections } from './schema/schema.guide.js';
|
|
13
|
+
import { buildPortableRepairPlan, explainPortableFindings, validatePortableDraft } from './draft/draft.operations.js';
|
|
14
|
+
import { createPortableLocalDraft, stagePortableDraft } from './draft/draft.create.js';
|
|
15
|
+
import { deletePortableLocalDraft, updatePortableLocalDraft } from './draft/draft.crud.js';
|
|
16
|
+
import { discoverPortableHostCapabilities } from './host/host.capabilities.js';
|
|
17
|
+
import { listPortableMaterialProviders, resolvePortableSchemaChainMaterial, resolvePortableSchemaMaterial } from './providers/schema.providers.js';
|
|
18
|
+
import { inspectPortableAssets, preparePortableAssetAnalysis } from './assets/asset.operations.js';
|
|
19
|
+
import { preparePortableTask } from './orchestration/task.prepare.js';
|
|
20
|
+
import { auditPortableRecords } from './audit/audit.capability.js';
|
|
21
|
+
export { planPortableLineageIntegrity, projectPortableLineageIntegrityRepair, applyPortableLineageIntegrity, searchPortableLineage } from './lineage/lineage.operations.js';
|
|
22
|
+
|
|
23
|
+
export const PORTABLE_RESULT_SCHEMA_ID = 'tiinex.portable.operation.result.v1';
|
|
24
|
+
export const PORTABLE_SCHEMA_CHAIN_SCHEMA_ID = 'tiinex.portable.schema-chain.v1';
|
|
25
|
+
|
|
26
|
+
export async function preparePortableTaskOperation(input = {}, options = {}) {
|
|
27
|
+
const result = await preparePortableTask(input, options);
|
|
28
|
+
return operationResult('prepare-task', {
|
|
29
|
+
task: result.task,
|
|
30
|
+
status: result.status,
|
|
31
|
+
route: result.route,
|
|
32
|
+
host: result.host,
|
|
33
|
+
result: result.result,
|
|
34
|
+
nextAction: result.nextAction,
|
|
35
|
+
boundary: result.boundary,
|
|
36
|
+
findings: result.findings
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function discoverPortableTooling(input = {}, options = {}) {
|
|
41
|
+
const result = discoverPortableHostCapabilities(input, options);
|
|
42
|
+
return operationResult('discover-tooling', {
|
|
43
|
+
profile: result.profile,
|
|
44
|
+
routes: result.routes,
|
|
45
|
+
findings: result.findings
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function listPortableProviders(input = {}, options = {}) {
|
|
50
|
+
const result = listPortableMaterialProviders(input, options);
|
|
51
|
+
return operationResult('list-material-providers', {
|
|
52
|
+
providers: result.providers,
|
|
53
|
+
host: result.host,
|
|
54
|
+
findings: result.findings
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function resolvePortableSchemaMaterialOperation(input = {}, options = {}) {
|
|
59
|
+
const result = await resolvePortableSchemaMaterial(input, options);
|
|
60
|
+
return operationResult('resolve-schema-material', {
|
|
61
|
+
requestedSchema: result.requestedSchema,
|
|
62
|
+
status: result.status,
|
|
63
|
+
material: result.material,
|
|
64
|
+
providerCatalog: result.providerCatalog,
|
|
65
|
+
providerRequest: result.providerRequest,
|
|
66
|
+
findings: result.findings
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export async function resolvePortableSchemaChainMaterialOperation(input = {}, options = {}) {
|
|
71
|
+
const result = await resolvePortableSchemaChainMaterial(input, options);
|
|
72
|
+
return operationResult('resolve-schema-chain-material', {
|
|
73
|
+
requestedSchema: result.requestedSchema,
|
|
74
|
+
status: result.status,
|
|
75
|
+
maxDepth: result.maxDepth,
|
|
76
|
+
nodes: result.nodes,
|
|
77
|
+
materials: result.materials,
|
|
78
|
+
providerRequest: result.providerRequest,
|
|
79
|
+
findings: result.findings
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function createPortableArtifactDraft(input = {}, options = {}) {
|
|
84
|
+
const result = createPortableLocalDraft(input, options);
|
|
85
|
+
return operationResult('create-local-draft', {
|
|
86
|
+
status: result.status,
|
|
87
|
+
schemaId: result.schemaId,
|
|
88
|
+
draft: result.draft,
|
|
89
|
+
plan: result.plan,
|
|
90
|
+
guide: result.guide,
|
|
91
|
+
validation: result.validation || null,
|
|
92
|
+
qualification: result.qualification,
|
|
93
|
+
findings: result.findings
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function updatePortableArtifactDraft(input = {}, options = {}) {
|
|
98
|
+
const result = updatePortableLocalDraft(input, options);
|
|
99
|
+
return operationResult('update-local-draft', {
|
|
100
|
+
status: result.status,
|
|
101
|
+
draft: result.draft,
|
|
102
|
+
previous: result.previous || null,
|
|
103
|
+
validation: result.validation || null,
|
|
104
|
+
qualification: result.qualification || null,
|
|
105
|
+
findings: result.findings
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function deletePortableArtifactDraft(input = {}, options = {}) {
|
|
110
|
+
const result = deletePortableLocalDraft(input, options);
|
|
111
|
+
return operationResult('delete-local-draft', {
|
|
112
|
+
status: result.status,
|
|
113
|
+
deletion: result.deletion,
|
|
114
|
+
findings: result.findings
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function stagePortableArtifactDraft(input = {}, options = {}) {
|
|
119
|
+
const result = stagePortableDraft(input, options);
|
|
120
|
+
return operationResult('stage-draft', {
|
|
121
|
+
status: result.status,
|
|
122
|
+
stagedArtifact: result.stagedArtifact,
|
|
123
|
+
validation: result.validation,
|
|
124
|
+
findings: result.findings
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function inspectPortableAssetIndex(input = {}, options = {}) {
|
|
129
|
+
const result = inspectPortableAssets(input, options);
|
|
130
|
+
return operationResult('inspect-assets', {
|
|
131
|
+
boundary: result.boundary,
|
|
132
|
+
assets: result.assets,
|
|
133
|
+
counts: result.counts,
|
|
134
|
+
findings: result.findings
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function preparePortableAssetAnalysisOperation(input = {}, options = {}) {
|
|
139
|
+
const result = preparePortableAssetAnalysis(input, options);
|
|
140
|
+
return operationResult('prepare-asset-analysis', {
|
|
141
|
+
status: result.status,
|
|
142
|
+
request: result.request,
|
|
143
|
+
host: result.host,
|
|
144
|
+
findings: result.findings
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function inspectPortableMaterial(input = {}, options = {}) {
|
|
149
|
+
const material = normalizePortableInput(input);
|
|
150
|
+
const records = material.records.map((record) => {
|
|
151
|
+
const parsed = parseArtifactMarkdown(record.markdown || '');
|
|
152
|
+
const declaredSchemaId = record.schemaId || record.kind || parsed.envelope?.current?.schema?.id || '';
|
|
153
|
+
const resolution = resolveSchemaCapabilities({ schemaId: declaredSchemaId }, { capability: 'read' });
|
|
154
|
+
const presentation = schemaReadPresentation(record, options.presentation || {});
|
|
155
|
+
return Object.freeze({
|
|
156
|
+
id: record.id,
|
|
157
|
+
path: record.path,
|
|
158
|
+
title: record.title,
|
|
159
|
+
summary: record.summary,
|
|
160
|
+
declaredSchemaId,
|
|
161
|
+
resolvedCompanionId: presentation.companionId || resolution.descriptor?.moduleId || '',
|
|
162
|
+
sourceMode: record.sourceMode || '',
|
|
163
|
+
sourceBoundary: record.source?.boundary || record.boundary || '',
|
|
164
|
+
sourceQualification: record.source?.provenanceQualification || (record.source?.adapterId === 'local' ? 'local-supplied' : 'explicit-supplied'),
|
|
165
|
+
hasContinuityContext: Boolean(record.hasContinuityContext),
|
|
166
|
+
hasIntegrity: Boolean(record.hasIntegrity),
|
|
167
|
+
parent: Object.freeze({
|
|
168
|
+
schemaId: record.parentSchemaId || '',
|
|
169
|
+
trace: record.trace || '',
|
|
170
|
+
origin: record.origin || '',
|
|
171
|
+
boundary: record.boundary || ''
|
|
172
|
+
}),
|
|
173
|
+
body: Object.freeze({
|
|
174
|
+
title: parsed.body?.title || '',
|
|
175
|
+
sections: Object.freeze([...(parsed.body?.sections || [])])
|
|
176
|
+
}),
|
|
177
|
+
presentation,
|
|
178
|
+
resolvedBinding: schemaCanonicalBinding(record),
|
|
179
|
+
qualification: qualifyCapabilityResolution(resolution, 'read'),
|
|
180
|
+
...(options.includeMarkdown ? { markdown: record.markdown || '' } : {})
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
return operationResult('inspect', {
|
|
184
|
+
boundary: material.boundary,
|
|
185
|
+
files: material.files,
|
|
186
|
+
records,
|
|
187
|
+
assets: material.assets,
|
|
188
|
+
workspaceEntries: material.workspaceEntries,
|
|
189
|
+
findings: material.findings
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function auditPortableMaterial(input = {}, options = {}) {
|
|
194
|
+
const material = normalizePortableInput(input);
|
|
195
|
+
const shared = auditPortableRecords(material.records, options);
|
|
196
|
+
const findings = [...material.findings, ...(shared.findings || [])];
|
|
197
|
+
return operationResult('audit', {
|
|
198
|
+
boundary: Object.freeze({ ...material.boundary, sharedCapability: shared.boundary }),
|
|
199
|
+
audits: shared.audits,
|
|
200
|
+
findings
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function resolvePortableLineage(input = {}, options = {}) {
|
|
205
|
+
const material = normalizePortableInput(input);
|
|
206
|
+
const resolved = resolveLineage(material.records, { depth: options.depth || 'loaded-portable' });
|
|
207
|
+
const traversal = traverseLoadedLineage(material.records, {
|
|
208
|
+
resolvedLineage: resolved,
|
|
209
|
+
startIds: options.startIds || options.startId || options.selectedId,
|
|
210
|
+
direction: options.direction || 'ancestors',
|
|
211
|
+
maxDepth: options.maxDepth ?? options.depthLimit ?? 3
|
|
212
|
+
});
|
|
213
|
+
const findings = [...material.findings, ...(resolved.findings || []), ...(traversal.findings || [])];
|
|
214
|
+
return operationResult('resolve-lineage', {
|
|
215
|
+
boundary: Object.freeze({ ...material.boundary, lineage: 'loaded-only; no remote fetch; no inferred edges' }),
|
|
216
|
+
lineage: sanitizeLineage(resolved),
|
|
217
|
+
traversal: sanitizeTraversal(traversal),
|
|
218
|
+
findings
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export function resolvePortableCapabilities(input = {}, options = {}) {
|
|
223
|
+
const schemaIds = normalizeSchemaIds(input.schemaIds || input.schemaId || options.schemaIds || options.schemaId);
|
|
224
|
+
const capability = String(input.capability || options.capability || '').trim();
|
|
225
|
+
const findings = [];
|
|
226
|
+
if (!schemaIds.length) findings.push(portableFinding('error', 'portable.capability.schema.required', 'At least one schema id is required for capability resolution.'));
|
|
227
|
+
const resolutions = schemaIds.map((schemaId) => {
|
|
228
|
+
const resolution = resolveSchemaCapabilities({ schemaId, checksum: input.checksum || '' }, { capability });
|
|
229
|
+
return Object.freeze({
|
|
230
|
+
requested: resolution.requested,
|
|
231
|
+
status: resolution.status,
|
|
232
|
+
fallbackUsed: resolution.fallbackUsed,
|
|
233
|
+
unresolvedSchemaId: resolution.unresolvedSchemaId,
|
|
234
|
+
descriptor: resolution.descriptor,
|
|
235
|
+
capability: resolution.capability,
|
|
236
|
+
qualification: qualifyCapabilityResolution(resolution, capability)
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
findings.push(...resolutions.flatMap((item) => item.descriptor?.findings || []));
|
|
240
|
+
return operationResult('resolve-capabilities', {
|
|
241
|
+
capability,
|
|
242
|
+
resolverBoundary: Object.freeze({ mode: 'site-exact-or-direct-root', semanticParentCapabilityFallback: false }),
|
|
243
|
+
resolutions,
|
|
244
|
+
findings
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function inspectPortableCreationContract(input = {}, options = {}) {
|
|
249
|
+
const schemaId = String(input.schemaId || options.schemaId || '').trim();
|
|
250
|
+
const transitionType = String(input.transitionType || options.transitionType || 'create-artifact').trim();
|
|
251
|
+
const contract = buildArtifactCreationContract({ schemaId, transitionType });
|
|
252
|
+
const validation = validateArtifactCreationContract(contract);
|
|
253
|
+
return operationResult('inspect-creation-contract', {
|
|
254
|
+
contract,
|
|
255
|
+
validation,
|
|
256
|
+
qualification: qualifyCreationContract(contract),
|
|
257
|
+
findings: [...(contract.findings || []), ...(validation.findings || [])]
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function describePortableSchemaChain(input = {}, options = {}) {
|
|
262
|
+
const schemaId = String(input.schemaId || options.schemaId || '').trim();
|
|
263
|
+
const sourceInput = input.materials || input;
|
|
264
|
+
const maxDepth = normalizeDepth(options.maxDepth ?? input.maxDepth ?? 16, 16);
|
|
265
|
+
const findings = [];
|
|
266
|
+
const nodes = [];
|
|
267
|
+
const seen = new Set();
|
|
268
|
+
let current = schemaId;
|
|
269
|
+
let status = 'partial';
|
|
270
|
+
|
|
271
|
+
if (!current) findings.push(portableFinding('error', 'portable.schema-chain.schema.required', 'Schema chain resolution requires a schema id.'));
|
|
272
|
+
while (current && nodes.length < maxDepth) {
|
|
273
|
+
if (seen.has(current)) {
|
|
274
|
+
findings.push(portableFinding('error', 'portable.schema-chain.cycle', 'Schema parent chain contains a cycle.', { schemaId: current }));
|
|
275
|
+
status = 'cycle';
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
seen.add(current);
|
|
279
|
+
const module = schemaRegistry.byId.get(current) || null;
|
|
280
|
+
const material = findSchemaMaterial(current, sourceInput);
|
|
281
|
+
const materialParent = suppliedSchemaParentId(current, sourceInput);
|
|
282
|
+
const parentSchemaId = String(module?.parentSchemaId || materialParent || '').trim();
|
|
283
|
+
const capabilityResolution = resolveSchemaCapabilities({ schemaId: current });
|
|
284
|
+
nodes.push(Object.freeze({
|
|
285
|
+
schemaId: current,
|
|
286
|
+
registered: Boolean(module),
|
|
287
|
+
moduleId: module?.id || '',
|
|
288
|
+
parentSchemaId,
|
|
289
|
+
parentSource: module?.parentSchemaId ? 'registered-module' : (materialParent ? 'supplied-schema-material' : 'unavailable'),
|
|
290
|
+
suppliedSchema: material ? Object.freeze({ path: material.path, role: material.role, authority: material.authority }) : null,
|
|
291
|
+
binding: module ? Object.freeze({
|
|
292
|
+
schemaId: module.binding?.schemaId || module.id || '',
|
|
293
|
+
sourcePath: module.binding?.sourcePath || '',
|
|
294
|
+
sourceRepository: module.binding?.sourceRepository || '',
|
|
295
|
+
sourceCommit: module.binding?.sourceCommit || '',
|
|
296
|
+
snapshot: module.binding?.snapshot || ''
|
|
297
|
+
}) : null,
|
|
298
|
+
registeredCapabilities: module ? Object.freeze({
|
|
299
|
+
read: capabilityResolution.descriptor?.actions?.read?.status || '',
|
|
300
|
+
validate: capabilityResolution.descriptor?.actions?.validate?.status || '',
|
|
301
|
+
create: capabilityResolution.descriptor?.actions?.create?.status || '',
|
|
302
|
+
fallback: capabilityResolution.descriptor?.actions?.fallback?.status || ''
|
|
303
|
+
}) : null,
|
|
304
|
+
runtimeResolution: Object.freeze({
|
|
305
|
+
status: capabilityResolution.status || '',
|
|
306
|
+
fallbackUsed: Boolean(capabilityResolution.fallbackUsed),
|
|
307
|
+
resolvedModuleId: capabilityResolution.descriptor?.moduleId || ''
|
|
308
|
+
})
|
|
309
|
+
}));
|
|
310
|
+
if (current === 'tiinex.root.v1' || !parentSchemaId) {
|
|
311
|
+
status = current === 'tiinex.root.v1' ? 'complete-to-root' : 'partial';
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
current = parentSchemaId;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (current && nodes.length >= maxDepth && status !== 'complete-to-root') findings.push(portableFinding('warning', 'portable.schema-chain.depth-limit', 'Schema chain stopped at the configured depth limit.', { maxDepth }));
|
|
318
|
+
const requestedRegistered = Boolean(schemaRegistry.byId.get(schemaId));
|
|
319
|
+
const runtimeFallback = !requestedRegistered ? Object.freeze({ used: true, mode: 'direct-root', semanticParentCapabilityFallback: false }) : Object.freeze({ used: false, mode: 'none', semanticParentCapabilityFallback: false });
|
|
320
|
+
if (!requestedRegistered) findings.push(portableFinding('info', 'portable.schema-chain.runtime-root-fallback', 'The current shared runtime resolves an unregistered schema directly to Root; this does not assert that Root is its semantic parent.', { schemaId }));
|
|
321
|
+
|
|
322
|
+
return operationResult('describe-schema-chain', {
|
|
323
|
+
chain: Object.freeze({
|
|
324
|
+
schema: PORTABLE_SCHEMA_CHAIN_SCHEMA_ID,
|
|
325
|
+
requestedSchema: schemaId,
|
|
326
|
+
status,
|
|
327
|
+
maxDepth,
|
|
328
|
+
nodes: Object.freeze(nodes),
|
|
329
|
+
runtimeFallback
|
|
330
|
+
}),
|
|
331
|
+
findings
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export function makePortableWriterBrief(input = {}, options = {}) {
|
|
336
|
+
const schemaId = String(input.schemaId || options.schemaId || '').trim();
|
|
337
|
+
const transitionType = String(input.transitionType || options.transitionType || 'create-artifact').trim();
|
|
338
|
+
const sourceInput = input.materials || input;
|
|
339
|
+
const contract = buildArtifactCreationContract({ schemaId, transitionType });
|
|
340
|
+
const schemaMaterial = findSchemaMaterial(schemaId, sourceInput);
|
|
341
|
+
const exact = contract.status === 'ready';
|
|
342
|
+
const mode = exact ? 'exact-create-tooling-available' : schemaMaterial ? 'llm-writer-fallback' : 'parent-or-root-artifact-only';
|
|
343
|
+
const baseQualification = qualifyCreationContract(contract);
|
|
344
|
+
const qualification = qualifyWriterBrief({ mode, base: baseQualification, requestedSchema: schemaId });
|
|
345
|
+
const chainResult = describePortableSchemaChain({ ...sourceInput, schemaId }, { maxDepth: options.maxDepth ?? 16 });
|
|
346
|
+
const findings = [...(chainResult.findings || [])];
|
|
347
|
+
if (mode === 'llm-writer-fallback') findings.push(portableFinding('warning', 'portable.writer.llm-fallback', 'Exact child creation tooling is unavailable; writing is delegated to an LLM or human using supplied readable schema material.', { schemaId }));
|
|
348
|
+
if (mode === 'parent-or-root-artifact-only') findings.push(portableFinding('error', 'portable.writer.schema-material.unavailable', 'Requested child creation is blocked because exact tooling and readable child schema material are unavailable.', { schemaId }));
|
|
349
|
+
if (mode === 'exact-create-tooling-available') findings.push(portableFinding('info', 'portable.writer.exact-tooling.available', 'Exact create tooling is available in the site core; this first portable batch exposes planning only and does not execute durable creation.', { schemaId }));
|
|
350
|
+
return operationResult('make-writer-brief', {
|
|
351
|
+
mode,
|
|
352
|
+
requestedSchema: schemaId,
|
|
353
|
+
transitionType,
|
|
354
|
+
schemaMaterial: schemaMaterial ? Object.freeze({
|
|
355
|
+
schemaId: schemaMaterial.schemaId,
|
|
356
|
+
path: schemaMaterial.path,
|
|
357
|
+
role: schemaMaterial.role,
|
|
358
|
+
authority: schemaMaterial.authority,
|
|
359
|
+
...(options.includeSchemaMarkdown === false ? {} : { markdown: schemaMaterial.markdown })
|
|
360
|
+
}) : Object.freeze({ available: false }),
|
|
361
|
+
schemaChain: chainResult.chain,
|
|
362
|
+
creationContract: contract,
|
|
363
|
+
qualification,
|
|
364
|
+
instructions: writerInstructions({ mode, schemaId, schemaMaterial, qualification }),
|
|
365
|
+
findings
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function compilePortableSchemaGuide(input = {}, options = {}) {
|
|
370
|
+
const result = buildPortableSchemaGuide(input, options);
|
|
371
|
+
return operationResult('schema-guide', { guide: result.guide, findings: result.findings });
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export function readPortableSchemaSection(input = {}, options = {}) {
|
|
375
|
+
const result = readPortableSchemaGuideSections(input, options);
|
|
376
|
+
return operationResult('read-schema-section', {
|
|
377
|
+
schemaId: result.schemaId,
|
|
378
|
+
selectors: result.selectors,
|
|
379
|
+
matches: result.matches,
|
|
380
|
+
truncated: result.truncated,
|
|
381
|
+
authority: result.authority || '',
|
|
382
|
+
path: result.path || '',
|
|
383
|
+
findings: result.findings || []
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export function planPortableArtifactCreation(input = {}, options = {}) {
|
|
388
|
+
const result = planPortableArtifact(input, options);
|
|
389
|
+
return operationResult('plan-artifact', { plan: result.plan, guide: result.guide, findings: result.findings });
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export function validatePortableArtifactDraft(input = {}, options = {}) {
|
|
393
|
+
const validation = validatePortableDraft(input, options);
|
|
394
|
+
return operationResult('validate-draft', { validation, findings: validation.findings || [] });
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export function explainPortableArtifactFindings(input = {}, options = {}) {
|
|
398
|
+
const explanation = explainPortableFindings(input, options);
|
|
399
|
+
const findings = Array.isArray(input?.findings) ? input.findings : input?.validation?.findings || input?.audit?.findings || [];
|
|
400
|
+
return operationResult('explain-findings', { explanation, findings });
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export function planPortableArtifactRepairs(input = {}, options = {}) {
|
|
404
|
+
const repairPlan = buildPortableRepairPlan(input, options);
|
|
405
|
+
const findings = Array.isArray(input?.findings) ? input.findings : input?.validation?.findings || input?.audit?.findings || [];
|
|
406
|
+
return operationResult('repair-plan', { repairPlan, findings });
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function sanitizeLineage(result = {}) {
|
|
410
|
+
return Object.freeze({
|
|
411
|
+
schema: result.schema,
|
|
412
|
+
nodes: Object.freeze((result.nodes || []).map((node) => Object.freeze({
|
|
413
|
+
id: node.id,
|
|
414
|
+
title: node.title,
|
|
415
|
+
path: node.path,
|
|
416
|
+
schemaId: node.schemaId,
|
|
417
|
+
sourceId: node.sourceId,
|
|
418
|
+
sourceMode: node.sourceMode,
|
|
419
|
+
boundary: node.boundary,
|
|
420
|
+
trace: node.trace,
|
|
421
|
+
origin: node.origin,
|
|
422
|
+
parentSchemaId: node.parentSchemaId,
|
|
423
|
+
hasContinuityContext: node.hasContinuityContext,
|
|
424
|
+
hasIntegrity: node.hasIntegrity
|
|
425
|
+
}))),
|
|
426
|
+
edges: Object.freeze(result.edges || []),
|
|
427
|
+
findings: Object.freeze(result.findings || []),
|
|
428
|
+
stats: result.stats || {},
|
|
429
|
+
options: result.options || {}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function sanitizeTraversal(result = {}) {
|
|
434
|
+
return Object.freeze({
|
|
435
|
+
schema: result.schema,
|
|
436
|
+
boundary: result.boundary,
|
|
437
|
+
direction: result.direction,
|
|
438
|
+
maxDepth: result.maxDepth,
|
|
439
|
+
startIds: result.startIds,
|
|
440
|
+
nodes: result.nodes,
|
|
441
|
+
edges: result.edges,
|
|
442
|
+
missingEdges: result.missingEdges,
|
|
443
|
+
findings: result.findings,
|
|
444
|
+
stats: result.stats
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function writerInstructions({ mode, schemaId, schemaMaterial, qualification }) {
|
|
449
|
+
if (mode === 'exact-create-tooling-available') return Object.freeze([
|
|
450
|
+
'Use the exact registered create companion and creation contract.',
|
|
451
|
+
'Keep the draft local and validate the result before export or publication.',
|
|
452
|
+
'Do not inherit a parent source object or perform a remote write.',
|
|
453
|
+
'This portable batch describes the operation but does not execute durable creation.'
|
|
454
|
+
]);
|
|
455
|
+
if (mode === 'llm-writer-fallback') return Object.freeze([
|
|
456
|
+
`Read the supplied ${schemaId} schema artifact before writing.`,
|
|
457
|
+
'Read every supplied or registered parent in the reported schema chain and preserve the Root continuity envelope.',
|
|
458
|
+
'Write a transparent local draft from the readable contract; do not invent source provenance or unavailable facts.',
|
|
459
|
+
'Run all available validation and report child semantic qualification as partial unless exact child validation is available.',
|
|
460
|
+
`Do not claim exact child create tooling. Schema material: ${schemaMaterial.path}`
|
|
461
|
+
]);
|
|
462
|
+
return Object.freeze([
|
|
463
|
+
`Do not guess the ${schemaId || 'unknown'} child format because its schema material and exact create tooling are unavailable.`,
|
|
464
|
+
'Preserve the intended content or create a genuine supported parent/Root artifact instead.',
|
|
465
|
+
'Record the unavailable schema as a blocking limitation and request the schema artifact.',
|
|
466
|
+
...(qualification.limitations || [])
|
|
467
|
+
]);
|
|
468
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { normalizeFinding as normalizeSharedFinding } from '../../validation/findings.js';
|
|
2
|
+
|
|
3
|
+
export const PORTABLE_FINDING_SOURCE = 'tiinex.portable.tooling.v1';
|
|
4
|
+
export const PORTABLE_FINDING_ENVELOPE_SCHEMA_ID = 'tiinex.validation.finding.v1';
|
|
5
|
+
|
|
6
|
+
export function portableFinding(severity, code, message, extra = {}) {
|
|
7
|
+
const metadata = serializableExtra(extra);
|
|
8
|
+
const normalized = normalizeSharedFinding({
|
|
9
|
+
severity: normalizeSeverity(severity),
|
|
10
|
+
code: String(code || 'portable.finding'),
|
|
11
|
+
messageKey: String(extra.messageKey || code || 'portable.finding'),
|
|
12
|
+
message: String(message || 'Portable tooling finding.'),
|
|
13
|
+
source: String(extra.source || PORTABLE_FINDING_SOURCE),
|
|
14
|
+
fixability: extra.fixability,
|
|
15
|
+
params: extra.params,
|
|
16
|
+
evidencePath: extra.evidencePath || extra.ref || '',
|
|
17
|
+
qualification: extra.qualification || ''
|
|
18
|
+
}, { schemaId: extra.schemaId || '' });
|
|
19
|
+
return Object.freeze({
|
|
20
|
+
...normalized,
|
|
21
|
+
...metadata,
|
|
22
|
+
schema: PORTABLE_FINDING_ENVELOPE_SCHEMA_ID
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function normalizePortableFinding(finding = {}, fallback = {}) {
|
|
27
|
+
return portableFinding(
|
|
28
|
+
finding.severity || fallback.severity || 'info',
|
|
29
|
+
finding.code || fallback.code || 'portable.finding',
|
|
30
|
+
finding.message || fallback.message || 'Portable tooling finding.',
|
|
31
|
+
{ ...fallback, ...finding }
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function dedupePortableFindings(findings = []) {
|
|
36
|
+
const seen = new Set();
|
|
37
|
+
const out = [];
|
|
38
|
+
for (const raw of Array.isArray(findings) ? findings : []) {
|
|
39
|
+
const finding = normalizePortableFinding(raw);
|
|
40
|
+
const key = [
|
|
41
|
+
finding.code,
|
|
42
|
+
finding.source || '',
|
|
43
|
+
finding.evidencePath || finding.ref || '',
|
|
44
|
+
finding.nodeId || '',
|
|
45
|
+
finding.target || '',
|
|
46
|
+
stableParams(finding.params)
|
|
47
|
+
].join(':');
|
|
48
|
+
if (seen.has(key)) continue;
|
|
49
|
+
seen.add(key);
|
|
50
|
+
out.push(finding);
|
|
51
|
+
}
|
|
52
|
+
return Object.freeze(out);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function summarizePortableFindings(findings = []) {
|
|
56
|
+
const normalized = dedupePortableFindings(findings);
|
|
57
|
+
const counts = { error: 0, warning: 0, info: 0 };
|
|
58
|
+
for (const finding of normalized) counts[normalizeSeverity(finding.severity)] += 1;
|
|
59
|
+
return Object.freeze({
|
|
60
|
+
status: counts.error ? 'invalid' : counts.warning ? 'degraded' : 'clean',
|
|
61
|
+
counts: Object.freeze({ ...counts, total: normalized.length })
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function normalizeSeverity(value = '') {
|
|
66
|
+
const severity = String(value || '').toLowerCase();
|
|
67
|
+
if (severity === 'error' || severity === 'warning') return severity;
|
|
68
|
+
return 'info';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function serializableExtra(extra = {}) {
|
|
72
|
+
const out = {};
|
|
73
|
+
for (const [key, value] of Object.entries(extra || {})) {
|
|
74
|
+
if (['schema', 'severity', 'code', 'messageKey', 'message', 'source', 'fixability', 'params', 'evidencePath', 'qualification'].includes(key)) continue;
|
|
75
|
+
if (typeof value === 'function' || typeof value === 'undefined') continue;
|
|
76
|
+
out[key] = value;
|
|
77
|
+
}
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function stableParams(value = {}) {
|
|
82
|
+
if (!value || typeof value !== 'object') return '';
|
|
83
|
+
return JSON.stringify(sortValue(value));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function sortValue(value) {
|
|
87
|
+
if (Array.isArray(value)) return value.map(sortValue);
|
|
88
|
+
if (!value || typeof value !== 'object') return value;
|
|
89
|
+
const out = {};
|
|
90
|
+
for (const key of Object.keys(value).sort()) out[key] = sortValue(value[key]);
|
|
91
|
+
return out;
|
|
92
|
+
}
|