percolation-inversion-compiler-ts 0.4.4

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 (366) hide show
  1. package/LICENSE +152 -0
  2. package/NOTICE +21 -0
  3. package/README.md +255 -0
  4. package/dist/agent/messages.d.ts +23 -0
  5. package/dist/agent/messages.js +457 -0
  6. package/dist/cli/main.d.ts +1 -0
  7. package/dist/cli/main.js +2646 -0
  8. package/dist/index.d.ts +91 -0
  9. package/dist/index.js +983 -0
  10. package/dist/io/schema.d.ts +16 -0
  11. package/dist/io/schema.js +153 -0
  12. package/dist/packet/index.d.ts +10 -0
  13. package/dist/packet/index.js +385 -0
  14. package/fixtures/portability_conformance/README.md +17 -0
  15. package/fixtures/portability_conformance/agent_check_report.json +1251 -0
  16. package/fixtures/portability_conformance/agent_intake_report.json +1169 -0
  17. package/fixtures/portability_conformance/agent_message_delivery_report.json +124 -0
  18. package/fixtures/portability_conformance/agent_relay_readiness_report.json +40 -0
  19. package/fixtures/portability_conformance/alt_admission_decision.json +16 -0
  20. package/fixtures/portability_conformance/bottleneck_witness_report.json +23 -0
  21. package/fixtures/portability_conformance/collective_phase_certificate.json +330 -0
  22. package/fixtures/portability_conformance/frontier_debt_report.json +24 -0
  23. package/fixtures/portability_conformance/manifest.json +113 -0
  24. package/fixtures/portability_conformance/negative/checksum_mismatch.json +4 -0
  25. package/fixtures/portability_conformance/negative/schema_invalid_agent_check.json +3 -0
  26. package/fixtures/portability_conformance/negative/unknown_schema.json +3 -0
  27. package/fixtures/portability_conformance/phase_acceleration_benchmark_report.json +21 -0
  28. package/fixtures/portability_conformance/phase_acceleration_plan.json +72 -0
  29. package/fixtures/portability_conformance/phase_control_audit_summary.json +16 -0
  30. package/fixtures/portability_conformance/relay_inbox.json +37 -0
  31. package/fixtures/portability_conformance/runtime_step_report.json +1384 -0
  32. package/fixtures/portability_conformance/salience_schedule_report.json +100 -0
  33. package/fixtures/portability_conformance/theory_fidelity_report.json +53 -0
  34. package/fixtures/portability_conformance/value_bridge_report.json +17 -0
  35. package/fixtures/python_v044_cli/adoption_packet.json +131 -0
  36. package/fixtures/python_v044_cli/adoption_request.json +60 -0
  37. package/fixtures/python_v044_cli/agent_autonomy_audit.json +254 -0
  38. package/fixtures/python_v044_cli/agent_check_compact.json +80 -0
  39. package/fixtures/python_v044_cli/agent_check_full.json +1265 -0
  40. package/fixtures/python_v044_cli/agent_communication_guide.json +426 -0
  41. package/fixtures/python_v044_cli/agent_intake.json +1175 -0
  42. package/fixtures/python_v044_cli/agent_manifest.json +373 -0
  43. package/fixtures/python_v044_cli/agent_runbook.json +115 -0
  44. package/fixtures/python_v044_cli/demo_installed_smoke.json +1367 -0
  45. package/fixtures/python_v044_cli/doctor_development.json +264 -0
  46. package/fixtures/python_v044_cli/identity_explain_profile_production.json +39 -0
  47. package/fixtures/python_v044_cli/phase_benchmark.json +42 -0
  48. package/fixtures/python_v044_cli/phase_benchmark_suite.json +428 -0
  49. package/fixtures/python_v044_cli/phase_dashboard.json +173 -0
  50. package/fixtures/python_v044_cli/phase_gap.json +119 -0
  51. package/fixtures/python_v044_cli/phase_observe.json +203 -0
  52. package/fixtures/python_v044_cli/phase_plan_compact.json +384 -0
  53. package/fixtures/python_v044_cli/phase_plan_full.json +2020 -0
  54. package/fixtures/python_v044_cli/phase_runbook.json +66 -0
  55. package/fixtures/python_v044_cli/routes_bindings.json +716 -0
  56. package/fixtures/python_v044_cli/routes_explain_replay_trc_physical_trace.json +57 -0
  57. package/fixtures/python_v044_cli/runtime_step_demo.json +1384 -0
  58. package/fixtures/python_v044_cli/snapshot_list.json +112 -0
  59. package/fixtures/python_v044_cli/snapshot_routes.json +926 -0
  60. package/fixtures/python_v044_cli/snapshot_show_alt.json +6830 -0
  61. package/fixtures/python_v044_cli/snapshot_show_bit.json +594 -0
  62. package/fixtures/python_v044_cli/snapshot_show_ecpt.json +2894 -0
  63. package/fixtures/python_v044_cli/snapshot_show_sqot.json +2392 -0
  64. package/fixtures/python_v044_cli/snapshot_show_trc.json +3037 -0
  65. package/fixtures/python_v044_cli/snapshot_verify_alt.json +10 -0
  66. package/fixtures/python_v044_cli/snapshot_verify_bit.json +10 -0
  67. package/fixtures/python_v044_cli/snapshot_verify_ecpt.json +10 -0
  68. package/fixtures/python_v044_cli/snapshot_verify_sqot.json +10 -0
  69. package/fixtures/python_v044_cli/snapshot_verify_trc.json +10 -0
  70. package/fixtures/python_v044_demo/agent_inbox.json +26 -0
  71. package/fixtures/python_v044_demo/agent_message.json +19 -0
  72. package/fixtures/python_v044_demo/agent_output.txt +1 -0
  73. package/fixtures/python_v044_demo/alt_admission_packet.json +208 -0
  74. package/fixtures/python_v044_demo/asi_proxy_phase_request.json +47 -0
  75. package/fixtures/python_v044_demo/general_intake_policy.json +58 -0
  76. package/fixtures/python_v044_demo/manifest.json +78 -0
  77. package/fixtures/python_v044_demo/packet_envelope.json +1463 -0
  78. package/fixtures/python_v044_demo/phase_dashboard.json +175 -0
  79. package/fixtures/python_v044_demo/runtime_state.json +143 -0
  80. package/fixtures/python_v044_demo/runtime_step_input.json +8 -0
  81. package/fixtures/python_v044_demo/runtime_step_report.json +1384 -0
  82. package/fixtures/python_v044_snapshots/alt.json +6830 -0
  83. package/fixtures/python_v044_snapshots/bit.json +543 -0
  84. package/fixtures/python_v044_snapshots/ecpt.json +2741 -0
  85. package/fixtures/python_v044_snapshots/sqot.json +2134 -0
  86. package/fixtures/python_v044_snapshots/trc.json +2880 -0
  87. package/package.json +129 -0
  88. package/schemas/ALTAccelerationCertificate.schema.json +169 -0
  89. package/schemas/ALTAdmissionDecision.schema.json +199 -0
  90. package/schemas/ALTCARACertificate.schema.json +285 -0
  91. package/schemas/ALTDeprecationRecord.schema.json +171 -0
  92. package/schemas/ALTKernelTransitionReport.schema.json +185 -0
  93. package/schemas/ALTResurrectionRecord.schema.json +171 -0
  94. package/schemas/ASIProxyTargetContract.schema.json +52 -0
  95. package/schemas/AbstractionToken.schema.json +281 -0
  96. package/schemas/AccelerationCertificate.schema.json +225 -0
  97. package/schemas/AccelerationExperimentSuite.schema.json +3731 -0
  98. package/schemas/AcceptedPacketPath.schema.json +148 -0
  99. package/schemas/ActionCommit.schema.json +67 -0
  100. package/schemas/ActionGrammar.schema.json +36 -0
  101. package/schemas/ActionabilityVector.schema.json +33 -0
  102. package/schemas/ActivationThresholdCertificate.schema.json +185 -0
  103. package/schemas/AdapterRouteSpec.schema.json +110 -0
  104. package/schemas/AdoptionFirstRunCommand.schema.json +44 -0
  105. package/schemas/AdoptionReviewChecklist.schema.json +36 -0
  106. package/schemas/AdoptionSafetyBoundary.schema.json +104 -0
  107. package/schemas/AgentAutonomyAuditReport.schema.json +213 -0
  108. package/schemas/AgentCheckReport.schema.json +3494 -0
  109. package/schemas/AgentCommandInvocation.schema.json +63 -0
  110. package/schemas/AgentCommunicationGuide.schema.json +213 -0
  111. package/schemas/AgentCommunicationPolicy.schema.json +73 -0
  112. package/schemas/AgentCommunicationStep.schema.json +85 -0
  113. package/schemas/AgentConnectorSpec.schema.json +89 -0
  114. package/schemas/AgentFeatureReadinessReport.schema.json +206 -0
  115. package/schemas/AgentIdentityAttestation.schema.json +99 -0
  116. package/schemas/AgentIdentityCheckReport.schema.json +225 -0
  117. package/schemas/AgentInboxRecord.schema.json +319 -0
  118. package/schemas/AgentIntakeReport.schema.json +3373 -0
  119. package/schemas/AgentIntakeRequest.schema.json +2250 -0
  120. package/schemas/AgentMessageContractReport.schema.json +195 -0
  121. package/schemas/AgentMessageDeliveryReport.schema.json +630 -0
  122. package/schemas/AgentMessageEnvelope.schema.json +201 -0
  123. package/schemas/AgentMessageNonceLedger.schema.json +45 -0
  124. package/schemas/AgentMessageVerificationContext.schema.json +60 -0
  125. package/schemas/AgentNetworkReadinessReport.schema.json +109 -0
  126. package/schemas/AgentNextActionReport.schema.json +83 -0
  127. package/schemas/AgentPacketExchangeReport.schema.json +519 -0
  128. package/schemas/AgentPeerRecord.schema.json +85 -0
  129. package/schemas/AgentPolicyIdentity.schema.json +79 -0
  130. package/schemas/AgentPopulationState.schema.json +2523 -0
  131. package/schemas/AgentRelayReadinessReport.schema.json +125 -0
  132. package/schemas/AgentRunbookReport.schema.json +100 -0
  133. package/schemas/AgentRuntimeConfig.schema.json +78 -0
  134. package/schemas/AgentTask.schema.json +101 -0
  135. package/schemas/AgentToOperatorRequest.schema.json +222 -0
  136. package/schemas/AgentWorkflowGuide.schema.json +128 -0
  137. package/schemas/AgentWorkflowStep.schema.json +59 -0
  138. package/schemas/AlgebraLawCertificate.schema.json +101 -0
  139. package/schemas/AttestationRecord.schema.json +63 -0
  140. package/schemas/AutocatalyticClosureWitness.schema.json +187 -0
  141. package/schemas/BaselineRefreshCertificate.schema.json +178 -0
  142. package/schemas/BasinReachabilityReport.schema.json +244 -0
  143. package/schemas/BottleneckCandidate.schema.json +105 -0
  144. package/schemas/BottleneckIntervention.schema.json +157 -0
  145. package/schemas/BottleneckInversionPlan.schema.json +212 -0
  146. package/schemas/BottleneckWitnessReport.schema.json +128 -0
  147. package/schemas/BoundaryGeneratorRecord.schema.json +57 -0
  148. package/schemas/BoundaryScriptRecord.schema.json +30 -0
  149. package/schemas/BudgetedToleranceScheduler.schema.json +59 -0
  150. package/schemas/CalibrationCertificate.schema.json +252 -0
  151. package/schemas/CanonicalImplementationReadinessReport.schema.json +298 -0
  152. package/schemas/CanonicalManifest.schema.json +80 -0
  153. package/schemas/CanonicalManifestRecord.schema.json +54 -0
  154. package/schemas/CanonicalTheorySnapshotSummary.schema.json +102 -0
  155. package/schemas/CapabilityBasinContract.schema.json +59 -0
  156. package/schemas/CapabilityPacketCandidate.schema.json +247 -0
  157. package/schemas/CapabilityPacketRegistry.schema.json +442 -0
  158. package/schemas/CapabilityStateVector.schema.json +169 -0
  159. package/schemas/CascadeResidualPotential.schema.json +32 -0
  160. package/schemas/CertificateCompilerRecord.schema.json +81 -0
  161. package/schemas/CertificateFamily.schema.json +376 -0
  162. package/schemas/CertificateRoute.schema.json +128 -0
  163. package/schemas/CertifiedAbstractionCapital.schema.json +161 -0
  164. package/schemas/CheckResult.schema.json +369 -0
  165. package/schemas/CheckerContext.schema.json +255 -0
  166. package/schemas/ClosedLoopAgentIteration.schema.json +1045 -0
  167. package/schemas/CollectivePhaseCertificate.schema.json +1377 -0
  168. package/schemas/CommercialReadinessSummary.schema.json +134 -0
  169. package/schemas/ConfidenceLedger.schema.json +26 -0
  170. package/schemas/ContentAddressedEvidenceRef.schema.json +48 -0
  171. package/schemas/ControlledTransition.schema.json +90 -0
  172. package/schemas/CryptographicAgentIdentity.schema.json +192 -0
  173. package/schemas/DKWCertificate.schema.json +31 -0
  174. package/schemas/DiagnosticReservePolicy.schema.json +22 -0
  175. package/schemas/DischargeRouteBinding.schema.json +93 -0
  176. package/schemas/DomainTypedSemiring.schema.json +55 -0
  177. package/schemas/DominanceWitness.schema.json +31 -0
  178. package/schemas/EProcessCertificate.schema.json +22 -0
  179. package/schemas/EdgeRelationVerificationReport.schema.json +161 -0
  180. package/schemas/EdgeRelationVerifierSpec.schema.json +62 -0
  181. package/schemas/EdgeWitness.schema.json +73 -0
  182. package/schemas/EdgeWitnessCertificate.schema.json +192 -0
  183. package/schemas/EvidenceArtifact.schema.json +112 -0
  184. package/schemas/EvidenceEnvelopeStoreRecord.schema.json +100 -0
  185. package/schemas/EvidencePolicy.schema.json +57 -0
  186. package/schemas/EvidenceResolutionBatch.schema.json +347 -0
  187. package/schemas/EvidenceVerificationProfile.schema.json +74 -0
  188. package/schemas/ExecutableALTCertificatePacket.schema.json +1512 -0
  189. package/schemas/ExecutableTraceNormalForm.schema.json +659 -0
  190. package/schemas/ExecutionAvailablePathCertificate.schema.json +204 -0
  191. package/schemas/ExternalCandidateClassification.schema.json +10 -0
  192. package/schemas/ExternalObligationCatalog.schema.json +238 -0
  193. package/schemas/ExternalVerifierHook.schema.json +174 -0
  194. package/schemas/FiniteOrder.schema.json +34 -0
  195. package/schemas/FinitePhaseControlCertificate.schema.json +100 -0
  196. package/schemas/FiniteTraceLaw.schema.json +30 -0
  197. package/schemas/FixedPopulationLedger.schema.json +255 -0
  198. package/schemas/FormationCostLedger.schema.json +91 -0
  199. package/schemas/FoundryControlDashboard.schema.json +198 -0
  200. package/schemas/FoundryState.schema.json +1819 -0
  201. package/schemas/FrontierDebtReport.schema.json +115 -0
  202. package/schemas/FunctorLawCertificate.schema.json +82 -0
  203. package/schemas/FusedGeometricComparisonCertificate.schema.json +79 -0
  204. package/schemas/FutureFreedomVector.schema.json +84 -0
  205. package/schemas/GeneralIntakePolicy.schema.json +255 -0
  206. package/schemas/GeneralIntakePolicyDecision.schema.json +85 -0
  207. package/schemas/GeneralIntakeProfile.schema.json +11 -0
  208. package/schemas/GeneralIntakeReport.schema.json +861 -0
  209. package/schemas/GeneralIntakeRuntimeBridgeReport.schema.json +761 -0
  210. package/schemas/GeneralIntakeSource.schema.json +57 -0
  211. package/schemas/GoodTuringCertificate.schema.json +27 -0
  212. package/schemas/HazardEnvelopeCertificate.schema.json +192 -0
  213. package/schemas/HiddenCapabilityInjectionReport.schema.json +212 -0
  214. package/schemas/IdentityContributionStatus.schema.json +11 -0
  215. package/schemas/IdentityTrustProfile.schema.json +12 -0
  216. package/schemas/ImplementationMaturity.schema.json +27 -0
  217. package/schemas/IndependenceCertificate.schema.json +42 -0
  218. package/schemas/InnerViabilityKernel.schema.json +45 -0
  219. package/schemas/IntakeProvenanceRecord.schema.json +192 -0
  220. package/schemas/InterventionCandidate.schema.json +266 -0
  221. package/schemas/Judgment.schema.json +351 -0
  222. package/schemas/LatticeWitness.schema.json +63 -0
  223. package/schemas/LedgerCoordinate.schema.json +79 -0
  224. package/schemas/LifecycleCostBounds.schema.json +65 -0
  225. package/schemas/LiquidityCertificate.schema.json +1094 -0
  226. package/schemas/MartingaleBlockResidual.schema.json +32 -0
  227. package/schemas/MartingaleDeficiencyCertificate.schema.json +76 -0
  228. package/schemas/MechanismCubeCertificate.schema.json +92 -0
  229. package/schemas/MissionValidityCertificate.schema.json +153 -0
  230. package/schemas/MonoidRecord.schema.json +30 -0
  231. package/schemas/MonotoneMap.schema.json +61 -0
  232. package/schemas/NegativeLiquidityCertificate.schema.json +176 -0
  233. package/schemas/NonPromotionPolicy.schema.json +39 -0
  234. package/schemas/ObligationRule.schema.json +54 -0
  235. package/schemas/ObligationSet.schema.json +230 -0
  236. package/schemas/ObligationTrace.schema.json +156 -0
  237. package/schemas/ObservationWindow.schema.json +48 -0
  238. package/schemas/ObservedTraceProjection.schema.json +57 -0
  239. package/schemas/OccupationLedger.schema.json +33 -0
  240. package/schemas/OperationalCheck.schema.json +29 -0
  241. package/schemas/OperationalReadinessReport.schema.json +216 -0
  242. package/schemas/OperatorAdoptionPacket.schema.json +303 -0
  243. package/schemas/OpportunityMeasureContract.schema.json +165 -0
  244. package/schemas/OrderedPotentialCone.schema.json +125 -0
  245. package/schemas/PacketCapitalLineage.schema.json +90 -0
  246. package/schemas/PacketExchangeEnvelope.schema.json +213 -0
  247. package/schemas/PacketImportInspectionReport.schema.json +68 -0
  248. package/schemas/PacketIngestionReport.schema.json +655 -0
  249. package/schemas/PacketLineageDigest.schema.json +70 -0
  250. package/schemas/PacketMergeReport.schema.json +286 -0
  251. package/schemas/PacketPromotionPolicy.schema.json +47 -0
  252. package/schemas/PacketPromotionReport.schema.json +354 -0
  253. package/schemas/PacketRejection.schema.json +158 -0
  254. package/schemas/PhaseAccelerationBenchmarkReport.schema.json +103 -0
  255. package/schemas/PhaseAccelerationPlan.schema.json +4449 -0
  256. package/schemas/PhaseAccelerationRequest.schema.json +5333 -0
  257. package/schemas/PhaseAccelerationScore.schema.json +66 -0
  258. package/schemas/PhaseBenchmarkCaseResult.schema.json +164 -0
  259. package/schemas/PhaseBenchmarkSuiteReport.schema.json +234 -0
  260. package/schemas/PhaseBenchmarkTask.schema.json +36 -0
  261. package/schemas/PhaseComponentGap.schema.json +46 -0
  262. package/schemas/PhaseControlAction.schema.json +80 -0
  263. package/schemas/PhaseControlAuditSummary.schema.json +143 -0
  264. package/schemas/PhaseControlEnvelope.schema.json +53 -0
  265. package/schemas/PhaseControlObjective.schema.json +98 -0
  266. package/schemas/PhaseControlPlan.schema.json +377 -0
  267. package/schemas/PhaseControlRunReport.schema.json +425 -0
  268. package/schemas/PhaseControlState.schema.json +383 -0
  269. package/schemas/PhaseDashboardReport.schema.json +249 -0
  270. package/schemas/PhaseGapVector.schema.json +101 -0
  271. package/schemas/PhaseObservationReport.schema.json +321 -0
  272. package/schemas/PhaseTrajectoryReport.schema.json +4522 -0
  273. package/schemas/PopulationRuntimeStepReport.schema.json +5125 -0
  274. package/schemas/PortabilityConformanceReport.schema.json +99 -0
  275. package/schemas/PortabilitySchemaBundle.schema.json +23 -0
  276. package/schemas/ProblemSolvingTrace.schema.json +162 -0
  277. package/schemas/ProcessGrammarRecord.schema.json +56 -0
  278. package/schemas/ProductOrder.schema.json +53 -0
  279. package/schemas/ProductionReadinessProfile.schema.json +37 -0
  280. package/schemas/ProjectionAudit.schema.json +70 -0
  281. package/schemas/ProofObligation.schema.json +200 -0
  282. package/schemas/ProtocolFrameDigest.schema.json +79 -0
  283. package/schemas/ProtocolFunctorCertificate.schema.json +89 -0
  284. package/schemas/ProtocolObject.schema.json +45 -0
  285. package/schemas/ProtocolRelativeBenchmarkMetric.schema.json +39 -0
  286. package/schemas/ProvenanceManifest.schema.json +221 -0
  287. package/schemas/ProvenanceManifestEntry.schema.json +29 -0
  288. package/schemas/PsiDashboard.schema.json +213 -0
  289. package/schemas/PullbackGluingWitness.schema.json +43 -0
  290. package/schemas/QuarantineLedger.schema.json +31 -0
  291. package/schemas/ReachableMassRecursionCertificate.schema.json +129 -0
  292. package/schemas/ReconstructionResidual.schema.json +24 -0
  293. package/schemas/RefreshRule.schema.json +31 -0
  294. package/schemas/Registry.schema.json +231 -0
  295. package/schemas/ReleaseArtifactManifest.schema.json +62 -0
  296. package/schemas/ReproductionMatrixCertificate.schema.json +190 -0
  297. package/schemas/ResidualCarryForwardReport.schema.json +57 -0
  298. package/schemas/ResourceCalendarRecord.schema.json +67 -0
  299. package/schemas/ResourceEnvelope.schema.json +42 -0
  300. package/schemas/ResourceMatchedBaselineConfig.schema.json +81 -0
  301. package/schemas/RiskBudgetLedger.schema.json +19 -0
  302. package/schemas/RobotsDecision.schema.json +44 -0
  303. package/schemas/RootFinalityCertificate.schema.json +190 -0
  304. package/schemas/RouteExecutionBatch.schema.json +930 -0
  305. package/schemas/RouteExecutionRequest.schema.json +87 -0
  306. package/schemas/RuntimeActionResult.schema.json +807 -0
  307. package/schemas/RuntimeComparisonReport.schema.json +3670 -0
  308. package/schemas/RuntimeEvent.schema.json +142 -0
  309. package/schemas/RuntimeEventLog.schema.json +161 -0
  310. package/schemas/RuntimeExecutionReport.schema.json +872 -0
  311. package/schemas/RuntimeExecutorPolicy.schema.json +68 -0
  312. package/schemas/RuntimeHealthReport.schema.json +161 -0
  313. package/schemas/RuntimeIdentityContext.schema.json +480 -0
  314. package/schemas/RuntimeRunReport.schema.json +3487 -0
  315. package/schemas/RuntimeServiceSettings.schema.json +55 -0
  316. package/schemas/RuntimeState.schema.json +1438 -0
  317. package/schemas/RuntimeStepInput.schema.json +685 -0
  318. package/schemas/RuntimeStepReport.schema.json +3314 -0
  319. package/schemas/RuntimeStoreRecord.schema.json +106 -0
  320. package/schemas/RuntimeStoreSnapshot.schema.json +4815 -0
  321. package/schemas/SBOMManifest.schema.json +67 -0
  322. package/schemas/SQOTTheorySnapshot.schema.json +49 -0
  323. package/schemas/SafePhaseAction.schema.json +96 -0
  324. package/schemas/SalienceQueueRecord.schema.json +313 -0
  325. package/schemas/SalienceScheduleReport.schema.json +434 -0
  326. package/schemas/SalienceSchedulingDecision.schema.json +167 -0
  327. package/schemas/SchemaBundleDigest.schema.json +57 -0
  328. package/schemas/ScriptGroundMetricCertificate.schema.json +47 -0
  329. package/schemas/SelectiveCUPCertificate.schema.json +414 -0
  330. package/schemas/SettlementReturnRAFCertificate.schema.json +122 -0
  331. package/schemas/SinkhornCertificate.schema.json +55 -0
  332. package/schemas/SnapshotAttribution.schema.json +63 -0
  333. package/schemas/SnapshotCatalog.schema.json +481 -0
  334. package/schemas/SplitCertificate.schema.json +39 -0
  335. package/schemas/StatusAlgebraRecord.schema.json +37 -0
  336. package/schemas/StoppedEvidenceSheafCertificate.schema.json +120 -0
  337. package/schemas/StrictTexParseReport.schema.json +67 -0
  338. package/schemas/SybilResistanceLedger.schema.json +427 -0
  339. package/schemas/SybilResistancePolicy.schema.json +176 -0
  340. package/schemas/TRCCompileResult.schema.json +239 -0
  341. package/schemas/TRCStateRecord.schema.json +149 -0
  342. package/schemas/TelemetryCostCertificate.schema.json +171 -0
  343. package/schemas/TexGrammarDiagnostic.schema.json +39 -0
  344. package/schemas/TheoryAuditReport.schema.json +654 -0
  345. package/schemas/TheoryAuditSuiteReport.schema.json +775 -0
  346. package/schemas/TheoryFidelityReport.schema.json +100 -0
  347. package/schemas/TheoryImplementationRecord.schema.json +203 -0
  348. package/schemas/TheorySnapshot.schema.json +459 -0
  349. package/schemas/TheorySnapshotItem.schema.json +60 -0
  350. package/schemas/TokenLineage.schema.json +76 -0
  351. package/schemas/ToleranceAllocationCertificate.schema.json +62 -0
  352. package/schemas/TraceNormalizationCertificate.schema.json +77 -0
  353. package/schemas/TraceSufficiencyCertificate.schema.json +166 -0
  354. package/schemas/TransportCertificate.schema.json +178 -0
  355. package/schemas/TypedTraceTransducerRecord.schema.json +64 -0
  356. package/schemas/ValueBridgeReport.schema.json +131 -0
  357. package/schemas/VectorCompatibleFamily.schema.json +354 -0
  358. package/schemas/VerificationThroughputReport.schema.json +62 -0
  359. package/schemas/VerifiedCapabilityPacket.schema.json +251 -0
  360. package/schemas/VerifierEvidenceEnvelope.schema.json +178 -0
  361. package/schemas/VerifierResolution.schema.json +275 -0
  362. package/schemas/WebDiscoveryReport.schema.json +675 -0
  363. package/schemas/WebFetchPolicy.schema.json +145 -0
  364. package/schemas/WebFetchReport.schema.json +133 -0
  365. package/schemas/bundle.schema.json +100808 -0
  366. package/schemas/schema-digest.json +1674 -0
