Skip to content

jamesyoung/signals_framework

Repository files navigation

Signals Framework Simulation Test Suite

Python License Build Status Code Style: Black

Overview

This repository contains a complete implementation of the Signals Framework in Python, along with a modular simulation harness to validate its performance and integrity across a diverse set of real-world and adversarial scenarios.

The framework models semiotic signals in decentralized networks, calculating signal strength based on recursive impact, attribution, actor credibility, and diminishing returns. This system enables emergent coordination, legitimacy filtering, and reputation analysis without static point-based scoring.


Project Structure

signals/               # Core model modules
├── signal.py          # Signal dataclass and base strength computation
├── strength.py        # Full recursive signal strength computation
├── analyzer.py        # User-facing API to manage graph and calculate metrics

simtests/              # Simulation test suite
├── test_harness.py    # Test runner for executing individual test configs
├── graph_utils.py     # Synthetic signal graph generators
├── scenarios/         # Individual simulation tests (e.g., depth, scaling, sybil)

run_all_tests.py       # CLI to batch-run all scenario tests
README.md              # (You are here)
requirements.txt       # Python dependencies

Features

  • Fully modular Signal Analyzer with DAG traversal, attribution logic, and strength computation

  • Supports:

    • Diminishing returns
    • Recursive impact with geometric decay
    • Attribution weighting
    • Amplification caps
    • Credibility modifiers
  • Pluggable graph structure for signal input

  • CLI support for batch testing with Markdown + log reporting

  • 15+ advanced simulation tests including:

    • Depth threshold
    • Runaway amplification cap
    • Attribution fairness
    • DAG integrity
    • Replayability
    • Sybil/gaming resistance
    • Emergent influence patterns

Setup

1. Install dependencies

pip install -r requirements.txt

2. Run all simulations

python run_all_tests.py

3. View results

  • Terminal summary with ✅/❌ status
  • Full output in test_output.log
  • Markdown table in test_summary.md

Example Output

CLI Summary:

🧾 Summary Report:
test_depth_cap.py              ✅ PASS            0.21s
test_runaway.py                ✅ PASS            0.19s
...

Markdown Report (test_summary.md):

# Simulation Test Summary

| Test Script             | Status     | Duration |
|------------------------|------------|----------|
| `test_depth_cap.py`    | ✅ PASS    | 0.21s    |
| `test_sybil_attack.py` | ✅ PASS    | 0.37s    |

Running Unit Tests and Linting

Unit Tests

Run all unit tests (e.g., for signal.py, strength.py, analyzer.py) using:

pytest --cov=signals tests/

This command also generates code coverage metrics.

Linting

To run lint checks using pylint, use:

pylint signals/ simtests/

To automatically format and fix import/order issues, optionally run:

black signals/ simtests/
isort signals/ simtests/

How to Add a New Simulation

  1. Create a new file in simtests/scenarios/ named test_my_scenario.py
  2. Define a main() function inside the file
  3. Use SignalAnalyzer and helpers from graph_utils or define your own graph
  4. The CLI will auto-discover and run your new test

License

MIT License. Developed by Simon Brown.


Citation

For academic use, cite:

Brown, S. (2025). The Signals Framework: A Semiotic Model for Emergent Participation in Decentralized Networks.


Contact

For questions, improvements, or integration inquiries:

About

Tests and Simulations for the Signals Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors