C-S Framework for Python
A Python framework implementing the Concept-Synchronization Constitution.
Installation
pip install cs-framework
# To include visualization tools (NiceGUI):
pip install cs-framework[visualization]
For development:
git clone https://github.com/shuntacurosu/cs-framework.git
cd cs-framework
pip install -e .[dev]
Usage
Running the Demo
-
Run the example application:
python src/examples/simple_demo/main.pyThis will generate an
execution.ttlfile. -
Run the Visualization GUI:
csfw gui --log execution.ttl
Open your browser at
http://localhost:8080.
Structure
src/cs_framework: Core framework library.src/cs_gui: Visualization tool using NiceGUI.src/examples: Example usage.tests: Unit and integration tests.
Testing
pytest
Skill-Driven Development Workflow
The C-S Framework is designed to be developed in collaboration with AI agents (Skills). Below is the standard development workflow based on the Pacman implementation example.
1. Design & Scaffolding (Architect Skill)
Use the Architect tool when creating a new Concept. This generates a robust skeleton including event definitions and Pydantic models.
# Example: Generating the Pacman concept
csfw scaffold \
--name Pacman \
--actions move change_direction die teleport \
--events moved died \
--output src/examples/pacman/src/concepts/
2. Implementation
Edit the generated files to implement the logic.
- Python (
src/concepts/*.py): Implement individual behaviors (Actions) and state transitions. Events are emitted type-safely via Pydantic models (emit). - YAML (
src/sync/rules.yaml): Define interactions between Concepts (Event → Action chains). Game rules can be adjusted without changing the code.
3. Static Analysis (Linter Skill)
Check the consistency between the implemented code and YAML definitions. Detects undefined actions or disconnected events (orphaned events).
csfw lint --path src/examples/pacman/src
4. Verification & Debugging (Fuzzer Skill)
Use scenario tests to reproduce bugs or verify specifications.
- Create Scenario: Describe a sequence of events and expected states (assertions) in
scenario.yaml. - Execute:
csfw run-scenario \ src/examples/pacman/run.py \ src/examples/pacman/scenario_bug_repro.yaml
5. Analysis (Debugger Skill)
Execution logs are saved as RDF (execution.ttl). You can use SPARQL queries to analyze event chains and their payloads (states) in detail.
Spec-Kit Integration
You can integrate CSFW with Spec-Kit to enforce framework best practices during the AI-driven development process.
# Integrate CSFW rules into Spec-Kit templates
python -m cs_framework.cli integrate-speckit
This command modifies your local .specify/ configuration to ensure that AI agents:
- Follow the Concept-Synchronization architecture.
- Use
scaffold.pyfor creating new concepts. - Run
lint.pyfor validation.
Reference
- What You See Is What It Does: A Structural Pattern for Legible Software (arXiv:2508.14511)
Metadata
Release files for cs-framework 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cs_framework-0.1.6.tar.gz | 56.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cs_framework-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 126.9 kB
Release files / cs_framework-0.1.6.tar.gz
| Download URL | cs_framework-0.1.6.tar.gz |
|---|---|
| Size | 56.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd255b3462cee18ff85fccda748204846843acd2ba379941d2fb32ef25cba73c
|
|
BLAKE2b-256 checksum How to use checksums |
e73228809eaba843324f4584552e1739b9af4c005388a3953a2f7930f201ae15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 6, 2026.
Transparency logRelease files / cs_framework-0.1.6-py3-none-any.whl
| Download URL | cs_framework-0.1.6-py3-none-any.whl |
|---|---|
| Size | 70.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
55f1da6d4540092098398bd32b3ae639e36a4586310989469207e3b406c28574
|
|
BLAKE2b-256 checksum How to use checksums |
45e4b3582d0c9dd5521c1bbf4bde4d06543859029592d48e756f703c2af20d2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 6, 2026.
Transparency log