@@ -0,0 +1,457 @@
1
+ // src/agent/messages.ts
2
+ import { createHash } from "crypto";
3
+ import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
4
+ import { dirname as dirname2 } from "path";
5
+
6
+ // src/core/json.ts
7
+ function sortJson(value) {
8
+ if (Array.isArray(value)) {
9
+ return value.map((item) => sortJson(item));
10
+ }
11
+ if (value && typeof value === "object") {
12
+ const input = value;
13
+ const output = {};
14
+ for (const key of Object.keys(input).sort()) {
15
+ const child = input[key];
16
+ if (child !== void 0) {
17
+ output[key] = sortJson(child);
18
+ }
19
+ }
20
+ return output;
21
+ }
22
+ return value;
23
+ }
24
+ function stableStringify(value) {
25
+ return `${JSON.stringify(sortJson(value), null, 2)}
26
+ `;
27
+ }
28
+ function parseJsonObject(text, label = "JSON") {
29
+ const parsed = JSON.parse(text);
30
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
31
+ throw new Error(`${label} must be a JSON object`);
32
+ }
33
+ return parsed;
34
+ }
35
+
36
+ // src/core/ledger.ts
37
+ function emptyLedger() {
38
+ return { coordinates: {} };
39
+ }
40
+ function residualLedger(name, value = 1, description) {
41
+ return {
42
+ coordinates: {
43
+ [name]: {
44
+ name,
45
+ value,
46
+ unit: "dimensionless",
47
+ kind: "residual",
48
+ description: description ?? null,
49
+ evidence_status: "declared",
50
+ evidence_refs: [],
51
+ known: true
52
+ }
53
+ }
54
+ };
55
+ }
56
+
57
+ // src/io/schema.ts
58
+ import {
59
+ cpSync,
60
+ existsSync as existsSync2,
61
+ mkdirSync,
62
+ readdirSync,
63
+ readFileSync,
64
+ writeFileSync
65
+ } from "fs";
66
+ import { basename, join as join2 } from "path";
67
+ import Ajv2020Module from "ajv/dist/2020.js";
68
+
69
+ // src/io/paths.ts
70
+ import { existsSync } from "fs";
71
+ import { dirname, join, resolve } from "path";
72
+ import { fileURLToPath } from "url";
73
+ function packageRoot() {
74
+ let current = dirname(fileURLToPath(import.meta.url));
75
+ for (let i = 0; i < 8; i += 1) {
76
+ if (existsSync(join(current, "package.json")) && existsSync(join(current, "schemas"))) {
77
+ return current;
78
+ }
79
+ const next = dirname(current);
80
+ if (next === current) {
81
+ break;
82
+ }
83
+ current = next;
84
+ }
85
+ return resolve(dirname(fileURLToPath(import.meta.url)), "../..");
86
+ }
87
+ function schemaDir() {
88
+ return join(packageRoot(), "schemas");
89
+ }
90
+
91
+ // src/io/schema.ts
92
+ var PUBLIC_SCHEMA_NAME = /^[A-Za-z][A-Za-z0-9]*$/;
93
+ function assertSchemaTypeName(typeName) {
94
+ if (!PUBLIC_SCHEMA_NAME.test(typeName)) {
95
+ throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
96
+ }
97
+ }
98
+ function schemaPath(typeName) {
99
+ assertSchemaTypeName(typeName);
100
+ return join2(schemaDir(), `${typeName}.schema.json`);
101
+ }
102
+ function schemaByType(typeName = "Registry") {
103
+ const path = schemaPath(typeName);
104
+ if (!existsSync2(path)) {
105
+ throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
106
+ }
107
+ return parseJsonObject(readFileSync(path, "utf8"), `${typeName} schema`);
108
+ }
109
+ function validateData(data, schema) {
110
+ const Ajv2020 = Ajv2020Module;
111
+ const ajv = new Ajv2020({ allErrors: true, strict: false });
112
+ const validate = ajv.compile(schema);
113
+ const valid = Boolean(validate(data));
114
+ return {
115
+ valid,
116
+ errors: valid ? [] : (validate.errors ?? []).map(
117
+ (error) => `${error.instancePath || "/"} ${error.message ?? "is invalid"}`
118
+ )
119
+ };
120
+ }
121
+ function validateByType(data, typeName) {
122
+ return validateData(data, schemaByType(typeName));
123
+ }
124
+
125
+ // src/io/identity.ts
126
+ function nonEmptyStringArray(value) {
127
+ return Array.isArray(value) && value.some((item) => typeof item === "string" && item.length > 0);
128
+ }
129
+ function runtimeIdentityContextAccepted(data) {
130
+ return validateByType(data, "RuntimeIdentityContext").valid && data.accepted === true && nonEmptyStringArray(data.accepted_agent_ids) && nonEmptyStringArray(data.accepted_public_key_ids);
131
+ }
132
+
133
+ // src/agent/messages.ts
134
+ function sha256(text) {
135
+ return createHash("sha256").update(text, "utf8").digest("hex");
136
+ }
137
+ function sortedUnique(values) {
138
+ return [
139
+ ...new Set(values.filter((value) => Boolean(value)))
140
+ ].sort();
141
+ }
142
+ function acceptedIdentityContext(path) {
143
+ if (!path || !existsSync3(path)) {
144
+ return false;
145
+ }
146
+ try {
147
+ const data = parseJsonObject(
148
+ readFileSync2(path, "utf8"),
149
+ "identity context"
150
+ );
151
+ return runtimeIdentityContextAccepted(data);
152
+ } catch {
153
+ return false;
154
+ }
155
+ }
156
+ function createAgentMessage(options) {
157
+ const digest = sha256(options.text);
158
+ return {
159
+ audience: [],
160
+ content: options.text,
161
+ content_sha256: digest,
162
+ declared_packet_kind: "capability-packet-candidate",
163
+ declared_receiver_family: ["agent", "verifier"],
164
+ declared_routes: [],
165
+ declared_validity_domain: "protocol-relative-finite",
166
+ evidence_refs: [],
167
+ expires_at: null,
168
+ issued_at: null,
169
+ issuer_attestation_id: null,
170
+ issuer_public_key_id: null,
171
+ message_id: `agent-message:${digest.slice(0, 12)}`,
172
+ metadata: {},
173
+ nonce: options.nonce ?? null,
174
+ protocol_version: "pic-agent-message-v1",
175
+ receiver_agent_id: options.receiver ?? null,
176
+ reply_to: null,
177
+ route_request_refs: [],
178
+ sender_agent_id: options.sender,
179
+ signature_ref: null,
180
+ tags: ["agent-message"],
181
+ thread_id: null
182
+ };
183
+ }
184
+ function readAgentMessage(path) {
185
+ const message = parseJsonObject(readFileSync2(path, "utf8"), "agent message");
186
+ const validation = validateByType(message, "AgentMessageEnvelope");
187
+ if (!validation.valid) {
188
+ throw new Error(
189
+ `agent message schema-invalid: ${validation.errors.join("; ")}`
190
+ );
191
+ }
192
+ return message;
193
+ }
194
+ function agentMessageContract(message) {
195
+ const content = String(message.content ?? "");
196
+ const digestValid = sha256(content) === message.content_sha256;
197
+ const declaredReceiverFamily = Array.isArray(message.declared_receiver_family) ? message.declared_receiver_family.map(String) : [];
198
+ const evidenceRefs = Array.isArray(message.evidence_refs) ? message.evidence_refs.map(String) : [];
199
+ const routeRefs = Array.isArray(message.route_request_refs) ? message.route_request_refs.map(String) : [];
200
+ const reasons = digestValid ? [] : ["message content digest mismatch"];
201
+ return {
202
+ accepted: digestValid,
203
+ candidate_only: true,
204
+ declared_packet_kind: message.declared_packet_kind ?? "capability-packet-candidate",
205
+ declared_receiver_family: declaredReceiverFamily,
206
+ declared_validity_domain: message.declared_validity_domain ?? "protocol-relative-finite",
207
+ evidence_refs: evidenceRefs,
208
+ message_contract_valid: digestValid,
209
+ message_id: message.message_id ?? null,
210
+ protocol_version: message.protocol_version ?? "pic-agent-message-v1",
211
+ reasons,
212
+ receiver_agent_id: message.receiver_agent_id ?? null,
213
+ report_id: `agent-message-contract:${sha256(stableStringify(message)).slice(0, 12)}`,
214
+ residual_ledger: digestValid ? emptyLedger() : residualLedger(
215
+ `agent-message:${String(message.message_id ?? "unknown")}:digest-mismatch`,
216
+ 1,
217
+ "message content digest mismatch"
218
+ ),
219
+ route_request_refs: routeRefs,
220
+ sender_agent_id: message.sender_agent_id ?? null,
221
+ settled: false
222
+ };
223
+ }
224
+ function verifyAgentMessage(message, options = {}) {
225
+ const profile = options.profile ?? "development";
226
+ const contract = agentMessageContract(message);
227
+ const content = String(message.content ?? "");
228
+ const digest = String(message.content_sha256 ?? sha256(content));
229
+ const nonce = typeof message.nonce === "string" ? message.nonce : null;
230
+ const replayDetected = Boolean(nonce && options.seenNonces?.includes(nonce));
231
+ const signaturePresent = Boolean(
232
+ message.signature_ref && message.issuer_public_key_id && message.issuer_attestation_id
233
+ );
234
+ const signatureRequired = ["production", "adversarial"].includes(
235
+ profile.toLowerCase()
236
+ );
237
+ const identityRequired = signatureRequired;
238
+ const identityAccepted = acceptedIdentityContext(options.identityContextPath);
239
+ const reasons = [
240
+ ...contract.reasons ?? []
241
+ ];
242
+ const identityReasons = [];
243
+ if (replayDetected) {
244
+ reasons.push("message replay nonce was already seen");
245
+ }
246
+ if (signatureRequired && !signaturePresent) {
247
+ reasons.push("signed agent message required by profile");
248
+ }
249
+ if (identityRequired && !identityAccepted) {
250
+ identityReasons.push("accepted identity context required by profile");
251
+ }
252
+ reasons.push(...identityReasons);
253
+ const accepted = contract.accepted === true && reasons.length === 0;
254
+ const packetId = `packet:agent-message:${String(message.message_id ?? "unknown")}`;
255
+ const packets = contract.accepted === true ? [
256
+ {
257
+ authority_granted: false,
258
+ authority_requested: false,
259
+ authority_required: false,
260
+ claim: content,
261
+ content_sha256: digest,
262
+ dependencies: [],
263
+ evidence_hash_valid: true,
264
+ evidence_refs: sortedUnique([
265
+ ...Array.isArray(message.evidence_refs) ? message.evidence_refs.map(String) : [],
266
+ `sha256:${digest}`,
267
+ `agent-message:${String(message.message_id ?? "unknown")}`
268
+ ]),
269
+ expected_downstream_gain: 125e-5,
270
+ expires_at: null,
271
+ freshness: 1,
272
+ hazard_charge: 0,
273
+ identity_contribution_status: "provisional",
274
+ issuer_agent_id: message.sender_agent_id ?? null,
275
+ issuer_attestation_id: message.issuer_attestation_id ?? null,
276
+ issuer_public_key_id: message.issuer_public_key_id ?? null,
277
+ issuer_signature_ref: message.signature_ref ?? null,
278
+ packet_id: packetId,
279
+ receiver_family: Array.isArray(message.declared_receiver_family) ? message.declared_receiver_family.map(String) : ["agent", "verifier"],
280
+ residual_charge: 0,
281
+ reuse_context: "general",
282
+ rollback_available: true,
283
+ route_safe: true,
284
+ salience_class: "packet",
285
+ source_kind: "agent-message",
286
+ source_ref: String(message.message_id ?? "unknown"),
287
+ status: "provisional",
288
+ tags: sortedUnique([
289
+ ...Array.isArray(message.tags) ? message.tags.map(String) : [],
290
+ "agent-message",
291
+ "external-candidate",
292
+ "general"
293
+ ]),
294
+ verification_cost: 5e-3,
295
+ verifier_routes: Array.isArray(message.declared_routes) ? message.declared_routes.map(String) : []
296
+ }
297
+ ] : [];
298
+ return {
299
+ accepted,
300
+ candidate_packet_ids: packets.map((packet) => packet.packet_id),
301
+ consumed_nonces: accepted && nonce ? [nonce] : [],
302
+ identity_reasons: sortedUnique(identityReasons),
303
+ identity_status: identityAccepted ? "verified" : identityRequired ? "required" : "not-required",
304
+ identity_verified: identityAccepted,
305
+ message_contract_valid: contract.accepted === true,
306
+ message_id: message.message_id ?? null,
307
+ next_safe_commands: [
308
+ "uv run pic agent message contract --message <message.json>",
309
+ "uv run pic ecology bridge-runtime --report <general-intake-report.json>"
310
+ ],
311
+ nonce_ledger: {
312
+ accepted,
313
+ consumed_nonces: accepted && nonce ? [nonce] : [],
314
+ ledger_id: "agent-message-nonce-ledger",
315
+ reasons: sortedUnique(reasons),
316
+ rejected_message_ids: accepted ? [] : [String(message.message_id ?? "unknown")],
317
+ replayed_nonces: replayDetected && nonce ? [nonce] : []
318
+ },
319
+ nonce_status: replayDetected ? "replayed" : nonce && accepted ? "consumed" : "not-provided",
320
+ packets,
321
+ quarantine_recommended: reasons.length > 0,
322
+ reasons: sortedUnique(reasons),
323
+ replay_detected: replayDetected,
324
+ report_id: `agent-message-check:${String(message.message_id ?? "unknown")}`,
325
+ residual_ledger: reasons.length === 0 ? emptyLedger() : residualLedger(
326
+ `agent-message:${String(message.message_id ?? "unknown")}:verification-residual`,
327
+ reasons.length,
328
+ "agent message verification residual"
329
+ ),
330
+ sender_agent_id: message.sender_agent_id ?? null,
331
+ settled: false,
332
+ signature_present: signaturePresent,
333
+ signature_required: signatureRequired
334
+ };
335
+ }
336
+ function initAgentInbox(path, inboxId = "agent-inbox") {
337
+ const record = {
338
+ inbox_id: inboxId,
339
+ messages: [],
340
+ peers: [],
341
+ seen_nonces: []
342
+ };
343
+ mkdirSync2(dirname2(path), { recursive: true });
344
+ writeFileSync2(path, stableStringify(record), "utf8");
345
+ return record;
346
+ }
347
+ function readAgentInbox(path) {
348
+ const text = readFileSync2(path, "utf8").trim();
349
+ if (text.includes("\n") && !text.startsWith("{")) {
350
+ return {
351
+ inbox_id: "agent-inbox",
352
+ messages: text.split(/\r?\n/).filter(Boolean).map((line) => parseJsonObject(line, "agent inbox line")),
353
+ peers: [],
354
+ seen_nonces: []
355
+ };
356
+ }
357
+ const inbox = parseJsonObject(text, "agent inbox");
358
+ const validation = validateByType(inbox, "AgentInboxRecord");
359
+ if (!validation.valid) {
360
+ throw new Error(
361
+ `agent inbox schema-invalid: ${validation.errors.join("; ")}`
362
+ );
363
+ }
364
+ return inbox;
365
+ }
366
+ function writeAgentInbox(path, inbox) {
367
+ mkdirSync2(dirname2(path), { recursive: true });
368
+ writeFileSync2(path, stableStringify(inbox), "utf8");
369
+ }
370
+ function appendAgentMessage(inboxPath, message) {
371
+ const inbox = existsSync3(inboxPath) ? readAgentInbox(inboxPath) : { inbox_id: "agent-inbox", messages: [], peers: [], seen_nonces: [] };
372
+ const messages = Array.isArray(inbox.messages) ? inbox.messages : [];
373
+ const updated = {
374
+ ...inbox,
375
+ messages: [...messages, message]
376
+ };
377
+ writeAgentInbox(inboxPath, updated);
378
+ return updated;
379
+ }
380
+ function deliveryReport(action, inboxRef, inbox, reports, profile = "development") {
381
+ const accepted = reports.every((report) => report.accepted === true);
382
+ const delivered = accepted ? reports.map((report) => String(report.message_id ?? "unknown")) : [];
383
+ const rejected = accepted ? [] : reports.map((report) => String(report.message_id ?? "unknown"));
384
+ const consumed = sortedUnique(
385
+ reports.flatMap(
386
+ (report) => Array.isArray(report.consumed_nonces) ? report.consumed_nonces.map(String) : []
387
+ )
388
+ );
389
+ const reasons = sortedUnique(
390
+ reports.flatMap(
391
+ (report) => Array.isArray(report.reasons) ? report.reasons.map(String) : []
392
+ )
393
+ );
394
+ return {
395
+ accepted,
396
+ action,
397
+ candidate_only: true,
398
+ candidate_packet_ids: sortedUnique(
399
+ reports.flatMap(
400
+ (report) => Array.isArray(report.candidate_packet_ids) ? report.candidate_packet_ids.map(String) : []
401
+ )
402
+ ),
403
+ delivered_message_ids: delivered,
404
+ exchange_reports: reports,
405
+ identity_context_accepted: false,
406
+ inbox_id: inbox.inbox_id ?? "agent-inbox",
407
+ inbox_ref: inboxRef,
408
+ message_ids: reports.map(
409
+ (report) => String(report.message_id ?? "unknown")
410
+ ),
411
+ next_safe_commands: [
412
+ "uv run pic agent inbox verify --inbox <inbox.json>",
413
+ "uv run pic ecology bridge-runtime --report <general-intake-report.json>"
414
+ ],
415
+ nonce_ledger: {
416
+ accepted,
417
+ consumed_nonces: consumed,
418
+ ledger_id: "agent-message-nonce-ledger",
419
+ reasons,
420
+ rejected_message_ids: rejected,
421
+ replayed_nonces: []
422
+ },
423
+ operationally_usable: accepted,
424
+ profile,
425
+ reasons,
426
+ rejected_message_ids: rejected,
427
+ report_id: `agent-message-delivery:${action}:${String(inbox.inbox_id ?? "agent-inbox")}`,
428
+ settled: false
429
+ };
430
+ }
431
+ function receiveAgentInbox(inboxPath, options = {}) {
432
+ const inbox = readAgentInbox(inboxPath);
433
+ const seen = Array.isArray(inbox.seen_nonces) ? inbox.seen_nonces.map(String) : [];
434
+ const messages = Array.isArray(inbox.messages) ? inbox.messages : [];
435
+ const reports = messages.map(
436
+ (message) => verifyAgentMessage(message, { ...options, seenNonces: seen })
437
+ );
438
+ return deliveryReport(
439
+ "receive",
440
+ inboxPath,
441
+ inbox,
442
+ reports,
443
+ options.profile ?? "development"
444
+ );
445
+ }
446
+ export {
447
+ agentMessageContract,
448
+ appendAgentMessage,
449
+ createAgentMessage,
450
+ deliveryReport,
451
+ initAgentInbox,
452
+ readAgentInbox,
453
+ readAgentMessage,
454
+ receiveAgentInbox,
455
+ verifyAgentMessage,
456
+ writeAgentInbox
457
+ };
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node