fix(drift): discount CALLS-layer tangle by unresolved_ratio (#244) (#… #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Self-Documenting Architecture Sync | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - 'docs/**' | |
| - 'README.md' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| sync-architecture-docs: | |
| name: Regenerate architecture graph & MCP reference | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3 | |
| with: | |
| enable-cache: true | |
| python-version: "3.12" | |
| - name: Install CGIS | |
| run: uv sync | |
| - name: Self-ingest core engine | |
| run: uv run cgis ingest ./src --output /tmp/self_graph.db | |
| - name: Generate pipeline flow diagram | |
| run: | | |
| mkdir -p docs/architecture/diagrams | |
| uv run cgis trace "cgis.pipeline.IngestionPipeline.run" \ | |
| --db /tmp/self_graph.db \ | |
| --depth 1 \ | |
| --format mermaid \ | |
| --internal-only \ | |
| > docs/architecture/diagrams/pipeline_flow.mermaid | |
| - name: Compute graph health badge | |
| run: uv run python scripts/generate_health.py --db /tmp/self_graph.db | |
| - name: Inject graph into README.md | |
| run: | | |
| uv run python scripts/inject_readme_graph.py \ | |
| --db /tmp/self_graph.db \ | |
| --fqn "cgis.pipeline.IngestionPipeline.run" \ | |
| --depth 1 \ | |
| --path-prefix "src/" | |
| - name: Generate MCP reference manual | |
| run: uv run python scripts/generate_mcp_ref.py | |
| - name: Sync schema docs from source | |
| run: uv run python scripts/generate_schema_docs.py | |
| - name: Open PR with generated docs | |
| uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "docs: auto-sync architecture graph and MCP reference" | |
| branch: docs/auto-sync | |
| delete-branch: true | |
| title: "docs: auto-sync architecture graph and MCP reference" | |
| body: | | |
| Auto-generated by the [Self-Documenting Architecture Sync](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow. | |
| Updates: | |
| - Pipeline flow diagram (`docs/architecture/diagrams/pipeline_flow.mermaid`) | |
| - Graph health badge (`docs/architecture/health_badge.json`) | |
| - Schema docs (`docs/architecture/HOW_IT_WORKS.md`) | |
| - MCP reference (`docs/how-to/MCP_REFERENCE.md`) | |
| - README diagram injection | |
| labels: "docs,automated" | |
| add-paths: | | |
| README.md | |
| docs/ |