A Python framework implementing the Concept-Synchronization Constitution
Project description
C-S Framework for Python
A Python framework implementing the Concept-Synchronization Constitution.
Installation
pip install cs-framework
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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cs_framework-0.1.2.tar.gz.
File metadata
- Download URL: cs_framework-0.1.2.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8309c12fb3f636eea2bf26d8f6d71a1177b48c835737a3c32db40fdb78958997
|
|
| MD5 |
9f1d27f350fe1d2dbe248ddf246a7c1a
|
|
| BLAKE2b-256 |
f0c3cf580fb04dfa9500cf2d2ba01753665b6f64a4b505fe3bc395e1c53af82c
|
Provenance
The following attestation bundles were made for cs_framework-0.1.2.tar.gz:
Publisher:
pypi-publish.yml on shuntacurosu/cs-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cs_framework-0.1.2.tar.gz -
Subject digest:
8309c12fb3f636eea2bf26d8f6d71a1177b48c835737a3c32db40fdb78958997 - Sigstore transparency entry: 747761439
- Sigstore integration time:
-
Permalink:
shuntacurosu/cs-framework@a4186d1db773f678b322bde7a194a22d668efc0f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/shuntacurosu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a4186d1db773f678b322bde7a194a22d668efc0f -
Trigger Event:
release
-
Statement type:
File details
Details for the file cs_framework-0.1.2-py3-none-any.whl.
File metadata
- Download URL: cs_framework-0.1.2-py3-none-any.whl
- Upload date:
- Size: 51.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d79655f81a20df5d21344ba393080979f1a2d2c7186942f5cecd9b52c11a5c36
|
|
| MD5 |
bd66a3abc13ba147d8a18afd2fec9058
|
|
| BLAKE2b-256 |
c4d11cef0adddbd8896cdf53093b89e77a4bf817764527ce1c32cb0bfb3d1713
|
Provenance
The following attestation bundles were made for cs_framework-0.1.2-py3-none-any.whl:
Publisher:
pypi-publish.yml on shuntacurosu/cs-framework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cs_framework-0.1.2-py3-none-any.whl -
Subject digest:
d79655f81a20df5d21344ba393080979f1a2d2c7186942f5cecd9b52c11a5c36 - Sigstore transparency entry: 747761440
- Sigstore integration time:
-
Permalink:
shuntacurosu/cs-framework@a4186d1db773f678b322bde7a194a22d668efc0f -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/shuntacurosu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@a4186d1db773f678b322bde7a194a22d668efc0f -
Trigger Event:
release
-
Statement type: