@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.
Files changed (517) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +31 -0
  3. package/README.md +45 -0
  4. package/package.json +176 -0
  5. package/src/actions/record.actions.js +312 -0
  6. package/src/adapters/adapter.contracts.js +143 -0
  7. package/src/adapters/archive/archive.adapter.js +502 -0
  8. package/src/adapters/archive/archive.portableChangeset.js +141 -0
  9. package/src/adapters/archive/archive.transport.js +124 -0
  10. package/src/artifacts/artifact.localDraft.js +27 -0
  11. package/src/artifacts/artifact.normalize.js +28 -0
  12. package/src/artifacts/artifact.parse.js +207 -0
  13. package/src/artifacts/artifact.record.js +83 -0
  14. package/src/audit/audit.run.js +103 -0
  15. package/src/audit/audit.summary.js +7 -0
  16. package/src/diagnostics/sourceBoundary.report.js +112 -0
  17. package/src/export/package.apply.js +349 -0
  18. package/src/export/package.builder.js +366 -0
  19. package/src/export/package.bytes.js +164 -0
  20. package/src/export/package.controlIntegrity.js +42 -0
  21. package/src/export/package.controlTopology.js +97 -0
  22. package/src/export/package.fileMap.js +174 -0
  23. package/src/export/package.manifest.js +401 -0
  24. package/src/export/package.preflight.js +204 -0
  25. package/src/export/package.sourceReference.js +81 -0
  26. package/src/export/package.workspaceContext.js +144 -0
  27. package/src/export/package.zip.js +128 -0
  28. package/src/export/tree.bundle.js +278 -0
  29. package/src/governance/governance.boundary.js +196 -0
  30. package/src/integrity/integrity.c14nV2.js +190 -0
  31. package/src/integrity/integrity.methodReference.js +73 -0
  32. package/src/integrity/integrity.validate.js +56 -0
  33. package/src/lineage/lineage.candidateResolution.js +46 -0
  34. package/src/lineage/lineage.githubIssueComment.js +106 -0
  35. package/src/lineage/lineage.githubIssueLocal.js +196 -0
  36. package/src/lineage/lineage.githubIssueTarget.js +89 -0
  37. package/src/lineage/lineage.integrity.js +133 -0
  38. package/src/lineage/lineage.materialPreference.js +26 -0
  39. package/src/lineage/lineage.model.js +63 -0
  40. package/src/lineage/lineage.parentAuthority.js +5 -0
  41. package/src/lineage/lineage.parentBinding.js +104 -0
  42. package/src/lineage/lineage.pathBasis.js +47 -0
  43. package/src/lineage/lineage.resolve.js +388 -0
  44. package/src/lineage/lineage.sourceScope.js +74 -0
  45. package/src/lineage/lineage.targetKeys.js +80 -0
  46. package/src/lineage/lineage.traverse.js +132 -0
  47. package/src/public/applicationProjection.js +236 -0
  48. package/src/public/companionResources.js +246 -0
  49. package/src/public/index.js +16 -0
  50. package/src/public/node.js +2 -0
  51. package/src/public/schemaAncestry.js +26 -0
  52. package/src/publication/publication.contract.js +196 -0
  53. package/src/publication/publication.preflight.js +159 -0
  54. package/src/publication/publication.targetContract.js +241 -0
  55. package/src/reingest/reingest.plan.js +162 -0
  56. package/src/release/plan.mjs +28 -0
  57. package/src/release/policy.mjs +100 -0
  58. package/src/release/run.mjs +74 -0
  59. package/src/schemas/capability.registry.js +226 -0
  60. package/src/schemas/companion.js +245 -0
  61. package/src/schemas/contracts.js +6 -0
  62. package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.js +14 -0
  63. package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.json +23 -0
  64. package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.runtime.json +4283 -0
  65. package/src/schemas/coordination/handoff/tiinex.handoff.v1.schema.source.js +9 -0
  66. package/src/schemas/coordination/project/tiinex.project.v1.schema.js +26 -0
  67. package/src/schemas/coordination/project/tiinex.project.v1.schema.json +23 -0
  68. package/src/schemas/coordination/project/tiinex.project.v1.schema.runtime.json +1985 -0
  69. package/src/schemas/coordination/project/tiinex.project.v1.schema.source.js +9 -0
  70. package/src/schemas/core/decision/tiinex.decision.v1.schema.js +14 -0
  71. package/src/schemas/core/decision/tiinex.decision.v1.schema.json +24 -0
  72. package/src/schemas/core/decision/tiinex.decision.v1.schema.runtime.json +1700 -0
  73. package/src/schemas/core/decision/tiinex.decision.v1.schema.source.js +9 -0
  74. package/src/schemas/core/evidence/tiinex.evidence.v1.capabilities.js +14 -0
  75. package/src/schemas/core/evidence/tiinex.evidence.v1.en.i18n.json +6 -0
  76. package/src/schemas/core/evidence/tiinex.evidence.v1.findings.js +9 -0
  77. package/src/schemas/core/evidence/tiinex.evidence.v1.presenter.js +1 -0
  78. package/src/schemas/core/evidence/tiinex.evidence.v1.schema.js +32 -0
  79. package/src/schemas/core/evidence/tiinex.evidence.v1.schema.json +24 -0
  80. package/src/schemas/core/evidence/tiinex.evidence.v1.schema.runtime.json +2184 -0
  81. package/src/schemas/core/evidence/tiinex.evidence.v1.schema.source.js +9 -0
  82. package/src/schemas/core/evidence/tiinex.evidence.v1.sv.i18n.json +6 -0
  83. package/src/schemas/core/evidence/tiinex.evidence.v1.transitions.js +1 -0
  84. package/src/schemas/core/evidence/tiinex.evidence.v1.validate.js +10 -0
  85. package/src/schemas/core/feedback/tiinex.feedback.v1.schema.js +14 -0
  86. package/src/schemas/core/feedback/tiinex.feedback.v1.schema.json +23 -0
  87. package/src/schemas/core/feedback/tiinex.feedback.v1.schema.runtime.json +1773 -0
  88. package/src/schemas/core/feedback/tiinex.feedback.v1.schema.source.js +9 -0
  89. package/src/schemas/core/interpretation/tiinex.interpretation.v1.capabilities.js +11 -0
  90. package/src/schemas/core/interpretation/tiinex.interpretation.v1.contract.js +40 -0
  91. package/src/schemas/core/interpretation/tiinex.interpretation.v1.en.i18n.json +9 -0
  92. package/src/schemas/core/interpretation/tiinex.interpretation.v1.findings.js +12 -0
  93. package/src/schemas/core/interpretation/tiinex.interpretation.v1.localMaterialization.js +89 -0
  94. package/src/schemas/core/interpretation/tiinex.interpretation.v1.presenter.js +8 -0
  95. package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.js +34 -0
  96. package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.json +23 -0
  97. package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.runtime.json +2029 -0
  98. package/src/schemas/core/interpretation/tiinex.interpretation.v1.schema.source.js +9 -0
  99. package/src/schemas/core/interpretation/tiinex.interpretation.v1.sv.i18n.json +9 -0
  100. package/src/schemas/core/interpretation/tiinex.interpretation.v1.transitions.js +1 -0
  101. package/src/schemas/core/interpretation/tiinex.interpretation.v1.validate.js +25 -0
  102. package/src/schemas/core/preservation/tiinex.preservation.v1.capabilities.js +14 -0
  103. package/src/schemas/core/preservation/tiinex.preservation.v1.en.i18n.json +6 -0
  104. package/src/schemas/core/preservation/tiinex.preservation.v1.findings.js +9 -0
  105. package/src/schemas/core/preservation/tiinex.preservation.v1.presenter.js +1 -0
  106. package/src/schemas/core/preservation/tiinex.preservation.v1.schema.js +31 -0
  107. package/src/schemas/core/preservation/tiinex.preservation.v1.schema.json +23 -0
  108. package/src/schemas/core/preservation/tiinex.preservation.v1.schema.runtime.json +2033 -0
  109. package/src/schemas/core/preservation/tiinex.preservation.v1.schema.source.js +9 -0
  110. package/src/schemas/core/preservation/tiinex.preservation.v1.sv.i18n.json +6 -0
  111. package/src/schemas/core/preservation/tiinex.preservation.v1.transitions.js +1 -0
  112. package/src/schemas/core/preservation/tiinex.preservation.v1.validate.js +10 -0
  113. package/src/schemas/core/relation/tiinex.relation.v1.capabilities.js +7 -0
  114. package/src/schemas/core/relation/tiinex.relation.v1.contract.js +3 -0
  115. package/src/schemas/core/relation/tiinex.relation.v1.en.i18n.json +4 -0
  116. package/src/schemas/core/relation/tiinex.relation.v1.findings.js +9 -0
  117. package/src/schemas/core/relation/tiinex.relation.v1.localMaterialization.js +153 -0
  118. package/src/schemas/core/relation/tiinex.relation.v1.presenter.js +3 -0
  119. package/src/schemas/core/relation/tiinex.relation.v1.schema.js +20 -0
  120. package/src/schemas/core/relation/tiinex.relation.v1.schema.json +23 -0
  121. package/src/schemas/core/relation/tiinex.relation.v1.schema.runtime.json +1668 -0
  122. package/src/schemas/core/relation/tiinex.relation.v1.schema.source.js +9 -0
  123. package/src/schemas/core/relation/tiinex.relation.v1.sv.i18n.json +4 -0
  124. package/src/schemas/core/relation/tiinex.relation.v1.transitions.js +1 -0
  125. package/src/schemas/core/relation/tiinex.relation.v1.validate.js +36 -0
  126. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.capabilities.js +14 -0
  127. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.contract.js +57 -0
  128. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.en.i18n.json +4 -0
  129. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.findings.js +13 -0
  130. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.presenter.js +3 -0
  131. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.js +20 -0
  132. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.json +24 -0
  133. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.runtime.json +3315 -0
  134. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.schema.source.js +9 -0
  135. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.sv.i18n.json +4 -0
  136. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.transitions.js +1 -0
  137. package/src/schemas/core/relation/workspace/representation/tiinex.workspace.representation.v1.validate.js +78 -0
  138. package/src/schemas/core/signal/tiinex.signal.v1.schema.js +14 -0
  139. package/src/schemas/core/signal/tiinex.signal.v1.schema.json +23 -0
  140. package/src/schemas/core/signal/tiinex.signal.v1.schema.runtime.json +1733 -0
  141. package/src/schemas/core/signal/tiinex.signal.v1.schema.source.js +9 -0
  142. package/src/schemas/core/task/tiinex.task.v1.capabilities.js +11 -0
  143. package/src/schemas/core/task/tiinex.task.v1.contract.js +3 -0
  144. package/src/schemas/core/task/tiinex.task.v1.en.i18n.json +15 -0
  145. package/src/schemas/core/task/tiinex.task.v1.findings.js +18 -0
  146. package/src/schemas/core/task/tiinex.task.v1.localMaterialization.js +148 -0
  147. package/src/schemas/core/task/tiinex.task.v1.presenter.js +8 -0
  148. package/src/schemas/core/task/tiinex.task.v1.schema.js +35 -0
  149. package/src/schemas/core/task/tiinex.task.v1.schema.json +23 -0
  150. package/src/schemas/core/task/tiinex.task.v1.schema.runtime.json +1708 -0
  151. package/src/schemas/core/task/tiinex.task.v1.schema.source.js +9 -0
  152. package/src/schemas/core/task/tiinex.task.v1.sv.i18n.json +15 -0
  153. package/src/schemas/core/task/tiinex.task.v1.transitions.js +3 -0
  154. package/src/schemas/core/task/tiinex.task.v1.validate.js +41 -0
  155. package/src/schemas/core/topic/tiinex.topic.v1.capabilities.js +14 -0
  156. package/src/schemas/core/topic/tiinex.topic.v1.creation.js +46 -0
  157. package/src/schemas/core/topic/tiinex.topic.v1.en.i18n.json +8 -0
  158. package/src/schemas/core/topic/tiinex.topic.v1.findings.js +11 -0
  159. package/src/schemas/core/topic/tiinex.topic.v1.localMaterialization.js +135 -0
  160. package/src/schemas/core/topic/tiinex.topic.v1.presenter.js +1 -0
  161. package/src/schemas/core/topic/tiinex.topic.v1.schema.js +34 -0
  162. package/src/schemas/core/topic/tiinex.topic.v1.schema.json +23 -0
  163. package/src/schemas/core/topic/tiinex.topic.v1.schema.runtime.json +1699 -0
  164. package/src/schemas/core/topic/tiinex.topic.v1.schema.source.js +9 -0
  165. package/src/schemas/core/topic/tiinex.topic.v1.sv.i18n.json +8 -0
  166. package/src/schemas/core/topic/tiinex.topic.v1.transitions.js +31 -0
  167. package/src/schemas/core/topic/tiinex.topic.v1.validate.js +11 -0
  168. package/src/schemas/creation.capability.js +289 -0
  169. package/src/schemas/creation.contracts.js +334 -0
  170. package/src/schemas/creation.executionSnapshot.js +79 -0
  171. package/src/schemas/creation.factoryQualification.js +73 -0
  172. package/src/schemas/creation.renderer.js +244 -0
  173. package/src/schemas/creation.representation.js +279 -0
  174. package/src/schemas/creation.rootMetadata.js +6 -0
  175. package/src/schemas/creation.schemaReferences.js +65 -0
  176. package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.js +14 -0
  177. package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.json +23 -0
  178. package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.runtime.json +1873 -0
  179. package/src/schemas/discovery/finding/tiinex.discovery.finding.v1.schema.source.js +9 -0
  180. package/src/schemas/discovery/tiinex.discovery.v1.schema.js +14 -0
  181. package/src/schemas/discovery/tiinex.discovery.v1.schema.json +23 -0
  182. package/src/schemas/discovery/tiinex.discovery.v1.schema.runtime.json +1839 -0
  183. package/src/schemas/discovery/tiinex.discovery.v1.schema.source.js +9 -0
  184. package/src/schemas/generic.artifact.module.js +25 -0
  185. package/src/schemas/party/organization/tiinex.party.organization.v1.schema.js +26 -0
  186. package/src/schemas/party/organization/tiinex.party.organization.v1.schema.json +23 -0
  187. package/src/schemas/party/organization/tiinex.party.organization.v1.schema.runtime.json +2249 -0
  188. package/src/schemas/party/organization/tiinex.party.organization.v1.schema.source.js +9 -0
  189. package/src/schemas/party/role/tiinex.party.role.v1.schema.js +26 -0
  190. package/src/schemas/party/role/tiinex.party.role.v1.schema.json +24 -0
  191. package/src/schemas/party/role/tiinex.party.role.v1.schema.runtime.json +2091 -0
  192. package/src/schemas/party/role/tiinex.party.role.v1.schema.source.js +9 -0
  193. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.capabilities.js +14 -0
  194. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.en.i18n.json +4 -0
  195. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.findings.js +1 -0
  196. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.presenter.js +1 -0
  197. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.js +29 -0
  198. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.json +21 -0
  199. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.runtime.json +2180 -0
  200. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.schema.source.js +9 -0
  201. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.sv.i18n.json +4 -0
  202. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.transitions.js +1 -0
  203. package/src/schemas/presentation/surface/tiinex.presentation.surface.v1.validate.js +1 -0
  204. package/src/schemas/reduction/tiinex.reduction.v1.schema.js +26 -0
  205. package/src/schemas/reduction/tiinex.reduction.v1.schema.json +23 -0
  206. package/src/schemas/reduction/tiinex.reduction.v1.schema.runtime.json +1733 -0
  207. package/src/schemas/reduction/tiinex.reduction.v1.schema.source.js +9 -0
  208. package/src/schemas/reference.shapes.js +33 -0
  209. package/src/schemas/registry.js +36 -0
  210. package/src/schemas/resolver.js +13 -0
  211. package/src/schemas/schema/module/tiinex.schema.module.v1.capabilities.js +14 -0
  212. package/src/schemas/schema/module/tiinex.schema.module.v1.en.i18n.json +4 -0
  213. package/src/schemas/schema/module/tiinex.schema.module.v1.findings.js +1 -0
  214. package/src/schemas/schema/module/tiinex.schema.module.v1.presenter.js +1 -0
  215. package/src/schemas/schema/module/tiinex.schema.module.v1.schema.js +29 -0
  216. package/src/schemas/schema/module/tiinex.schema.module.v1.schema.json +21 -0
  217. package/src/schemas/schema/module/tiinex.schema.module.v1.schema.runtime.json +2093 -0
  218. package/src/schemas/schema/module/tiinex.schema.module.v1.schema.source.js +9 -0
  219. package/src/schemas/schema/module/tiinex.schema.module.v1.sv.i18n.json +4 -0
  220. package/src/schemas/schema/module/tiinex.schema.module.v1.transitions.js +1 -0
  221. package/src/schemas/schema/module/tiinex.schema.module.v1.validate.js +1 -0
  222. package/src/schemas/schema.factory.descriptor.js +104 -0
  223. package/src/schemas/schema.githubSourceTarget.js +131 -0
  224. package/src/schemas/schema.identity.js +10 -0
  225. package/src/schemas/schema.reference.js +133 -0
  226. package/src/schemas/schema.source.js +239 -0
  227. package/src/schemas/tiinex.root.v1.capabilities.js +14 -0
  228. package/src/schemas/tiinex.root.v1.classify.js +55 -0
  229. package/src/schemas/tiinex.root.v1.en.i18n.json +24 -0
  230. package/src/schemas/tiinex.root.v1.fallback.js +84 -0
  231. package/src/schemas/tiinex.root.v1.findings.js +19 -0
  232. package/src/schemas/tiinex.root.v1.presenter.js +5 -0
  233. package/src/schemas/tiinex.root.v1.schema.js +29 -0
  234. package/src/schemas/tiinex.root.v1.schema.json +24 -0
  235. package/src/schemas/tiinex.root.v1.schema.runtime.json +1574 -0
  236. package/src/schemas/tiinex.root.v1.schema.source.js +9 -0
  237. package/src/schemas/tiinex.root.v1.sv.i18n.json +24 -0
  238. package/src/schemas/tiinex.root.v1.transitions.js +1 -0
  239. package/src/schemas/tiinex.root.v1.validate.js +36 -0
  240. package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.js +14 -0
  241. package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.json +23 -0
  242. package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.runtime.json +2027 -0
  243. package/src/schemas/validation/finding/tiinex.validation.finding.v1.schema.source.js +9 -0
  244. package/src/schemas/validation/method/tiinex.validation.method.v1.schema.js +14 -0
  245. package/src/schemas/validation/method/tiinex.validation.method.v1.schema.json +23 -0
  246. package/src/schemas/validation/method/tiinex.validation.method.v1.schema.runtime.json +1848 -0
  247. package/src/schemas/validation/method/tiinex.validation.method.v1.schema.source.js +9 -0
  248. package/src/schemas/validation/report/tiinex.validation.report.v1.schema.js +14 -0
  249. package/src/schemas/validation/report/tiinex.validation.report.v1.schema.json +23 -0
  250. package/src/schemas/validation/report/tiinex.validation.report.v1.schema.runtime.json +2015 -0
  251. package/src/schemas/validation/report/tiinex.validation.report.v1.schema.source.js +9 -0
  252. package/src/schemas/workspace/tiinex.workspace.v1.capabilities.js +12 -0
  253. package/src/schemas/workspace/tiinex.workspace.v1.en.i18n.json +7 -0
  254. package/src/schemas/workspace/tiinex.workspace.v1.findings.js +5 -0
  255. package/src/schemas/workspace/tiinex.workspace.v1.presenter.js +27 -0
  256. package/src/schemas/workspace/tiinex.workspace.v1.schema.js +30 -0
  257. package/src/schemas/workspace/tiinex.workspace.v1.schema.json +23 -0
  258. package/src/schemas/workspace/tiinex.workspace.v1.schema.runtime.json +1596 -0
  259. package/src/schemas/workspace/tiinex.workspace.v1.schema.source.js +9 -0
  260. package/src/schemas/workspace/tiinex.workspace.v1.sv.i18n.json +7 -0
  261. package/src/schemas/workspace/tiinex.workspace.v1.transitions.js +10 -0
  262. package/src/schemas/workspace/tiinex.workspace.v1.validate.js +10 -0
  263. package/src/sources/github/github.issueTarget.js +127 -0
  264. package/src/sources/origin.references.js +249 -0
  265. package/src/sources/source.explicitTargets.js +49 -0
  266. package/src/sources/transport.levels.js +107 -0
  267. package/src/tooling/portable/adapters/cli/cli.cold-start-input.js +34 -0
  268. package/src/tooling/portable/adapters/cli/cli.command-input.js +455 -0
  269. package/src/tooling/portable/adapters/cli/cli.common-author.js +249 -0
  270. package/src/tooling/portable/adapters/cli/cli.common-output.js +330 -0
  271. package/src/tooling/portable/adapters/cli/cli.editor-assistance.js +13 -0
  272. package/src/tooling/portable/adapters/cli/cli.ground-materialize.js +96 -0
  273. package/src/tooling/portable/adapters/cli/cli.ground-recovery.js +99 -0
  274. package/src/tooling/portable/adapters/cli/cli.handoff-manufacture.js +345 -0
  275. package/src/tooling/portable/adapters/cli/cli.handoff-sibling-allocation.js +31 -0
  276. package/src/tooling/portable/adapters/cli/cli.help.js +80 -0
  277. package/src/tooling/portable/adapters/cli/cli.land.js +13 -0
  278. package/src/tooling/portable/adapters/cli/cli.local-output.js +72 -0
  279. package/src/tooling/portable/adapters/cli/cli.material-policy.js +6 -0
  280. package/src/tooling/portable/adapters/cli/cli.operator-bridge.js +18 -0
  281. package/src/tooling/portable/adapters/cli/cli.reduction-input.js +14 -0
  282. package/src/tooling/portable/adapters/cli/cli.run.js +434 -0
  283. package/src/tooling/portable/adapters/llm/llm.entrypoint.js +34 -0
  284. package/src/tooling/portable/adapters/node/checkpoint.verify.js +267 -0
  285. package/src/tooling/portable/adapters/node/handoff.manufacture.bootstrap.js +109 -0
  286. package/src/tooling/portable/adapters/node/handoff.manufacture.enumeration.js +94 -0
  287. package/src/tooling/portable/adapters/node/handoff.manufacture.js +193 -0
  288. package/src/tooling/portable/adapters/node/handoff.manufacture.multiRoot.js +49 -0
  289. package/src/tooling/portable/adapters/node/handoff.manufacture.packageParent.js +130 -0
  290. package/src/tooling/portable/adapters/node/handoff.manufacture.requirements.js +353 -0
  291. package/src/tooling/portable/adapters/node/handoff.manufacture.scope.js +147 -0
  292. package/src/tooling/portable/adapters/node/workspaceCarrier.manufacture.js +62 -0
  293. package/src/tooling/portable/assets/asset.operations.js +170 -0
  294. package/src/tooling/portable/audit/audit.capability.js +119 -0
  295. package/src/tooling/portable/bootstrap/artifact.result.selfverify.mjs +109 -0
  296. package/src/tooling/portable/bootstrap/bootstrap.case.mjs +43 -0
  297. package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.md +814 -0
  298. package/src/tooling/portable/bootstrap/tiinex.llm.bootstrap.pointer.json +25 -0
  299. package/src/tooling/portable/checkpoint/portable.checkpoint.js +89 -0
  300. package/src/tooling/portable/conformance/checkpoint.qualification.js +271 -0
  301. package/src/tooling/portable/draft/draft.create.js +389 -0
  302. package/src/tooling/portable/draft/draft.crud.js +175 -0
  303. package/src/tooling/portable/draft/draft.exact.js +173 -0
  304. package/src/tooling/portable/draft/draft.operations.js +265 -0
  305. package/src/tooling/portable/draft/draft.qualification.js +45 -0
  306. package/src/tooling/portable/draft/draft.set.js +193 -0
  307. package/src/tooling/portable/draft/draft.validation-context.js +7 -0
  308. package/src/tooling/portable/editor/authoring.parent.js +37 -0
  309. package/src/tooling/portable/editor/editor.assistance.js +221 -0
  310. package/src/tooling/portable/editor/staged.validation.js +96 -0
  311. package/src/tooling/portable/engine.facade.js +468 -0
  312. package/src/tooling/portable/findings.js +92 -0
  313. package/src/tooling/portable/grounding/grounding.capsule.js +128 -0
  314. package/src/tooling/portable/grounding/grounding.continuity.js +283 -0
  315. package/src/tooling/portable/grounding/grounding.participantAuthority.js +20 -0
  316. package/src/tooling/portable/grounding/grounding.planningContext.js +34 -0
  317. package/src/tooling/portable/grounding/grounding.readiness.authority.js +17 -0
  318. package/src/tooling/portable/grounding/grounding.readiness.js +316 -0
  319. package/src/tooling/portable/grounding/grounding.readiness.support.js +245 -0
  320. package/src/tooling/portable/grounding/grounding.sourceEvidence.js +71 -0
  321. package/src/tooling/portable/grounding/grounding.workContext.js +72 -0
  322. package/src/tooling/portable/grounding/grounding.workProvenance.js +153 -0
  323. package/src/tooling/portable/handoff/carrierLineage.js +214 -0
  324. package/src/tooling/portable/handoff/carrierProfile.js +54 -0
  325. package/src/tooling/portable/handoff/carrierProjection.js +193 -0
  326. package/src/tooling/portable/handoff/carrierProjection.routeQualification.js +228 -0
  327. package/src/tooling/portable/handoff/carrierProjection.shared.js +7 -0
  328. package/src/tooling/portable/handoff/carrierProjection.workspaces.js +54 -0
  329. package/src/tooling/portable/handoff/coldConsumerEntrypoint.js +185 -0
  330. package/src/tooling/portable/handoff/coldStartQualification.contract.js +184 -0
  331. package/src/tooling/portable/handoff/coldStartQualification.grounding.js +392 -0
  332. package/src/tooling/portable/handoff/coldStartQualification.js +22 -0
  333. package/src/tooling/portable/handoff/coldStartQualification.materials.js +364 -0
  334. package/src/tooling/portable/handoff/coldStartQualification.observation.js +220 -0
  335. package/src/tooling/portable/handoff/coldStartQualification.run.js +81 -0
  336. package/src/tooling/portable/handoff/coldStartQualification.shared.js +57 -0
  337. package/src/tooling/portable/handoff/coldStartRolePointers.js +39 -0
  338. package/src/tooling/portable/handoff/contextAudit.js +247 -0
  339. package/src/tooling/portable/handoff/contracts/tiinex.handoff.package.v1.schema.md +409 -0
  340. package/src/tooling/portable/handoff/handoffAuthoringPlan.js +35 -0
  341. package/src/tooling/portable/handoff/handoffEndpointProjection.js +61 -0
  342. package/src/tooling/portable/handoff/handoffLeafProjection.js +91 -0
  343. package/src/tooling/portable/handoff/humanOutputPresentation.js +21 -0
  344. package/src/tooling/portable/handoff/manufacture.js +84 -0
  345. package/src/tooling/portable/handoff/materialClosure.archiveV2.binding.js +72 -0
  346. package/src/tooling/portable/handoff/materialClosure.archiveV2.direct.js +160 -0
  347. package/src/tooling/portable/handoff/materialClosure.archiveV2.indexes.js +36 -0
  348. package/src/tooling/portable/handoff/materialClosure.archiveV2.js +247 -0
  349. package/src/tooling/portable/handoff/materialClosure.archiveV2.projectionProvider.js +44 -0
  350. package/src/tooling/portable/handoff/materialClosure.archiveV2.workspace.js +226 -0
  351. package/src/tooling/portable/handoff/materialClosure.descriptor.js +169 -0
  352. package/src/tooling/portable/handoff/materialClosure.inputBinding.js +372 -0
  353. package/src/tooling/portable/handoff/materialClosure.inputBinding.support.js +62 -0
  354. package/src/tooling/portable/handoff/materialClosure.materialized.js +143 -0
  355. package/src/tooling/portable/handoff/materialClosure.materials.js +116 -0
  356. package/src/tooling/portable/handoff/materialClosure.package.js +181 -0
  357. package/src/tooling/portable/handoff/materialClosure.plan.js +204 -0
  358. package/src/tooling/portable/handoff/materialClosure.readiness.js +36 -0
  359. package/src/tooling/portable/handoff/materialClosure.requirements.js +137 -0
  360. package/src/tooling/portable/handoff/operatorContextProjection.js +105 -0
  361. package/src/tooling/portable/handoff/pointerEntrypoint.js +138 -0
  362. package/src/tooling/portable/handoff/qualifiedHandoffFixture.js +34 -0
  363. package/src/tooling/portable/handoff/recipientV2.artifactFirst.build.js +321 -0
  364. package/src/tooling/portable/handoff/recipientV2.artifactFirst.closure.js +126 -0
  365. package/src/tooling/portable/handoff/recipientV2.artifactFirst.inspect.js +194 -0
  366. package/src/tooling/portable/handoff/recipientV2.artifactFirst.materials.js +207 -0
  367. package/src/tooling/portable/handoff/recipientV2.artifactFirst.projection.js +69 -0
  368. package/src/tooling/portable/handoff/recipientV2.artifactFirst.roles.js +166 -0
  369. package/src/tooling/portable/handoff/recipientV2.artifactFirst.routes.js +113 -0
  370. package/src/tooling/portable/handoff/recipientV2.artifactFirst.shared.js +87 -0
  371. package/src/tooling/portable/handoff/recipientV2.artifactFirst.workspaces.js +160 -0
  372. package/src/tooling/portable/handoff/recipientV2.artifactFirstPhase1.js +44 -0
  373. package/src/tooling/portable/handoff/recipientV2.artifactInspection.js +55 -0
  374. package/src/tooling/portable/handoff/recipientV2.artifacts.js +174 -0
  375. package/src/tooling/portable/handoff/recipientV2.coldProjection.js +24 -0
  376. package/src/tooling/portable/handoff/recipientV2.delivery.js +48 -0
  377. package/src/tooling/portable/handoff/recipientV2.endpointRolePointers.js +179 -0
  378. package/src/tooling/portable/handoff/recipientV2.entryContract.js +28 -0
  379. package/src/tooling/portable/handoff/recipientV2.humanOutput.js +78 -0
  380. package/src/tooling/portable/handoff/recipientV2.inspect.helpers.js +218 -0
  381. package/src/tooling/portable/handoff/recipientV2.inspect.js +194 -0
  382. package/src/tooling/portable/handoff/recipientV2.inspect.pathToken.js +9 -0
  383. package/src/tooling/portable/handoff/recipientV2.inspect.projection.js +58 -0
  384. package/src/tooling/portable/handoff/recipientV2.inspect.workspaces.js +177 -0
  385. package/src/tooling/portable/handoff/recipientV2.lineage.js +142 -0
  386. package/src/tooling/portable/handoff/recipientV2.packageV1.build.js +147 -0
  387. package/src/tooling/portable/handoff/recipientV2.packageV1.constants.js +4 -0
  388. package/src/tooling/portable/handoff/recipientV2.packageV1.contract.js +101 -0
  389. package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.helpers.js +126 -0
  390. package/src/tooling/portable/handoff/recipientV2.packageV1.inspect.js +185 -0
  391. package/src/tooling/portable/handoff/recipientV2.packageV1.js +12 -0
  392. package/src/tooling/portable/handoff/recipientV2.packageV1.shared.js +24 -0
  393. package/src/tooling/portable/handoff/recipientV2.packageV1.workspaceProjection.js +22 -0
  394. package/src/tooling/portable/handoff/recipientV2.pointer.js +40 -0
  395. package/src/tooling/portable/handoff/recipientV2.routeSelection.js +16 -0
  396. package/src/tooling/portable/handoff/recipientV2.topology.helpers.js +20 -0
  397. package/src/tooling/portable/handoff/recipientV2.topology.js +320 -0
  398. package/src/tooling/portable/handoff/recipientV2.topology.materials.js +70 -0
  399. package/src/tooling/portable/handoff/recipientV2.topology.workspaces.js +193 -0
  400. package/src/tooling/portable/handoff/recipientV2.transportManifest.js +123 -0
  401. package/src/tooling/portable/handoff/recipientV2.workspaceRepresentation.js +163 -0
  402. package/src/tooling/portable/handoff/routeArtifactConformance.js +130 -0
  403. package/src/tooling/portable/handoff/toolingBootstrap.js +67 -0
  404. package/src/tooling/portable/handoff/transportCompanion.js +175 -0
  405. package/src/tooling/portable/handoff/workspaceByteProvider.archive.js +95 -0
  406. package/src/tooling/portable/handoff/workspaceByteProvider.js +271 -0
  407. package/src/tooling/portable/handoff/workspaceCarrier.manufacture.js +93 -0
  408. package/src/tooling/portable/handoff/workspaceLandingPlan.js +142 -0
  409. package/src/tooling/portable/handoff/workspacePackageSources.js +105 -0
  410. package/src/tooling/portable/handoff/workspaceQualifiedReference.js +10 -0
  411. package/src/tooling/portable/handoff/workspaceSourceIdentity.js +52 -0
  412. package/src/tooling/portable/handoff/workspaceTargetConformance.js +134 -0
  413. package/src/tooling/portable/host/host.capabilities.js +181 -0
  414. package/src/tooling/portable/host/tool.bindings.js +357 -0
  415. package/src/tooling/portable/host/tool.receiptNormalization.js +141 -0
  416. package/src/tooling/portable/index.js +52 -0
  417. package/src/tooling/portable/input/node.input.js +184 -0
  418. package/src/tooling/portable/input/portable.input.js +249 -0
  419. package/src/tooling/portable/lifecycle/lifecycle.action.js +11 -0
  420. package/src/tooling/portable/lifecycle/lifecycle.material.js +173 -0
  421. package/src/tooling/portable/lifecycle/lifecycle.operations.js +34 -0
  422. package/src/tooling/portable/lifecycle/lifecycle.readiness.js +247 -0
  423. package/src/tooling/portable/lineage/lineage.integrity.apply.audit.js +22 -0
  424. package/src/tooling/portable/lineage/lineage.integrity.apply.evidence.js +36 -0
  425. package/src/tooling/portable/lineage/lineage.integrity.apply.js +306 -0
  426. package/src/tooling/portable/lineage/lineage.integrity.apply.structure.js +178 -0
  427. package/src/tooling/portable/lineage/lineage.integrity.plan.js +377 -0
  428. package/src/tooling/portable/lineage/lineage.integrity.projection.human.js +82 -0
  429. package/src/tooling/portable/lineage/lineage.integrity.projection.js +349 -0
  430. package/src/tooling/portable/lineage/lineage.operations.js +32 -0
  431. package/src/tooling/portable/lineage/lineage.print.js +398 -0
  432. package/src/tooling/portable/lineage/lineage.print.render.js +88 -0
  433. package/src/tooling/portable/lineage/lineage.print.utils.js +58 -0
  434. package/src/tooling/portable/lineage/lineage.publicationProviderReceipts.js +141 -0
  435. package/src/tooling/portable/lineage/lineage.publicationQualification.js +183 -0
  436. package/src/tooling/portable/lineage/lineage.search.js +301 -0
  437. package/src/tooling/portable/live/live.artifact.js +192 -0
  438. package/src/tooling/portable/live/live.export.js +107 -0
  439. package/src/tooling/portable/live/live.lineage.closure.js +71 -0
  440. package/src/tooling/portable/live/live.lineage.js +338 -0
  441. package/src/tooling/portable/live/live.protocol.js +181 -0
  442. package/src/tooling/portable/materialization/durable.materialize.js +162 -0
  443. package/src/tooling/portable/materialization/epistemic.plan.js +239 -0
  444. package/src/tooling/portable/materialization/loaded.parent.js +54 -0
  445. package/src/tooling/portable/materialization/materialization.facade.js +30 -0
  446. package/src/tooling/portable/operation.catalog.js +393 -0
  447. package/src/tooling/portable/operation.catalog.package.js +183 -0
  448. package/src/tooling/portable/operation.result.js +25 -0
  449. package/src/tooling/portable/orchestration/task.prepare.js +191 -0
  450. package/src/tooling/portable/output/artifact.result.package.js +308 -0
  451. package/src/tooling/portable/output/deterministic.zip.js +88 -0
  452. package/src/tooling/portable/output/node.artifact-set.js +223 -0
  453. package/src/tooling/portable/output/node.draft.js +41 -0
  454. package/src/tooling/portable/output/node.zip.js +39 -0
  455. package/src/tooling/portable/output/recipientV2.zip.js +59 -0
  456. package/src/tooling/portable/overview/blockingCue.js +16 -0
  457. package/src/tooling/portable/overview/operatingOverview.js +413 -0
  458. package/src/tooling/portable/package/generation.binding.js +314 -0
  459. package/src/tooling/portable/package/generation.binding.projection.js +128 -0
  460. package/src/tooling/portable/package/material.graph.js +236 -0
  461. package/src/tooling/portable/package/runtime.package.js +321 -0
  462. package/src/tooling/portable/package/schema.transition.companion.js +196 -0
  463. package/src/tooling/portable/package/semantic.package.graph.js +272 -0
  464. package/src/tooling/portable/package/semantic.package.js +203 -0
  465. package/src/tooling/portable/package/semantic.package.schema-resolution.js +158 -0
  466. package/src/tooling/portable/package/semantic.package.transition-registry.js +189 -0
  467. package/src/tooling/portable/package/semantic.package.types.js +18 -0
  468. package/src/tooling/portable/providers/schema.bootstrap.provenance.js +10 -0
  469. package/src/tooling/portable/providers/schema.provider.qualification.js +52 -0
  470. package/src/tooling/portable/providers/schema.providers.js +458 -0
  471. package/src/tooling/portable/publication/runtime.publication.js +53 -0
  472. package/src/tooling/portable/qualification.js +150 -0
  473. package/src/tooling/portable/reduction/reduction.composition.js +229 -0
  474. package/src/tooling/portable/reduction/reduction.eligibility.helpers.js +258 -0
  475. package/src/tooling/portable/reduction/reduction.eligibility.js +191 -0
  476. package/src/tooling/portable/reduction/reduction.operations.js +30 -0
  477. package/src/tooling/portable/reduction/reduction.preflight.js +85 -0
  478. package/src/tooling/portable/reduction/reduction.shared.js +173 -0
  479. package/src/tooling/portable/schema/bootstrap/canonical.pack.js +24 -0
  480. package/src/tooling/portable/schema/bootstrap/docs-3988951208eb9a8926e84ab42625d4b42fa00c2d/party/role/tiinex.party.role.v1.schema.md +289 -0
  481. package/src/tooling/portable/schema/bootstrap/docs-3988951208eb9a8926e84ab42625d4b42fa00c2d/validation/report/tiinex.validation.report.v1.schema.md +300 -0
  482. package/src/tooling/portable/schema/bootstrap/qualified-local-root/tiinex.root.v1.runtime-projection.json +48 -0
  483. package/src/tooling/portable/schema/bootstrap/qualified-local-root/tiinex.root.v1.schema.md +865 -0
  484. package/src/tooling/portable/schema/contract.compile.js +406 -0
  485. package/src/tooling/portable/schema/contract.compile.utils.js +9 -0
  486. package/src/tooling/portable/schema/contract.constraints.js +117 -0
  487. package/src/tooling/portable/schema/contract.envelope.validate.js +177 -0
  488. package/src/tooling/portable/schema/contract.field-domain.compile.js +399 -0
  489. package/src/tooling/portable/schema/contract.field-domain.js +247 -0
  490. package/src/tooling/portable/schema/contract.field-shape.compile.js +34 -0
  491. package/src/tooling/portable/schema/contract.inheritance.inline.js +103 -0
  492. package/src/tooling/portable/schema/contract.inheritance.js +210 -0
  493. package/src/tooling/portable/schema/contract.inheritance.record.js +76 -0
  494. package/src/tooling/portable/schema/contract.machine-shape.js +309 -0
  495. package/src/tooling/portable/schema/contract.project.js +81 -0
  496. package/src/tooling/portable/schema/contract.semantic-resolution.js +82 -0
  497. package/src/tooling/portable/schema/contract.validate.js +0 -0
  498. package/src/tooling/portable/schema/lexical.shape.v1.js +338 -0
  499. package/src/tooling/portable/schema/llm.companion.js +108 -0
  500. package/src/tooling/portable/schema/named.declarations.js +162 -0
  501. package/src/tooling/portable/schema/ordinary.contract.js +193 -0
  502. package/src/tooling/portable/schema/ordinary.fields.js +205 -0
  503. package/src/tooling/portable/schema/qualifiedLocalRoot.projection.js +70 -0
  504. package/src/tooling/portable/schema/qualifiedLocalRoot.runtime.js +170 -0
  505. package/src/tooling/portable/schema/schema.contract.js +465 -0
  506. package/src/tooling/portable/schema/schema.guide.js +326 -0
  507. package/src/tooling/portable/schema/schema.snapshot.js +119 -0
  508. package/src/tooling/portable/session/portable.session.js +145 -0
  509. package/src/tooling/portable/transfer/transfer.plan.js +102 -0
  510. package/src/transitions/record.transitions.js +484 -0
  511. package/src/transitions/transition.validate.js +129 -0
  512. package/src/validation/findings.js +76 -0
  513. package/src/validation/validateArtifact.js +216 -0
  514. package/src/workspaces/workspace.entrypointCapability.js +44 -0
  515. package/src/workspaces/workspace.materialRole.js +242 -0
  516. package/src/workspaces/workspace.recordPaths.js +426 -0
  517. package/tools/tiinex-portable.mjs +6 -0
