tgi-foundation 0.2.0.dev0__tar.gz → 0.2.0.dev11__tar.gz
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.
- tgi_foundation-0.2.0.dev11/MANIFEST.in +3 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/PKG-INFO +3 -7
- tgi_foundation-0.2.0.dev11/README.md +3 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/pyproject.toml +4 -4
- tgi_foundation-0.2.0.dev11/tgi/causal_port_classes.py +226 -0
- tgi_foundation-0.2.0.dev11/tgi/causal_port_classes_check.py +93 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/intervention_continuity_check.py +2 -3
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/intervention_roles_check.py +1 -2
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/lineage_state_check.py +2 -3
- tgi_foundation-0.2.0.dev11/tgi/phase_bound_port_classes.py +204 -0
- tgi_foundation-0.2.0.dev11/tgi/phase_bound_response_atlas.py +265 -0
- tgi_foundation-0.2.0.dev11/tgi/phase_bound_response_atlas_check.py +92 -0
- tgi_foundation-0.2.0.dev11/tgi/response_incidence_check.py +25 -0
- tgi_foundation-0.2.0.dev11/tgi/source_bound_endpoint_transport.py +216 -0
- tgi_foundation-0.2.0.dev11/tgi/source_bound_endpoint_transport_check.py +151 -0
- tgi_foundation-0.2.0.dev11/tgi/source_bound_single_nmu_edit.py +162 -0
- tgi_foundation-0.2.0.dev11/tgi/source_bound_single_nmu_edit_check.py +130 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi_foundation.egg-info/PKG-INFO +3 -7
- tgi_foundation-0.2.0.dev11/tgi_foundation.egg-info/SOURCES.txt +53 -0
- tgi_foundation-0.2.0.dev0/MANIFEST.in +0 -8
- tgi_foundation-0.2.0.dev0/README.md +0 -7
- tgi_foundation-0.2.0.dev0/contracts/user_acceptance_frame_v1.json +0 -54
- tgi_foundation-0.2.0.dev0/examples/acceptance_frames.jsonl +0 -2
- tgi_foundation-0.2.0.dev0/output/pdf/BAND_OWNED_PHASE_AND_ORGANIZATION.pdf +0 -0
- tgi_foundation-0.2.0.dev0/output/pdf/CHARACTER_IDENTITY_AND_LATTICE.pdf +0 -0
- tgi_foundation-0.2.0.dev0/output/pdf/DETERMINISTIC_RESOLUTION_AND_CONTINUAL_LEARNING.pdf +0 -0
- tgi_foundation-0.2.0.dev0/output/pdf/INTERVENTIONAL_SPATIAL_RELATIONS.pdf +0 -0
- tgi_foundation-0.2.0.dev0/output/pdf/OWNED_SPATIAL_EXECUTION.pdf +0 -0
- tgi_foundation-0.2.0.dev0/output/pdf/TGI_TOPOLOGICAL_GEOMETRIC_INTELLIGENCE.pdf +0 -0
- tgi_foundation-0.2.0.dev0/paper/technical/BAND_OWNED_PHASE_AND_ORGANIZATION.md +0 -218
- tgi_foundation-0.2.0.dev0/paper/technical/CHARACTER_IDENTITY_AND_LATTICE.md +0 -231
- tgi_foundation-0.2.0.dev0/paper/technical/DETERMINISTIC_RESOLUTION_AND_CONTINUAL_LEARNING.md +0 -255
- tgi_foundation-0.2.0.dev0/paper/technical/INTERVENTIONAL_SPATIAL_RELATIONS.md +0 -253
- tgi_foundation-0.2.0.dev0/paper/technical/OWNED_SPATIAL_EXECUTION.md +0 -219
- tgi_foundation-0.2.0.dev0/paper/technical/README.md +0 -39
- tgi_foundation-0.2.0.dev0/paper/technical/TGI_TOPOLOGICAL_GEOMETRIC_INTELLIGENCE.md +0 -201
- tgi_foundation-0.2.0.dev0/paper/technical/validation.json +0 -64
- tgi_foundation-0.2.0.dev0/tests/test_checkpoint_spatial.py +0 -37
- tgi_foundation-0.2.0.dev0/tests/test_frame_engine.py +0 -229
- tgi_foundation-0.2.0.dev0/tgi/__main__.py +0 -194
- tgi_foundation-0.2.0.dev0/tgi/acquisition_history.py +0 -45
- tgi_foundation-0.2.0.dev0/tgi/acquisition_history_check.py +0 -51
- tgi_foundation-0.2.0.dev0/tgi/acquisition_monitor.py +0 -66
- tgi_foundation-0.2.0.dev0/tgi/acquisition_monitor_check.py +0 -78
- tgi_foundation-0.2.0.dev0/tgi/acquisition_projection.py +0 -70
- tgi_foundation-0.2.0.dev0/tgi/acquisition_projection_check.py +0 -93
- tgi_foundation-0.2.0.dev0/tgi/acquisition_role_cells.py +0 -53
- tgi_foundation-0.2.0.dev0/tgi/acquisition_role_constraints.py +0 -13
- tgi_foundation-0.2.0.dev0/tgi/acquisition_role_constraints_check.py +0 -66
- tgi_foundation-0.2.0.dev0/tgi/acquisition_stream.py +0 -21
- tgi_foundation-0.2.0.dev0/tgi/actuation_goal_frontier.py +0 -117
- tgi_foundation-0.2.0.dev0/tgi/actuation_goal_frontier_check.py +0 -147
- tgi_foundation-0.2.0.dev0/tgi/actuation_goal_workflow.py +0 -159
- tgi_foundation-0.2.0.dev0/tgi/actuation_sequence_feedback.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/actuation_sequence_feedback_check.py +0 -43
- tgi_foundation-0.2.0.dev0/tgi/ask_certificate.py +0 -74
- tgi_foundation-0.2.0.dev0/tgi/bands.py +0 -59
- tgi_foundation-0.2.0.dev0/tgi/capacity_graph.py +0 -70
- tgi_foundation-0.2.0.dev0/tgi/closed_actuation_goal_frontier.py +0 -13
- tgi_foundation-0.2.0.dev0/tgi/closed_actuation_goal_frontier_check.py +0 -19
- tgi_foundation-0.2.0.dev0/tgi/closed_actuation_goal_workflow.py +0 -159
- tgi_foundation-0.2.0.dev0/tgi/closure.py +0 -202
- tgi_foundation-0.2.0.dev0/tgi/compact_acquisition_map.py +0 -68
- tgi_foundation-0.2.0.dev0/tgi/compact_acquisition_map_check.py +0 -91
- tgi_foundation-0.2.0.dev0/tgi/compact_complete_role_core.py +0 -36
- tgi_foundation-0.2.0.dev0/tgi/compact_complete_role_core_check.py +0 -62
- tgi_foundation-0.2.0.dev0/tgi/compact_role_observation.py +0 -13
- tgi_foundation-0.2.0.dev0/tgi/compact_role_observation_check.py +0 -66
- tgi_foundation-0.2.0.dev0/tgi/complete_role_core.py +0 -53
- tgi_foundation-0.2.0.dev0/tgi/complete_role_core_check.py +0 -54
- tgi_foundation-0.2.0.dev0/tgi/context_family_selection.py +0 -45
- tgi_foundation-0.2.0.dev0/tgi/context_family_selection_check.py +0 -32
- tgi_foundation-0.2.0.dev0/tgi/context_family_separation.py +0 -43
- tgi_foundation-0.2.0.dev0/tgi/context_family_separation_check.py +0 -47
- tgi_foundation-0.2.0.dev0/tgi/contextual_isometry.py +0 -62
- tgi_foundation-0.2.0.dev0/tgi/contextual_isometry_check.py +0 -54
- tgi_foundation-0.2.0.dev0/tgi/continuation_checkpoint.py +0 -75
- tgi_foundation-0.2.0.dev0/tgi/continuation_cycle.py +0 -102
- tgi_foundation-0.2.0.dev0/tgi/continuation_goal_frontier.py +0 -13
- tgi_foundation-0.2.0.dev0/tgi/continuation_goal_frontier_check.py +0 -19
- tgi_foundation-0.2.0.dev0/tgi/continuation_goal_workflow.py +0 -159
- tgi_foundation-0.2.0.dev0/tgi/continuation_learning.py +0 -36
- tgi_foundation-0.2.0.dev0/tgi/continuation_learning_check.py +0 -53
- tgi_foundation-0.2.0.dev0/tgi/correspondence.py +0 -76
- tgi_foundation-0.2.0.dev0/tgi/cross_action_correspondence.py +0 -182
- tgi_foundation-0.2.0.dev0/tgi/cross_action_correspondence_check.py +0 -92
- tgi_foundation-0.2.0.dev0/tgi/cross_view_identity_map.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/cross_view_identity_map_check.py +0 -48
- tgi_foundation-0.2.0.dev0/tgi/empirical_transport.py +0 -74
- tgi_foundation-0.2.0.dev0/tgi/empirical_transport_check.py +0 -78
- tgi_foundation-0.2.0.dev0/tgi/evidence_response.py +0 -24
- tgi_foundation-0.2.0.dev0/tgi/evidence_response_check.py +0 -33
- tgi_foundation-0.2.0.dev0/tgi/exact_field.py +0 -101
- tgi_foundation-0.2.0.dev0/tgi/experience.py +0 -68
- tgi_foundation-0.2.0.dev0/tgi/experience_cli.py +0 -44
- tgi_foundation-0.2.0.dev0/tgi/feedback_update.py +0 -32
- tgi_foundation-0.2.0.dev0/tgi/feedback_update_check.py +0 -38
- tgi_foundation-0.2.0.dev0/tgi/formation.py +0 -74
- tgi_foundation-0.2.0.dev0/tgi/frame_cli.py +0 -26
- tgi_foundation-0.2.0.dev0/tgi/functional_capacity.py +0 -74
- tgi_foundation-0.2.0.dev0/tgi/functional_capacity_check.py +0 -110
- tgi_foundation-0.2.0.dev0/tgi/functional_transition.py +0 -40
- tgi_foundation-0.2.0.dev0/tgi/functional_transition_check.py +0 -58
- tgi_foundation-0.2.0.dev0/tgi/geometry.py +0 -143
- tgi_foundation-0.2.0.dev0/tgi/grounding.py +0 -285
- tgi_foundation-0.2.0.dev0/tgi/guarded_word_closure.py +0 -148
- tgi_foundation-0.2.0.dev0/tgi/guarded_word_closure_check.py +0 -171
- tgi_foundation-0.2.0.dev0/tgi/guarded_word_goal_frontier.py +0 -13
- tgi_foundation-0.2.0.dev0/tgi/guarded_word_goal_frontier_check.py +0 -19
- tgi_foundation-0.2.0.dev0/tgi/guarded_word_goal_workflow.py +0 -160
- tgi_foundation-0.2.0.dev0/tgi/intervention_composition.py +0 -63
- tgi_foundation-0.2.0.dev0/tgi/intervention_composition_check.py +0 -84
- tgi_foundation-0.2.0.dev0/tgi/intervention_correspondence.py +0 -156
- tgi_foundation-0.2.0.dev0/tgi/intervention_correspondence_check.py +0 -80
- tgi_foundation-0.2.0.dev0/tgi/intervention_experiment.py +0 -62
- tgi_foundation-0.2.0.dev0/tgi/intervention_experiment_check.py +0 -78
- tgi_foundation-0.2.0.dev0/tgi/intervention_resolution.py +0 -45
- tgi_foundation-0.2.0.dev0/tgi/intervention_resolution_check.py +0 -70
- tgi_foundation-0.2.0.dev0/tgi/intervention_scope.py +0 -34
- tgi_foundation-0.2.0.dev0/tgi/intervention_sequence_experiment.py +0 -71
- tgi_foundation-0.2.0.dev0/tgi/intervention_sequence_experiment_check.py +0 -97
- tgi_foundation-0.2.0.dev0/tgi/interventions.py +0 -240
- tgi_foundation-0.2.0.dev0/tgi/joint_correspondence.py +0 -73
- tgi_foundation-0.2.0.dev0/tgi/joint_frontier_acquisition.py +0 -114
- tgi_foundation-0.2.0.dev0/tgi/joint_frontier_acquisition_check.py +0 -116
- tgi_foundation-0.2.0.dev0/tgi/joint_goal_observation.py +0 -49
- tgi_foundation-0.2.0.dev0/tgi/joint_goal_observation_check.py +0 -55
- tgi_foundation-0.2.0.dev0/tgi/joint_goal_traversal.py +0 -101
- tgi_foundation-0.2.0.dev0/tgi/joint_goal_traversal_check.py +0 -114
- tgi_foundation-0.2.0.dev0/tgi/joint_observed_laws.py +0 -40
- tgi_foundation-0.2.0.dev0/tgi/joint_observed_laws_check.py +0 -63
- tgi_foundation-0.2.0.dev0/tgi/joint_temporal_candidates.py +0 -40
- tgi_foundation-0.2.0.dev0/tgi/joint_temporal_candidates_check.py +0 -68
- tgi_foundation-0.2.0.dev0/tgi/lineage_knowledge.py +0 -29
- tgi_foundation-0.2.0.dev0/tgi/lineage_knowledge_check.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/local_acquisition_ownership.py +0 -65
- tgi_foundation-0.2.0.dev0/tgi/local_acquisition_runtime.py +0 -119
- tgi_foundation-0.2.0.dev0/tgi/local_acquisition_selection.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/local_acquisition_transition.py +0 -50
- tgi_foundation-0.2.0.dev0/tgi/local_acquisition_transition_check.py +0 -80
- tgi_foundation-0.2.0.dev0/tgi/local_evidence_persistence.py +0 -67
- tgi_foundation-0.2.0.dev0/tgi/measured_actuation_transition.py +0 -56
- tgi_foundation-0.2.0.dev0/tgi/measured_actuation_transition_check.py +0 -81
- tgi_foundation-0.2.0.dev0/tgi/measured_capacity.py +0 -61
- tgi_foundation-0.2.0.dev0/tgi/measured_context.py +0 -52
- tgi_foundation-0.2.0.dev0/tgi/measured_context_check.py +0 -65
- tgi_foundation-0.2.0.dev0/tgi/measured_context_laws.py +0 -75
- tgi_foundation-0.2.0.dev0/tgi/measured_context_laws_check.py +0 -91
- tgi_foundation-0.2.0.dev0/tgi/measured_context_layout.py +0 -49
- tgi_foundation-0.2.0.dev0/tgi/momentum.py +0 -43
- tgi_foundation-0.2.0.dev0/tgi/observation_context_laws.py +0 -32
- tgi_foundation-0.2.0.dev0/tgi/observation_context_laws_check.py +0 -40
- tgi_foundation-0.2.0.dev0/tgi/observation_epochs.py +0 -35
- tgi_foundation-0.2.0.dev0/tgi/observation_epochs_check.py +0 -51
- tgi_foundation-0.2.0.dev0/tgi/observation_projection.py +0 -45
- tgi_foundation-0.2.0.dev0/tgi/observation_projection_check.py +0 -48
- tgi_foundation-0.2.0.dev0/tgi/observed_actuation_cycle.py +0 -114
- tgi_foundation-0.2.0.dev0/tgi/observed_actuation_discovery.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/observed_actuation_discovery_check.py +0 -54
- tgi_foundation-0.2.0.dev0/tgi/observed_actuation_learning.py +0 -71
- tgi_foundation-0.2.0.dev0/tgi/observed_actuation_learning_check.py +0 -73
- tgi_foundation-0.2.0.dev0/tgi/observed_actuation_runtime.py +0 -114
- tgi_foundation-0.2.0.dev0/tgi/observed_context_actions.py +0 -66
- tgi_foundation-0.2.0.dev0/tgi/observed_context_actions_check.py +0 -81
- tgi_foundation-0.2.0.dev0/tgi/observed_joint_state.py +0 -52
- tgi_foundation-0.2.0.dev0/tgi/observed_joint_state_check.py +0 -55
- tgi_foundation-0.2.0.dev0/tgi/observed_refinement.py +0 -43
- tgi_foundation-0.2.0.dev0/tgi/observed_response.py +0 -20
- tgi_foundation-0.2.0.dev0/tgi/observed_response_check.py +0 -27
- tgi_foundation-0.2.0.dev0/tgi/observed_role_core.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/observed_role_core_check.py +0 -54
- tgi_foundation-0.2.0.dev0/tgi/occurrence_route.py +0 -56
- tgi_foundation-0.2.0.dev0/tgi/operator_windows.py +0 -84
- tgi_foundation-0.2.0.dev0/tgi/operator_windows_check.py +0 -111
- tgi_foundation-0.2.0.dev0/tgi/organization_cli.py +0 -77
- tgi_foundation-0.2.0.dev0/tgi/organization_inventory_check.py +0 -82
- tgi_foundation-0.2.0.dev0/tgi/path_isometry.py +0 -82
- tgi_foundation-0.2.0.dev0/tgi/path_temporal_feasibility.py +0 -69
- tgi_foundation-0.2.0.dev0/tgi/port_distinction_exploration.py +0 -37
- tgi_foundation-0.2.0.dev0/tgi/port_distinction_exploration_check.py +0 -40
- tgi_foundation-0.2.0.dev0/tgi/proofcheck.py +0 -117
- tgi_foundation-0.2.0.dev0/tgi/provenance.py +0 -19
- tgi_foundation-0.2.0.dev0/tgi/recent_observation.py +0 -145
- tgi_foundation-0.2.0.dev0/tgi/relational.py +0 -222
- tgi_foundation-0.2.0.dev0/tgi/response_eligibility.py +0 -46
- tgi_foundation-0.2.0.dev0/tgi/response_eligibility_check.py +0 -55
- tgi_foundation-0.2.0.dev0/tgi/response_interval_order.py +0 -59
- tgi_foundation-0.2.0.dev0/tgi/response_interval_order_check.py +0 -92
- tgi_foundation-0.2.0.dev0/tgi/response_readout.py +0 -53
- tgi_foundation-0.2.0.dev0/tgi/response_readout_check.py +0 -73
- tgi_foundation-0.2.0.dev0/tgi/role_bundle.py +0 -31
- tgi_foundation-0.2.0.dev0/tgi/role_bundle_check.py +0 -20
- tgi_foundation-0.2.0.dev0/tgi/role_candidates.py +0 -47
- tgi_foundation-0.2.0.dev0/tgi/role_candidates_check.py +0 -57
- tgi_foundation-0.2.0.dev0/tgi/role_eligibility.py +0 -34
- tgi_foundation-0.2.0.dev0/tgi/role_feedback.py +0 -15
- tgi_foundation-0.2.0.dev0/tgi/role_feedback_check.py +0 -23
- tgi_foundation-0.2.0.dev0/tgi/role_history.py +0 -37
- tgi_foundation-0.2.0.dev0/tgi/role_projection.py +0 -16
- tgi_foundation-0.2.0.dev0/tgi/role_proposal.py +0 -39
- tgi_foundation-0.2.0.dev0/tgi/role_proposal_check.py +0 -51
- tgi_foundation-0.2.0.dev0/tgi/role_readout.py +0 -31
- tgi_foundation-0.2.0.dev0/tgi/role_response.py +0 -34
- tgi_foundation-0.2.0.dev0/tgi/scoped_sequence_experiment.py +0 -20
- tgi_foundation-0.2.0.dev0/tgi/scoped_sequence_experiment_check.py +0 -33
- tgi_foundation-0.2.0.dev0/tgi/separation.py +0 -74
- tgi_foundation-0.2.0.dev0/tgi/separation_check.py +0 -87
- tgi_foundation-0.2.0.dev0/tgi/sequence_prefix_feedback.py +0 -57
- tgi_foundation-0.2.0.dev0/tgi/sequence_prefix_feedback_check.py +0 -79
- tgi_foundation-0.2.0.dev0/tgi/source_intervals.py +0 -85
- tgi_foundation-0.2.0.dev0/tgi/source_intervals_check.py +0 -97
- tgi_foundation-0.2.0.dev0/tgi/spatial_action_observation.py +0 -88
- tgi_foundation-0.2.0.dev0/tgi/spatial_action_relation.py +0 -53
- tgi_foundation-0.2.0.dev0/tgi/spatial_action_relation_check.py +0 -45
- tgi_foundation-0.2.0.dev0/tgi/spatial_action_relation_cycle.py +0 -84
- tgi_foundation-0.2.0.dev0/tgi/spatial_action_relation_migration.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/spatial_action_relation_migration_bundle.py +0 -60
- tgi_foundation-0.2.0.dev0/tgi/spatial_contextual_action_cycle.py +0 -130
- tgi_foundation-0.2.0.dev0/tgi/spatial_contextual_action_local.py +0 -79
- tgi_foundation-0.2.0.dev0/tgi/spatial_contextual_action_phase.py +0 -81
- tgi_foundation-0.2.0.dev0/tgi/spatial_contextual_action_phase_check.py +0 -81
- tgi_foundation-0.2.0.dev0/tgi/spatial_direct_action_cycle.py +0 -98
- tgi_foundation-0.2.0.dev0/tgi/spatial_direct_action_relation.py +0 -60
- tgi_foundation-0.2.0.dev0/tgi/spatial_direct_action_relation_check.py +0 -67
- tgi_foundation-0.2.0.dev0/tgi/spatial_local_action_cycle.py +0 -62
- tgi_foundation-0.2.0.dev0/tgi/spatial_local_action_relation.py +0 -66
- tgi_foundation-0.2.0.dev0/tgi/spatial_temporal_action_cycle.py +0 -116
- tgi_foundation-0.2.0.dev0/tgi/spatial_temporal_action_local.py +0 -77
- tgi_foundation-0.2.0.dev0/tgi/spatial_temporal_action_phase.py +0 -89
- tgi_foundation-0.2.0.dev0/tgi/spatial_temporal_action_phase_check.py +0 -94
- tgi_foundation-0.2.0.dev0/tgi/structural_append_closure.py +0 -99
- tgi_foundation-0.2.0.dev0/tgi/structural_append_closure_check.py +0 -106
- tgi_foundation-0.2.0.dev0/tgi/structural_continuation_closure.py +0 -93
- tgi_foundation-0.2.0.dev0/tgi/structural_continuation_closure_check.py +0 -108
- tgi_foundation-0.2.0.dev0/tgi/temporal_candidate_spectrum.py +0 -57
- tgi_foundation-0.2.0.dev0/tgi/temporal_candidate_spectrum_check.py +0 -94
- tgi_foundation-0.2.0.dev0/tgi/temporal_correspondence.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/temporal_correspondence_check.py +0 -56
- tgi_foundation-0.2.0.dev0/tgi/temporal_projection.py +0 -41
- tgi_foundation-0.2.0.dev0/tgi/temporal_projection_check.py +0 -56
- tgi_foundation-0.2.0.dev0/tgi/transport.py +0 -294
- tgi_foundation-0.2.0.dev0/tgi/transport_cli.py +0 -27
- tgi_foundation-0.2.0.dev0/tgi/unlabeled_port_classes.py +0 -199
- tgi_foundation-0.2.0.dev0/tgi/unlabeled_port_classes_check.py +0 -113
- tgi_foundation-0.2.0.dev0/tgi/unobserved_action_selection.py +0 -47
- tgi_foundation-0.2.0.dev0/tgi/unobserved_action_selection_check.py +0 -40
- tgi_foundation-0.2.0.dev0/tgi/verification.py +0 -98
- tgi_foundation-0.2.0.dev0/tgi/witness_function.py +0 -62
- tgi_foundation-0.2.0.dev0/tgi/witness_probe.py +0 -50
- tgi_foundation-0.2.0.dev0/tgi/witness_probe_feedback.py +0 -106
- tgi_foundation-0.2.0.dev0/tgi/witness_response.py +0 -67
- tgi_foundation-0.2.0.dev0/tgi_foundation.egg-info/SOURCES.txt +0 -273
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/LICENSE +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/setup.cfg +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/__init__.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/acquisition_snapshot.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/acquisition_witness.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/compact_measured_path.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/compatible_joins.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/derivation.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/events.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/frame_engine.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/identity.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/incidence.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/incremental.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/intervention_continuity.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/intervention_edit_contrast.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/intervention_edit_contrast_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/intervention_roles.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/lineage_state.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/local_edit_transport_classes.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/local_edit_transport_classes_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/measured_occurrence_path.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/observation_point.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/organization.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/organization_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/organization_snapshot.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/phase_evidence.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/resonance.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/role_eligibility_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/role_history_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/role_projection_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/role_readout_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/role_response_check.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/role_work.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/spatial.py +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi_foundation.egg-info/dependency_links.txt +0 -0
- {tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi_foundation.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tgi-foundation
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev11
|
|
4
4
|
Summary: Native character-identity and geometric knowledge mechanisms for Topological Geometric Intelligence
|
|
5
5
|
Author: Emylton Leunufna
|
|
6
6
|
License: Copyright (c) 2026 Emylton Leunufna
|
|
@@ -21,10 +21,6 @@ Description-Content-Type: text/markdown
|
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Dynamic: license-file
|
|
23
23
|
|
|
24
|
-
# TGI
|
|
24
|
+
# TGI foundation M2
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Python >=3.11. Local check: `python -m unittest discover -s tests -q`. CLI: `python -m tgi --help`. See `paper/technical/README.md` for the foundational and five technical papers. Raw research evidence and historical hypotheses are intentionally outside this public code tree.
|
|
29
|
-
|
|
30
|
-
Copyright (c) 2026 Emylton Leunufna. No reuse allowed without permission.
|
|
26
|
+
Native NMU identity, source-bound response atlas, endpoint transport, and one-NMU substitution transport. Emylton Leunufna. No reuse allowed without permission.
|
|
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tgi-foundation"
|
|
7
|
-
version = "0.2.0.
|
|
7
|
+
version = "0.2.0.dev11"
|
|
8
8
|
description = "Native character-identity and geometric knowledge mechanisms for Topological Geometric Intelligence"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
|
-
dependencies = []
|
|
12
|
-
authors = [{name = "Emylton Leunufna"}]
|
|
13
|
-
license = {file = "LICENSE"}
|
|
11
|
+
dependencies = []
|
|
12
|
+
authors = [{name = "Emylton Leunufna"}]
|
|
13
|
+
license = {file = "LICENSE"}
|
|
14
14
|
keywords = ["topological geometric intelligence", "TGI", "NMU", "crystal memory"]
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Development Status :: 3 - Alpha",
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"""NMU-preserving observational classes under sensor-local alphabet changes."""
|
|
2
|
+
import copy
|
|
3
|
+
import hashlib
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import re
|
|
7
|
+
import tempfile
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from .frame_engine import canonical, unique_object
|
|
11
|
+
from .identity import REGISTRY_ID, encode
|
|
12
|
+
from .intervention_edit_contrast import contrast
|
|
13
|
+
from .organization import OMEGA_CRIT
|
|
14
|
+
|
|
15
|
+
REVISION = 'TGI-M1-CAUSAL-PORT-TOPOLOGY-V1'
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _sha(data):
|
|
19
|
+
return hashlib.sha256(data).hexdigest()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _event(source, action, ports):
|
|
23
|
+
if type(source) is not str or not source or type(action) is not str or not action or \
|
|
24
|
+
type(ports) is not dict or len(ports) < 3:
|
|
25
|
+
raise ValueError('Original source, action and three port streams required')
|
|
26
|
+
observed = {}
|
|
27
|
+
for name, pair in sorted(ports.items()):
|
|
28
|
+
if type(name) is not str or not name or type(pair) not in (tuple, list) or len(pair) != 2:
|
|
29
|
+
raise ValueError('Raw port address and frame pair required')
|
|
30
|
+
observed[name] = contrast(*pair)
|
|
31
|
+
return {'source': source, 'action_nmu': list(encode(action)), 'ports': observed}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _evidence(events, members, names, action):
|
|
35
|
+
contexts = set()
|
|
36
|
+
controls = 0
|
|
37
|
+
comparators = set()
|
|
38
|
+
for event in events:
|
|
39
|
+
key = tuple(event['action_nmu'])
|
|
40
|
+
changed = all(event['ports'][name]['kind'] != 'STABLE' for name in members)
|
|
41
|
+
stable = all(event['ports'][name]['kind'] == 'STABLE' for name in members)
|
|
42
|
+
if changed and key == action:
|
|
43
|
+
contexts.add(tuple(tuple(event['ports'][name]['before_nmu']) for name in members))
|
|
44
|
+
if stable:
|
|
45
|
+
if key == action:
|
|
46
|
+
controls += 1
|
|
47
|
+
if any(event['ports'][name]['kind'] != 'STABLE' for name in names if name not in members):
|
|
48
|
+
comparators.add(key)
|
|
49
|
+
return len(contexts), controls, any(other != action for other in comparators)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def form(events, *, revision=REVISION, valid_row=None):
|
|
53
|
+
if type(events) is not list:
|
|
54
|
+
raise ValueError('Ordered original events required')
|
|
55
|
+
from .intervention_edit_contrast_check import verify as valid_contrast
|
|
56
|
+
if valid_row is None:
|
|
57
|
+
valid_row = valid_contrast
|
|
58
|
+
traces, phases, names, seen, actions = {}, [], None, set(), set()
|
|
59
|
+
prior, epoch = None, 0
|
|
60
|
+
for index, event in enumerate(events):
|
|
61
|
+
if type(event) is not dict or set(event) != {'source', 'action_nmu', 'ports'} or \
|
|
62
|
+
type(event['source']) is not str or not event['source'] or event['source'] in seen or \
|
|
63
|
+
type(event['action_nmu']) is not list or not event['action_nmu'] or \
|
|
64
|
+
type(event['ports']) is not dict:
|
|
65
|
+
raise ValueError('Unique original event required')
|
|
66
|
+
seen.add(event['source'])
|
|
67
|
+
current = list(event['ports'])
|
|
68
|
+
if len(current) < 3 or current != sorted(current) or \
|
|
69
|
+
any(type(name) is not str or not name or not valid_row(event['ports'][name]) for name in current):
|
|
70
|
+
raise ValueError('Complete original port contrasts required')
|
|
71
|
+
if names is None:
|
|
72
|
+
names = current
|
|
73
|
+
traces = {name: [] for name in names}
|
|
74
|
+
if current != names:
|
|
75
|
+
raise ValueError('Fixed port inventory required')
|
|
76
|
+
actions.add(tuple(event['action_nmu']))
|
|
77
|
+
for name in names:
|
|
78
|
+
traces[name].append(event['ports'][name]['kind'])
|
|
79
|
+
grouped = {}
|
|
80
|
+
for name in names:
|
|
81
|
+
grouped.setdefault(tuple(traces[name]), []).append(name)
|
|
82
|
+
groups = sorted(tuple(members) for members in grouped.values())
|
|
83
|
+
cells, winners = [], []
|
|
84
|
+
for members in groups:
|
|
85
|
+
counts = []
|
|
86
|
+
for action in sorted(actions):
|
|
87
|
+
omega, controls, comparator = _evidence(events[epoch:index+1], members, names, action)
|
|
88
|
+
counts.append({'action_nmu': list(action), 'omega': omega,
|
|
89
|
+
'controls': controls, 'comparator': comparator})
|
|
90
|
+
if omega >= OMEGA_CRIT and controls and comparator:
|
|
91
|
+
winners.append((action, members))
|
|
92
|
+
cells.append({'members': list(members), 'C_L_by_action': counts, 'xi': 0})
|
|
93
|
+
if prior is not None and prior not in groups:
|
|
94
|
+
result = {'status': 'REVOKED', 'action_nmu': None, 'members': None}
|
|
95
|
+
prior, epoch = None, index + 1
|
|
96
|
+
elif len(winners) == 1:
|
|
97
|
+
action, members = winners[0]
|
|
98
|
+
result = {'status': 'CRYSTAL', 'action_nmu': list(action), 'members': list(members)}
|
|
99
|
+
prior = members
|
|
100
|
+
for cell in cells:
|
|
101
|
+
cell['xi'] = int(tuple(cell['members']) == members)
|
|
102
|
+
elif prior is not None and not any(members == prior for _, members in winners):
|
|
103
|
+
result = {'status': 'REVOKED', 'action_nmu': None, 'members': None}
|
|
104
|
+
else:
|
|
105
|
+
result = {'status': 'NO_PATH', 'action_nmu': None, 'members': None}
|
|
106
|
+
phases.append({'event_index': index, 'source': event['source'],
|
|
107
|
+
'epoch_start': epoch, 'classes': cells, 'result': result})
|
|
108
|
+
return {'revision': revision, 'registry': REGISTRY_ID, 'events': copy.deepcopy(events),
|
|
109
|
+
'phases': phases, 'result': phases[-1]['result'] if phases else
|
|
110
|
+
{'status': 'NO_PATH', 'action_nmu': None, 'members': None}}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class CausalPortClasses:
|
|
114
|
+
REVISION = REVISION
|
|
115
|
+
EVENT_FACTORY = staticmethod(_event)
|
|
116
|
+
FORM = staticmethod(form)
|
|
117
|
+
|
|
118
|
+
@staticmethod
|
|
119
|
+
def VERIFY(events, certificate):
|
|
120
|
+
from .causal_port_classes_check import verify
|
|
121
|
+
return verify(events, certificate)
|
|
122
|
+
|
|
123
|
+
def __init__(self, events=()):
|
|
124
|
+
self._events = copy.deepcopy(list(events))
|
|
125
|
+
self._certificate = self.FORM(self._events)
|
|
126
|
+
if not self.VERIFY(self._events, self._certificate):
|
|
127
|
+
raise ValueError('Independent causal topology replay failed')
|
|
128
|
+
|
|
129
|
+
def _verify(self):
|
|
130
|
+
if not self.VERIFY(self._events, self._certificate):
|
|
131
|
+
raise ValueError('Original causal state changed')
|
|
132
|
+
|
|
133
|
+
@property
|
|
134
|
+
def certificate(self):
|
|
135
|
+
self._verify()
|
|
136
|
+
return copy.deepcopy(self._certificate)
|
|
137
|
+
|
|
138
|
+
def observe(self, source, action, ports):
|
|
139
|
+
self._verify()
|
|
140
|
+
if any(row['source'] == source for row in self._events):
|
|
141
|
+
raise ValueError('Duplicate original source')
|
|
142
|
+
return type(self)(self._events + [self.EVENT_FACTORY(source, action, ports)])
|
|
143
|
+
|
|
144
|
+
def resolve(self, action):
|
|
145
|
+
self._verify()
|
|
146
|
+
if type(action) is not str or not action:
|
|
147
|
+
raise ValueError('Raw action required')
|
|
148
|
+
result = self._certificate['result']
|
|
149
|
+
return list(result['members']) if result['status'] == 'CRYSTAL' and \
|
|
150
|
+
result['action_nmu'] == list(encode(action)) else None
|
|
151
|
+
|
|
152
|
+
def commit(self, path):
|
|
153
|
+
self._verify()
|
|
154
|
+
payload = {'revision': self.REVISION, 'registry': REGISTRY_ID,
|
|
155
|
+
'events': self._events, 'certificate': self._certificate}
|
|
156
|
+
envelope = {'payload': payload, 'sha256': _sha(canonical(payload).encode('utf8'))}
|
|
157
|
+
data = canonical(envelope).encode('utf8')
|
|
158
|
+
target = Path(path)
|
|
159
|
+
temporary = None
|
|
160
|
+
try:
|
|
161
|
+
with tempfile.NamedTemporaryFile(mode='wb', dir=target.parent, delete=False) as stream:
|
|
162
|
+
temporary = Path(stream.name)
|
|
163
|
+
stream.write(data)
|
|
164
|
+
stream.flush()
|
|
165
|
+
os.fsync(stream.fileno())
|
|
166
|
+
os.replace(temporary, target)
|
|
167
|
+
temporary = None
|
|
168
|
+
finally:
|
|
169
|
+
if temporary is not None and temporary.exists():
|
|
170
|
+
temporary.unlink()
|
|
171
|
+
return {'path': str(target), 'sha256': _sha(data), 'bytes': len(data)}
|
|
172
|
+
|
|
173
|
+
@classmethod
|
|
174
|
+
def recover(cls, path, expected_sha256):
|
|
175
|
+
if type(expected_sha256) is not str or re.fullmatch('[0-9a-f]{64}', expected_sha256) is None:
|
|
176
|
+
raise ValueError('External digest required')
|
|
177
|
+
data = Path(path).read_bytes()
|
|
178
|
+
if _sha(data) != expected_sha256:
|
|
179
|
+
raise ValueError('Checkpoint digest mismatch')
|
|
180
|
+
envelope = json.loads(data.decode('utf8'), object_pairs_hook=unique_object)
|
|
181
|
+
if type(envelope) is not dict or set(envelope) != {'payload', 'sha256'}:
|
|
182
|
+
raise ValueError('Invalid checkpoint envelope')
|
|
183
|
+
payload = envelope['payload']
|
|
184
|
+
if type(payload) is not dict or set(payload) != {'revision', 'registry', 'events', 'certificate'} or \
|
|
185
|
+
payload['revision'] != cls.REVISION or payload['registry'] != REGISTRY_ID or \
|
|
186
|
+
_sha(canonical(payload).encode('utf8')) != envelope['sha256']:
|
|
187
|
+
raise ValueError('Invalid checkpoint payload')
|
|
188
|
+
result = cls(payload['events'])
|
|
189
|
+
if canonical(result.certificate) != canonical(payload['certificate']):
|
|
190
|
+
raise ValueError('Recomputed causal certificate differs')
|
|
191
|
+
return result
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
REVISION_INCIDENCE = 'TGI-M1-RESPONSE-INCIDENCE-V1'
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def _response_event(source, action, ports):
|
|
198
|
+
if type(source) is not str or not source or type(action) is not str or not action or \
|
|
199
|
+
type(ports) is not dict or len(ports) < 3:
|
|
200
|
+
raise ValueError('Original source, action and three port streams required')
|
|
201
|
+
observed = {}
|
|
202
|
+
for name, pair in sorted(ports.items()):
|
|
203
|
+
if type(name) is not str or not name or type(pair) not in (tuple, list) or len(pair) != 2 or \
|
|
204
|
+
type(pair[0]) is not str or not pair[0] or type(pair[1]) is not str or not pair[1]:
|
|
205
|
+
raise ValueError('Nonempty raw port frame pair required')
|
|
206
|
+
before, after = list(encode(pair[0])), list(encode(pair[1]))
|
|
207
|
+
changed = before != after
|
|
208
|
+
observed[name] = {'before_nmu': before, 'after_nmu': after,
|
|
209
|
+
'kind': 'CHANGED' if changed else 'STABLE', 'changed': changed}
|
|
210
|
+
return {'source': source, 'action_nmu': list(encode(action)), 'ports': observed}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def form_incidence(events):
|
|
214
|
+
from .response_incidence_check import valid_response
|
|
215
|
+
return form(events, revision=REVISION_INCIDENCE, valid_row=valid_response)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
class ResponseIncidenceClasses(CausalPortClasses):
|
|
219
|
+
REVISION = REVISION_INCIDENCE
|
|
220
|
+
EVENT_FACTORY = staticmethod(_response_event)
|
|
221
|
+
FORM = staticmethod(form_incidence)
|
|
222
|
+
|
|
223
|
+
@staticmethod
|
|
224
|
+
def VERIFY(events, certificate):
|
|
225
|
+
from .response_incidence_check import verify
|
|
226
|
+
return verify(events, certificate)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Independent exhaustive replay of observational edit-topology classes."""
|
|
2
|
+
from .frame_engine import canonical
|
|
3
|
+
from .identity import REGISTRY_ID, decode
|
|
4
|
+
from .intervention_edit_contrast_check import verify as valid_contrast
|
|
5
|
+
from .organization import OMEGA_CRIT
|
|
6
|
+
|
|
7
|
+
REVISION = 'TGI-M1-CAUSAL-PORT-TOPOLOGY-V1'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def verify(events, certificate, *, revision=REVISION, valid_row=valid_contrast):
|
|
11
|
+
try:
|
|
12
|
+
if type(events) is not list or type(certificate) is not dict or \
|
|
13
|
+
set(certificate) != {'revision', 'registry', 'events', 'phases', 'result'} or \
|
|
14
|
+
certificate['revision'] != revision or certificate['registry'] != REGISTRY_ID or \
|
|
15
|
+
canonical(certificate['events']) != canonical(events) or \
|
|
16
|
+
type(certificate['phases']) is not list or len(certificate['phases']) != len(events):
|
|
17
|
+
return False
|
|
18
|
+
names = None
|
|
19
|
+
sources = set()
|
|
20
|
+
prior = None
|
|
21
|
+
epoch = 0
|
|
22
|
+
final = {'status': 'NO_PATH', 'action_nmu': None, 'members': None}
|
|
23
|
+
for stop, event in enumerate(events):
|
|
24
|
+
if type(event) is not dict or set(event) != {'source', 'action_nmu', 'ports'} or \
|
|
25
|
+
type(event['source']) is not str or not event['source'] or event['source'] in sources or \
|
|
26
|
+
type(event['action_nmu']) is not list or not event['action_nmu'] or \
|
|
27
|
+
type(event['ports']) is not dict:
|
|
28
|
+
return False
|
|
29
|
+
sources.add(event['source'])
|
|
30
|
+
if not decode(event['action_nmu']):
|
|
31
|
+
return False
|
|
32
|
+
observed = list(event['ports'])
|
|
33
|
+
if len(observed) < 3 or observed != sorted(observed) or \
|
|
34
|
+
any(type(name) is not str or not name or not valid_row(event['ports'][name])
|
|
35
|
+
for name in observed):
|
|
36
|
+
return False
|
|
37
|
+
if names is None:
|
|
38
|
+
names = observed
|
|
39
|
+
if observed != names:
|
|
40
|
+
return False
|
|
41
|
+
prefix = events[:stop+1]
|
|
42
|
+
partition = {}
|
|
43
|
+
for name in names:
|
|
44
|
+
signature = tuple(row['ports'][name]['kind'] for row in prefix)
|
|
45
|
+
partition.setdefault(signature, []).append(name)
|
|
46
|
+
groups = sorted(tuple(members) for members in partition.values())
|
|
47
|
+
actions = sorted({tuple(row['action_nmu']) for row in prefix})
|
|
48
|
+
cells, winners = [], []
|
|
49
|
+
for members in groups:
|
|
50
|
+
counts = []
|
|
51
|
+
for action in actions:
|
|
52
|
+
support = set()
|
|
53
|
+
controls = 0
|
|
54
|
+
separating_actions = set()
|
|
55
|
+
for row in events[epoch:stop+1]:
|
|
56
|
+
raw_action = tuple(row['action_nmu'])
|
|
57
|
+
all_changed = all(row['ports'][name]['changed'] for name in members)
|
|
58
|
+
all_stable = all(not row['ports'][name]['changed'] for name in members)
|
|
59
|
+
if all_changed and raw_action == action:
|
|
60
|
+
support.add(tuple(tuple(row['ports'][name]['before_nmu']) for name in members))
|
|
61
|
+
if all_stable:
|
|
62
|
+
if raw_action == action:
|
|
63
|
+
controls += 1
|
|
64
|
+
if any(row['ports'][name]['changed'] for name in names if name not in members):
|
|
65
|
+
separating_actions.add(raw_action)
|
|
66
|
+
comparator = any(other != action for other in separating_actions)
|
|
67
|
+
omega = len(support)
|
|
68
|
+
counts.append({'action_nmu': list(action), 'omega': omega,
|
|
69
|
+
'controls': controls, 'comparator': comparator})
|
|
70
|
+
if omega >= OMEGA_CRIT and controls and comparator:
|
|
71
|
+
winners.append((action, members))
|
|
72
|
+
cells.append({'members': list(members), 'C_L_by_action': counts, 'xi': 0})
|
|
73
|
+
if prior is not None and prior not in groups:
|
|
74
|
+
final = {'status': 'REVOKED', 'action_nmu': None, 'members': None}
|
|
75
|
+
prior = None
|
|
76
|
+
epoch = stop+1
|
|
77
|
+
elif len(winners) == 1:
|
|
78
|
+
action, members = winners[0]
|
|
79
|
+
final = {'status': 'CRYSTAL', 'action_nmu': list(action), 'members': list(members)}
|
|
80
|
+
prior = members
|
|
81
|
+
for cell in cells:
|
|
82
|
+
cell['xi'] = int(tuple(cell['members']) == members)
|
|
83
|
+
elif prior is not None and not any(members == prior for _, members in winners):
|
|
84
|
+
final = {'status': 'REVOKED', 'action_nmu': None, 'members': None}
|
|
85
|
+
else:
|
|
86
|
+
final = {'status': 'NO_PATH', 'action_nmu': None, 'members': None}
|
|
87
|
+
expected = {'event_index': stop, 'source': event['source'],
|
|
88
|
+
'epoch_start': epoch, 'classes': cells, 'result': final}
|
|
89
|
+
if canonical(expected) != canonical(certificate['phases'][stop]):
|
|
90
|
+
return False
|
|
91
|
+
return canonical(final) == canonical(certificate['result'])
|
|
92
|
+
except (ValueError, TypeError, KeyError, IndexError, AttributeError):
|
|
93
|
+
return False
|
{tgi_foundation-0.2.0.dev0 → tgi_foundation-0.2.0.dev11}/tgi/intervention_continuity_check.py
RENAMED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"""Independent complete epoch/bridge role-lineage outcome verification."""
|
|
2
|
-
from copy import deepcopy
|
|
3
2
|
from .frame_engine import canonical
|
|
4
3
|
from .organization_snapshot import snapshot
|
|
5
4
|
from .intervention_roles_check import verify_intervention_roles
|
|
@@ -12,14 +11,14 @@ def verify_intervention_continuity(old,bridge,new,root_port,certificate,*,max_se
|
|
|
12
11
|
with budget.scope():
|
|
13
12
|
budget.consume()
|
|
14
13
|
try:
|
|
15
|
-
c=
|
|
14
|
+
c=certificate
|
|
16
15
|
if set(c)!={'policy','root_port','epochs','outcomes','total_completions','result'} or c['policy']!='bridged_intervention_role_continuity_v1' or c['root_port']!=root_port:return False
|
|
17
16
|
if not isinstance(c['epochs'],list) or len(c['epochs'])!=3:return False
|
|
18
17
|
epochs=c['epochs']
|
|
19
18
|
for raw,role in zip((old,bridge,new),epochs):
|
|
20
19
|
if raw is None:
|
|
21
20
|
if role is not None:return False
|
|
22
|
-
elif not isinstance(raw,(tuple,list)) or len(raw)!=3 or not verify_intervention_roles(snapshot(raw[0]),
|
|
21
|
+
elif not isinstance(raw,(tuple,list)) or len(raw)!=3 or not verify_intervention_roles(snapshot(raw[0]),raw[1],raw[2],role):return False
|
|
23
22
|
left,middle,right=epochs
|
|
24
23
|
if left is None or right is None or root_port not in left['ports']:return False
|
|
25
24
|
li=left['ports'].index(root_port);bi=middle['ports'].index(root_port) if middle and root_port in middle['ports'] else None
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"""Independent source/cell/complete-partition verifier for visible roles."""
|
|
2
|
-
from copy import deepcopy
|
|
3
2
|
from .identity import decode,encode
|
|
4
3
|
from .organization import OMEGA_CRIT
|
|
5
4
|
from .organization_snapshot import snapshot
|
|
@@ -17,7 +16,7 @@ def verify_intervention_roles(acquisition,groups,measurements,certificate,*,max_
|
|
|
17
16
|
fields={'policy','groups','witness','ports','rows','changed_before_diversity','partitions','completions','role_candidates','status'}
|
|
18
17
|
c=certificate
|
|
19
18
|
if set(c)!=fields or c['policy']!='visible_intervention_roles_v1' or canonical(c['groups'])!=canonical(groups):return False
|
|
20
|
-
view=snapshot(acquisition)
|
|
19
|
+
view=snapshot(acquisition)
|
|
21
20
|
if not verify_acquisition_witness(view,measurements,c['witness']):return False
|
|
22
21
|
if not isinstance(groups,list) or not groups:return False
|
|
23
22
|
measured={};expected={(s,i) for s,(frames,_) in view.episodes.items() for i in range(len(frames))}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"""Independent complete observed-state, operation and native lineage check."""
|
|
2
|
-
from copy import deepcopy
|
|
3
2
|
from .identity import decode,encode
|
|
4
3
|
from .frame_engine import canonical
|
|
5
4
|
from .organization_snapshot import snapshot
|
|
@@ -15,10 +14,10 @@ def verify_lineage_state(old,bridge,new,root_port,anchor,actions,certificate,*,m
|
|
|
15
14
|
if not isinstance(anchor,dict) or set(anchor)!={'source','frame'} or not isinstance(anchor['source'],str) or type(anchor['frame']) is not int or anchor['frame'] not in (0,2):return False
|
|
16
15
|
if not isinstance(actions,(list,tuple)) or not actions or any(not isinstance(a,str) or not a for a in actions):return False
|
|
17
16
|
for action in actions:encode(action)
|
|
18
|
-
c=
|
|
17
|
+
c=certificate
|
|
19
18
|
if set(c)!={'policy','root_port','anchor','actions','lineage','port','states','inventory','result'} or c['policy']!='lineage_observed_state_v1' or c['root_port']!=root_port or canonical(c['anchor'])!=canonical(anchor) or canonical(c['actions'])!=canonical(list(actions)):return False
|
|
20
19
|
if not verify_intervention_continuity(old,bridge,new,root_port,c['lineage']):return False
|
|
21
|
-
view=snapshot(new[0]);groups=new[1];lookup={(r['source'],r['frame']):
|
|
20
|
+
view=snapshot(new[0]);groups=new[1];lookup={(r['source'],r['frame']):r for r in new[2]}
|
|
22
21
|
assignment={s['source']:s['port'] for group in groups for s in group}
|
|
23
22
|
port=assignment[anchor['source']]
|
|
24
23
|
def endpoint(source,frame):
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"""Source-owned physical port classes gated by their original frame crystals.
|
|
2
|
+
|
|
3
|
+
Port response topology and raw path organization are distinct TGI operators.
|
|
4
|
+
This cycle binds their common raw experience without requiring a text-pattern
|
|
5
|
+
organization to exist for a physical sensor class.
|
|
6
|
+
"""
|
|
7
|
+
import copy
|
|
8
|
+
import hashlib
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
import re
|
|
12
|
+
import tempfile
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from .frame_engine import canonical, unique_object
|
|
16
|
+
from .identity import REGISTRY_ID, decode
|
|
17
|
+
from .local_edit_transport_classes import OwnedPortClasses, _event
|
|
18
|
+
from .local_edit_transport_classes_check import verify as verify_classes
|
|
19
|
+
from .causal_port_classes import (CausalPortClasses, ResponseIncidenceClasses,
|
|
20
|
+
_event as _causal_event, _response_event)
|
|
21
|
+
from .causal_port_classes_check import verify as verify_causal_classes
|
|
22
|
+
from .response_incidence_check import verify as verify_response_incidence
|
|
23
|
+
from .organization import RawOrganization
|
|
24
|
+
|
|
25
|
+
REVISION = 'TGI-PHASE-BOUND-PORT-CLASSES-V1'
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _sha(data):
|
|
29
|
+
return hashlib.sha256(data).hexdigest()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _source(event_source, port):
|
|
33
|
+
return canonical([event_source, port])
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _fork_crystals(parent):
|
|
37
|
+
if type(parent) is not RawOrganization or parent.frames._pending:
|
|
38
|
+
raise ValueError('Complete predecessor crystal state required')
|
|
39
|
+
child = RawOrganization()
|
|
40
|
+
for name in ('_atoms', '_bonds', '_origins', '_contexts', '_sources', '_pending'):
|
|
41
|
+
setattr(child.frames, name, dict(getattr(parent.frames, name)))
|
|
42
|
+
child.episodes = dict(parent.episodes)
|
|
43
|
+
return child
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class PhaseBoundPortClasses:
|
|
47
|
+
REVISION = REVISION
|
|
48
|
+
CLASS_TYPE = OwnedPortClasses
|
|
49
|
+
EVENT_FACTORY = staticmethod(_event)
|
|
50
|
+
VERIFY_CLASS = staticmethod(verify_classes)
|
|
51
|
+
|
|
52
|
+
def __init__(self, events=(), *, max_search_steps=100000):
|
|
53
|
+
if type(events) not in (list, tuple) or type(max_search_steps) is not int or max_search_steps < 1:
|
|
54
|
+
raise ValueError('Ordered raw events and positive search budget required')
|
|
55
|
+
rows = copy.deepcopy(list(events))
|
|
56
|
+
native_events = []
|
|
57
|
+
model = RawOrganization()
|
|
58
|
+
seen = set()
|
|
59
|
+
for event in rows:
|
|
60
|
+
if type(event) is not dict or set(event) != {'source', 'action', 'ports'}:
|
|
61
|
+
raise ValueError('Original event source, action and port frames required')
|
|
62
|
+
source, action, ports = event['source'], event['action'], event['ports']
|
|
63
|
+
if type(source) is not str or not source or source in seen or type(ports) is not dict:
|
|
64
|
+
raise ValueError('Unique original event source and port map required')
|
|
65
|
+
seen.add(source)
|
|
66
|
+
native_events.append(self.EVENT_FACTORY(source, action, ports))
|
|
67
|
+
for port, pair in sorted(ports.items()):
|
|
68
|
+
model.observe(_source(source, port), list(pair))
|
|
69
|
+
if len(model.episodes) > max_search_steps:
|
|
70
|
+
raise ValueError('INCOMPLETE: source verification budget exhausted')
|
|
71
|
+
classes = self.CLASS_TYPE(native_events)
|
|
72
|
+
if not all(model._alive(source) for source in model.episodes):
|
|
73
|
+
raise ValueError('Original frame crystal is not alive')
|
|
74
|
+
self._events, self._classes, self._model = rows, classes, model
|
|
75
|
+
self._events_digest = _sha(canonical(rows).encode('utf8'))
|
|
76
|
+
self._class_digest = _sha(canonical(classes._certificate).encode('utf8'))
|
|
77
|
+
self.max_search_steps = max_search_steps
|
|
78
|
+
|
|
79
|
+
def _certificate(self):
|
|
80
|
+
class_certificate = self._classes._certificate
|
|
81
|
+
if _sha(canonical(self._events).encode('utf8')) != self._events_digest or \
|
|
82
|
+
_sha(canonical(class_certificate).encode('utf8')) != self._class_digest:
|
|
83
|
+
raise ValueError('Original action, port event, or class certificate changed')
|
|
84
|
+
if not self.VERIFY_CLASS(class_certificate['events'], class_certificate):
|
|
85
|
+
raise ValueError('Original class decision failed independent replay')
|
|
86
|
+
expected_sources = {_source(event['source'], port)
|
|
87
|
+
for event in self._events for port in event['ports']}
|
|
88
|
+
expected_frames = {canonical([source, index]) for source in expected_sources
|
|
89
|
+
for index in range(2)}
|
|
90
|
+
if (set(self._model.episodes) != expected_sources or
|
|
91
|
+
set(self._model.frames._sources) != expected_frames or
|
|
92
|
+
self._model.frames._pending):
|
|
93
|
+
raise ValueError('Crystal source inventory differs from original ports')
|
|
94
|
+
if len(expected_sources) > self.max_search_steps:
|
|
95
|
+
raise ValueError('INCOMPLETE: source verification budget exhausted')
|
|
96
|
+
# Port response topology does not require a text-pattern organization.
|
|
97
|
+
# _alive independently checks each original C/L receipt, Ω, ξ, atom,
|
|
98
|
+
# coordinate, forward bond, and exact NMU traversal before use.
|
|
99
|
+
bindings = []
|
|
100
|
+
for event in self._events:
|
|
101
|
+
for port, pair in sorted(event['ports'].items()):
|
|
102
|
+
source = _source(event['source'], port)
|
|
103
|
+
if source not in self._model.episodes or not self._model._alive(source):
|
|
104
|
+
raise ValueError('Original crystal source is not alive')
|
|
105
|
+
frames, receipts = self._model.episodes[source]
|
|
106
|
+
if tuple(map(decode, frames)) != tuple(pair):
|
|
107
|
+
raise ValueError('Port observation disagrees with source crystal')
|
|
108
|
+
bindings.append({'source': source, 'event_source': event['source'],
|
|
109
|
+
'port': port, 'receipts': [r.as_dict() for r in receipts]})
|
|
110
|
+
return {'revision': self.REVISION, 'registry': REGISTRY_ID,
|
|
111
|
+
'class_certificate': class_certificate,
|
|
112
|
+
'bindings': bindings, 'decision': class_certificate['result']}
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def certificate(self):
|
|
116
|
+
return copy.deepcopy(self._certificate())
|
|
117
|
+
|
|
118
|
+
def observe(self, source, action, ports):
|
|
119
|
+
self._certificate()
|
|
120
|
+
row = {'source': source, 'action': action, 'ports': copy.deepcopy(ports)}
|
|
121
|
+
self.EVENT_FACTORY(source, action, row['ports'])
|
|
122
|
+
if any(event['source'] == source for event in self._events):
|
|
123
|
+
raise ValueError('Duplicate original event source')
|
|
124
|
+
classes = self._classes.observe(source, action, row['ports'])
|
|
125
|
+
model = _fork_crystals(self._model)
|
|
126
|
+
for port, pair in sorted(row['ports'].items()):
|
|
127
|
+
model.observe(_source(source, port), list(pair))
|
|
128
|
+
child = object.__new__(type(self))
|
|
129
|
+
child._events = copy.deepcopy(self._events) + [row]
|
|
130
|
+
child._classes, child._model = classes, model
|
|
131
|
+
child._events_digest = _sha(canonical(child._events).encode('utf8'))
|
|
132
|
+
child._class_digest = _sha(canonical(classes._certificate).encode('utf8'))
|
|
133
|
+
child.max_search_steps = self.max_search_steps
|
|
134
|
+
child._certificate()
|
|
135
|
+
return child
|
|
136
|
+
|
|
137
|
+
def observe_batch(self, events):
|
|
138
|
+
"""Publish one atomic successor while preserving every ordered event phase."""
|
|
139
|
+
self._certificate() # Reject altered predecessor before successor creation.
|
|
140
|
+
if type(events) not in (list, tuple) or not events:
|
|
141
|
+
raise ValueError('Nonempty ordered event batch required')
|
|
142
|
+
return type(self)(self._events + copy.deepcopy(list(events)),
|
|
143
|
+
max_search_steps=self.max_search_steps)
|
|
144
|
+
|
|
145
|
+
def resolve(self, action):
|
|
146
|
+
certificate = self._certificate()
|
|
147
|
+
return self._classes.resolve(action) if certificate['decision']['status'] == 'CRYSTAL' else None
|
|
148
|
+
|
|
149
|
+
def commit(self, path):
|
|
150
|
+
certificate = self._certificate()
|
|
151
|
+
payload = {'revision': self.REVISION, 'registry': REGISTRY_ID,
|
|
152
|
+
'events': self._events, 'certificate': certificate}
|
|
153
|
+
envelope = {'payload': payload, 'sha256': _sha(canonical(payload).encode('utf8'))}
|
|
154
|
+
data = canonical(envelope).encode('utf8')
|
|
155
|
+
target = Path(path)
|
|
156
|
+
temporary = None
|
|
157
|
+
try:
|
|
158
|
+
with tempfile.NamedTemporaryFile(mode='wb', dir=target.parent, delete=False) as stream:
|
|
159
|
+
temporary = Path(stream.name)
|
|
160
|
+
stream.write(data)
|
|
161
|
+
stream.flush()
|
|
162
|
+
os.fsync(stream.fileno())
|
|
163
|
+
os.replace(temporary, target)
|
|
164
|
+
temporary = None
|
|
165
|
+
finally:
|
|
166
|
+
if temporary is not None and temporary.exists():
|
|
167
|
+
temporary.unlink()
|
|
168
|
+
return {'path': str(target), 'sha256': _sha(data), 'bytes': len(data)}
|
|
169
|
+
|
|
170
|
+
@classmethod
|
|
171
|
+
def recover(cls, path, expected_sha256, *, max_search_steps=100000):
|
|
172
|
+
if type(expected_sha256) is not str or re.fullmatch('[0-9a-f]{64}', expected_sha256) is None:
|
|
173
|
+
raise ValueError('External checkpoint digest required')
|
|
174
|
+
data = Path(path).read_bytes()
|
|
175
|
+
if _sha(data) != expected_sha256:
|
|
176
|
+
raise ValueError('Checkpoint digest mismatch')
|
|
177
|
+
envelope = json.loads(data.decode('utf8'), object_pairs_hook=unique_object)
|
|
178
|
+
if type(envelope) is not dict or set(envelope) != {'payload', 'sha256'}:
|
|
179
|
+
raise ValueError('Invalid checkpoint envelope')
|
|
180
|
+
payload = envelope['payload']
|
|
181
|
+
if (type(payload) is not dict or set(payload) != {'revision', 'registry', 'events', 'certificate'} or
|
|
182
|
+
payload['revision'] != cls.REVISION or payload['registry'] != REGISTRY_ID or
|
|
183
|
+
envelope['sha256'] != _sha(canonical(payload).encode('utf8'))):
|
|
184
|
+
raise ValueError('Invalid checkpoint payload')
|
|
185
|
+
result = cls(payload['events'], max_search_steps=max_search_steps)
|
|
186
|
+
if canonical(result.certificate) != canonical(payload['certificate']):
|
|
187
|
+
raise ValueError('Recomputed source binding differs')
|
|
188
|
+
return result
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class PhaseBoundCausalPortClasses(PhaseBoundPortClasses):
|
|
192
|
+
"""Alphabet-invariant response topology with the same source crystal law."""
|
|
193
|
+
REVISION = 'TGI-PHASE-BOUND-CAUSAL-PORT-CLASSES-V1'
|
|
194
|
+
CLASS_TYPE = CausalPortClasses
|
|
195
|
+
EVENT_FACTORY = staticmethod(_causal_event)
|
|
196
|
+
VERIFY_CLASS = staticmethod(verify_causal_classes)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class PhaseBoundResponseIncidenceClasses(PhaseBoundPortClasses):
|
|
200
|
+
"""Multi-NMU sensor response incidence with original frame crystals."""
|
|
201
|
+
REVISION = 'TGI-PHASE-BOUND-RESPONSE-INCIDENCE-V1'
|
|
202
|
+
CLASS_TYPE = ResponseIncidenceClasses
|
|
203
|
+
EVENT_FACTORY = staticmethod(_response_event)
|
|
204
|
+
VERIFY_CLASS = staticmethod(verify_response_incidence)
|