Skip to content

Commit 1725c25

Browse files
authored
Merge pull request #2833 from fermga/copilot/fix-netlify-problems
Fix Netlify build and add automated code review workflow
2 parents 32a00be + cda1cc1 commit 1725c25

File tree

13 files changed

+97
-27
lines changed

13 files changed

+97
-27
lines changed

.github/workflows/code-review.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Automated Code Review
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, reopened]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
16+
jobs:
17+
code-review:
18+
name: Run automated code review
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v5
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v6
28+
with:
29+
python-version: '3.11'
30+
cache: pip
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install -e .[dev-minimal]
36+
37+
- name: Run code review
38+
id: review
39+
continue-on-error: true
40+
run: |
41+
# Note: This is a placeholder for the actual code review process
42+
# In practice, this would call a code review service or tool
43+
echo "Running automated code review..."
44+
echo "Checking code quality, style, and best practices..."
45+
46+
# Run linters and static analysis
47+
EXIT_CODE=0
48+
python -m black --check src/ tests/ 2>&1 && echo "✅ Black formatting passed" || { echo "::warning::Black formatting issues found"; EXIT_CODE=1; }
49+
python -m mypy src/ 2>&1 && echo "✅ Type checking passed" || { echo "::warning::Type checking issues found"; EXIT_CODE=1; }
50+
51+
echo "Code review completed"
52+
exit $EXIT_CODE
53+
54+
- name: Comment on PR
55+
if: always()
56+
uses: actions/github-script@v7
57+
with:
58+
script: |
59+
const reviewStatus = '${{ steps.review.outcome }}' === 'success' ? '✅ Passed' : '⚠️ Issues found';
60+
const comment = `## Automated Code Review\n\n${reviewStatus}\n\nPlease review the workflow logs for details.`;
61+
62+
github.rest.issues.createComment({
63+
owner: context.repo.owner,
64+
repo: context.repo.repo,
65+
issue_number: context.issue.number,
66+
body: comment
67+
});

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ repos:
1717
files: ^src/tnfr/
1818
- repo: local
1919
hooks:
20+
- id: code-review-check
21+
name: Code review quality check
22+
entry: bash -c 'echo "⚠️ Remember to run code review before committing significant changes" && echo " Run: make lint test" && exit 0'
23+
language: system
24+
pass_filenames: false
25+
stages: [commit]
2026
- id: check-stubs
2127
name: Check .pyi stub files
2228
entry: python scripts/generate_stubs.py --check

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ sphinxcontrib-mermaid>=0.9
77
ipykernel>=6
88
nbconvert>=7.16
99
pypandoc-binary>=1.14
10+
mkdocs>=1.5
11+
mkdocs-material>=9.4
12+
mkdocs-jupyter>=0.24

docs/source/advanced/ARCHITECTURE_GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,9 @@ Before creating a PR with factory changes:
809809

810810
## References
811811

812-
- [AGENTS.md](../../../AGENTS.md) - TNFR paradigm fundamentals
813-
- [CONTRIBUTING.md](../../../CONTRIBUTING.md) - General contribution guidelines
814-
- [ARCHITECTURE.md](../../../ARCHITECTURE.md) - Overall project structure
812+
- [AGENTS.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/AGENTS.md) - TNFR paradigm fundamentals
813+
- [CONTRIBUTING.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/CONTRIBUTING.md) - General contribution guidelines
814+
- [ARCHITECTURE.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/ARCHITECTURE.md) - Overall project structure
815815
- [Performance Optimization](PERFORMANCE_OPTIMIZATION.md) - Caching and optimization patterns
816816
- [Testing Strategies](TESTING_STRATEGIES.md) - Test patterns and coverage requirements
817817
- [Foundations](../foundations.md) - Mathematical foundations

docs/source/advanced/DEVELOPMENT_WORKFLOW.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ make verify-refs-verbose
751751
- This guide
752752
- [ARCHITECTURE_GUIDE.md](ARCHITECTURE_GUIDE.md)
753753
- [TESTING_STRATEGIES.md](TESTING_STRATEGIES.md)
754-
- [CONTRIBUTING.md](../../../CONTRIBUTING.md)
754+
- [CONTRIBUTING.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/CONTRIBUTING.md)
755755
756756
2. **Search GitHub Issues**:
757757
- Known issues and solutions
@@ -833,8 +833,8 @@ mypy --help # Mypy options
833833
- [Architecture Guide](ARCHITECTURE_GUIDE.md) - Factory patterns and dependencies
834834
- [Testing Strategies](TESTING_STRATEGIES.md) - Testing best practices
835835
- [Performance Optimization](PERFORMANCE_OPTIMIZATION.md) - Optimization techniques
836-
- [CONTRIBUTING.md](../../../CONTRIBUTING.md) - Contribution guidelines
837-
- [README.md](../../../README.md) - Project overview
836+
- [CONTRIBUTING.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/CONTRIBUTING.md) - Contribution guidelines
837+
- [README.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/README.md) - Project overview
838838
839839
---
840840

