Skip to content

Commit 4a2d864

Browse files
author
fer
committed
docs: Complete U5 (Multi-Scale Coherence) documentation parity with U1-U4
- Added full U5 section to 02-CANONICAL-CONSTRAINTS.md with same depth as U1-U4 * Intuition, Formal Definition, Physical Derivation * Implementation code examples * Valid/invalid examples and anti-patterns * Test specifications and related documentation - Updated all grammar documentation files (33+ files) to reflect U5 * MASTER-INDEX.md: System overview and conceptual hierarchy * 08-QUICK-REFERENCE.md: Constraint box, decision tree, examples * 06-VALIDATION-AND-TESTING.md: Coverage checklist and requirements * 01-FUNDAMENTAL-CONCEPTS.md: Learning path references * GLOSSARY.md: Grammar definition and sequence validation * EXECUTIVE-SUMMARY.md: Business value and constraint count - Updated technical implementation documentation * 05-TECHNICAL-IMPLEMENTATION.md: Architecture and validation logic * 04-VALID-SEQUENCES.md: Validation algorithms and notes * 07-MIGRATION-AND-EVOLUTION.md: Phase 3 current state, breaking changes - Updated operator classification references * Added RECURSIVE_GENERATORS and SCALE_STABILIZERS to all relevant docs * Updated all code docstrings from 'U1-U4' to 'U1-U5' * Updated Summary Table and Complete Validation Example - Implementation note: U5 already exists in codebase (grammar.py) * Tests exist (test_u5_multiscale_coherence.py) * This commit achieves documentation completeness only Physics basis: C_parent >= α·ΣC_child (hierarchical coherence conservation) U5 requirement: Deep REMESH (depth>1) needs IL/THOL within ±3 operators Refs: AGENTS.md (Invariant #7: Operational Fractality), UNIFIED_GRAMMAR_RULES.md
0 parents  commit 4a2d864

File tree

1,190 files changed

+306358
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,190 files changed

+306358
-0
lines changed

.codeql/codeql-config.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# CodeQL Configuration
2+
# This file configures CodeQL analysis for the TNFR Python Engine repository
3+
4+
name: "TNFR CodeQL Configuration"
5+
6+
# Use the default security-and-quality query suite
7+
queries:
8+
- uses: security-and-quality
9+
10+
# Query filters to suppress false positives
11+
query-filters:
12+
# Suppress incomplete URL substring sanitization in test files
13+
# Context: Test files use 'module_name in sys.modules' pattern for test
14+
# isolation (clearing module cache), not for URL validation. CodeQL
15+
# incorrectly flags this as CWE-020 (Incomplete URL substring sanitization).
16+
# This is a false positive - the code performs module management, not
17+
# security validation.
18+
- exclude:
19+
id: py/incomplete-url-substring-sanitization
20+
paths:
21+
- "tests/**/*.py"
22+
reason: "Test files use module path checking for test isolation, not URL validation"
23+
24+
# Suppress ineffectual statement warnings for Protocol method stubs
25+
# Context: Python Protocol classes use ellipsis (...) as method body to define
26+
# structural contracts for type checking. These are not ineffectual statements
27+
# but required typing patterns per PEP 544 (Protocol).
28+
# Affected files: types.py (13 stubs), node.py (6 stubs)
29+
- exclude:
30+
id: py/ineffectual-statement
31+
paths:
32+
- "src/tnfr/types.py"
33+
- "src/tnfr/node.py"
34+
reason: "Protocol method definitions use ellipsis as valid structural contract stubs (PEP 544)"
35+
36+
# Suppress ineffectual statement warnings for @overload signatures
37+
# Context: Python @overload decorator (PEP 484) requires function signatures
38+
# with ellipsis body to define type variants. The actual implementation follows
39+
# these signatures. These are not ineffectual but required typing patterns.
40+
# Affected files: trace.py, utils/data.py, metrics/trig.py (6 overload stubs)
41+
- exclude:
42+
id: py/ineffectual-statement
43+
paths:
44+
- "src/tnfr/trace.py"
45+
- "src/tnfr/utils/data.py"
46+
- "src/tnfr/metrics/trig.py"
47+
reason: "@overload signatures use ellipsis as valid type variant stubs (PEP 484)"

.env.example

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# TNFR Engine Environment Configuration
2+
# Copy this file to .env and fill in your actual values
3+
# NEVER commit .env files with real credentials to version control
4+
5+
# ============================================================================
6+
# Development Configuration
7+
# ============================================================================
8+
9+
# PyPI Publishing Configuration (for release scripts)
10+
# Use API tokens for enhanced security: https://pypi.org/help/#apitoken
11+
PYPI_USERNAME=__token__
12+
PYPI_PASSWORD=pypi-XXXXXXXXXXXXXXXXXXXXXXXX # Your PyPI API token
13+
PYPI_API_TOKEN=pypi-XXXXXXXXXXXXXXXXXXXXXXXX # Alternative name
14+
TWINE_USERNAME=__token__
15+
TWINE_PASSWORD=pypi-XXXXXXXXXXXXXXXXXXXXXXXX # Your PyPI API token
16+
PYPI_REPOSITORY=pypi # or 'testpypi' for testing
17+
18+
# GitHub Configuration (for security dashboard and CI scripts)
19+
GITHUB_TOKEN=ghp_XXXXXXXXXXXXXXXXXXXXXXXX # GitHub Personal Access Token
20+
GITHUB_REPOSITORY=fermga/TNFR-Python-Engine # Format: owner/repo
21+
22+
# Redis Configuration (for RedisCacheLayer with authentication)
23+
REDIS_HOST=localhost
24+
REDIS_PORT=6379
25+
REDIS_PASSWORD=your-redis-password-here
26+
REDIS_DB=0
27+
REDIS_USE_TLS=false
28+
29+
# Cache Signing Configuration (for hardened cache security)
30+
# Generate a strong random secret: python -c "import secrets; print(secrets.token_hex(32))"
31+
TNFR_CACHE_SECRET= # 64-character hex string recommended
32+
33+
# ============================================================================
34+
# TNFR Engine Configuration
35+
# ============================================================================
36+
37+
# Logging Configuration
38+
TNFR_LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
39+
40+
# Reproducibility Configuration
41+
TNFR_RANDOM_SEED=42 # For deterministic simulations
42+
43+
# Performance Configuration
44+
TNFR_BACKEND=numpy # numpy, jax, or torch
45+
TNFR_CACHE_ENABLED=true
46+
47+
# ============================================================================
48+
# Security Best Practices
49+
# ============================================================================
50+
#
51+
# 1. NEVER commit this file with real credentials
52+
# 2. Use API tokens instead of passwords where possible
53+
# 3. Rotate credentials regularly
54+
# 4. Use different credentials for development, staging, and production
55+
# 5. Store production secrets in secure secret management systems
56+
# 6. Grant minimal necessary permissions to all tokens
57+
# 7. Revoke tokens immediately if compromised
58+
#
59+
# For more information, see SECURITY.md

0 commit comments

Comments
 (0)