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.
- package/LICENSE +152 -0
- package/NOTICE +21 -0
- package/README.md +255 -0
- package/dist/agent/messages.d.ts +23 -0
- package/dist/agent/messages.js +457 -0
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/main.js +2646 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +983 -0
- package/dist/io/schema.d.ts +16 -0
- package/dist/io/schema.js +153 -0
- package/dist/packet/index.d.ts +10 -0
- package/dist/packet/index.js +385 -0
- package/fixtures/portability_conformance/README.md +17 -0
- package/fixtures/portability_conformance/agent_check_report.json +1251 -0
- package/fixtures/portability_conformance/agent_intake_report.json +1169 -0
- package/fixtures/portability_conformance/agent_message_delivery_report.json +124 -0
- package/fixtures/portability_conformance/agent_relay_readiness_report.json +40 -0
- package/fixtures/portability_conformance/alt_admission_decision.json +16 -0
- package/fixtures/portability_conformance/bottleneck_witness_report.json +23 -0
- package/fixtures/portability_conformance/collective_phase_certificate.json +330 -0
- package/fixtures/portability_conformance/frontier_debt_report.json +24 -0
- package/fixtures/portability_conformance/manifest.json +113 -0
- package/fixtures/portability_conformance/negative/checksum_mismatch.json +4 -0
- package/fixtures/portability_conformance/negative/schema_invalid_agent_check.json +3 -0
- package/fixtures/portability_conformance/negative/unknown_schema.json +3 -0
- package/fixtures/portability_conformance/phase_acceleration_benchmark_report.json +21 -0
- package/fixtures/portability_conformance/phase_acceleration_plan.json +72 -0
- package/fixtures/portability_conformance/phase_control_audit_summary.json +16 -0
- package/fixtures/portability_conformance/relay_inbox.json +37 -0
- package/fixtures/portability_conformance/runtime_step_report.json +1384 -0
- package/fixtures/portability_conformance/salience_schedule_report.json +100 -0
- package/fixtures/portability_conformance/theory_fidelity_report.json +53 -0
- package/fixtures/portability_conformance/value_bridge_report.json +17 -0
- package/fixtures/python_v044_cli/adoption_packet.json +131 -0
- package/fixtures/python_v044_cli/adoption_request.json +60 -0
- package/fixtures/python_v044_cli/agent_autonomy_audit.json +254 -0
- package/fixtures/python_v044_cli/agent_check_compact.json +80 -0
- package/fixtures/python_v044_cli/agent_check_full.json +1265 -0
- package/fixtures/python_v044_cli/agent_communication_guide.json +426 -0
- package/fixtures/python_v044_cli/agent_intake.json +1175 -0
- package/fixtures/python_v044_cli/agent_manifest.json +373 -0
- package/fixtures/python_v044_cli/agent_runbook.json +115 -0
- package/fixtures/python_v044_cli/demo_installed_smoke.json +1367 -0
- package/fixtures/python_v044_cli/doctor_development.json +264 -0
- package/fixtures/python_v044_cli/identity_explain_profile_production.json +39 -0
- package/fixtures/python_v044_cli/phase_benchmark.json +42 -0
- package/fixtures/python_v044_cli/phase_benchmark_suite.json +428 -0
- package/fixtures/python_v044_cli/phase_dashboard.json +173 -0
- package/fixtures/python_v044_cli/phase_gap.json +119 -0
- package/fixtures/python_v044_cli/phase_observe.json +203 -0
- package/fixtures/python_v044_cli/phase_plan_compact.json +384 -0
- package/fixtures/python_v044_cli/phase_plan_full.json +2020 -0
- package/fixtures/python_v044_cli/phase_runbook.json +66 -0
- package/fixtures/python_v044_cli/routes_bindings.json +716 -0
- package/fixtures/python_v044_cli/routes_explain_replay_trc_physical_trace.json +57 -0
- package/fixtures/python_v044_cli/runtime_step_demo.json +1384 -0
- package/fixtures/python_v044_cli/snapshot_list.json +112 -0
- package/fixtures/python_v044_cli/snapshot_routes.json +926 -0
- package/fixtures/python_v044_cli/snapshot_show_alt.json +6830 -0
- package/fixtures/python_v044_cli/snapshot_show_bit.json +594 -0
- package/fixtures/python_v044_cli/snapshot_show_ecpt.json +2894 -0
- package/fixtures/python_v044_cli/snapshot_show_sqot.json +2392 -0
- package/fixtures/python_v044_cli/snapshot_show_trc.json +3037 -0
- package/fixtures/python_v044_cli/snapshot_verify_alt.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_bit.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_ecpt.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_sqot.json +10 -0
- package/fixtures/python_v044_cli/snapshot_verify_trc.json +10 -0
- package/fixtures/python_v044_demo/agent_inbox.json +26 -0
- package/fixtures/python_v044_demo/agent_message.json +19 -0
- package/fixtures/python_v044_demo/agent_output.txt +1 -0
- package/fixtures/python_v044_demo/alt_admission_packet.json +208 -0
- package/fixtures/python_v044_demo/asi_proxy_phase_request.json +47 -0
- package/fixtures/python_v044_demo/general_intake_policy.json +58 -0
- package/fixtures/python_v044_demo/manifest.json +78 -0
- package/fixtures/python_v044_demo/packet_envelope.json +1463 -0
- package/fixtures/python_v044_demo/phase_dashboard.json +175 -0
- package/fixtures/python_v044_demo/runtime_state.json +143 -0
- package/fixtures/python_v044_demo/runtime_step_input.json +8 -0
- package/fixtures/python_v044_demo/runtime_step_report.json +1384 -0
- package/fixtures/python_v044_snapshots/alt.json +6830 -0
- package/fixtures/python_v044_snapshots/bit.json +543 -0
- package/fixtures/python_v044_snapshots/ecpt.json +2741 -0
- package/fixtures/python_v044_snapshots/sqot.json +2134 -0
- package/fixtures/python_v044_snapshots/trc.json +2880 -0
- package/package.json +129 -0
- package/schemas/ALTAccelerationCertificate.schema.json +169 -0
- package/schemas/ALTAdmissionDecision.schema.json +199 -0
- package/schemas/ALTCARACertificate.schema.json +285 -0
- package/schemas/ALTDeprecationRecord.schema.json +171 -0
- package/schemas/ALTKernelTransitionReport.schema.json +185 -0
- package/schemas/ALTResurrectionRecord.schema.json +171 -0
- package/schemas/ASIProxyTargetContract.schema.json +52 -0
- package/schemas/AbstractionToken.schema.json +281 -0
- package/schemas/AccelerationCertificate.schema.json +225 -0
- package/schemas/AccelerationExperimentSuite.schema.json +3731 -0
- package/schemas/AcceptedPacketPath.schema.json +148 -0
- package/schemas/ActionCommit.schema.json +67 -0
- package/schemas/ActionGrammar.schema.json +36 -0
- package/schemas/ActionabilityVector.schema.json +33 -0
- package/schemas/ActivationThresholdCertificate.schema.json +185 -0
- package/schemas/AdapterRouteSpec.schema.json +110 -0
- package/schemas/AdoptionFirstRunCommand.schema.json +44 -0
- package/schemas/AdoptionReviewChecklist.schema.json +36 -0
- package/schemas/AdoptionSafetyBoundary.schema.json +104 -0
- package/schemas/AgentAutonomyAuditReport.schema.json +213 -0
- package/schemas/AgentCheckReport.schema.json +3494 -0
- package/schemas/AgentCommandInvocation.schema.json +63 -0
- package/schemas/AgentCommunicationGuide.schema.json +213 -0
- package/schemas/AgentCommunicationPolicy.schema.json +73 -0
- package/schemas/AgentCommunicationStep.schema.json +85 -0
- package/schemas/AgentConnectorSpec.schema.json +89 -0
- package/schemas/AgentFeatureReadinessReport.schema.json +206 -0
- package/schemas/AgentIdentityAttestation.schema.json +99 -0
- package/schemas/AgentIdentityCheckReport.schema.json +225 -0
- package/schemas/AgentInboxRecord.schema.json +319 -0
- package/schemas/AgentIntakeReport.schema.json +3373 -0
- package/schemas/AgentIntakeRequest.schema.json +2250 -0
- package/schemas/AgentMessageContractReport.schema.json +195 -0
- package/schemas/AgentMessageDeliveryReport.schema.json +630 -0
- package/schemas/AgentMessageEnvelope.schema.json +201 -0
- package/schemas/AgentMessageNonceLedger.schema.json +45 -0
- package/schemas/AgentMessageVerificationContext.schema.json +60 -0
- package/schemas/AgentNetworkReadinessReport.schema.json +109 -0
- package/schemas/AgentNextActionReport.schema.json +83 -0
- package/schemas/AgentPacketExchangeReport.schema.json +519 -0
- package/schemas/AgentPeerRecord.schema.json +85 -0
- package/schemas/AgentPolicyIdentity.schema.json +79 -0
- package/schemas/AgentPopulationState.schema.json +2523 -0
- package/schemas/AgentRelayReadinessReport.schema.json +125 -0
- package/schemas/AgentRunbookReport.schema.json +100 -0
- package/schemas/AgentRuntimeConfig.schema.json +78 -0
- package/schemas/AgentTask.schema.json +101 -0
- package/schemas/AgentToOperatorRequest.schema.json +222 -0
- package/schemas/AgentWorkflowGuide.schema.json +128 -0
- package/schemas/AgentWorkflowStep.schema.json +59 -0
- package/schemas/AlgebraLawCertificate.schema.json +101 -0
- package/schemas/AttestationRecord.schema.json +63 -0
- package/schemas/AutocatalyticClosureWitness.schema.json +187 -0
- package/schemas/BaselineRefreshCertificate.schema.json +178 -0
- package/schemas/BasinReachabilityReport.schema.json +244 -0
- package/schemas/BottleneckCandidate.schema.json +105 -0
- package/schemas/BottleneckIntervention.schema.json +157 -0
- package/schemas/BottleneckInversionPlan.schema.json +212 -0
- package/schemas/BottleneckWitnessReport.schema.json +128 -0
- package/schemas/BoundaryGeneratorRecord.schema.json +57 -0
- package/schemas/BoundaryScriptRecord.schema.json +30 -0
- package/schemas/BudgetedToleranceScheduler.schema.json +59 -0
- package/schemas/CalibrationCertificate.schema.json +252 -0
- package/schemas/CanonicalImplementationReadinessReport.schema.json +298 -0
- package/schemas/CanonicalManifest.schema.json +80 -0
- package/schemas/CanonicalManifestRecord.schema.json +54 -0
- package/schemas/CanonicalTheorySnapshotSummary.schema.json +102 -0
- package/schemas/CapabilityBasinContract.schema.json +59 -0
- package/schemas/CapabilityPacketCandidate.schema.json +247 -0
- package/schemas/CapabilityPacketRegistry.schema.json +442 -0
- package/schemas/CapabilityStateVector.schema.json +169 -0
- package/schemas/CascadeResidualPotential.schema.json +32 -0
- package/schemas/CertificateCompilerRecord.schema.json +81 -0
- package/schemas/CertificateFamily.schema.json +376 -0
- package/schemas/CertificateRoute.schema.json +128 -0
- package/schemas/CertifiedAbstractionCapital.schema.json +161 -0
- package/schemas/CheckResult.schema.json +369 -0
- package/schemas/CheckerContext.schema.json +255 -0
- package/schemas/ClosedLoopAgentIteration.schema.json +1045 -0
- package/schemas/CollectivePhaseCertificate.schema.json +1377 -0
- package/schemas/CommercialReadinessSummary.schema.json +134 -0
- package/schemas/ConfidenceLedger.schema.json +26 -0
- package/schemas/ContentAddressedEvidenceRef.schema.json +48 -0
- package/schemas/ControlledTransition.schema.json +90 -0
- package/schemas/CryptographicAgentIdentity.schema.json +192 -0
- package/schemas/DKWCertificate.schema.json +31 -0
- package/schemas/DiagnosticReservePolicy.schema.json +22 -0
- package/schemas/DischargeRouteBinding.schema.json +93 -0
- package/schemas/DomainTypedSemiring.schema.json +55 -0
- package/schemas/DominanceWitness.schema.json +31 -0
- package/schemas/EProcessCertificate.schema.json +22 -0
- package/schemas/EdgeRelationVerificationReport.schema.json +161 -0
- package/schemas/EdgeRelationVerifierSpec.schema.json +62 -0
- package/schemas/EdgeWitness.schema.json +73 -0
- package/schemas/EdgeWitnessCertificate.schema.json +192 -0
- package/schemas/EvidenceArtifact.schema.json +112 -0
- package/schemas/EvidenceEnvelopeStoreRecord.schema.json +100 -0
- package/schemas/EvidencePolicy.schema.json +57 -0
- package/schemas/EvidenceResolutionBatch.schema.json +347 -0
- package/schemas/EvidenceVerificationProfile.schema.json +74 -0
- package/schemas/ExecutableALTCertificatePacket.schema.json +1512 -0
- package/schemas/ExecutableTraceNormalForm.schema.json +659 -0
- package/schemas/ExecutionAvailablePathCertificate.schema.json +204 -0
- package/schemas/ExternalCandidateClassification.schema.json +10 -0
- package/schemas/ExternalObligationCatalog.schema.json +238 -0
- package/schemas/ExternalVerifierHook.schema.json +174 -0
- package/schemas/FiniteOrder.schema.json +34 -0
- package/schemas/FinitePhaseControlCertificate.schema.json +100 -0
- package/schemas/FiniteTraceLaw.schema.json +30 -0
- package/schemas/FixedPopulationLedger.schema.json +255 -0
- package/schemas/FormationCostLedger.schema.json +91 -0
- package/schemas/FoundryControlDashboard.schema.json +198 -0
- package/schemas/FoundryState.schema.json +1819 -0
- package/schemas/FrontierDebtReport.schema.json +115 -0
- package/schemas/FunctorLawCertificate.schema.json +82 -0
- package/schemas/FusedGeometricComparisonCertificate.schema.json +79 -0
- package/schemas/FutureFreedomVector.schema.json +84 -0
- package/schemas/GeneralIntakePolicy.schema.json +255 -0
- package/schemas/GeneralIntakePolicyDecision.schema.json +85 -0
- package/schemas/GeneralIntakeProfile.schema.json +11 -0
- package/schemas/GeneralIntakeReport.schema.json +861 -0
- package/schemas/GeneralIntakeRuntimeBridgeReport.schema.json +761 -0
- package/schemas/GeneralIntakeSource.schema.json +57 -0
- package/schemas/GoodTuringCertificate.schema.json +27 -0
- package/schemas/HazardEnvelopeCertificate.schema.json +192 -0
- package/schemas/HiddenCapabilityInjectionReport.schema.json +212 -0
- package/schemas/IdentityContributionStatus.schema.json +11 -0
- package/schemas/IdentityTrustProfile.schema.json +12 -0
- package/schemas/ImplementationMaturity.schema.json +27 -0
- package/schemas/IndependenceCertificate.schema.json +42 -0
- package/schemas/InnerViabilityKernel.schema.json +45 -0
- package/schemas/IntakeProvenanceRecord.schema.json +192 -0
- package/schemas/InterventionCandidate.schema.json +266 -0
- package/schemas/Judgment.schema.json +351 -0
- package/schemas/LatticeWitness.schema.json +63 -0
- package/schemas/LedgerCoordinate.schema.json +79 -0
- package/schemas/LifecycleCostBounds.schema.json +65 -0
- package/schemas/LiquidityCertificate.schema.json +1094 -0
- package/schemas/MartingaleBlockResidual.schema.json +32 -0
- package/schemas/MartingaleDeficiencyCertificate.schema.json +76 -0
- package/schemas/MechanismCubeCertificate.schema.json +92 -0
- package/schemas/MissionValidityCertificate.schema.json +153 -0
- package/schemas/MonoidRecord.schema.json +30 -0
- package/schemas/MonotoneMap.schema.json +61 -0
- package/schemas/NegativeLiquidityCertificate.schema.json +176 -0
- package/schemas/NonPromotionPolicy.schema.json +39 -0
- package/schemas/ObligationRule.schema.json +54 -0
- package/schemas/ObligationSet.schema.json +230 -0
- package/schemas/ObligationTrace.schema.json +156 -0
- package/schemas/ObservationWindow.schema.json +48 -0
- package/schemas/ObservedTraceProjection.schema.json +57 -0
- package/schemas/OccupationLedger.schema.json +33 -0
- package/schemas/OperationalCheck.schema.json +29 -0
- package/schemas/OperationalReadinessReport.schema.json +216 -0
- package/schemas/OperatorAdoptionPacket.schema.json +303 -0
- package/schemas/OpportunityMeasureContract.schema.json +165 -0
- package/schemas/OrderedPotentialCone.schema.json +125 -0
- package/schemas/PacketCapitalLineage.schema.json +90 -0
- package/schemas/PacketExchangeEnvelope.schema.json +213 -0
- package/schemas/PacketImportInspectionReport.schema.json +68 -0
- package/schemas/PacketIngestionReport.schema.json +655 -0
- package/schemas/PacketLineageDigest.schema.json +70 -0
- package/schemas/PacketMergeReport.schema.json +286 -0
- package/schemas/PacketPromotionPolicy.schema.json +47 -0
- package/schemas/PacketPromotionReport.schema.json +354 -0
- package/schemas/PacketRejection.schema.json +158 -0
- package/schemas/PhaseAccelerationBenchmarkReport.schema.json +103 -0
- package/schemas/PhaseAccelerationPlan.schema.json +4449 -0
- package/schemas/PhaseAccelerationRequest.schema.json +5333 -0
- package/schemas/PhaseAccelerationScore.schema.json +66 -0
- package/schemas/PhaseBenchmarkCaseResult.schema.json +164 -0
- package/schemas/PhaseBenchmarkSuiteReport.schema.json +234 -0
- package/schemas/PhaseBenchmarkTask.schema.json +36 -0
- package/schemas/PhaseComponentGap.schema.json +46 -0
- package/schemas/PhaseControlAction.schema.json +80 -0
- package/schemas/PhaseControlAuditSummary.schema.json +143 -0
- package/schemas/PhaseControlEnvelope.schema.json +53 -0
- package/schemas/PhaseControlObjective.schema.json +98 -0
- package/schemas/PhaseControlPlan.schema.json +377 -0
- package/schemas/PhaseControlRunReport.schema.json +425 -0
- package/schemas/PhaseControlState.schema.json +383 -0
- package/schemas/PhaseDashboardReport.schema.json +249 -0
- package/schemas/PhaseGapVector.schema.json +101 -0
- package/schemas/PhaseObservationReport.schema.json +321 -0
- package/schemas/PhaseTrajectoryReport.schema.json +4522 -0
- package/schemas/PopulationRuntimeStepReport.schema.json +5125 -0
- package/schemas/PortabilityConformanceReport.schema.json +99 -0
- package/schemas/PortabilitySchemaBundle.schema.json +23 -0
- package/schemas/ProblemSolvingTrace.schema.json +162 -0
- package/schemas/ProcessGrammarRecord.schema.json +56 -0
- package/schemas/ProductOrder.schema.json +53 -0
- package/schemas/ProductionReadinessProfile.schema.json +37 -0
- package/schemas/ProjectionAudit.schema.json +70 -0
- package/schemas/ProofObligation.schema.json +200 -0
- package/schemas/ProtocolFrameDigest.schema.json +79 -0
- package/schemas/ProtocolFunctorCertificate.schema.json +89 -0
- package/schemas/ProtocolObject.schema.json +45 -0
- package/schemas/ProtocolRelativeBenchmarkMetric.schema.json +39 -0
- package/schemas/ProvenanceManifest.schema.json +221 -0
- package/schemas/ProvenanceManifestEntry.schema.json +29 -0
- package/schemas/PsiDashboard.schema.json +213 -0
- package/schemas/PullbackGluingWitness.schema.json +43 -0
- package/schemas/QuarantineLedger.schema.json +31 -0
- package/schemas/ReachableMassRecursionCertificate.schema.json +129 -0
- package/schemas/ReconstructionResidual.schema.json +24 -0
- package/schemas/RefreshRule.schema.json +31 -0
- package/schemas/Registry.schema.json +231 -0
- package/schemas/ReleaseArtifactManifest.schema.json +62 -0
- package/schemas/ReproductionMatrixCertificate.schema.json +190 -0
- package/schemas/ResidualCarryForwardReport.schema.json +57 -0
- package/schemas/ResourceCalendarRecord.schema.json +67 -0
- package/schemas/ResourceEnvelope.schema.json +42 -0
- package/schemas/ResourceMatchedBaselineConfig.schema.json +81 -0
- package/schemas/RiskBudgetLedger.schema.json +19 -0
- package/schemas/RobotsDecision.schema.json +44 -0
- package/schemas/RootFinalityCertificate.schema.json +190 -0
- package/schemas/RouteExecutionBatch.schema.json +930 -0
- package/schemas/RouteExecutionRequest.schema.json +87 -0
- package/schemas/RuntimeActionResult.schema.json +807 -0
- package/schemas/RuntimeComparisonReport.schema.json +3670 -0
- package/schemas/RuntimeEvent.schema.json +142 -0
- package/schemas/RuntimeEventLog.schema.json +161 -0
- package/schemas/RuntimeExecutionReport.schema.json +872 -0
- package/schemas/RuntimeExecutorPolicy.schema.json +68 -0
- package/schemas/RuntimeHealthReport.schema.json +161 -0
- package/schemas/RuntimeIdentityContext.schema.json +480 -0
- package/schemas/RuntimeRunReport.schema.json +3487 -0
- package/schemas/RuntimeServiceSettings.schema.json +55 -0
- package/schemas/RuntimeState.schema.json +1438 -0
- package/schemas/RuntimeStepInput.schema.json +685 -0
- package/schemas/RuntimeStepReport.schema.json +3314 -0
- package/schemas/RuntimeStoreRecord.schema.json +106 -0
- package/schemas/RuntimeStoreSnapshot.schema.json +4815 -0
- package/schemas/SBOMManifest.schema.json +67 -0
- package/schemas/SQOTTheorySnapshot.schema.json +49 -0
- package/schemas/SafePhaseAction.schema.json +96 -0
- package/schemas/SalienceQueueRecord.schema.json +313 -0
- package/schemas/SalienceScheduleReport.schema.json +434 -0
- package/schemas/SalienceSchedulingDecision.schema.json +167 -0
- package/schemas/SchemaBundleDigest.schema.json +57 -0
- package/schemas/ScriptGroundMetricCertificate.schema.json +47 -0
- package/schemas/SelectiveCUPCertificate.schema.json +414 -0
- package/schemas/SettlementReturnRAFCertificate.schema.json +122 -0
- package/schemas/SinkhornCertificate.schema.json +55 -0
- package/schemas/SnapshotAttribution.schema.json +63 -0
- package/schemas/SnapshotCatalog.schema.json +481 -0
- package/schemas/SplitCertificate.schema.json +39 -0
- package/schemas/StatusAlgebraRecord.schema.json +37 -0
- package/schemas/StoppedEvidenceSheafCertificate.schema.json +120 -0
- package/schemas/StrictTexParseReport.schema.json +67 -0
- package/schemas/SybilResistanceLedger.schema.json +427 -0
- package/schemas/SybilResistancePolicy.schema.json +176 -0
- package/schemas/TRCCompileResult.schema.json +239 -0
- package/schemas/TRCStateRecord.schema.json +149 -0
- package/schemas/TelemetryCostCertificate.schema.json +171 -0
- package/schemas/TexGrammarDiagnostic.schema.json +39 -0
- package/schemas/TheoryAuditReport.schema.json +654 -0
- package/schemas/TheoryAuditSuiteReport.schema.json +775 -0
- package/schemas/TheoryFidelityReport.schema.json +100 -0
- package/schemas/TheoryImplementationRecord.schema.json +203 -0
- package/schemas/TheorySnapshot.schema.json +459 -0
- package/schemas/TheorySnapshotItem.schema.json +60 -0
- package/schemas/TokenLineage.schema.json +76 -0
- package/schemas/ToleranceAllocationCertificate.schema.json +62 -0
- package/schemas/TraceNormalizationCertificate.schema.json +77 -0
- package/schemas/TraceSufficiencyCertificate.schema.json +166 -0
- package/schemas/TransportCertificate.schema.json +178 -0
- package/schemas/TypedTraceTransducerRecord.schema.json +64 -0
- package/schemas/ValueBridgeReport.schema.json +131 -0
- package/schemas/VectorCompatibleFamily.schema.json +354 -0
- package/schemas/VerificationThroughputReport.schema.json +62 -0
- package/schemas/VerifiedCapabilityPacket.schema.json +251 -0
- package/schemas/VerifierEvidenceEnvelope.schema.json +178 -0
- package/schemas/VerifierResolution.schema.json +275 -0
- package/schemas/WebDiscoveryReport.schema.json +675 -0
- package/schemas/WebFetchPolicy.schema.json +145 -0
- package/schemas/WebFetchReport.schema.json +133 -0
- package/schemas/bundle.schema.json +100808 -0
- package/schemas/schema-digest.json +1674 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface ValidationResult {
|
|
2
|
+
valid: boolean;
|
|
3
|
+
errors: string[];
|
|
4
|
+
}
|
|
5
|
+
declare function schemaNames(): string[];
|
|
6
|
+
declare function schemaByType(typeName?: string): Record<string, unknown>;
|
|
7
|
+
declare function schemaBundle(): {
|
|
8
|
+
bundle_id: string;
|
|
9
|
+
schemas: Record<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
declare function validateData(data: unknown, schema: Record<string, unknown>): ValidationResult;
|
|
12
|
+
declare function validateByType(data: unknown, typeName: string): ValidationResult;
|
|
13
|
+
declare function writeSchema(typeName: string, outputPath: string): void;
|
|
14
|
+
declare function writeAllSchemas(outputDir: string): string[];
|
|
15
|
+
|
|
16
|
+
export { type ValidationResult, schemaBundle, schemaByType, schemaNames, validateByType, validateData, writeAllSchemas, writeSchema };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// src/io/schema.ts
|
|
2
|
+
import {
|
|
3
|
+
cpSync,
|
|
4
|
+
existsSync as existsSync2,
|
|
5
|
+
mkdirSync,
|
|
6
|
+
readdirSync,
|
|
7
|
+
readFileSync,
|
|
8
|
+
writeFileSync
|
|
9
|
+
} from "fs";
|
|
10
|
+
import { basename, join as join2 } from "path";
|
|
11
|
+
import Ajv2020Module from "ajv/dist/2020.js";
|
|
12
|
+
|
|
13
|
+
// src/core/json.ts
|
|
14
|
+
function sortJson(value) {
|
|
15
|
+
if (Array.isArray(value)) {
|
|
16
|
+
return value.map((item) => sortJson(item));
|
|
17
|
+
}
|
|
18
|
+
if (value && typeof value === "object") {
|
|
19
|
+
const input = value;
|
|
20
|
+
const output = {};
|
|
21
|
+
for (const key of Object.keys(input).sort()) {
|
|
22
|
+
const child = input[key];
|
|
23
|
+
if (child !== void 0) {
|
|
24
|
+
output[key] = sortJson(child);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return output;
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
function stableStringify(value) {
|
|
32
|
+
return `${JSON.stringify(sortJson(value), null, 2)}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
function parseJsonObject(text, label = "JSON") {
|
|
36
|
+
const parsed = JSON.parse(text);
|
|
37
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
38
|
+
throw new Error(`${label} must be a JSON object`);
|
|
39
|
+
}
|
|
40
|
+
return parsed;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/io/paths.ts
|
|
44
|
+
import { existsSync } from "fs";
|
|
45
|
+
import { dirname, join, resolve } from "path";
|
|
46
|
+
import { fileURLToPath } from "url";
|
|
47
|
+
function packageRoot() {
|
|
48
|
+
let current = dirname(fileURLToPath(import.meta.url));
|
|
49
|
+
for (let i = 0; i < 8; i += 1) {
|
|
50
|
+
if (existsSync(join(current, "package.json")) && existsSync(join(current, "schemas"))) {
|
|
51
|
+
return current;
|
|
52
|
+
}
|
|
53
|
+
const next = dirname(current);
|
|
54
|
+
if (next === current) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
current = next;
|
|
58
|
+
}
|
|
59
|
+
return resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
60
|
+
}
|
|
61
|
+
function schemaDir() {
|
|
62
|
+
return join(packageRoot(), "schemas");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/io/schema.ts
|
|
66
|
+
var PUBLIC_SCHEMA_NAME = /^[A-Za-z][A-Za-z0-9]*$/;
|
|
67
|
+
function assertSchemaTypeName(typeName) {
|
|
68
|
+
if (!PUBLIC_SCHEMA_NAME.test(typeName)) {
|
|
69
|
+
throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function schemaPath(typeName) {
|
|
73
|
+
assertSchemaTypeName(typeName);
|
|
74
|
+
return join2(schemaDir(), `${typeName}.schema.json`);
|
|
75
|
+
}
|
|
76
|
+
function schemaNames() {
|
|
77
|
+
return readdirSync(schemaDir()).filter(
|
|
78
|
+
(name) => name.endsWith(".schema.json") && name !== "bundle.schema.json"
|
|
79
|
+
).map((name) => name.slice(0, -".schema.json".length)).sort();
|
|
80
|
+
}
|
|
81
|
+
function schemaByType(typeName = "Registry") {
|
|
82
|
+
const path = schemaPath(typeName);
|
|
83
|
+
if (!existsSync2(path)) {
|
|
84
|
+
throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
|
|
85
|
+
}
|
|
86
|
+
return parseJsonObject(readFileSync(path, "utf8"), `${typeName} schema`);
|
|
87
|
+
}
|
|
88
|
+
function schemaBundle() {
|
|
89
|
+
const bundlePath = join2(schemaDir(), "bundle.schema.json");
|
|
90
|
+
if (existsSync2(bundlePath)) {
|
|
91
|
+
const bundle = parseJsonObject(
|
|
92
|
+
readFileSync(bundlePath, "utf8"),
|
|
93
|
+
"schema bundle"
|
|
94
|
+
);
|
|
95
|
+
if (bundle.bundle_id && bundle.schemas && typeof bundle.schemas === "object" && !Array.isArray(bundle.schemas)) {
|
|
96
|
+
return bundle;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const schemas = {};
|
|
100
|
+
for (const name of schemaNames()) {
|
|
101
|
+
schemas[name] = schemaByType(name);
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
bundle_id: "percolation-inversion-compiler-portability",
|
|
105
|
+
schemas
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function validateData(data, schema) {
|
|
109
|
+
const Ajv2020 = Ajv2020Module;
|
|
110
|
+
const ajv = new Ajv2020({ allErrors: true, strict: false });
|
|
111
|
+
const validate = ajv.compile(schema);
|
|
112
|
+
const valid = Boolean(validate(data));
|
|
113
|
+
return {
|
|
114
|
+
valid,
|
|
115
|
+
errors: valid ? [] : (validate.errors ?? []).map(
|
|
116
|
+
(error) => `${error.instancePath || "/"} ${error.message ?? "is invalid"}`
|
|
117
|
+
)
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function validateByType(data, typeName) {
|
|
121
|
+
return validateData(data, schemaByType(typeName));
|
|
122
|
+
}
|
|
123
|
+
function writeSchema(typeName, outputPath) {
|
|
124
|
+
writeFileSync(outputPath, stableStringify(schemaByType(typeName)), "utf8");
|
|
125
|
+
}
|
|
126
|
+
function writeAllSchemas(outputDir) {
|
|
127
|
+
mkdirSync(outputDir, { recursive: true });
|
|
128
|
+
const written = [];
|
|
129
|
+
const files = [
|
|
130
|
+
...schemaNames().map((name) => `${name}.schema.json`),
|
|
131
|
+
"bundle.schema.json",
|
|
132
|
+
"schema-digest.json"
|
|
133
|
+
];
|
|
134
|
+
for (const file of files) {
|
|
135
|
+
const source = join2(schemaDir(), file);
|
|
136
|
+
if (!existsSync2(source)) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const target = join2(outputDir, file);
|
|
140
|
+
cpSync(source, target);
|
|
141
|
+
written.push(basename(target));
|
|
142
|
+
}
|
|
143
|
+
return written.sort();
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
schemaBundle,
|
|
147
|
+
schemaByType,
|
|
148
|
+
schemaNames,
|
|
149
|
+
validateByType,
|
|
150
|
+
validateData,
|
|
151
|
+
writeAllSchemas,
|
|
152
|
+
writeSchema
|
|
153
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare function packetEnvelopeFromRuntimeReport(report: Record<string, unknown>): Record<string, unknown>;
|
|
2
|
+
declare function packetEnvelopeFromPath(path: string): Record<string, unknown>;
|
|
3
|
+
declare function readPacketEnvelope(path: string): Record<string, unknown>;
|
|
4
|
+
declare function readPacketOrMerge(path: string): Record<string, unknown>;
|
|
5
|
+
declare function inspectPacketEnvelope(envelope: Record<string, unknown>): Record<string, unknown>;
|
|
6
|
+
declare function mergePacketEnvelopes(envelopes: Array<Record<string, unknown>>): Record<string, unknown>;
|
|
7
|
+
declare function packetLineageDigest(packetOrMerge: Record<string, unknown>): Record<string, unknown>;
|
|
8
|
+
declare function packetToJson(packet: Record<string, unknown>): string;
|
|
9
|
+
|
|
10
|
+
export { inspectPacketEnvelope, mergePacketEnvelopes, packetEnvelopeFromPath, packetEnvelopeFromRuntimeReport, packetLineageDigest, packetToJson, readPacketEnvelope, readPacketOrMerge };
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
// src/packet/index.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
4
|
+
|
|
5
|
+
// src/core/json.ts
|
|
6
|
+
function sortJson(value) {
|
|
7
|
+
if (Array.isArray(value)) {
|
|
8
|
+
return value.map((item) => sortJson(item));
|
|
9
|
+
}
|
|
10
|
+
if (value && typeof value === "object") {
|
|
11
|
+
const input = value;
|
|
12
|
+
const output = {};
|
|
13
|
+
for (const key of Object.keys(input).sort()) {
|
|
14
|
+
const child = input[key];
|
|
15
|
+
if (child !== void 0) {
|
|
16
|
+
output[key] = sortJson(child);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return output;
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
function stableStringify(value) {
|
|
24
|
+
return `${JSON.stringify(sortJson(value), null, 2)}
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
function parseJsonObject(text, label = "JSON") {
|
|
28
|
+
const parsed = JSON.parse(text);
|
|
29
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
30
|
+
throw new Error(`${label} must be a JSON object`);
|
|
31
|
+
}
|
|
32
|
+
return parsed;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// src/core/ledger.ts
|
|
36
|
+
function summarizeLedger(ledger) {
|
|
37
|
+
const summary = {};
|
|
38
|
+
if (!ledger) {
|
|
39
|
+
return summary;
|
|
40
|
+
}
|
|
41
|
+
for (const coordinate of Object.values(ledger.coordinates ?? {})) {
|
|
42
|
+
const kind = coordinate.kind ?? "residual";
|
|
43
|
+
summary[kind] = (summary[kind] ?? 0) + Number(coordinate.value ?? 0);
|
|
44
|
+
}
|
|
45
|
+
return Object.fromEntries(
|
|
46
|
+
Object.entries(summary).sort(([a], [b]) => a.localeCompare(b))
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/io/schema.ts
|
|
51
|
+
import {
|
|
52
|
+
cpSync,
|
|
53
|
+
existsSync as existsSync2,
|
|
54
|
+
mkdirSync,
|
|
55
|
+
readdirSync,
|
|
56
|
+
readFileSync,
|
|
57
|
+
writeFileSync
|
|
58
|
+
} from "fs";
|
|
59
|
+
import { basename, join as join2 } from "path";
|
|
60
|
+
import Ajv2020Module from "ajv/dist/2020.js";
|
|
61
|
+
|
|
62
|
+
// src/io/paths.ts
|
|
63
|
+
import { existsSync } from "fs";
|
|
64
|
+
import { dirname, join, resolve } from "path";
|
|
65
|
+
import { fileURLToPath } from "url";
|
|
66
|
+
function packageRoot() {
|
|
67
|
+
let current = dirname(fileURLToPath(import.meta.url));
|
|
68
|
+
for (let i = 0; i < 8; i += 1) {
|
|
69
|
+
if (existsSync(join(current, "package.json")) && existsSync(join(current, "schemas"))) {
|
|
70
|
+
return current;
|
|
71
|
+
}
|
|
72
|
+
const next = dirname(current);
|
|
73
|
+
if (next === current) {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
current = next;
|
|
77
|
+
}
|
|
78
|
+
return resolve(dirname(fileURLToPath(import.meta.url)), "../..");
|
|
79
|
+
}
|
|
80
|
+
function schemaDir() {
|
|
81
|
+
return join(packageRoot(), "schemas");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/io/schema.ts
|
|
85
|
+
var PUBLIC_SCHEMA_NAME = /^[A-Za-z][A-Za-z0-9]*$/;
|
|
86
|
+
function assertSchemaTypeName(typeName) {
|
|
87
|
+
if (!PUBLIC_SCHEMA_NAME.test(typeName)) {
|
|
88
|
+
throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function schemaPath(typeName) {
|
|
92
|
+
assertSchemaTypeName(typeName);
|
|
93
|
+
return join2(schemaDir(), `${typeName}.schema.json`);
|
|
94
|
+
}
|
|
95
|
+
function schemaByType(typeName = "Registry") {
|
|
96
|
+
const path = schemaPath(typeName);
|
|
97
|
+
if (!existsSync2(path)) {
|
|
98
|
+
throw new Error(`unknown schema type ${JSON.stringify(typeName)}`);
|
|
99
|
+
}
|
|
100
|
+
return parseJsonObject(readFileSync(path, "utf8"), `${typeName} schema`);
|
|
101
|
+
}
|
|
102
|
+
function validateData(data, schema) {
|
|
103
|
+
const Ajv2020 = Ajv2020Module;
|
|
104
|
+
const ajv = new Ajv2020({ allErrors: true, strict: false });
|
|
105
|
+
const validate = ajv.compile(schema);
|
|
106
|
+
const valid = Boolean(validate(data));
|
|
107
|
+
return {
|
|
108
|
+
valid,
|
|
109
|
+
errors: valid ? [] : (validate.errors ?? []).map(
|
|
110
|
+
(error) => `${error.instancePath || "/"} ${error.message ?? "is invalid"}`
|
|
111
|
+
)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function validateByType(data, typeName) {
|
|
115
|
+
return validateData(data, schemaByType(typeName));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/packet/index.ts
|
|
119
|
+
var COMMAND_MARKERS = [
|
|
120
|
+
"cmd.exe",
|
|
121
|
+
"powershell",
|
|
122
|
+
"bash ",
|
|
123
|
+
"sh ",
|
|
124
|
+
"wsl ",
|
|
125
|
+
"git ",
|
|
126
|
+
"pip install",
|
|
127
|
+
"python -m pip",
|
|
128
|
+
"uv run",
|
|
129
|
+
"rm -rf",
|
|
130
|
+
"curl ",
|
|
131
|
+
"wget "
|
|
132
|
+
];
|
|
133
|
+
function sha256(text) {
|
|
134
|
+
return createHash("sha256").update(text, "utf8").digest("hex");
|
|
135
|
+
}
|
|
136
|
+
function stableDigest(data) {
|
|
137
|
+
return sha256(JSON.stringify(sortJson(data)));
|
|
138
|
+
}
|
|
139
|
+
function sortedUnique(values) {
|
|
140
|
+
return [
|
|
141
|
+
...new Set(values.filter((value) => Boolean(value)))
|
|
142
|
+
].sort();
|
|
143
|
+
}
|
|
144
|
+
function commandLikeStrings(data) {
|
|
145
|
+
if (typeof data === "string") {
|
|
146
|
+
const lower = data.toLowerCase();
|
|
147
|
+
return COMMAND_MARKERS.some((marker) => lower.includes(marker)) ? [data] : [];
|
|
148
|
+
}
|
|
149
|
+
if (Array.isArray(data)) {
|
|
150
|
+
return data.flatMap((item) => commandLikeStrings(item));
|
|
151
|
+
}
|
|
152
|
+
if (data && typeof data === "object") {
|
|
153
|
+
return Object.values(data).flatMap((value) => commandLikeStrings(value));
|
|
154
|
+
}
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
function readTypedJson(path, schema) {
|
|
158
|
+
const data = parseJsonObject(readFileSync2(path, "utf8"), schema);
|
|
159
|
+
const validation = validateByType(data, schema);
|
|
160
|
+
if (!validation.valid) {
|
|
161
|
+
throw new Error(
|
|
162
|
+
`${schema} schema-invalid: ${validation.errors.join("; ")}`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return data;
|
|
166
|
+
}
|
|
167
|
+
function residualCarryForward(reportId, residualSummary, missingObligations, candidateOnlyReasons, settledBlockers, accepted) {
|
|
168
|
+
return {
|
|
169
|
+
accepted,
|
|
170
|
+
candidate_only_reasons: candidateOnlyReasons,
|
|
171
|
+
missing_obligations: missingObligations,
|
|
172
|
+
reasons: ["residuals and blockers are preserved during packet export"],
|
|
173
|
+
report_id: reportId,
|
|
174
|
+
residual_summary: residualSummary,
|
|
175
|
+
settled: false,
|
|
176
|
+
settled_blockers: settledBlockers
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function packetEnvelopeFromRuntimeReport(report) {
|
|
180
|
+
const digest = stableDigest(report);
|
|
181
|
+
const missing = Array.isArray(report.missing_obligations) ? report.missing_obligations.map(String) : [];
|
|
182
|
+
const residualSummary = summarizeLedger(report.residual_ledger);
|
|
183
|
+
const candidateOnlyReasons = [
|
|
184
|
+
"runtime report is exported as diagnostic packet-exchange data",
|
|
185
|
+
"packet exchange does not route promotion checks"
|
|
186
|
+
];
|
|
187
|
+
const settledBlockers = sortedUnique([
|
|
188
|
+
"packet exchange is sidecar-only and cannot settle claims",
|
|
189
|
+
report.settled === true ? null : "source runtime report settled=false",
|
|
190
|
+
...missing
|
|
191
|
+
]);
|
|
192
|
+
const reportId = String(report.report_id ?? "runtime-report");
|
|
193
|
+
return {
|
|
194
|
+
accepted: report.accepted === true,
|
|
195
|
+
candidate_only_reasons: candidateOnlyReasons,
|
|
196
|
+
content: report,
|
|
197
|
+
content_digest: digest,
|
|
198
|
+
created_timestamp: "not-recorded",
|
|
199
|
+
identity_context_summary: {
|
|
200
|
+
accepted_agent_context_present: false,
|
|
201
|
+
accepted_public_key_context_present: false
|
|
202
|
+
},
|
|
203
|
+
issuer_agent_id: null,
|
|
204
|
+
issuer_public_key_id: null,
|
|
205
|
+
lineage_parents: [reportId],
|
|
206
|
+
missing_obligations: missing,
|
|
207
|
+
packet_id: `packet-exchange:${reportId}:${digest.slice(0, 12)}`,
|
|
208
|
+
provenance_summary: {
|
|
209
|
+
source_report_id: reportId,
|
|
210
|
+
state_id: String(report.state_id ?? ""),
|
|
211
|
+
input_id: String(report.input_id ?? "")
|
|
212
|
+
},
|
|
213
|
+
reasons: ["exported packet is diagnostic data and is not promoted"],
|
|
214
|
+
residual_carry_forward: residualCarryForward(
|
|
215
|
+
`residual-carry-forward:${reportId}`,
|
|
216
|
+
residualSummary,
|
|
217
|
+
missing,
|
|
218
|
+
candidateOnlyReasons,
|
|
219
|
+
settledBlockers,
|
|
220
|
+
report.accepted === true
|
|
221
|
+
),
|
|
222
|
+
residual_ledger_summary: residualSummary,
|
|
223
|
+
safety_invariants: [
|
|
224
|
+
"packet exchange treats content as inert data",
|
|
225
|
+
"packet exchange does not execute embedded commands",
|
|
226
|
+
"packet exchange does not promote packets to settled"
|
|
227
|
+
],
|
|
228
|
+
schema_version: "pic-packet-exchange-v1",
|
|
229
|
+
settled: false,
|
|
230
|
+
settled_blockers: settledBlockers,
|
|
231
|
+
source_kind: "runtime-report",
|
|
232
|
+
workflow_usable: report.accepted === true
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function packetEnvelopeFromPath(path) {
|
|
236
|
+
return packetEnvelopeFromRuntimeReport(
|
|
237
|
+
readTypedJson(path, "RuntimeStepReport")
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
function readPacketEnvelope(path) {
|
|
241
|
+
return readTypedJson(path, "PacketExchangeEnvelope");
|
|
242
|
+
}
|
|
243
|
+
function readPacketOrMerge(path) {
|
|
244
|
+
const data = parseJsonObject(
|
|
245
|
+
readFileSync2(path, "utf8"),
|
|
246
|
+
"packet or merge report"
|
|
247
|
+
);
|
|
248
|
+
if (Array.isArray(data.packets)) {
|
|
249
|
+
const validation2 = validateByType(data, "PacketMergeReport");
|
|
250
|
+
if (!validation2.valid) {
|
|
251
|
+
throw new Error(
|
|
252
|
+
`PacketMergeReport schema-invalid: ${validation2.errors.join("; ")}`
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
return data;
|
|
256
|
+
}
|
|
257
|
+
const validation = validateByType(data, "PacketExchangeEnvelope");
|
|
258
|
+
if (!validation.valid) {
|
|
259
|
+
throw new Error(
|
|
260
|
+
`PacketExchangeEnvelope schema-invalid: ${validation.errors.join("; ")}`
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
return data;
|
|
264
|
+
}
|
|
265
|
+
function inspectPacketEnvelope(envelope) {
|
|
266
|
+
return {
|
|
267
|
+
accepted: envelope.accepted === true,
|
|
268
|
+
candidate_only: true,
|
|
269
|
+
content_digest: String(envelope.content_digest ?? ""),
|
|
270
|
+
content_treated_as_data: true,
|
|
271
|
+
embedded_command_like_values: sortedUnique(commandLikeStrings(envelope)),
|
|
272
|
+
executed_command_count: 0,
|
|
273
|
+
packet_id: String(envelope.packet_id ?? ""),
|
|
274
|
+
reasons: [
|
|
275
|
+
"packet content was inspected as inert data",
|
|
276
|
+
"embedded command-like strings are not execution authority"
|
|
277
|
+
],
|
|
278
|
+
report_id: `packet-inspection:${String(envelope.packet_id ?? "")}`,
|
|
279
|
+
settled: false,
|
|
280
|
+
workflow_usable: envelope.workflow_usable === true
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
function mergePacketEnvelopes(envelopes) {
|
|
284
|
+
const byDigest = /* @__PURE__ */ new Map();
|
|
285
|
+
const duplicateIds = [];
|
|
286
|
+
const duplicateDigests = [];
|
|
287
|
+
const residualSummary = {};
|
|
288
|
+
const missing = [];
|
|
289
|
+
const candidateOnly = [];
|
|
290
|
+
const blockers = [];
|
|
291
|
+
for (const envelope of envelopes) {
|
|
292
|
+
const digest = String(envelope.content_digest ?? "");
|
|
293
|
+
if (byDigest.has(digest)) {
|
|
294
|
+
duplicateIds.push(String(envelope.packet_id ?? ""));
|
|
295
|
+
duplicateDigests.push(digest);
|
|
296
|
+
} else {
|
|
297
|
+
byDigest.set(digest, envelope);
|
|
298
|
+
}
|
|
299
|
+
for (const [key, value] of Object.entries(
|
|
300
|
+
envelope.residual_ledger_summary ?? {}
|
|
301
|
+
)) {
|
|
302
|
+
residualSummary[key] = (residualSummary[key] ?? 0) + Number(value);
|
|
303
|
+
}
|
|
304
|
+
if (Array.isArray(envelope.missing_obligations)) {
|
|
305
|
+
missing.push(...envelope.missing_obligations.map(String));
|
|
306
|
+
}
|
|
307
|
+
if (Array.isArray(envelope.candidate_only_reasons)) {
|
|
308
|
+
candidateOnly.push(...envelope.candidate_only_reasons.map(String));
|
|
309
|
+
}
|
|
310
|
+
if (Array.isArray(envelope.settled_blockers)) {
|
|
311
|
+
blockers.push(...envelope.settled_blockers.map(String));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
const packets = [...byDigest.values()];
|
|
315
|
+
return {
|
|
316
|
+
accepted: packets.length > 0 && packets.every((packet) => packet.accepted === true),
|
|
317
|
+
candidate_only_preserved: packets.every(
|
|
318
|
+
(packet) => packet.settled !== true
|
|
319
|
+
),
|
|
320
|
+
duplicate_content_digests: sortedUnique(duplicateDigests),
|
|
321
|
+
duplicate_packet_ids: sortedUnique(duplicateIds),
|
|
322
|
+
input_packet_count: envelopes.length,
|
|
323
|
+
merged_packet_count: packets.length,
|
|
324
|
+
packets,
|
|
325
|
+
reasons: ["packet merge is diagnostic-only and does not promote packets"],
|
|
326
|
+
report_id: "packet-merge-report",
|
|
327
|
+
residual_carry_forward: residualCarryForward(
|
|
328
|
+
"residual-carry-forward:packet-merge",
|
|
329
|
+
Object.fromEntries(Object.entries(residualSummary).sort()),
|
|
330
|
+
sortedUnique(missing),
|
|
331
|
+
sortedUnique(candidateOnly),
|
|
332
|
+
sortedUnique(blockers),
|
|
333
|
+
packets.length > 0 && packets.every((packet) => packet.accepted === true)
|
|
334
|
+
),
|
|
335
|
+
settled: false,
|
|
336
|
+
workflow_usable: packets.some((packet) => packet.workflow_usable === true)
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function packetLineageDigest(packetOrMerge) {
|
|
340
|
+
const packets = Array.isArray(packetOrMerge.packets) ? packetOrMerge.packets : [packetOrMerge];
|
|
341
|
+
const residualSummary = {};
|
|
342
|
+
for (const packet of packets) {
|
|
343
|
+
for (const [key, value] of Object.entries(
|
|
344
|
+
packet.residual_ledger_summary ?? {}
|
|
345
|
+
)) {
|
|
346
|
+
residualSummary[key] = (residualSummary[key] ?? 0) + Number(value);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
accepted: packets.length > 0 && packets.every((packet) => packet.accepted === true),
|
|
351
|
+
candidate_only: true,
|
|
352
|
+
content_digests: packets.map(
|
|
353
|
+
(packet) => String(packet.content_digest ?? "")
|
|
354
|
+
),
|
|
355
|
+
lineage_id: "packet-lineage-digest",
|
|
356
|
+
packet_ids: packets.map((packet) => String(packet.packet_id ?? "")),
|
|
357
|
+
parent_edges: Object.fromEntries(
|
|
358
|
+
packets.map((packet) => [
|
|
359
|
+
String(packet.packet_id ?? ""),
|
|
360
|
+
Array.isArray(packet.lineage_parents) ? packet.lineage_parents.map(String) : []
|
|
361
|
+
])
|
|
362
|
+
),
|
|
363
|
+
reasons: [
|
|
364
|
+
"lineage digest is diagnostic-only and preserves candidate status"
|
|
365
|
+
],
|
|
366
|
+
residual_summary: Object.fromEntries(
|
|
367
|
+
Object.entries(residualSummary).sort()
|
|
368
|
+
),
|
|
369
|
+
settled: false,
|
|
370
|
+
workflow_usable: packets.some((packet) => packet.workflow_usable === true)
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
function packetToJson(packet) {
|
|
374
|
+
return stableStringify(packet);
|
|
375
|
+
}
|
|
376
|
+
export {
|
|
377
|
+
inspectPacketEnvelope,
|
|
378
|
+
mergePacketEnvelopes,
|
|
379
|
+
packetEnvelopeFromPath,
|
|
380
|
+
packetEnvelopeFromRuntimeReport,
|
|
381
|
+
packetLineageDigest,
|
|
382
|
+
packetToJson,
|
|
383
|
+
readPacketEnvelope,
|
|
384
|
+
readPacketOrMerge
|
|
385
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Portability Conformance Pack
|
|
2
|
+
|
|
3
|
+
This directory contains stable JSON outputs for cross-language implementations.
|
|
4
|
+
Each file is intended to validate against the public schema named in
|
|
5
|
+
`manifest.json`. Manifest SHA-256 values are computed over LF-normalized bytes
|
|
6
|
+
so Windows and Unix checkouts validate the same examples.
|
|
7
|
+
|
|
8
|
+
The examples are protocol-relative and intentionally keep `settled=false` where
|
|
9
|
+
external or route-level obligations remain. Ports should preserve the separate
|
|
10
|
+
meanings of `accepted`, `operationally_usable`, `finite_checks_passed`, and
|
|
11
|
+
`settled` rather than collapsing them into one success flag.
|
|
12
|
+
|
|
13
|
+
The phase acceleration examples add the compact planning contract for ports:
|
|
14
|
+
`PhaseAccelerationPlan` ranks finite gaps, bottlenecks, and safe next actions,
|
|
15
|
+
while `PhaseAccelerationBenchmarkReport` checks that candidate-only volume does
|
|
16
|
+
not reduce phase gaps and that planner output does not grant execution
|
|
17
|
+
authority.
|