docs/source/advanced/TESTING_STRATEGIES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,8 @@ pytest tests/ --memprof
923923
- [Architecture Guide](ARCHITECTURE_GUIDE.md) - Factory patterns and dependency management
924924
- [Performance Optimization](PERFORMANCE_OPTIMIZATION.md) - Optimization strategies
925925
- [Development Workflow](DEVELOPMENT_WORKFLOW.md) - Contributing guidelines
926-
- [CONTRIBUTING.md](../../../CONTRIBUTING.md) - General contribution guide
927-
- [TESTING.md](../../../TESTING.md) - Test strategy overview
926+
- [CONTRIBUTING.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/CONTRIBUTING.md) - General contribution guide
927+
- [TESTING.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/TESTING.md) - Test strategy overview
928928

929929
---
930930

docs/source/theory/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ Hands-on exploration and visualization of TNFR concepts:
110110

111111
### Related Documentation
112112
- [TNFR Fundamental Concepts](../getting-started/TNFR_CONCEPTS.md) — Intuitive introduction
113-
- [GLOSSARY](../../../GLOSSARY.md) — Terminology reference
114-
- [AGENTS.md](../../../AGENTS.md) — Canonical invariants for AI agents
113+
- [GLOSSARY](https://github.com/fermga/TNFR-Python-Engine/blob/main/GLOSSARY.md) — Terminology reference
114+
- [AGENTS.md](https://github.com/fermga/TNFR-Python-Engine/blob/main/AGENTS.md) — Canonical invariants for AI agents
115115

116116
## 📋 Document Status
117117

docs/source/user-guide/METRICS_INTERPRETATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Metrics Interpretation Guide
22

3-
[Home](../index.rst)[User Guide](../user-guide/) › Metrics Interpretation
3+
[Home](../home.md) › Metrics Interpretation
44

55
This guide explains how to interpret and use TNFR's key metrics: Total Coherence (C(t)), Sense Index (Si), structural frequency (νf), phase (φ), and reorganization gradient (ΔNFR).
66

docs/source/user-guide/OPERATORS_GUIDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Operators Guide: The 13 Structural Operators
22

3-
[Home](../index.rst)[User Guide](../user-guide/) › Operators Guide
3+
[Home](../home.md) › Operators Guide
44

55
This guide provides a comprehensive reference for TNFR's 13 canonical structural operators. These operators are the **only valid way** to modify networks in TNFR, ensuring all changes are traceable, coherent, and reproducible.
66

@@ -606,7 +606,7 @@ Safe_Exploration := Dissonance Operator* Coherence
606606
Multi_Scale := Recursivity(Sequence)
607607
```
608608

609-
See [Glyph Sequences Guide](../../../GLYPH_SEQUENCES_GUIDE.md) for comprehensive patterns.
609+
See [Glyph Sequences Guide](https://github.com/fermga/TNFR-Python-Engine/blob/main/GLYPH_SEQUENCES_GUIDE.md) for comprehensive patterns.
610610

611611
## Monitoring Operator Effects
612612

@@ -718,7 +718,7 @@ def adaptive_operator(G, node):
718718
## See Also
719719

720720
- **[API Reference](../api/operators.md)** - Complete operator API
721-
- **[Glyph Sequences Guide](../../../GLYPH_SEQUENCES_GUIDE.md)** - Canonical patterns
721+
- **[Glyph Sequences Guide](https://github.com/fermga/TNFR-Python-Engine/blob/main/GLYPH_SEQUENCES_GUIDE.md)** - Canonical patterns
722722
- **[Metrics Interpretation](METRICS_INTERPRETATION.md)** - Understanding effects
723723
- **[Troubleshooting](TROUBLESHOOTING.md)** - Solving common issues
724724
- **[Examples](../examples/README.md)** - Practical operator usage

docs/source/user-guide/TROUBLESHOOTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Troubleshooting Guide
22

3-
[Home](../index.rst)[User Guide](../user-guide/) › Troubleshooting
3+
[Home](../home.md) › Troubleshooting
44

55
This guide helps you diagnose and solve common problems when working with TNFR networks.
66

0 commit comments

Comments
 (0)