{"id":34501377,"url":"https://github.com/delorenj/syntropy","last_synced_at":"2026-04-19T22:09:15.621Z","repository":{"id":329936818,"uuid":"1121063098","full_name":"delorenj/syntropy","owner":"delorenj","description":"Fighting documentation heat death through algorithmic governance. Python CLI tool for maintaining documentation integrity with Hub-and-Spoke topology validation and session-based staleness tracking.","archived":false,"fork":false,"pushed_at":"2025-12-22T11:36:28.000Z","size":309,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T22:45:06.741Z","etag":null,"topics":["cli","developer-tools","documentation","documentation-tools","entropy","governance","knowledge-management","markdown","pydantic","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delorenj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-22T11:30:40.000Z","updated_at":"2025-12-22T11:36:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/delorenj/syntropy","commit_stats":null,"previous_names":["delorenj/syntropy"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/delorenj/syntropy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delorenj%2Fsyntropy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delorenj%2Fsyntropy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delorenj%2Fsyntropy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delorenj%2Fsyntropy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delorenj","download_url":"https://codeload.github.com/delorenj/syntropy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delorenj%2Fsyntropy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32024391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","developer-tools","documentation","documentation-tools","entropy","governance","knowledge-management","markdown","pydantic","python"],"created_at":"2025-12-24T02:01:26.234Z","updated_at":"2026-04-19T22:09:15.600Z","avatar_url":"https://github.com/delorenj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Syntropy\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" alt=\"Syntropy Logo\" width=\"200\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eFighting documentation heat death through algorithmic governance\u003c/strong\u003e\n\u003c/p\u003e\n\nA Python CLI tool that maintains documentation integrity by enforcing structure and tracking staleness. Implements Hub-and-Spoke topology validation with session-based decay detection to prevent documentation entropy.\n\n## Features\n\n- **Hub-and-Spoke Topology**: Enforce navigable documentation structure (Root documents link to Leaf documents)\n- **Staleness Detection**: Track documentation age based on coding sessions, not just time\n- **Graceful Degradation**: Malformed YAML frontmatter never crashes, creates \"corrupted\" state\n- **Performance-First**: \u003c3 second SLA with aggressive caching and incremental parsing\n- **Type-Safe**: Full Pydantic validation with clear error messages\n- **Rich CLI**: Beautiful terminal output with colors, tables, and progress indicators\n- **Dual Configuration**: YAML frontmatter in docs (metadata) + TOML config file (tool settings)\n\n## Installation\n\n### Prerequisites\n\n- Python 3.12 or higher\n- [uv](https://github.com/astral-sh/uv) package manager\n\n### Install with uv\n\n```bash\ncd syntropy\nuv sync\n```\n\nThis will:\n1. Create a virtual environment\n2. Install all dependencies\n3. Install syntropy in editable mode\n\n### Verify Installation\n\n```bash\nuv run syntropy --version\n# Output: syntropy, version 0.1.0\n\nuv run syntropy --help\n# Output: Documentation Entropy Control System usage\n```\n\n## Quick Start\n\n### 1. Create Configuration\n\nThe tool uses **TOML format for configuration** (not YAML):\n\n```bash\n# Option 1: Copy the example config file\ncp .syntropy.toml.example .syntropy.toml\n\n# Option 2: Generate default config programmatically\nuv run python -c \"from syntropy.config import create_default_config; from pathlib import Path; create_default_config(Path('.syntropy.toml'))\"\n```\n\nEdit `.syntropy.toml` (TOML format) to customize:\n\n```toml\ndoc_root = \"docs/\"\ngraph_depth_limit = 2\nstaleness_threshold = 3\n\n[domain_mapping]\nauthentication = [\"app/oauth_*.py\", \"extension/src/auth/**\"]\nbackend_api = [\"app/routes.py\", \"app/utils.py\"]\n# ... more domains\n```\n\n### 2. Add YAML Frontmatter to Docs\n\nDocumentation files use **YAML frontmatter for metadata** (this is separate from the TOML config file).\n\nRoot document (e.g., `docs/Map.md`):\n\n```markdown\n---\ntype: root\nparent: null\nlast_verified_session: 1\ndomain: meta\ntags: [\"navigation\", \"index\"]\n---\n\n# Documentation Map\n\n## Authentication\nSee [Authentication Flows](./auth-flow.md)\n```\n\nLeaf document (e.g., `docs/auth-flow.md`):\n\n```markdown\n---\ntype: leaf\nparent: \"docs/Map.md\"\nlast_verified_session: 1\ndomain: authentication\ntags: [\"oauth\", \"jwt\"]\n---\n\n# Authentication Flows\n\nDetails about OAuth implementation...\n```\n\n### 3. Run Entropy Check\n\n```bash\n# Full check: parse → audit → report\nuv run syntropy check\n\n# Individual commands\nuv run syntropy parse    # Build graph\nuv run syntropy audit    # Validate topology\nuv run syntropy report   # Display results\n```\n\n## Usage\n\n### Commands\n\n#### `syntropy check`\n\nRun full entropy check (parse → audit → report). This is the primary command.\n\n```bash\nuv run syntropy check\nuv run syntropy check --force          # Ignore cache\nuv run syntropy check --session 10     # Specify session number\nuv run syntropy check --format json    # JSON output\n```\n\n#### `syntropy parse`\n\nBuild/cache documentation graph from filesystem.\n\n```bash\nuv run syntropy parse\nuv run syntropy parse --force  # Force full reparse\n```\n\n#### `syntropy audit`\n\nRun topology validation and staleness detection.\n\n```bash\nuv run syntropy audit\nuv run syntropy audit --session 15  # Specify session number\n```\n\n#### `syntropy report`\n\nGenerate and display entropy report.\n\n```bash\nuv run syntropy report\nuv run syntropy report --format markdown\nuv run syntropy report --format json --output report.json\n```\n\n### Configuration\n\n#### Understanding Configuration Formats\n\nThis tool uses **two different formats** for different purposes:\n\n1. **TOML** (`.syntropy.toml`): Tool configuration file\n   - Controls how the tool operates\n   - Settings like doc_root, graph_depth_limit, staleness_threshold\n   - Uses TOML syntax: `key = \"value\"`, `[sections]`, etc.\n\n2. **YAML** (frontmatter in `.md` files): Documentation metadata\n   - Metadata for individual documentation files\n   - Information like type, parent, last_verified_session\n   - Uses YAML syntax within `---` delimiters in markdown files\n\n**Why two formats?**\n- YAML frontmatter is the standard for markdown metadata\n- TOML is more Pythonic and better for tool configuration\n- Each format is optimized for its purpose\n\n#### Configuration File (TOML)\n\nPlace `.syntropy.toml` (TOML format) in your project root:\n\n```toml\ndoc_root = \"docs/\"                    # Documentation directory\ngraph_depth_limit = 2                 # Max hops from root to leaf\nstaleness_threshold = 3               # Sessions before marked stale\ncache_file = \".docs_cache.json\"       # Cache location\nexcluded_patterns = [\"node_modules/\", \"venv/\"]\n\n[domain_mapping]\n# Map code patterns to documentation domains\nauthentication = [\"app/oauth_*.py\", \"extension/src/auth/**\"]\n```\n\n#### Environment Variables\n\nOverride config with environment variables:\n\n```bash\nexport DOC_ENTROPY_DOC_ROOT=\"documentation/\"\nexport DOC_ENTROPY_GRAPH_DEPTH_LIMIT=3\nexport DOC_ENTROPY_STALENESS_THRESHOLD=5\nexport DOC_ENTROPY_CACHE_FILE=\".cache.json\"\n\nuv run syntropy check\n```\n\n### Custom Config File\n\n```bash\nuv run syntropy --config custom.toml check\n```\n\n### Verbose Output\n\n```bash\nuv run syntropy --verbose check\n```\n\n## YAML Frontmatter Schema\n\n### Root Document\n\n```yaml\n---\ntype: root                      # Must be \"root\"\nparent: null                    # Must be null\nlast_verified_session: 12       # Session number (\u003e= 1)\ndomain: \"meta\"                  # Domain name\ntags: [\"navigation\"]            # Optional tags\n---\n```\n\n### Leaf Document\n\n```yaml\n---\ntype: leaf                      # Must be \"leaf\"\nparent: \"docs/Map.md\"          # Required: path to parent root\nlast_verified_session: 12       # Session number (\u003e= 1)\ndomain: \"authentication\"        # Domain name\ntags: [\"oauth\", \"jwt\"]         # Optional tags\ndependencies: []                # Optional dependencies\n---\n```\n\n## Development Status\n\n**Current Phase**: Sprint 1-1 (Foundation) ✅\n\n**Implemented**:\n- ✅ Project structure and packaging\n- ✅ Core Pydantic data models\n- ✅ TOML configuration system\n- ✅ Click-based CLI with Rich output\n- ✅ Comprehensive unit tests (90%+ coverage)\n\n**Coming Next** (Sprint 1-2):\n- 📅 File scanner with .gitignore support\n- 📅 YAML frontmatter parser with graceful degradation\n- 📅 mtime-based cache manager\n- 📅 NetworkX graph builder\n\n**Future Phases**:\n- Sprint 1-3: Topology validation and staleness detection\n- Sprint 1-4: Rich terminal reporting and mise integration\n- MVP-2: Migration tooling and export formats\n\nSee [DEVELOPMENT.md](./DEVELOPMENT.md) for contributor guide.\n\n## Architecture\n\n### Hub-and-Spoke Topology\n\n```\nMap.md (Root)\n├── Architecture.md (Root)\n│   ├── backend-design.md (Leaf)\n│   └── data-models.md (Leaf)\n└── API.md (Root)\n    ├── endpoints.md (Leaf)\n    └── authentication.md (Leaf)\n```\n\n**Constraints**:\n- Max depth: 2 hops (Root → Intermediate → Leaf)\n- Each leaf has exactly one parent\n- No circular references (DAG structure)\n- All docs reachable from Map.md\n\n### Performance\n\n**SLA: \u003c3 seconds** for complete check on 500 documents\n\nBreakdown (typical):\n- Parse: 0.5s (warm cache) / 2.5s (cold)\n- Audit: \u003c100ms\n- Report: \u003c500ms\n\n**Optimization strategies**:\n- mtime-based caching\n- Incremental graph updates\n- O(n) algorithms for topology validation\n\n## Troubleshooting\n\n### Error: \"Config file already exists\"\n\n```bash\n# Remove existing config first\nrm .syntropy.toml\n\n# Then regenerate\nuv run python -c \"from syntropy.config import create_default_config; from pathlib import Path; create_default_config(Path('.syntropy.toml'))\"\n```\n\n### Error: \"Leaf documents must specify a parent\"\n\nYour document has `type: leaf` but `parent: null`. Either:\n1. Change `type: root` (if it's a hub document)\n2. Add `parent: \"docs/ParentDoc.md\"`\n\n### Error: \"Root documents must not have a parent\"\n\nYour document has `type: root` but also specifies a parent. Change `parent: null`.\n\n### Warning: \"File path must be absolute\"\n\nDocument model requires absolute paths. This is typically handled internally but may appear in error messages.\n\n## License\n\nMIT License - See LICENSE file for details\n\n## Contributing\n\nSee [DEVELOPMENT.md](./DEVELOPMENT.md) for:\n- Development setup\n- Running tests\n- Code style guidelines\n- Architecture documentation\n\n## Support\n\nFor issues, questions, or contributions:\n- GitHub Issues: (coming soon)\n- Email: dev@intelliforia.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelorenj%2Fsyntropy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelorenj%2Fsyntropy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelorenj%2Fsyntropy/lists"}