@@ -0,0 +1,137 @@
1
+ import { parseNamedDeclarationSection } from '../schema/named.declarations.js';
2
+
3
+ export const PORTABLE_HANDOFF_MATERIAL_REQUIREMENTS_SCHEMA_ID = 'tiinex.portable.handoff-material-requirements.v1';
4
+
5
+ export function projectHandoffMaterialRequirements(handoff = {}) {
6
+ const markdown = String(handoff.markdown || handoff.content || handoff.text || '');
7
+ const findings = [];
8
+ const required = projectSection(markdown, '## Required Context', 'required', findings);
9
+ const reference = projectSection(markdown, '## Reference Context', 'reference', findings);
10
+ const endpointRoles = projectEndpointRoleRequirements(markdown, findings);
11
+ return deepFreeze({
12
+ schema: PORTABLE_HANDOFF_MATERIAL_REQUIREMENTS_SCHEMA_ID,
13
+ handoff: Object.freeze({
14
+ id: String(handoff.id || handoff.path || ''),
15
+ path: String(handoff.path || ''),
16
+ reference: String(handoff.reference || handoff.permalink || ''),
17
+ semanticStatus: String(handoff.semanticStatus || handoff.validation?.status || 'unknown')
18
+ }),
19
+ required,
20
+ reference,
21
+ endpointRoles,
22
+ dependencies: Object.freeze([]),
23
+ counts: Object.freeze({ required: required.length, reference: reference.length, endpointRoles: endpointRoles.length, dependencies: 0 }),
24
+ findings: Object.freeze(findings)
25
+ });
26
+ }
27
+
28
+ export function projectParticipantRoleRequirements(participantRoles = [], scope = {}) {
29
+ const routeWorkspaceId = String(scope.workspaceId || '').trim();
30
+ const routePath = String(scope.routePath || scope.path || '').trim();
31
+ const routeToken = safeToken(`${routeWorkspaceId}-${routePath}`);
32
+ return Object.freeze((participantRoles || []).map((entry, index) => {
33
+ const role = typeof entry === 'string' ? { reference: entry } : (entry || {});
34
+ const targetWorkspaceId = String(role.workspaceId || role.targetWorkspaceId || '').trim();
35
+ const targetPath = String(role.path || role.targetPath || '').trim();
36
+ const rawReference = String(role.reference || role.referenceTarget || targetPath || '').trim();
37
+ const reference = parseMaterialReference(rawReference);
38
+ return Object.freeze({
39
+ id: `participant-role:${routeToken}:${index + 1}`,
40
+ name: String(role.label || role.roleLabel || `participant-role-${index + 1}`),
41
+ classification: 'participant-role',
42
+ roleLabel: String(role.label || role.roleLabel || ''),
43
+ material: 'Role artifact required for package-local recipient grounding',
44
+ purpose: 'package-local pre-Handoff Role grounding only; does not declare semantic participation',
45
+ availability: 'declared',
46
+ materialReference: rawReference,
47
+ reference,
48
+ routeWorkspaceId,
49
+ routePath,
50
+ targetWorkspaceId,
51
+ targetPath,
52
+ source: null,
53
+ fields: Object.freeze({ RouteWorkspace: routeWorkspaceId, RoutePath: routePath, TargetWorkspace: targetWorkspaceId, TargetPath: targetPath, Reference: rawReference })
54
+ });
55
+ }));
56
+ }
57
+
58
+ function projectSection(markdown, heading, classification, findings) {
59
+ const parsed = parseNamedDeclarationSection(markdown, heading);
60
+ findings.push(...(parsed.findings || []).map((item) => finding('warning', `portable.handoff-material.${classification}.parse.${item.code || 'finding'}`, 'Handoff context declaration parsing reported a structural finding.', { classification, ...item })));
61
+ const out = [];
62
+ for (const entry of parsed.entries || []) {
63
+ if (String(entry.name || '').trim().toLowerCase() === 'none') continue;
64
+ const fields = entry.fields || {};
65
+ const rawReference = String(fields['Material Reference'] || '').trim();
66
+ const reference = parseMaterialReference(rawReference);
67
+ out.push(Object.freeze({
68
+ id: `${classification}:${safeToken(entry.name)}`,
69
+ name: String(entry.name || ''),
70
+ classification,
71
+ material: String(fields.Material || ''),
72
+ purpose: String(fields.Purpose || ''),
73
+ availability: String(fields.Availability || 'unknown'),
74
+ materialReference: rawReference,
75
+ reference,
76
+ source: entry.source || null,
77
+ fields: Object.freeze({ ...fields })
78
+ }));
79
+ }
80
+ return Object.freeze(out);
81
+ }
82
+
83
+
84
+ function projectEndpointRoleRequirements(markdown, findings) {
85
+ const section = sectionText(markdown, 'Handoff Parties');
86
+ if (!section) return Object.freeze([]);
87
+ const out = [];
88
+ for (const side of ['From', 'To']) {
89
+ const kind = field(section, `${side} Kind`).toLowerCase();
90
+ const rawReference = field(section, `${side} Reference`);
91
+ if (kind !== 'role' || !rawReference) continue;
92
+ const reference = parseMaterialReference(rawReference);
93
+ if (!reference.exactTargetDeclared) findings.push(finding('warning', 'portable.handoff-material.endpoint-role.reference-opaque', 'Role endpoint declares a Reference that is not an exact Markdown-link target.', { side: side.toLowerCase(), reference: rawReference }));
94
+ out.push(Object.freeze({
95
+ id: `endpoint-role:${side.toLowerCase()}`,
96
+ name: field(section, side) || `${side} Role`,
97
+ classification: 'endpoint-role',
98
+ party: side.toLowerCase(),
99
+ roleLabel: field(section, side),
100
+ roleKind: kind,
101
+ material: `${side} endpoint Role artifact`,
102
+ purpose: 'cold-start endpoint Role grounding',
103
+ availability: 'declared',
104
+ materialReference: rawReference,
105
+ reference,
106
+ source: null,
107
+ fields: Object.freeze({ Side: side, Role: field(section, side), Kind: kind, Reference: rawReference })
108
+ }));
109
+ }
110
+ return Object.freeze(out);
111
+ }
112
+
113
+ function sectionText(markdown = '', heading = '') {
114
+ const match = new RegExp(`^##\\s+${escapeRe(heading)}\\s*$`, 'mi').exec(String(markdown || ''));
115
+ if (!match) return '';
116
+ const rest = String(markdown || '').slice(match.index + match[0].length);
117
+ const next = /^##\s+/m.exec(rest);
118
+ return (next ? rest.slice(0, next.index) : rest).trim();
119
+ }
120
+ function field(section = '', name = '') {
121
+ const match = String(section || '').match(new RegExp(`^\\s*-\\s+${escapeRe(name)}:\\s*(.+?)\\s*$`, 'mi'));
122
+ return String(match?.[1] || '').trim();
123
+ }
124
+ function escapeRe(value = '') { return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); }
125
+
126
+ export function parseMaterialReference(value = '') {
127
+ const raw = String(value || '').trim();
128
+ const link = raw.match(/^\[([^\]\r\n]+)\]\(([^)\s]+)\)$/);
129
+ if (link) return Object.freeze({ form: 'markdown-link', raw, label: link[1], target: link[2], exactTargetDeclared: true });
130
+ return Object.freeze({ form: raw ? 'opaque' : 'absent', raw, label: '', target: raw, exactTargetDeclared: false });
131
+ }
132
+
133
+ function safeToken(value = '') {
134
+ return String(value || '').trim().toLowerCase().replace(/[^a-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 100) || 'material';
135
+ }
136
+ function finding(severity, code, message, extra = {}) { return Object.freeze({ severity, code, message, ...extra }); }
137
+ function deepFreeze(value) { if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value; for (const child of Object.values(value)) deepFreeze(child); return Object.freeze(value); }
@@ -0,0 +1,105 @@
1
+ import path from 'node:path';
2
+ import { projectQualifiedHandoffEndpoints } from './handoffEndpointProjection.js';
3
+ import { projectQualifiedHandoffLeaves } from './handoffLeafProjection.js';
4
+ import { projectQualifiedWorkspacePackageSources } from './workspacePackageSources.js';
5
+
6
+ export const PORTABLE_OPERATOR_CONTEXT_SCHEMA_ID = 'tiinex.portable.operator-context.v1';
7
+
8
+ export function projectPortableOperatorContext(input = {}) {
9
+ const files = Array.isArray(input.files) ? input.files : [];
10
+ const repositories = normalizeRepositories(input.repositories || input.localRepositories || []);
11
+ const roots = normalizeRoots(input.workspaceRoots || input.roots || [], repositories);
12
+ const findings = [];
13
+ const projectedRoots = [];
14
+ const flattenedWorkspaces = [];
15
+ const flattenedLeaves = [];
16
+ const flattenedEndpoints = [];
17
+
18
+ if (!roots.length) {
19
+ findings.push(finding('error', 'portable.operator-context.roots.required', 'Operator context requires explicit Workspace roots; repository basenames or ambient process paths are not semantic Workspace identity.'));
20
+ }
21
+
22
+ for (const root of roots) {
23
+ const rootFiles = files.filter((file) => fileBelongsToRoot(file, root.root));
24
+ const rootRepositories = repositories.filter((repository) => samePath(repository.root, root.root));
25
+ const sources = projectQualifiedWorkspacePackageSources({ files: rootFiles, repositories: rootRepositories.length ? rootRepositories : repositories });
26
+ const workspaces = [];
27
+ for (const candidate of sources.candidates || []) {
28
+ const leaves = projectQualifiedHandoffLeaves({ files: rootFiles });
29
+ const endpoints = projectQualifiedHandoffEndpoints({ files: rootFiles, workspaceId: candidate.workspaceId });
30
+ const workspace = freeze({
31
+ ...candidate,
32
+ hostRootId: root.id,
33
+ hostRoot: root.root,
34
+ handoffLeaves: leaves.leaves || [],
35
+ pointerless: leaves.pointerless,
36
+ endpoints: endpoints.candidates || []
37
+ });
38
+ workspaces.push(workspace);
39
+ flattenedWorkspaces.push(workspace);
40
+ for (const leaf of workspace.handoffLeaves) flattenedLeaves.push(freeze({ ...leaf, workspaceId: candidate.workspaceId, hostRootId: root.id, hostRoot: root.root }));
41
+ for (const endpoint of workspace.endpoints) flattenedEndpoints.push(freeze({ ...endpoint, hostRootId: root.id, hostRoot: root.root }));
42
+ }
43
+ findings.push(...(sources.findings || []).map((item) => finding(item.severity || 'warning', item.code || 'portable.operator-context.workspace-source', item.message || 'Workspace source projection finding.', { ...(item.context || {}), hostRootId: root.id, hostRoot: root.root })));
44
+ projectedRoots.push(freeze({ id: root.id, root: root.root, repository: rootRepositories[0] || null, workspaces }));
45
+ }
46
+
47
+ const workspaceIds = new Map();
48
+ for (const workspace of flattenedWorkspaces) workspaceIds.set(workspace.workspaceId, (workspaceIds.get(workspace.workspaceId) || 0) + 1);
49
+ for (const [workspaceId, count] of workspaceIds.entries()) {
50
+ if (count > 1) findings.push(finding('error', 'portable.operator-context.workspace-id.ambiguous', 'Multiple explicit roots projected the same package-local Workspace identity; the host must not collapse them by repository basename.', { workspaceId, count }));
51
+ }
52
+
53
+ const status = findings.some((item) => item.severity === 'error') ? 'blocked' : 'ready';
54
+ const pointerless = freeze({
55
+ selectionLabel: 'No Handoff pointer',
56
+ packageRole: 'recipient-facing-workspace-carrier',
57
+ semanticState: 'qualified-canonical-docs',
58
+ manufactureState: status === 'ready' ? 'ready' : 'blocked',
59
+ blockerCode: status === 'ready' ? '' : 'portable.operator-context.blocked',
60
+ consequence: 'Workspace transport only — no Handoff semantics.'
61
+ });
62
+ return freeze({
63
+ schema: PORTABLE_OPERATOR_CONTEXT_SCHEMA_ID,
64
+ status,
65
+ roots: projectedRoots,
66
+ workspaces: flattenedWorkspaces.sort((a, b) => a.workspaceId.localeCompare(b.workspaceId) || a.workspaceTargetPath.localeCompare(b.workspaceTargetPath)),
67
+ handoffLeaves: flattenedLeaves.sort((a, b) => a.workspaceId.localeCompare(b.workspaceId) || a.path.localeCompare(b.path)),
68
+ endpoints: dedupeEndpoints(flattenedEndpoints),
69
+ pointerless,
70
+ findings,
71
+ operationBoundary: { sourceMutation: false, remoteWrite: false, manufacture: false, identityInference: false },
72
+ boundary: 'Projects one multi-root operator context from explicit host roots. Qualified Workspace artifact identity remains distinct from physical repository identity; Role/Party endpoints and Handoff leaves are shared-core projections, and No Handoff pointer remains explicit.'
73
+ });
74
+ }
75
+
76
+ function normalizeRoots(value = [], repositories = []) {
77
+ const supplied = Array.isArray(value) ? value : [];
78
+ const list = supplied.length ? supplied : repositories.map((repository) => ({ id: repository.id || repository.root, root: repository.root }));
79
+ const seen = new Set();
80
+ const roots = [];
81
+ for (const item of list) {
82
+ const root = path.resolve(String(item?.root || item?.path || '')).replace(/\\/g, '/').replace(/\/$/, '');
83
+ if (!root || seen.has(root)) continue;
84
+ seen.add(root);
85
+ roots.push(freeze({ id: String(item?.id || root), root }));
86
+ }
87
+ return roots;
88
+ }
89
+ function normalizeRepositories(value = []) {
90
+ return (Array.isArray(value) ? value : []).map((item) => freeze({ ...item, id: String(item?.id || item?.root || ''), root: path.resolve(String(item?.root || item?.id || '')).replace(/\\/g, '/').replace(/\/$/, '') })).filter((item) => item.root);
91
+ }
92
+ function fileBelongsToRoot(file = {}, root = '') {
93
+ const localPath = String(file?.locator?.localPath || '').replace(/\\/g, '/');
94
+ if (!localPath || !root) return false;
95
+ const base = String(root).replace(/\\/g, '/').replace(/\/$/, '');
96
+ return localPath === base || localPath.startsWith(`${base}/`);
97
+ }
98
+ function samePath(a = '', b = '') { return String(a || '').replace(/\\/g, '/').replace(/\/$/, '') === String(b || '').replace(/\\/g, '/').replace(/\/$/, ''); }
99
+ function dedupeEndpoints(candidates = []) {
100
+ const byTarget = new Map();
101
+ for (const candidate of candidates) byTarget.set(candidate.target, candidate);
102
+ return [...byTarget.values()].sort((a, b) => a.kind.localeCompare(b.kind) || a.label.localeCompare(b.label) || a.target.localeCompare(b.target));
103
+ }
104
+ function finding(severity, code, message, context = {}) { return freeze({ severity, code, message, context }); }
105
+ 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)]))); }
@@ -0,0 +1,138 @@
1
+ import { packageFileBytes, sha256Hex, utf8Bytes } from '../../../export/package.bytes.js';
2
+ import { canonicalC14nV2SelfState, sealC14nV2Self } from '../../../integrity/integrity.c14nV2.js';
3
+ import { C14N_V2_VALIDATOR_TARGET } from '../../../integrity/integrity.methodReference.js';
4
+ import { inspectHandoffCarrierProjection } from './carrierProjection.js';
5
+ import { qualifyTiinexRouteArtifact } from './routeArtifactConformance.js';
6
+
7
+ export const HANDOFF_POINTER_ENTRYPOINT_PROJECTION_SCHEMA_ID = 'tiinex.portable.handoff-pointer-entrypoints.v1';
8
+ export const HANDOFF_POINTER_ENTRYPOINT_INSPECTION_SCHEMA_ID = 'tiinex.portable.handoff-pointer-entrypoints.inspection.v1';
9
+ export const HANDOFF_POINTER_ENTRYPOINT_PREFIX = 'handoff-entrypoint-';
10
+ export const CANONICAL_POINTER_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/3988951208eb9a8926e84ab42625d4b42fa00c2d/.topics/.schemas/core/pointer/tiinex.pointer.v1.schema.md';
11
+
12
+ const BOUNDARY = 'Generated package-root tiinex.pointer.v1 orientation only. Pointer filename, prose, and placement have no Parent, assignment, acceptance, completion, source, package-identity, or route-selection authority; qualified package carrier/closure truth remains controlling.';
13
+
14
+ export function buildHandoffPointerEntrypoints(input = {}) {
15
+ const carrier = input.carrierProjection || input.projection || {};
16
+ const createdAt = normalizeCreatedAt(input.createdAt || '');
17
+ const qualifiedRoutes = carrier.status === 'ready' ? (carrier.routes || []).filter((route) => route.state === 'qualified') : [];
18
+ const entries = qualifiedRoutes.map((route) => buildPointerEntry(route, createdAt));
19
+ return deepFreeze({
20
+ schema: HANDOFF_POINTER_ENTRYPOINT_PROJECTION_SCHEMA_ID,
21
+ version: 1,
22
+ status: carrier.status === 'ready' && entries.length === qualifiedRoutes.length && entries.length > 0 ? 'ready' : 'blocked',
23
+ boundary: BOUNDARY,
24
+ canonicalPointerSchema: CANONICAL_POINTER_SCHEMA_TARGET,
25
+ entries: Object.freeze(entries),
26
+ authority: Object.freeze({ semanticAuthority: 'none', routeSelectionAuthority: 'package-qualified-route-membership-only', parentAuthority: false, sourceAuthority: false })
27
+ });
28
+ }
29
+
30
+ export function inspectHandoffPointerEntrypoints(bundle = {}, options = {}) {
31
+ const findings = [];
32
+ const carrierInspection = options.carrierInspection || inspectHandoffCarrierProjection(bundle);
33
+ if (carrierInspection.status !== 'valid') findings.push(finding('error', 'portable.handoff-pointer.carrier.invalid', 'Handoff Pointer entrypoints cannot qualify because package carrier truth is invalid.'));
34
+ const carrier = carrierInspection.projection || {};
35
+ const createdAt = packageCreatedAt(bundle);
36
+ const expected = buildHandoffPointerEntrypoints({ carrierProjection: carrier, createdAt });
37
+ const actualFiles = (bundle.files || []).filter((file) => isHandoffPointerEntrypointPath(file.path));
38
+ const actualByPath = new Map();
39
+ for (const file of actualFiles) {
40
+ const path = String(file.path || '');
41
+ const list = actualByPath.get(path) || [];
42
+ list.push(file);
43
+ actualByPath.set(path, list);
44
+ }
45
+ for (const [path, files] of actualByPath) if (files.length > 1) findings.push(finding('error', 'portable.handoff-pointer.duplicate-path', 'Multiple generated Pointer carriers use the same package-root path.', { path, count: files.length }));
46
+
47
+ const expectedByPath = new Map((expected.entries || []).map((entry) => [entry.path, entry]));
48
+ const qualifiedTargets = new Set((carrier.routes || []).filter((route) => route.state === 'qualified').map((route) => String(route.pointerTarget || route.packagePath || '')));
49
+ const actualEntries = [];
50
+ for (const file of actualFiles) {
51
+ const parsed = parsePointer(file);
52
+ actualEntries.push(parsed);
53
+ if (parsed.schemaState !== 'qualified') findings.push(finding('error', 'portable.handoff-pointer.schema.invalid', 'Package-root Pointer is not an ordinary tiinex.pointer.v1 artifact.', { path: parsed.path }));
54
+ if (parsed.integrityState !== 'verified') findings.push(finding('error', 'portable.handoff-pointer.integrity.invalid', 'Package-root Pointer self integrity is not verified.', { path: parsed.path, integrityState: parsed.integrityState }));
55
+ if (parsed.conformance.status !== 'qualified') findings.push(finding('error', 'portable.handoff-pointer.conformance.invalid', 'Generated package-root Pointer fails Tiinex Root/continuity conformance.', { path: parsed.path, reasons: parsed.conformance.findings.map((item) => item.code) }));
56
+ if (parsed.targets.length !== 1) findings.push(finding('error', 'portable.handoff-pointer.target.cardinality', 'Each package route Pointer must expose exactly one explicit destination.', { path: parsed.path, count: parsed.targets.length }));
57
+ if (/^\s*-\s+Parent\b/m.test(parsed.markdown)) findings.push(finding('error', 'portable.handoff-pointer.parent.promotion', 'Generated package route Pointer must not mint Parent continuity. ', { path: parsed.path }));
58
+ for (const target of parsed.targets) if (!qualifiedTargets.has(target)) findings.push(finding('error', 'portable.handoff-pointer.target.unqualified-route', 'Pointer target is not a package-qualified Handoff route.', { path: parsed.path, target }));
59
+ const expectedEntry = expectedByPath.get(parsed.path);
60
+ if (!expectedEntry) findings.push(finding('error', 'portable.handoff-pointer.unexpected', 'Package contains an unexpected route Pointer projection.', { path: parsed.path }));
61
+ else if (parsed.markdown !== expectedEntry.markdown) findings.push(finding('error', 'portable.handoff-pointer.projection.mismatch', 'Pointer bytes diverge from the projection independently rebuilt from package route truth.', { path: parsed.path }));
62
+ }
63
+ for (const expectedEntry of expected.entries || []) if (!actualByPath.has(expectedEntry.path)) findings.push(finding('error', 'portable.handoff-pointer.missing', 'Package is missing the expected route-specific root Pointer.', { path: expectedEntry.path, routeId: expectedEntry.routeId }));
64
+ if (actualFiles.length !== (expected.entries || []).length) findings.push(finding('error', 'portable.handoff-pointer.count.mismatch', 'Package-root Pointer count diverges from qualified route count.', { actual: actualFiles.length, expected: (expected.entries || []).length }));
65
+
66
+ return deepFreeze({
67
+ schema: HANDOFF_POINTER_ENTRYPOINT_INSPECTION_SCHEMA_ID,
68
+ status: findings.some((item) => item.severity === 'error') ? 'invalid' : 'valid',
69
+ projection: expected,
70
+ entries: Object.freeze(actualEntries.map(({ markdown, ...entry }) => Object.freeze(entry))),
71
+ carrierInspection,
72
+ findings: Object.freeze(findings),
73
+ findingSummary: Object.freeze({ findings: findings.length, errors: findings.filter((item) => item.severity === 'error').length }),
74
+ boundary: BOUNDARY
75
+ });
76
+ }
77
+
78
+ export function isHandoffPointerEntrypointPath(value = '') {
79
+ const path = String(value || '');
80
+ return path.startsWith(HANDOFF_POINTER_ENTRYPOINT_PREFIX) && path.endsWith('.trace.md') && !path.includes('/');
81
+ }
82
+
83
+ function buildPointerEntry(route = {}, createdAt = '') {
84
+ const path = pointerPath(route);
85
+ const title = `Handoff route pointer — ${String(route.parties?.to || route.workspaceId || 'recipient')}`;
86
+ const unsigned = `# Continuity Context\n\n- Envelope Schema: tiinex.root.v1\n- Current\n - Current Schema: [tiinex.pointer.v1](${CANONICAL_POINTER_SCHEMA_TARGET})\n - Created At: ${createdAt}\n - Summary: Thin package-local pointer to one qualified Handoff route.\n\n---\n\n# ${title}\n\nThis generated pointer exposes one next hop only. Package carrier and closure controls remain the authority for whether that Handoff route is qualified.\n\n## Destinations\n\n- Qualified Handoff route: [${route.workspaceRelativePath}](${route.pointerTarget || route.packagePath})\n\n# Continuity Integrity\n\n- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: self\n - Value: \n`;
87
+ const sealed = sealC14nV2Self(unsigned);
88
+ if (sealed.state !== 'sealed') throw new Error(`portable.handoff-pointer.integrity.seal-failed:${sealed.reason || sealed.state}`);
89
+ return deepFreeze({
90
+ path,
91
+ routeId: String(route.id || ''),
92
+ workspaceId: String(route.workspaceId || ''),
93
+ targetPackagePath: String(route.pointerTarget || route.packagePath || ''),
94
+ targetSha256: String(route.sha256 || ''),
95
+ markdown: `${sealed.markdown}\n`,
96
+ boundary: BOUNDARY
97
+ });
98
+ }
99
+
100
+ function pointerPath(route = {}) {
101
+ const seed = String(route.id || `${route.workspaceId}:${route.workspaceRelativePath}`);
102
+ const token = slug(`${route.workspaceId}-${route.dimension || ''}-${route.parties?.to || ''}`) || 'route';
103
+ return `${HANDOFF_POINTER_ENTRYPOINT_PREFIX}${token}-${sha256Hex(utf8Bytes(seed)).slice(0, 12)}.trace.md`;
104
+ }
105
+
106
+ function parsePointer(file = {}) {
107
+ const markdown = decodeUtf8(packageFileBytes(file));
108
+ const schemaState = /Current Schema:\s*\[tiinex\.pointer\.v1\]\([^)]+\)/i.test(markdown) || /Current Schema:\s*tiinex\.pointer\.v1\b/i.test(markdown) ? 'qualified' : 'invalid';
109
+ const integrityState = canonicalC14nV2SelfState(markdown).state;
110
+ const targets = parseDestinationTargets(markdown);
111
+ const conformance = qualifyTiinexRouteArtifact({ markdown, expectedSchemaId: 'tiinex.pointer.v1', requireExactContract: false });
112
+ return Object.freeze({ path: String(file.path || ''), schemaState, integrityState, conformance, targets: Object.freeze(targets), sha256: sha256Hex(packageFileBytes(file)), markdown });
113
+ }
114
+
115
+ function parseDestinationTargets(markdown = '') {
116
+ const source = String(markdown || '');
117
+ const heading = /^##\s+Destinations\s*$/mi.exec(source);
118
+ if (!heading) return [];
119
+ const afterHeading = source.slice(heading.index + heading[0].length);
120
+ const nextHeading = /^#{1,2}\s+/m.exec(afterHeading);
121
+ const section = nextHeading ? afterHeading.slice(0, nextHeading.index) : afterHeading;
122
+ const out = [];
123
+ const link = /\[[^\]\r\n]+\]\(([^)\r\n]+)\)/g;
124
+ let found;
125
+ while ((found = link.exec(section))) out.push(String(found[1] || '').trim());
126
+ return out;
127
+ }
128
+
129
+ function packageCreatedAt(bundle = {}) {
130
+ const manifest = parseJsonFile((bundle.files || []).find((file) => String(file.path || '') === 'tiinex.package/manifest.json')) || bundle.manifest || {};
131
+ return normalizeCreatedAt(manifest.createdAt || bundle.builtAt || '');
132
+ }
133
+ function normalizeCreatedAt(value = '') { return String(value || '').trim() || '1970-01-01T00:00:00.000Z'; }
134
+ function parseJsonFile(file = null) { try { return file ? JSON.parse(decodeUtf8(packageFileBytes(file))) : null; } catch { return null; } }
135
+ function decodeUtf8(data) { try { return new TextDecoder('utf-8', { fatal: true }).decode(data); } catch { return ''; } }
136
+ function slug(value = '') { return String(value || '').trim().toLowerCase().normalize('NFKD').replace(/[\u0300-\u036f]/g, '').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 96); }
137
+ function finding(severity, code, message, extra = {}) { return Object.freeze({ severity, code, message, ...extra }); }
138
+ function deepFreeze(value) { if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value; if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) return value; for (const child of Object.values(value)) deepFreeze(child); return Object.freeze(value); }
@@ -0,0 +1,34 @@
1
+ import { sealC14nV2Self } from '../../../integrity/integrity.c14nV2.js';
2
+ import { C14N_V2_VALIDATOR_TARGET } from '../../../integrity/integrity.methodReference.js';
3
+
4
+ const ROOT_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/3988951208eb9a8926e84ab42625d4b42fa00c2d/.topics/.schemas/tiinex.root.v1.schema.md';
5
+ const HANDOFF_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/3988951208eb9a8926e84ab42625d4b42fa00c2d/.topics/.schemas/coordination/handoff/tiinex.handoff.v1.schema.md';
6
+ const TASK_SCHEMA_TARGET = 'https://github.com/Tiinex/docs/blob/053d46ce082d4ec261b82abc44ecca403d61e240/.topics/.schemas/core/task/tiinex.task.v1.schema.md';
7
+
8
+ export function qualifiedHandoffFixture(input = {}) {
9
+ const title = String(input.title || `Qualified ${input.to || 'recipient'} handoff fixture`);
10
+ const from = String(input.from || 'Anchor');
11
+ const to = String(input.to || 'Loom');
12
+ const fromReference = String(input.fromReference || '').trim();
13
+ const toReference = String(input.toReference || '').trim();
14
+ const purpose = String(input.purpose || 'qualified Handoff regression fixture');
15
+ const createdAt = String(input.createdAt || '2026-08-23 12:00:00');
16
+ const requiredContext = sectionEntries(input.requiredContext, '- none');
17
+ const referenceContext = sectionEntries(input.referenceContext, '- none');
18
+ const retainedResponsibilities = sectionEntries(input.retainedResponsibilities, '- none');
19
+ const exclusions = sectionEntries(input.exclusionsAndDependencies, '- none');
20
+ const transferKind = String(input.transferKind || 'work');
21
+ const signalKind = String(input.signalKind || 'return');
22
+ const parent = input.parent && typeof input.parent === 'object' ? input.parent : null;
23
+ const parentBlock = parent ? `- Parent\n - Parent Schema: [${String(parent.schemaId || 'tiinex.task.v1')}](${String(parent.schemaTarget || TASK_SCHEMA_TARGET)})\n - Created At: ${String(parent.createdAt || '2026-08-23 11:00:00')}\n - Trace: [Parent](${String(parent.trace || '../parent.trace.md')})\n - Origin:\n${parent.includeRelative === false ? '' : ` - [relative](${String(parent.relative || parent.trace || '../parent.trace.md')})\n`}${parent.includeBrowseGit === false ? '' : ` - [browse + git](${String(parent.browseGit || 'https://github.com/Tiinex/site/blob/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/.topics/parent.trace.md')})\n`}\n` : '';
24
+ const parentIntegrityEntry = parent ? `- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: [Parent](${String(parent.towards || parent.browseGit || 'https://github.com/Tiinex/site/blob/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/.topics/parent.trace.md')})\n - Value: ${String(parent.targetValue || '')}\n\n` : '';
25
+ const unsigned = `# Continuity Context\n\n- Envelope Schema: [tiinex.root.v1](${ROOT_SCHEMA_TARGET})\n${parentBlock}- Current\n - Current Schema: [tiinex.handoff.v1](${HANDOFF_SCHEMA_TARGET})\n - Created At: ${createdAt}\n - Authors: Fixture\n - Why: Exercise portable Handoff qualification.\n - Summary: ${title}.\n - Status: local\n\n---\n\n# ${title}\n\n## Handoff Parties\n\n- Purpose: ${purpose}\n- From: ${from}\n- From Kind: role\n${fromReference ? `- From Reference: [${from}](${fromReference})\n` : ''}- To: ${to}\n- To Kind: role\n${toReference ? `- To Reference: [${to}](${toReference})\n` : ''}\n\n## Transfers\n\n- fixture-transfer\n - Transfer Kind: ${transferKind}\n - Description: bounded fixture work\n - Boundary: fixture-only\n\n## Required Context\n\n${requiredContext}\n\n## Reference Context\n\n${referenceContext}\n\n## Retained Responsibilities\n\n${retainedResponsibilities}\n\n## Exclusions And Dependencies\n\n${exclusions}\n\n## Completion Expectation\n\n- Signal Kind: ${signalKind}\n- Signal Meaning: return the bounded fixture result\n- Return To: ${from}\n\n## Interpretation Limits\n\n- Does Not Mean: fixture routing grants semantic authority\n- Must Not Be Used To Claim: package placement or filenames override Tiinex qualification\n- Authority Limits: fixture only\n\n# Continuity Integrity\n\n${parentIntegrityEntry}- [sha256-base64url-c14n-v2](${C14N_V2_VALIDATOR_TARGET})\n - Towards: self\n - Value: \n`;
26
+ const sealed = sealC14nV2Self(unsigned);
27
+ if (sealed.state !== 'sealed') throw new Error(`qualified-handoff-fixture.seal-failed:${sealed.reason || sealed.state}`);
28
+ return `${sealed.markdown}\n`;
29
+ }
30
+
31
+ function sectionEntries(value, fallback) {
32
+ const text = value === undefined || value === null ? fallback : String(value);
33
+ return text.trim() || fallback;
34
+ }