Skip to content

Conversation

@fermga
Copy link
Owner

@fermga fermga commented Aug 27, 2025

Reverts #6

@netlify
Copy link

netlify bot commented Aug 27, 2025

Deploy Preview for stunning-zabaione-f1f1ef failed. Why did it fail? →

Name Link
🔨 Latest commit 2168cfc
🔍 Latest deploy log https://app.netlify.com/projects/stunning-zabaione-f1f1ef/deploys/68af509864a8170008a1e1b9

@fermga fermga merged commit 5010028 into main Aug 27, 2025
0 of 4 checks passed
@fermga fermga deleted the revert-6-codex/create-tests-for-aplicar_remesh_si_estabilizacion_global branch August 27, 2025 19:11
fermga added a commit that referenced this pull request Sep 12, 2025
…implicados: [Autoorganizacion]\nInvariantes afectados: [#8]\nCambios clave: refactor multi_recompute_abs_max con defaultdict y comprensiones; nueva importación\nRiesgos/disonancias previstas: posible sobrecarga de memoria mitigada con pruebas\nMétricas: C(t) estable, Si n/a, νf n/a, fase n/a\nPruebas: alias_cache, alias_iterable, alias_accessor_usage, cached_abs_max_performance, metrics\nMapa de equivalencias: sin cambios
fermga added a commit that referenced this pull request Sep 12, 2025
Intento: Centralizar la escritura en disco para reforzar coherencia de IO
Operadores implicados: [Autoorganización]
Invariantes afectados: [#8]
Cambios clave: extracción de helper _write_to_fd, reutilización en escrituras atómicas/directas
Riesgos/disonancias previstas: posible variación en sincronización de disco; mitigado manteniendo fsync en ruta atómica
Métricas: sin cambio en C(t), Si, νf, fase
Pruebas: tests existentes
Mapa de equivalencias: sin cambios de API
fermga added a commit that referenced this pull request Sep 12, 2025
Intento: simplifica la ordenación de nodos para mantener coherencia al calcular digests
Operadores implicados: [Coherencia]
Invariantes afectados: [#8]
Cambios clave: reemplazo de tuplas por ordenación con clave y cálculo explícito de repr
Riesgos/disonancias previstas: posible doble cálculo de representación; se contiene con cache LRU
Métricas: C(t) sin cambio; Si sin cambio; νf sin cambio; fase sin cambio
Pruebas: tests/test_cache_helpers.py
Mapa de equivalencias: n/a
fermga added a commit that referenced this pull request Sep 12, 2025
Operadores implicados: [Autoorganizacion]
Invariantes afectados: [#8]
Cambios clave: ajustar expectativas a CallbackSpec en pruebas
Riesgos/disonancias previstas: ninguno
Métricas: sin cambio
Pruebas: test_register_callback, test_normalize_event_callbacks, test_ensure_callbacks, test_invoke_callbacks, test_callback_errors_limit, test_add_edge_callbacks, test_trace
Mapa de equivalencias: ninguno
fermga added a commit that referenced this pull request Sep 12, 2025
Intento: mejorar trazabilidad de callbacks fallidos en NetworkX
Operadores implicados: [Recepción]
Invariantes afectados: [#8]
Cambios clave:
- registra errores NetworkX antes de relanzar la excepción
- prueba dedicada a _callback_errors con NetworkXError
Riesgos/disonancias previstas: registro adicional pero controlado por _CALLBACK_LOCK
Métricas: C(t), Si, νf, fase sin cambios
Pruebas: tests/test_invoke_callbacks.py::test_invoke_callbacks_records_networkx_error
Mapa de equivalencias: N/A
fermga added a commit that referenced this pull request Sep 12, 2025
Operadores implicados: [Autoorganizacion]
Invariantes afectados: [#8]
Cambios clave:
- se retira _alias_cache_lock y el contexto with
- se documenta el lock interno de lru_cache
Riesgos/disonancias previstas: posible condicion de carrera; contenida mediante el bloqueo interno de lru_cache y verificacion concurrente
Metricas: C(t), Si, vf, fase sin cambios
Pruebas: tests/test_alias_helpers_threadsafe.py
Mapa de equivalencias: ninguno
fermga added a commit that referenced this pull request Sep 12, 2025
Intento: Modernizar anotaciones de tipos para mejorar coherencia y simplificar importaciones
Operadores implicados: [Autoorganizacion]
Invariantes afectados: [#8]
Cambios clave: remover Set de typing, usar set[str] en _warn_orjson_params_once
Riesgos/disonancias previstas: ninguna; se mantiene compatibilidad con orjson
Métricas: C(t) estable, Si estable, νf estable, fase estable
Pruebas: tests/test_json_utils.py
Mapa de equivalencias: n/a
fermga added a commit that referenced this pull request Sep 12, 2025
Intento: centralizar la coherencia de la caché RNG
Operadores implicados: [Autoorganizacion]
Invariantes afectados: [#8]
Cambios clave: añade _sync_cache_size y lo usa en make_rng y cache_enabled
Riesgos/disonancias previstas: reactivación involuntaria de caché contenida con guardas existentes
Métricas: C(t), Si, νf, fase sin cambios
Pruebas: tests/test_rng_* (existentes)
Mapa de equivalencias: n/a
fermga added a commit that referenced this pull request Sep 12, 2025
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- lazy-import kahan_sum inside collections_utils to avoid circular dependency
Expected risks/dissonances: minor overhead from repeated imports, mitigated by Python module cache
Metrics: C(t), Si, νf, phase unaffected
Equivalence map: N/A
fermga added a commit that referenced this pull request Sep 12, 2025
Operators involved: [Recursivity]
Affected invariants: [#4, #8]
Key changes:
- Added _validated_history helper combining validate_window and ensure_history_deque
- Updated push_glyph and recent_glyph to use helper
- Added tests for helper behaviour
Expected risks/dissonances:
- Incorrect handling of zero window mitigated by explicit tests
Metrics: C(t), Si, νf, phase unchanged
Equivalence map: none
fermga added a commit that referenced this pull request Sep 12, 2025
Intent: structure jitter state for reproducible coherence
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- Introduced JitterCache class to hold jitter sequence and graph caches
- Refactored setup_jitter_cache and clear_rng_cache to use the instance
- Exposed module-level singleton preserving prior API
Expected risks/dissonances: possible stale cache references; mitigated via alias updates and tests
Metrics: C(t) stable, deterministic sequences maintained
Equivalence map: setup_jitter_cache(), clear_rng_cache() -> unchanged signatures
fermga added a commit that referenced this pull request Sep 12, 2025
…excluding booleans

Operators involved: [Coherence]
Affected invariants: [#8]
Key changes:
- use numbers.Integral for window type check
- add tests for numpy integer acceptance
Expected risks/dissonances: none anticipated; bool exclusion preserved
Metrics: C(t), Si, νf, phase unchanged
Equivalence map: n/a
fermga added a commit that referenced this pull request Sep 12, 2025
Operators involved: [Self-organization, Coherence]
Affected invariants: [#8]
Key changes:
- add _node_repr_digest for joint representation and digest caching
- refactor _node_repr, _hash_node and helpers to use single cache
- adjust checksum tests for new API
Expected risks/dissonances: cache invalidation regressions handled by tests
Metrics: C(t) stable, Si unchanged, νf and phase unaffected
Equivalence map: _hash_node(obj, repr_) -> _hash_node(obj)
fermga added a commit that referenced this pull request Sep 12, 2025
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- add README section on edge_version_update context manager
Expected risks/dissonances: none; documentation only
Metrics: C(t), Si, νf, phase unchanged
Equivalence map: increment_edge_version -> edge_version_update
fermga added a commit that referenced this pull request Sep 12, 2025
Operators involved: [Mutation]
Affected invariants: [#8]
Key changes:
- introduce JitterCacheManager and expose manager instance
- replace globals with manager methods and properties
- update operators and tests to use manager interface
Expected risks/dissonances: API consumers may need adjustment to manager-based access
Metrics: C(t), Si, νf unchanged; deterministic jitter sequences
Equivalence map: setup_jitter_cache->JITTER_MANAGER.setup; clear_rng_cache->JITTER_MANAGER.clear; _JITTER_SEQ->JITTER_MANAGER.seq
fermga added a commit that referenced this pull request Sep 12, 2025
Operators involved: [Coupling]
Affected invariants: [#8]
Key changes:
- extract _normalized_callbacks helper
- reuse helper in registry and event normalization
- test invalid entries are discarded
Expected risks/dissonances: none
Metrics: N/A
Equivalence map: none
fermga added a commit that referenced this pull request Sep 12, 2025
Intent: strengthen optional import coherence via bounded TTL cache
Operators involved: [Self-organization, Transition]
Affected invariants: [#8]
Key changes:
- replace OrderedDict with configurable TTLCache
- simplify prune/record/discard using cache ops
- delegate prune_failed_imports to cache expiration
- adapt tests for TTL-based behaviour
Expected risks/dissonances: TTL semantics diverge from manual timestamps; covered by tests
Metrics: C(t), Si, νf, phase unchanged (stability maintained)
Equivalence map: N/A
fermga added a commit that referenced this pull request Sep 12, 2025
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes: - merge warning and import locks into shared critical sections
- factor failure message formatting
Expected risks/dissonances: potential deadlock mitigated by consistent lock order
Metrics: n/a
Equivalence map: none
fermga added a commit that referenced this pull request Sep 12, 2025
Intent: streamline safe_write coherence
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- Extract _write_file helper for open/write logic
- Use helper in atomic and direct branches with shared try/except
- Preserve error messages and fsync behavior
Expected risks/dissonances: minimal; tmp file handling could vary per OS
Metrics: C(t), Si, νf, phase unchanged
Equivalence map: safe_write API unchanged
fermga added a commit that referenced this pull request Sep 13, 2025
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- Cache per-dict alias keys to avoid repeated scans
- Reuse cached keys in get and set with size-based invalidation
- Add tests verifying iteration reduction and cache invalidation
Expected risks/dissonances: stale cache if dictionary mutated without size change
Metrics: C(t), Si, νf unchanged
Equivalence map: N/A
fermga added a commit that referenced this pull request Sep 13, 2025
…rganization]\nAffected invariants: [#8]\nKey changes:\n- Replace strong registry dict with WeakValueDictionary guarded by _REGISTRY_LOCK\n- Add test verifying locks without references vanish from registry\nExpected risks/dissonances: relies on garbage collection timing; tests force gc to contain\nMetrics: C(t) stable; νf unchanged; phase unaffected\nEquivalence map: n/a
fermga added a commit that referenced this pull request Sep 13, 2025
…ter reporting

Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- accept precomputed frozenset in _warn_orjson_params_once
- extract _format_ignored_params
- reset warnings via clear_orjson_cache and adjust calls
- add test ensuring unique warnings per combination
Expected risks/dissonances: minimal risk of misfiring warnings; mitigated by tests verifying single emission
Metrics: C(t) stable; Si, νf, phase unaffected
Equivalence map: None
fermga added a commit that referenced this pull request Sep 13, 2025
Intent: stabilize JSON parameter handling by reusing immutable defaults
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- add frozen DEFAULT_PARAMS for json serialization
- reuse default params when options unchanged
- test identity reuse of default params
Expected risks/dissonances: minimal; ensures default reuse without altering behaviour
Metrics: no change in C(t), Si, νf, phase expected
Equivalence map: N/A
fermga added a commit that referenced this pull request Sep 13, 2025
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- Wrap NodoNX.from_graph cache in named lock tied to id(G)
- Initialize new NodoNX inside critical section
- Add multithreaded test exercising from_graph
Expected risks/dissonances: slight contention when many threads create nodes
Metrics: C(t), Si unchanged
Equivalence map: N/A
fermga added a commit that referenced this pull request Sep 13, 2025
Operators involved: [Coherence]
Affected invariants: [#5, #8]
Key changes:
- add _neighbor_phase_mean_core
- delegate neighbor_phase_mean_list and _neighbor_phase_mean to core
- extend neighbor_phase_mean tests
Expected risks/dissonances: refactor may mis-handle numpy/no numpy paths; covered by tests
Metrics: C(t), Si, νf, phase unchanged; averaging more explicit
Equivalence map: none
fermga added a commit that referenced this pull request Sep 13, 2025
Intent: maintain deterministic caching of selector thresholds
Operators involved: [Self-organization]
Affected invariants: [#8]
Key changes:
- Introduced _sorted_items helper for stable mapping order
- Applied helper for thr_sel and thr_def before caching
- Added regression test ensuring cache ignores dict order
Expected risks/dissonances: minimal; sorting overhead small
Metrics: C(t) stable; Si, νf, phase unchanged
Equivalence map: N/A
Copilot AI added a commit that referenced this pull request Nov 9, 2025
Create copilot-setup-steps.yml workflow to preconfigure the Copilot agent's
development environment with TNFR dependencies and verification steps.

Intent: Strengthen structural coherence by ensuring Copilot can explore,
study, investigate, and develop TNFR implementations with proper tooling.

Operators involved: Emission (AL) - initiating development workflow
                     Coherence (IL) - stabilizing environment setup

Key changes:
- Created .github/workflows/copilot-setup-steps.yml
- Configured Python 3.11 setup with pip caching
- Installed core dependencies: test, numpy, yaml, orjson
- Added verification steps to confirm TNFR installation
- Enabled workflow_dispatch for manual testing
- Auto-triggers on workflow file changes

Expected benefits:
- Faster Copilot startup (cached dependencies)
- Reliable development environment (pre-installed deps)
- Immediate validation capability (test infrastructure ready)
- Alignment with TNFR mission: explore, study, investigate, develop

Affected invariants: #8 (Controlled Determinism - reproducible environment)

Metrics: Setup time expected to decrease, C(t) of development workflow ↑

Co-authored-by: fermga <203334638+fermga@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Nov 9, 2025
Use `pip install -e .` to install TNFR directly from the repository
source code (latest development version) instead of the older PyPI version.
Add verification step to display installation location confirming it's from repo.

Intent: Ensure Copilot works with the most advanced TNFR version for
exploration, study, investigation, and development of the theory.

Operators involved: Emission (AL) - generating from fresh source
                     Coherence (IL) - stabilizing on correct version

Key changes:
- Changed from `pip install .` to `pip install -e .` (editable mode)
- Added explicit comment: "Install TNFR directly from repository source code (NOT from PyPI)"
- Added location verification in test step
- Editable mode enables immediate reflection of code changes

Benefits:
- ✓ Latest development version (0.1.dev4 from repo vs older PyPI)
- ✓ Editable install: changes in source immediately available
- ✓ Clear verification: shows installation location
- ✓ Copilot works with cutting-edge TNFR implementations

Affected invariants: #8 (Controlled Determinism - correct version source)

Metrics: Version freshness ↑, development iteration speed ↑

Co-authored-by: fermga <203334638+fermga@users.noreply.github.com>
fermga pushed a commit that referenced this pull request Nov 11, 2025
…storing structural integrity)

Operators involved: Coherence (IL) - Stabilizes module structure through negative feedback

Affected invariants:
- #4 (Operator Closure): Preserved API compatibility via re-exports
- #8 (Controlled Determinism): Deterministic import resolution
- #10 (Domain Neutrality): No domain-specific assumptions introduced

Key changes:
- Created src/tnfr/validation/base.py: Isolated ValidationOutcome, Validator, SubjectT
- Updated src/tnfr/validation/runtime.py: Import from .base instead of .
- Updated src/tnfr/validation/__init__.py: Re-export from .base (removed duplicates)
- Updated src/tnfr/validation/spectral.py: Import from .base
- Added test_circular_import_fix.py: Verification test for complete import chain

Expected risks/dissonances: None - structure strengthened, API preserved

Metrics:
- C(t): ↑ (module structure now coherent)
- ΔNFR: ↓ (circular dependency eliminated)
- Si: ↑ (stable import resolution)

Equivalence map:
- ValidationOutcome: validation.__init__ → validation.base → validation.__init__ (re-exported)
- Validator: validation.__init__ → validation.base → validation.__init__ (re-exported)
- API surface unchanged for external consumers

Fixes #2926 circular import blocking CI/CD
fermga pushed a commit that referenced this pull request Nov 14, 2025
…ction

Intent: Restore PEP 621 compliance for Binder/builds (coherence in distribution)
Operators involved: (Infrastructure stabilization) IL/Transition analog
Affected invariants: #8 (reproducibility), #4 (closure via proper packaging)

Key changes:
- Sanitized project.authors removing unsupported 'orcid' subfield
- Added [tool.tnfr.metadata] primary_author_orcid to retain identity traceability

Expected risks/dissonances: None; pure metadata stabilizer
Metrics: Build now passes local 'pip install .' without validation error
fermga pushed a commit that referenced this pull request Nov 14, 2025
Intent: Increase test coverage for src/tnfr/sparse module from 0% to 65%
Operators involved: Testing infrastructure (no runtime operators)
Affected invariants: #8 (Controlled Determinism - reproducibility)

Key changes:
- Created tests/sparse/__init__.py and test_sparse_representations.py
- Added 31 test cases across 7 test classes
- Fixed IndentationError in src/tnfr/dynamics/integrators.py (line 874)
- Fixed missing import in src/tnfr/physics/extended_canonical_fields.py
- Fixed numpy 2.3.4 corruption (reinstalled 2.2.1)
- Fixed scipy corruption (reinstalled 1.16.3)

Test coverage:
- CompactAttributeStore: 6 tests (defaults, vectorized ops, storage removal)
- SparseCache: 7 tests (TTL expiration, LRU eviction, memory tracking)
- SparseTNFRGraph: 8 tests (init, memory footprint, attributes)
- MemoryEfficiency: 2 tests (sparse vs dense, scaling)
- Integration: 2 tests (TNFR compatibility, reproducibility)
- EdgeCases: 6 tests (zero nodes, invalid density, boundaries)
- Performance: 2 tests (large graphs, access speed)

Coverage: 65% (204 statements, 71 miss)
Status: All 31 tests passing

Expected risks/dissonances: Syntax errors fixed (integrators.py, extended_canonical_fields.py)

Metrics before/after:
- Test files: 488 → 490 (+2)
- Health: 100/100 → 100/100 (maintained)
- Coverage sparse module: 0% → 65%
fermga pushed a commit that referenced this pull request Nov 14, 2025
Intent: Increase test coverage for src/tnfr/ontosim orchestration layer
Operators involved: Testing infrastructure (no runtime operators)
Affected invariants: #8 (Controlled Determinism), #1 (EPI as Coherent Form)

Key changes:
- Created tests/ontosim/__init__.py and test_ontosim_runner.py
- Added 39 test cases across 10 test classes
- All tests passing (39/39)

Test coverage:
- TestPrepareNetwork: 7 tests (initialization, history buffers, callbacks, ΔNFR hooks)
- TestStep: 7 tests (single-step execution, attribute updates, custom dt)
- TestRun: 6 tests (multi-step execution, zero steps, parameter propagation)
- TestReproducibility: 3 tests (deterministic with seeds - Invariant #8)
- TestIntegration: 3 tests (different topologies, mixed step/run, disconnected graphs)
- TestEdgeCases: 6 tests (single node, empty graph, large graphs, unprepared handling)
- TestHistoryTracking: 3 tests (buffer structure, maxlen, types)
- TestCallbackIntegration: 2 tests (structure, custom callbacks)
- TestParameterOverrides: 2 tests (DT override, multiple params, override_defaults flag)

Key findings:
- Node attributes use Unicode: 'νf' (not 'nu_f'), 'theta', 'EPI', 'Si'
- Parameters: 'DT' (not 'DT_DEFAULT'), 'RANDOM_SEED'
- History buffers exist but populate only with observers/callbacks
- Time tracking not directly exposed in G.graph['t']

Status: All 39 tests passing
Health: 100/100 maintained

Expected risks/dissonances: None - all tests adapted to actual API

Metrics before/after:
- Test files: 490 → 492 (+2)
- Health: 100/100 → 100/100 (maintained)
- Coverage ontosim: TBD (needs coverage run)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants