@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,80 @@
1
+ export function portableCliHelpText(commandPrefix = '', surfaceCommand = '') {
2
+ const command = String(commandPrefix || '').trim()
3
+ || (String(process.argv[1] || '').replace(/\\/g, '/').includes('/bin/') ? 'node bin/tiinex-portable.mjs' : 'node tools/tiinex-portable.mjs');
4
+ const common = String(surfaceCommand || '').trim().toLowerCase();
5
+ const specific = commonCommandHelp(command, common);
6
+ if (specific) return specific.join('\n');
7
+ return [
8
+ 'Tiinex portable tooling',
9
+ '',
10
+ 'Common path (same command for humans and LLMs):',
11
+ `${command} ground <handoff-package.zip> --route <Continue-from> [--holder-role <recipient-role>]`,
12
+ `${command} ground <handoff-package.zip> --route <Continue-from> --holder-role <recipient-role> --continue <workspace-dir>`,
13
+ `${command} author <workspace-dir> --schema <schema-id> --path <workspace-relative-artifact> --body <body.md> [--parent <workspace-relative-parent>] [--title <title>] [--summary <summary>] [--why <why>]`,
14
+ `${command} handoff <workspace-dir>`,
15
+ '',
16
+ `Handoff aliases: ${command} orient <carrier.zip>; ${command} validate <carrier.zip>`,
17
+ `Advanced/internal catalog: ${command} operations`,
18
+ '',
19
+ 'Common boundaries:',
20
+ '- `orient`, `ground`, and public `handoff` use compact decision-first default projections; add `--full` on the same command for the complete qualified receipt.',
21
+ '- `ground` is read-only; append `--continue <workspace-dir>` only after `grounded-to-act` to materialize the selected carried Workspace and runtime-only `.tiinex/continuation.json`.',
22
+ '- `author` uses continuation state to infer ordinary Parent continuity, seal c14n-v2 integrity, audit, and stage; invalid artifacts are not retained.',
23
+ '- `handoff` uses continuation state plus the latest qualified authored Handoff to manufacture the canonical return carrier and excludes runtime-only `.tiinex` state. Normal operator completion is one Handoff package plus the exact routing text; markdown-capable hosts render that routing in a fenced code block, and do not emit loose Evidence/Handoff markdown as extra transport payloads.',
24
+ '- Remote reads/writes remain explicit host concerns. Tooling operation safety does not create or revoke semantic Task/Handoff authority.',
25
+ '',
26
+ 'Use `<common-command> --help` for focused common-path usage. Use `operations` deliberately for the advanced/internal operation catalog.'
27
+ ].join('\n');
28
+ }
29
+
30
+ function commonCommandHelp(command, surfaceCommand) {
31
+ if (surfaceCommand === 'ground') return [
32
+ 'Tiinex portable tooling — ground',
33
+ '',
34
+ `${command} ground <handoff-package.zip> --route <Continue-from> [--holder-role <recipient-role>]`,
35
+ `${command} ground <handoff-package.zip> --route <Continue-from> --holder-role <recipient-role> --continue <workspace-dir>`,
36
+ '',
37
+ 'Reads and qualifies the exact selected Handoff route. The default projection keeps readiness, recipient authority boundary, explicit consuming-session holder binding, Required Context closure, continuity/blockers, current Task identity, and exact next action compact; add `--full` for the full qualified receipt.',
38
+ 'Add `--include-required-context <requirement-id,name|all>` and/or `--include-current-work` only when exact body text is needed. `ground --continue` includes the bounded current Task body needed to proceed, retains Required Context counts and continuity/recovery state, and does not repeat qualified Required Context item paths or root-detail receipts unless explicitly requested (or `--full` is used).',
39
+ 'For a Role recipient, `--holder-role <recipient-role>` is an explicit consuming-session Role-capacity binding; it is never inferred from route selection, provider identity, or assistant/user position. Without it, the holder remains unresolved and grounding stays discussion-only. After `grounded-to-act`, `--continue` materializes the selected carried Workspace into an empty local directory and writes runtime-only `.tiinex/continuation.json`. The grounding operation itself is non-mutating; downstream work authority comes from qualified Handoff/Task/Role artifacts, not from that operation-safety fact.',
40
+ '',
41
+ `Advanced/internal catalog: ${command} operations`
42
+ ];
43
+ if (surfaceCommand === 'author') return [
44
+ 'Tiinex portable tooling — author',
45
+ '',
46
+ `${command} author <workspace-dir> --schema <schema-id> --path <workspace-relative-artifact> --body <body.md> [--parent <workspace-relative-parent>] [--title <title>] [--summary <summary>] [--why <why>]`,
47
+ '',
48
+ 'Uses qualified continuation state to infer the ordinary Parent when `--parent` is omitted, seals c14n-v2 self-integrity, audits, stages, and updates continuation state only after qualification. Invalid output is not retained.',
49
+ '',
50
+ `Advanced/internal catalog: ${command} operations`
51
+ ];
52
+ if (surfaceCommand === 'handoff') return [
53
+ 'Tiinex portable tooling — handoff',
54
+ '',
55
+ `${command} handoff <workspace-dir>`,
56
+ '',
57
+ 'Infers the latest qualified authored Handoff, selected Workspace identity/target, received package parent, unchanged sibling Workspace providers, canonical projected filename, and return output directory. The default receipt keeps output identity, routing text, closure/workspace qualification, verification, and actionable findings compact; add `--full` for the complete manufacture receipt. Normal operator completion is exactly one Handoff package plus the adjacent exact routing text. In markdown-capable hosts render that routing in a fenced code block; do not emit canonical Workspace Evidence/Handoff markdown as additional loose transport files. Runtime-only `.tiinex` state is excluded from canonical manufacture.',
58
+ '',
59
+ `Advanced/internal catalog: ${command} operations`
60
+ ];
61
+ if (surfaceCommand === 'orient') return [
62
+ 'Tiinex portable tooling — orient',
63
+ '',
64
+ `${command} orient <handoff-package.zip>`,
65
+ '',
66
+ 'Read-only recipient orientation for a supplied Handoff carrier. The default projection identifies qualified Workspaces/routes, selection, non-authority, and the exact grounding route; add `--full` for endpoint, closure, and package-detail receipts.',
67
+ '',
68
+ `Advanced/internal catalog: ${command} operations`
69
+ ];
70
+ if (surfaceCommand === 'validate') return [
71
+ 'Tiinex portable tooling — validate',
72
+ '',
73
+ `${command} validate <handoff-package.zip>`,
74
+ '',
75
+ 'Audits carried Handoff-package context and qualification evidence without mutating source material.',
76
+ '',
77
+ `Advanced/internal catalog: ${command} operations`
78
+ ];
79
+ return null;
80
+ }
@@ -0,0 +1,13 @@
1
+ export async function land(flags, material, readOptionalJson, splitFlag) {
2
+ const repositoriesValue = await readOptionalJson(flags.repositories || flags.repos);
3
+ const selectionsValue = await readOptionalJson(flags.selections);
4
+ return {
5
+ input: {
6
+ ...material,
7
+ repositories: repositoriesValue.repositories || (Array.isArray(repositoriesValue) ? repositoriesValue : []),
8
+ selections: selectionsValue.selections || selectionsValue || repositoriesValue.selections || {},
9
+ workspaceIds: splitFlag(flags.workspaces || flags['workspace-ids'])
10
+ },
11
+ options: {}
12
+ };
13
+ }
@@ -0,0 +1,72 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { writePortableLocalDraftFile } from '../../output/node.draft.js';
3
+ import { writePortableArtifactResultPackage } from '../../output/artifact.result.package.js';
4
+ import { writePortableArtifactSet, writePortableArtifactSetBundle } from '../../output/node.artifact-set.js';
5
+
6
+ export async function materializeCliLocalDraftResult(result = {}, input = {}, flags = {}) {
7
+ if (!flags.output) throw new Error('portable.cli.artifact-output.required');
8
+ const writeReceipt = await writePortableLocalDraftFile(result, flags.output, { overwrite: flags.overwrite === true });
9
+ const qualifiedPath = flags['qualified-package'] || flags['result-package'] || '';
10
+ const primaryOutput = Object.freeze({ role: 'artifact', mediaType: 'text/markdown', path: writeReceipt.outputPath, sha256: writeReceipt.sha256, bytes: writeReceipt.bytes, status: writeReceipt.status });
11
+ if (!qualifiedPath) return Object.freeze({ ...result, writeReceipt, delivery: Object.freeze({ profile: 'artifact-first', primary: primaryOutput, secondary: null }) });
12
+
13
+ const transferVerificationDocument = await readRequiredJsonDocument(flags['transfer-verification'], 'portable.cli.transfer-verification.required');
14
+ const bootstrapVerificationDocument = await readRequiredJsonDocument(flags['bootstrap-verification'], 'portable.cli.bootstrap-verification.required');
15
+ const resultPackageReceipt = await writePortableArtifactResultPackage(result, qualifiedPath, {
16
+ writeReceipt,
17
+ creationInput: input,
18
+ transferManifest: await readRequiredJson(flags['transfer-manifest'], 'portable.cli.transfer-manifest.required'),
19
+ bootstrapManifest: await readRequiredJson(flags['bootstrap-manifest'], 'portable.cli.bootstrap-manifest.required'),
20
+ transferVerification: transferVerificationDocument.value,
21
+ transferVerificationBytes: transferVerificationDocument.bytes,
22
+ bootstrapVerification: bootstrapVerificationDocument.value,
23
+ bootstrapVerificationBytes: bootstrapVerificationDocument.bytes,
24
+ taskRequest: await readRequiredText(flags['task-request'], 'portable.cli.task-request.required'),
25
+ createdAt: flags['created-at'] || '',
26
+ overwrite: flags.overwrite === true
27
+ });
28
+ return Object.freeze({ ...result, writeReceipt, resultPackageReceipt, delivery: Object.freeze({ profile: 'artifact-first-with-qualified-evidence', primary: primaryOutput, secondary: Object.freeze({ role: 'qualified-evidence', mediaType: 'application/zip', path: resultPackageReceipt.outputPath, sha256: resultPackageReceipt.sha256, bytes: resultPackageReceipt.bytes, status: resultPackageReceipt.status }) }) });
29
+ }
30
+
31
+ async function readRequiredJson(file = '', code = 'portable.cli.json-file.required') {
32
+ if (!String(file || '').trim()) throw new Error(code);
33
+ return JSON.parse(await readFile(file, 'utf8'));
34
+ }
35
+
36
+ async function readRequiredJsonDocument(file = '', code = 'portable.cli.json-file.required') {
37
+ if (!String(file || '').trim()) throw new Error(code);
38
+ const bytes = await readFile(file);
39
+ return Object.freeze({ value: JSON.parse(bytes.toString('utf8')), bytes });
40
+ }
41
+
42
+ async function readRequiredText(file = '', code = 'portable.cli.text-file.required') {
43
+ if (!String(file || '').trim()) throw new Error(code);
44
+ return readFile(file, 'utf8');
45
+ }
46
+
47
+ export async function materializeCliArtifactSetResult(result = {}, flags = {}, options = {}) {
48
+ if (options.bundlePrimary === true) {
49
+ if (!flags.bundle) throw new Error('portable.cli.live-export.bundle.required');
50
+ const bundleReceipt = await writePortableArtifactSetBundle(result, flags.bundle, { overwrite: flags.overwrite === true });
51
+ return Object.freeze({
52
+ ...result,
53
+ bundleReceipt,
54
+ delivery: Object.freeze({
55
+ profile: 'bundle-only',
56
+ primary: Object.freeze({ role: 'artifact-bundle', mediaType: 'application/zip', path: bundleReceipt.outputPath, sha256: bundleReceipt.sha256, bytes: bundleReceipt.bytes, status: bundleReceipt.status }),
57
+ secondary: null
58
+ })
59
+ });
60
+ }
61
+ if (!flags['output-dir']) throw new Error('portable.cli.artifact-set.output-dir.required');
62
+ const writeReceipt = await writePortableArtifactSet(result, flags['output-dir'], { bundlePath: flags.bundle || '', overwrite: flags.overwrite === true });
63
+ return Object.freeze({
64
+ ...result,
65
+ writeReceipt,
66
+ delivery: Object.freeze({
67
+ profile: 'artifact-first-set',
68
+ primary: Object.freeze(writeReceipt.artifacts.map((entry) => Object.freeze({ role: 'artifact', mediaType: 'text/markdown', path: entry.outputPath, sha256: entry.sha256, bytes: entry.bytes, status: 'written-local-clean' }))),
69
+ secondary: writeReceipt.bundleReceipt ? Object.freeze({ role: 'artifact-bundle', mediaType: 'application/zip', path: writeReceipt.bundleReceipt.outputPath, sha256: writeReceipt.bundleReceipt.sha256, bytes: writeReceipt.bundleReceipt.bytes, status: writeReceipt.bundleReceipt.status }) : null
70
+ })
71
+ });
72
+ }
@@ -0,0 +1,6 @@
1
+ export const OPERATIONS_WITHOUT_EXPLICIT_MATERIAL = new Set([
2
+ 'prepare-task','prepare-materialization','create-local-artifact-set','create-local-draft','plan-host-action','accept-host-receipt',
3
+ 'describe-checkpoint-gate','qualify-checkpoint','describe-schema-chain','schema-guide','plan-artifact','list-material-providers',
4
+ 'resolve-schema-material','resolve-schema-chain-material','materialize-durable-findings','build-runtime-package','roundtrip-runtime-package',
5
+ 'describe-cold-start-ingress','project-cold-start-host','qualify-cold-start','ground-cold-consumer'
6
+ ]);
@@ -0,0 +1,18 @@
1
+ export async function prepareOperatorBridgeCliInput(command = '', material = {}, flags = {}, readOptionalJson = async () => ({})) {
2
+ if (command === 'project-workspace-package-sources') {
3
+ const repositories = await readOptionalJson(flags.repositories);
4
+ return { input: { ...material, repositories: repositories.repositories || repositories }, options: {} };
5
+ }
6
+ if (command === 'project-handoff-authoring-plan') return { input: { ...material, parentPath: flags.parent || flags['parent-path'] || '', title: flags.title || '' }, options: {} };
7
+ if (command === 'project-handoff-endpoints') return { input: { ...material, workspaceId: flags['workspace-id'] || flags.workspace || 'workspace' }, options: {} };
8
+ if (command === 'project-operator-context') {
9
+ const repositories = await readOptionalJson(flags.repositories);
10
+ const workspaceRoots = await readOptionalJson(flags['workspace-roots'] || flags.roots);
11
+ return { input: { ...material, repositories: repositories.repositories || repositories, workspaceRoots: workspaceRoots.workspaces || workspaceRoots.roots || workspaceRoots }, options: {} };
12
+ }
13
+ if (command === 'project-staged-validation') {
14
+ const staged = await readOptionalJson(flags.staged || flags.paths);
15
+ return { input: { ...material, stagedPaths: staged.stagedPaths || staged.paths || (Array.isArray(staged) ? staged : []) }, options: {} };
16
+ }
17
+ return null;
18
+ }
@@ -0,0 +1,14 @@
1
+ export async function reductionPreflightCliInput({ material, flags, options, readOptionalJson, splitFlag }) {
2
+ const value = await readOptionalJson(flags['reduction-inputs'] || flags.inputs || flags['eligibility-inputs']);
3
+ const candidateSet = value.candidateSet || value.candidates || splitFlag(flags.candidate || flags.candidates);
4
+ return {
5
+ input: {
6
+ ...material,
7
+ ...value,
8
+ candidateSet,
9
+ reductionArtifactPath: flags.reduction || flags['reduction-artifact'] || value.reductionArtifactPath || value.reduction || '',
10
+ immutableSources: value.immutableSources || await readOptionalJson(flags['immutable-sources'])
11
+ },
12
+ options
13
+ };
14
+ }
@@ -0,0 +1,434 @@
1
+ import { mkdir, writeFile } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { listPortableOperations, runPortableOperation } from '../../operation.catalog.js';
4
+ import { writePortableRuntimePackageZip } from '../../output/node.zip.js';
5
+ import { materializeCliArtifactSetResult, materializeCliLocalDraftResult } from './cli.local-output.js';
6
+ import { portableCliHelpText } from './cli.help.js';
7
+ import { materializeHandoffManufactureCliOutput } from './cli.handoff-manufacture.js';
8
+ import { commandInput } from './cli.command-input.js';
9
+ import { continueGroundWithHostResult } from './cli.ground-recovery.js';
10
+ import { groundContinuationOperationInput, materializeGroundWorkspaceCliOutput } from './cli.ground-materialize.js';
11
+ import { runCommonAuthorCli } from './cli.common-author.js';
12
+ import { projectCommonCliDefaultOutput } from './cli.common-output.js';
13
+
14
+ export async function runPortableCli(argv = process.argv.slice(2), io = console, runtime = {}) {
15
+ const parsed = parseArgs(argv);
16
+ if (!parsed.command || parsed.command === 'help' || parsed.flags.help) {
17
+ io.log(portableCliHelpText(runtime.commandPrefix, parsed.flags.help ? parsed.surfaceCommand : ''));
18
+ return 0;
19
+ }
20
+ if (parsed.command === 'operations') {
21
+ writeJson(io, listPortableOperations(), parsed.flags.compact !== true);
22
+ return 0;
23
+ }
24
+ try {
25
+ if (parsed.command === 'author') {
26
+ const result = await runCommonAuthorCli(parsed, runtime);
27
+ writeJson(io, result, parsed.flags.compact !== true);
28
+ return result?.findingSummary?.counts?.error ? 2 : 0;
29
+ }
30
+ const timingEnabled = Boolean(parsed.flags['phase-timing']);
31
+ const totalStartedAt = timingEnabled ? monotonicNowMs() : 0;
32
+
33
+ const inputStartedAt = timingEnabled ? monotonicNowMs() : 0;
34
+ const { input, options } = await commandInput(parsed, runtime);
35
+ const operationInput = parsed.command === 'project-grounding-readiness'
36
+ ? groundContinuationOperationInput(input, parsed.flags)
37
+ : input;
38
+ const inputPreparationMs = timingEnabled ? elapsedMs(inputStartedAt) : 0;
39
+
40
+ const operationStartedAt = timingEnabled ? monotonicNowMs() : 0;
41
+ let result = await runPortableOperation(parsed.command, operationInput, options);
42
+ let commonPathOutput = null;
43
+ if (parsed.command === 'project-grounding-readiness' && parsed.flags['host-result']) {
44
+ const continued = await continueGroundWithHostResult(result, operationInput, options, parsed.flags);
45
+ result = continued.result;
46
+ commonPathOutput = continued.output;
47
+ }
48
+ const operationExecutionMs = timingEnabled ? elapsedMs(operationStartedAt) : 0;
49
+
50
+ const materializationStartedAt = timingEnabled ? monotonicNowMs() : 0;
51
+ let output = commonPathOutput || result;
52
+ if (parsed.command === 'manufacture-handoff-package') {
53
+ output = await materializeHandoffManufactureCliOutput(result, parsed.flags);
54
+ } else if (parsed.command === 'project-grounding-readiness' && (parsed.flags.continue || parsed.flags['materialize-workspace'] || parsed.flags['workspace-output'])) {
55
+ output = await materializeGroundWorkspaceCliOutput(output, operationInput, parsed.flags);
56
+ } else if (parsed.command === 'build-runtime-package' && parsed.flags.output) {
57
+ const receipt = await writePortableRuntimePackageZip(result.bundle, parsed.flags.output);
58
+ output = Object.freeze({ ...result, bundle: undefined, writeReceipt: receipt });
59
+ } else if (parsed.command === 'create-local-draft' && (parsed.flags.output || parsed.flags['qualified-package'] || parsed.flags['result-package'])) {
60
+ output = await materializeCliLocalDraftResult(result, input, parsed.flags);
61
+ } else if ((parsed.command === 'create-local-artifact-set' || parsed.command === 'export-live-lineage') && (parsed.flags['output-dir'] || parsed.flags.bundle)) {
62
+ output = await materializeCliArtifactSetResult(result, parsed.flags, { bundlePrimary: parsed.command === 'export-live-lineage' });
63
+ } else if (parsed.command === 'process-live-turn' && parsed.flags.output && result.status !== 'blocked') {
64
+ const outputPath = path.resolve(String(parsed.flags.output));
65
+ const stateBytes = `${JSON.stringify(result.state, null, 2)}\n`;
66
+ await mkdir(path.dirname(outputPath), { recursive: true });
67
+ await writeFile(outputPath, stateBytes, 'utf8');
68
+ output = Object.freeze({ ...result, liveStateOutput: Object.freeze({ path: outputPath, bytes: Buffer.byteLength(stateBytes), artifacts: result.state?.artifacts?.length || 0 }) });
69
+ }
70
+ const outputMaterializationMs = timingEnabled ? elapsedMs(materializationStartedAt) : 0;
71
+ if (timingEnabled) output = withCliPhaseTiming(output, {
72
+ command: parsed.command,
73
+ inputPreparationMs,
74
+ operationExecutionMs,
75
+ outputMaterializationMs,
76
+ measuredElapsedBeforeFinalSerializationMs: elapsedMs(totalStartedAt)
77
+ });
78
+ if (parsed.flags.summary) output = withCliSummaryProjection(output, parsed.command, parsed.flags);
79
+ output = projectCommonCliDefaultOutput(output, parsed);
80
+ writeJson(io, output, parsed.flags.compact !== true);
81
+ return result?.findingSummary?.counts?.error ? 2 : 0;
82
+ } catch (error) {
83
+ io.error(JSON.stringify({
84
+ schema: 'tiinex.portable.cli.error.v1',
85
+ error: String(error?.message || error),
86
+ command: parsed.command
87
+ }, null, 2));
88
+ return 1;
89
+ }
90
+ }
91
+
92
+ export function withCliSummaryProjection(result = {}, command = '', flags = {}) {
93
+ const operation = String(command || result.operation || '');
94
+ if (!['inspect', 'audit', 'search-lineage', 'resolve-lineage', 'qualify-cold-start'].includes(operation)) return result;
95
+ if (operation === 'qualify-cold-start') return cliColdStartQualificationSummary(result, flags);
96
+ const findings = Array.isArray(result.findings) ? result.findings : [];
97
+ const actionableFindings = findings.filter((finding) => finding?.severity === 'error' || finding?.severity === 'warning');
98
+ const counts = cliSummaryCounts(result, operation, findings);
99
+ return Object.freeze({
100
+ schema: result.schema,
101
+ operation: result.operation || operation,
102
+ projection: 'bounded-summary',
103
+ status: result.status || (result.findingSummary?.counts?.error ? 'blocked' : 'ready'),
104
+ boundary: result.boundary,
105
+ counts,
106
+ ...(operation === 'search-lineage' ? {
107
+ query: result.query,
108
+ scope: result.scope,
109
+ page: result.page,
110
+ facets: result.facets
111
+ } : {}),
112
+ ...(operation === 'resolve-lineage' ? {
113
+ traversal: cliLineageTraversalSummary(result.traversal),
114
+ lineage: cliLineageGraphSummary(result.lineage)
115
+ } : {}),
116
+ findingSummary: result.findingSummary,
117
+ actionableFindings: Object.freeze(actionableFindings.slice(0, 20)),
118
+ actionableFindingsOmitted: Math.max(0, actionableFindings.length - 20),
119
+ ...(result.cliPhaseTiming ? { cliPhaseTiming: result.cliPhaseTiming } : {})
120
+ });
121
+ }
122
+
123
+
124
+ function cliColdStartQualificationSummary(result = {}, flags = {}) {
125
+ const findings = Array.isArray(result.findings) ? result.findings : [];
126
+ const actionableFindings = findings.filter((finding) => finding?.severity === 'error' || finding?.severity === 'warning');
127
+ const requiredContext = Array.isArray(result.continuation?.requiredContext) ? result.continuation.requiredContext : [];
128
+ const requestedRequiredContextSelectors = coldStartRequiredContextSelectors(flags['include-required-context']);
129
+ const selectedRequiredContext = requiredContext.filter((item) => coldStartRequiredContextSelected(item, requestedRequiredContextSelectors));
130
+ const selectedSet = new Set(selectedRequiredContext);
131
+ const orderedRequiredContext = [...selectedRequiredContext, ...requiredContext.filter((item) => !selectedSet.has(item))];
132
+ const requiredContextSummary = orderedRequiredContext.slice(0, 20).map((item) => {
133
+ const contentProjected = selectedSet.has(item) && typeof item?.content === 'string';
134
+ return Object.freeze({
135
+ requirementId: item.requirementId,
136
+ name: item.name,
137
+ state: item.state,
138
+ referenceTarget: item.referenceTarget,
139
+ kind: item.kind,
140
+ workspaceId: item.workspaceId,
141
+ archivePackagePath: item.archivePackagePath,
142
+ innerPath: item.innerPath,
143
+ packagePath: item.packagePath,
144
+ providerMode: item.providerMode,
145
+ bytes: item.bytes,
146
+ sha256: item.sha256,
147
+ actualBytes: item.actualBytes,
148
+ actualSha256: item.actualSha256,
149
+ contentState: item.contentState,
150
+ contentProjected,
151
+ ...(contentProjected ? { content: item.content } : {})
152
+ });
153
+ });
154
+ const projectedRequiredContextBodies = requiredContextSummary.filter((item) => item.contentProjected).length;
155
+ const availableRequiredContextBodies = requiredContext.filter((item) => typeof item?.content === 'string' && item.content.length > 0).length;
156
+ const unmatchedRequiredContextSelectors = requestedRequiredContextSelectors.filter((selector) => selector !== 'all' && !requiredContext.some((item) => coldStartRequiredContextMatches(item, selector)));
157
+ const qualification = result.qualification || {};
158
+ const grounding = result.grounding || {};
159
+ const continuation = result.continuation || {};
160
+ return Object.freeze({
161
+ schema: result.schema,
162
+ operation: result.operation || 'qualify-cold-start',
163
+ resultSchema: result.resultSchema,
164
+ projection: 'bounded-summary',
165
+ status: result.status,
166
+ ingressKind: result.ingressKind,
167
+ qualification: Object.freeze({
168
+ state: qualification.state,
169
+ preferredPathPassed: qualification.preferredPathPassed,
170
+ recoveryState: qualification.recoveryState,
171
+ recoveryIsPreferredPathEvidence: qualification.recoveryIsPreferredPathEvidence,
172
+ toolingAvailability: qualification.toolingAvailability,
173
+ firstSemanticOperation: qualification.firstSemanticOperation,
174
+ expectedFirstSemanticOperation: qualification.expectedFirstSemanticOperation,
175
+ orientationOperation: qualification.orientationOperation,
176
+ groundingState: qualification.groundingState,
177
+ hostEvidence: qualification.hostEvidence,
178
+ fallback: qualification.fallback
179
+ }),
180
+ metrics: result.metrics,
181
+ grounding: Object.freeze({
182
+ status: grounding.status,
183
+ ingressKind: grounding.ingressKind,
184
+ selectedRoute: cliColdStartRouteSummary(grounding.selectedRoute),
185
+ handoff: cliColdStartHandoffSummary(grounding.handoff),
186
+ role: cliColdStartRoleSummary(grounding.role),
187
+ participation: cliColdStartParticipationSummary(grounding.participation),
188
+ interaction: cliColdStartInteractionSummary(grounding.interaction),
189
+ capabilities: cliColdStartCapabilitiesSummary(grounding.capabilities),
190
+ degradedCapture: grounding.degradedCapture,
191
+ mutationBoundary: grounding.mutationBoundary,
192
+ next: grounding.next,
193
+ findingSummary: grounding.findingSummary
194
+ }),
195
+ continuation: Object.freeze({
196
+ state: continuation.state,
197
+ substantiveWorkMayBegin: continuation.substantiveWorkMayBegin,
198
+ qualificationState: continuation.qualificationState,
199
+ selectedRoute: continuation.selectedRoute,
200
+ transfer: Object.freeze([...(continuation.transfer || [])].slice(0, 20)),
201
+ transferOmitted: Math.max(0, (continuation.transfer || []).length - 20),
202
+ requiredContext: Object.freeze(requiredContextSummary),
203
+ requiredContextOmitted: Math.max(0, requiredContext.length - requiredContextSummary.length),
204
+ requiredContextContentBodiesProjected: projectedRequiredContextBodies,
205
+ requiredContextContentBodiesOmitted: Math.max(0, availableRequiredContextBodies - projectedRequiredContextBodies),
206
+ requestedRequiredContextSelectors: Object.freeze(requestedRequiredContextSelectors),
207
+ unmatchedRequiredContextSelectors: Object.freeze(unmatchedRequiredContextSelectors),
208
+ completionExpectation: continuation.completionExpectation,
209
+ returnPackage: continuation.returnPackage,
210
+ next: continuation.next,
211
+ boundary: continuation.boundary
212
+ }),
213
+ oneShot: result.oneShot,
214
+ findingSummary: result.findingSummary,
215
+ actionableFindings: Object.freeze(actionableFindings.slice(0, 20)),
216
+ actionableFindingsOmitted: Math.max(0, actionableFindings.length - 20),
217
+ projectionBoundary: Object.freeze({
218
+ requiredContextBodiesProjected: projectedRequiredContextBodies > 0,
219
+ fullProjectionAvailable: true,
220
+ interpretation: 'This receipt preserves cold-start qualification state, route/task transfer, required-context identity metadata, completion expectation, and actionable findings while omitting body-scale grounding/context material. Request the full qualification projection or explicitly read the qualified required-context material before relying on omitted body text for substantive reasoning.'
221
+ }),
222
+ ...(result.cliPhaseTiming ? { cliPhaseTiming: result.cliPhaseTiming } : {})
223
+ });
224
+ }
225
+
226
+
227
+ function coldStartRequiredContextSelectors(value) {
228
+ if (!value) return Object.freeze([]);
229
+ if (value === true) return Object.freeze(['all']);
230
+ return Object.freeze(String(value).split(',').map((item) => item.trim()).filter(Boolean).map((item) => item.toLowerCase()));
231
+ }
232
+
233
+ function coldStartRequiredContextSelected(item = {}, selectors = []) {
234
+ if (!selectors.length) return false;
235
+ if (selectors.includes('all')) return true;
236
+ return selectors.some((selector) => coldStartRequiredContextMatches(item, selector));
237
+ }
238
+
239
+ function coldStartRequiredContextMatches(item = {}, selector = '') {
240
+ const normalized = String(selector || '').trim().toLowerCase();
241
+ if (!normalized) return false;
242
+ return [item.requirementId, item.name, item.referenceTarget].some((value) => String(value || '').trim().toLowerCase() === normalized);
243
+ }
244
+
245
+ function cliColdStartRouteSummary(route = {}) {
246
+ if (!route || typeof route !== 'object') return route;
247
+ const required = route.requiredClosure || {};
248
+ return Object.freeze({
249
+ id: route.id,
250
+ state: route.state,
251
+ workspaceId: route.workspaceId,
252
+ workspaceRelativeHandoffPath: route.workspaceRelativeHandoffPath,
253
+ packagePath: route.packagePath,
254
+ from: route.from,
255
+ to: route.to,
256
+ pointerPath: route.pointerPath,
257
+ requiredClosure: Object.freeze({
258
+ state: required.state,
259
+ requiredCount: required.requiredCount,
260
+ qualifiedCount: required.qualifiedCount,
261
+ requirementsProjected: false
262
+ })
263
+ });
264
+ }
265
+
266
+ function cliColdStartHandoffSummary(handoff = {}) {
267
+ if (!handoff || typeof handoff !== 'object') return handoff;
268
+ return Object.freeze({
269
+ schemaId: handoff.schemaId,
270
+ purpose: handoff.purpose,
271
+ from: handoff.from,
272
+ fromKind: handoff.fromKind,
273
+ to: handoff.to,
274
+ toKind: handoff.toKind,
275
+ transferCount: (handoff.transfers || []).length,
276
+ transfersProjected: false,
277
+ completionExpectation: handoff.completionExpectation,
278
+ routeId: handoff.routeId,
279
+ workspaceId: handoff.workspaceId,
280
+ workspaceRelativePath: handoff.workspaceRelativePath,
281
+ packagePath: handoff.packagePath
282
+ });
283
+ }
284
+
285
+ function cliColdStartRoleSummary(role = {}) {
286
+ if (!role || typeof role !== 'object') return role;
287
+ return Object.freeze({
288
+ state: role.state,
289
+ endpoint: role.endpoint,
290
+ material: role.material,
291
+ transition: role.transition,
292
+ predecessor: role.predecessor,
293
+ compatibility: role.compatibility,
294
+ exactBoundaryProjected: false,
295
+ authorityBoundaryProjected: false,
296
+ interpretationLimitsProjected: false
297
+ });
298
+ }
299
+
300
+ function cliColdStartParticipationSummary(participation = {}) {
301
+ if (!participation || typeof participation !== 'object') return participation;
302
+ return Object.freeze({
303
+ participantState: participation.participantState,
304
+ currentContribution: participation.currentContribution,
305
+ handoffCapacities: participation.handoffCapacities,
306
+ transportIdentityAssumption: participation.transportIdentityAssumption,
307
+ cardinality: participation.cardinality
308
+ });
309
+ }
310
+
311
+ function cliColdStartInteractionSummary(interaction = {}) {
312
+ if (!interaction || typeof interaction !== 'object') return interaction;
313
+ return Object.freeze({
314
+ handoffPurpose: interaction.handoffPurpose,
315
+ currentPurpose: interaction.currentPurpose,
316
+ purposeState: interaction.purposeState,
317
+ mode: interaction.mode,
318
+ modeState: interaction.modeState,
319
+ executionExpected: interaction.executionExpected,
320
+ nonExecutionMode: interaction.nonExecutionMode,
321
+ continuingDialoguePermitted: interaction.continuingDialoguePermitted,
322
+ oneShotAssumed: interaction.oneShotAssumed
323
+ });
324
+ }
325
+
326
+ function cliColdStartCapabilitiesSummary(capabilities = {}) {
327
+ if (!capabilities || typeof capabilities !== 'object') return capabilities;
328
+ const discovery = capabilities.discovery || {};
329
+ const profile = discovery.profile || {};
330
+ const instance = profile.capabilityInstance || capabilities.instance || {};
331
+ const advertised = profile.capabilities || {};
332
+ return Object.freeze({
333
+ discovery: Object.freeze({
334
+ schema: discovery.schema,
335
+ status: discovery.status,
336
+ tools: Array.isArray(profile.tools) ? profile.tools.length : 0,
337
+ provider: instance.provider,
338
+ host: instance.host,
339
+ session: instance.session,
340
+ materialAccess: advertised.materialAccess,
341
+ execution: advertised.execution,
342
+ mutation: advertised.mutation,
343
+ interaction: advertised.interaction
344
+ }),
345
+ providerNameGrantsCapability: capabilities.providerNameGrantsCapability,
346
+ advertisementIsExerciseEvidence: capabilities.advertisementIsExerciseEvidence
347
+ });
348
+ }
349
+
350
+ function cliSummaryCounts(result = {}, operation = '', findings = []) {
351
+ if (operation === 'inspect') return Object.freeze({
352
+ files: Array.isArray(result.files) ? result.files.length : 0,
353
+ records: Array.isArray(result.records) ? result.records.length : 0,
354
+ assets: Array.isArray(result.assets) ? result.assets.length : 0,
355
+ workspaceEntries: Array.isArray(result.workspaceEntries) ? result.workspaceEntries.length : 0,
356
+ findings: findings.length
357
+ });
358
+ if (operation === 'audit') return Object.freeze({
359
+ audits: Array.isArray(result.audits) ? result.audits.length : 0,
360
+ findings: findings.length
361
+ });
362
+ if (operation === 'search-lineage') return Object.freeze({
363
+ returnedMatches: Array.isArray(result.matches) ? result.matches.length : Number(result.page?.returned || 0),
364
+ totalMatches: Number(result.page?.total || 0),
365
+ eligibleRecords: Number(result.scope?.eligibleRecords || 0),
366
+ findings: findings.length
367
+ });
368
+ return Object.freeze({
369
+ loadedNodes: Number(result.traversal?.stats?.loadedNodes || result.lineage?.stats?.loadedNodes || result.lineage?.stats?.nodes || 0),
370
+ visitedNodes: Number(result.traversal?.stats?.visitedNodes || result.lineage?.stats?.visitedNodes || 0),
371
+ traversedEdges: Number(result.traversal?.stats?.traversedEdges || result.lineage?.stats?.traversedEdges || 0),
372
+ missingEdges: Number(result.traversal?.stats?.missingEdges || result.lineage?.stats?.missingEdges || 0),
373
+ findings: findings.length
374
+ });
375
+ }
376
+
377
+ function cliLineageTraversalSummary(traversal = {}) {
378
+ return Object.freeze({
379
+ boundary: traversal.boundary,
380
+ direction: traversal.direction,
381
+ maxDepth: traversal.maxDepth,
382
+ startIds: Object.freeze([...(traversal.startIds || [])]),
383
+ stats: traversal.stats
384
+ });
385
+ }
386
+
387
+ function cliLineageGraphSummary(lineage = {}) {
388
+ return Object.freeze({
389
+ stats: lineage.stats,
390
+ options: lineage.options
391
+ });
392
+ }
393
+
394
+ function monotonicNowMs() {
395
+ return Number(process.hrtime.bigint()) / 1_000_000;
396
+ }
397
+
398
+ function elapsedMs(startedAt = 0) {
399
+ return Math.max(0, Math.round((monotonicNowMs() - Number(startedAt || 0)) * 1000) / 1000);
400
+ }
401
+
402
+ function withCliPhaseTiming(result = {}, timing = {}) {
403
+ return Object.freeze({
404
+ ...result,
405
+ cliPhaseTiming: Object.freeze({
406
+ schema: 'tiinex.portable.cli.phase-timing.v1',
407
+ command: String(timing.command || ''),
408
+ measuredElapsedBeforeFinalSerializationMs: Number(timing.measuredElapsedBeforeFinalSerializationMs || 0),
409
+ phases: Object.freeze({
410
+ inputPreparationMs: Number(timing.inputPreparationMs || 0),
411
+ operationExecutionMs: Number(timing.operationExecutionMs || 0),
412
+ outputMaterializationMs: Number(timing.outputMaterializationMs || 0)
413
+ }),
414
+ measurementBoundary: 'immediately-before-final-json-serialization',
415
+ unmeasured: Object.freeze({
416
+ finalJsonSerialization: true,
417
+ finalEmission: true
418
+ }),
419
+ boundary: 'Monotonic in-process CLI phase timing through result/output materialization only. The receipt is frozen immediately before final JSON serialization, so final JSON serialization and emission are explicitly unmeasured. It also excludes host review/queue latency, client streaming latency, model compute outside this process, and any work performed before this CLI process starts or after it exits.'
420
+ })
421
+ });
422
+ }
423
+
424
+
425
+ function parseArgs(argv=[]) {
426
+ const args=[...argv],first=args.shift()||'';
427
+ if(first==='--help'||first==='-h') return {command:'help',flags:{help:true},positionals:[]};
428
+ const command=({orient:'orient-handoff-package',ground:'project-grounding-readiness',receive:'qualify-cold-start',validate:'audit-handoff-package-context',handoff:'manufacture-handoff-package',author:'author'})[first]||first;
429
+ const flags={},positionals=[];
430
+ while(args.length){const token=args.shift();if(!token.startsWith('--')){positionals.push(token);continue;}const key=token.slice(2);flags[key]=!args.length||args[0].startsWith('--')?true:args.shift();}
431
+ return {command,flags,positionals,surfaceCommand:first};
432
+ }
433
+
434
+ function writeJson(io, value, pretty = true) { io.log(JSON.stringify(value, null, pretty ? 2 : 0)); }