FE-1414: Support Python packages in the architecture docs - #9230
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 17, 2026 23:51
0404a2d to
0dde89b
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 17, 2026 23:56
0dde89b to
e9619cf
Compare
kube
marked this pull request as ready for review
August 17, 2026 23:56
PR SummaryCursor Bugbot is generating a summary for commit e9619cf. Configure here. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Python package support to Petrinaut’s architecture documentation generator.
Changes:
- Extracts layers and roles from Python module docstrings.
- Registers the Python bindings and optimizer packages.
- Adds Python-aware diagrams and subprocess-boundary documentation.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
apps/petrinaut-opt/src/optimization_api.py |
Declares the optimizer layer. |
libs/@local/petrinaut-python/src/petrinaut/__init__.py |
Declares the bindings layer. |
libs/@local/petrinaut-arch-docs/architecture.config.ts |
Registers Python packages and ignored directories. |
libs/@local/petrinaut-arch-docs/src/scope.ts |
Selects source extensions by language. |
libs/@local/petrinaut-arch-docs/src/extract.ts |
Extracts architecture data from Python sources. |
libs/@local/petrinaut-arch-docs/src/tags.ts |
Adds Python docstring tag scanning. |
libs/@local/petrinaut-arch-docs/src/tags.test.ts |
Tests Python tag scanning. |
libs/@local/petrinaut-arch-docs/src/emit/d2.ts |
Adds colors for Python layers. |
libs/@local/petrinaut-arch-docs/src/emit/mdx.ts |
Clarifies Python import-edge limitations. |
libs/@local/petrinaut-arch-docs/content/optimizer/subprocess-boundary.mdx |
Documents the optimizer–CLI process boundary. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kube
marked this pull request as draft
August 18, 2026 00:14
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 18, 2026 00:33
e9619cf to
fa79bff
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 18, 2026 00:47
fa79bff to
d756009
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 18, 2026 02:01
d756009 to
8aa7b93
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 18, 2026 23:19
ff9a860 to
20a8f84
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 18, 2026 23:37
20a8f84 to
89f7cd1
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 19, 2026 09:03
89f7cd1 to
49329d4
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 19, 2026 09:40
49329d4 to
5c0751d
Compare
kube
force-pushed
the
cf/fe-1414-arch-docs-support-python-packages-layers-and-docstring
branch
from
August 19, 2026 10:05
5c0751d to
0de26eb
Compare
The generator only accepted TypeScript packages; apps/petrinaut-opt and the new Python bindings could not be documented. The layer pipeline was already language-agnostic, so this teaches the two gates Python: source extensions are resolved per package language, and the tag scanner reads @layerRoot/@ROLE from triple-quoted docstrings (module docstrings are the Python analog of a file's doc comment; # comments are deliberately not scanned). The import graph still receives only TypeScript packages - Python layers render with no edges, and the generated edge-table caption says so. Registers @apps/petrinaut-opt (layer: optimizer) and @local/petrinaut-python (layer: bindings) with docstring declarations, gives both roots diagram colours, and adds an authored page on the optimizer-CLI subprocess boundary, which a static import graph cannot represent. Python import edges are FE-1415.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌟 What is the purpose of this PR?
The architecture docs generator only accepted TypeScript packages, so
apps/petrinaut-optand the new@local/petrinaut-pythonbindings could not be documented. This teaches it Python: layer pages, roles, file counts, and diagrams for Python packages, with@layerRoot/@roleread from docstrings. Import edges for Python remain out of scope (FE-1415, backlog).Stack #9226 (top): FE-1410 → FE-1411 → FE-1408 → FE-1413 → FE-1270 → FE-1412 → this PR.
🔗 Related links
🔍 What does this change?
Generator (
@local/petrinaut-arch-docs).pyfor Python); the TypeScript-only gate in the extractor is gone. The graph builder still receives only TypeScript packages, exactly as before.@layerRoot/@rolefrom triple-quoted docstrings (both quote styles). Module docstrings are the Python analog of a file's doc comment;#comments are deliberately not scanned. The tag grammar, duplicate detection, and miscasing hints are shared across languages.__pycache__and.venvjoin the ignored directories; the generated edge-table caption now states that Python packages contribute no edges yet.Registrations (42 layers, 433 files — up from 40/423)
@apps/petrinaut-opt→ root layeroptimizer, declared inoptimization_api.py's docstring.@local/petrinaut-python→ root layerbindings, declared in the package docstring.Authored content
content/optimizer/subprocess-boundary.mdx(attached tooptimizer): the optimizer↔CLI relationship is a process contract a static import graph cannot represent — this page is the missing arrow, covering the spawn handshake, the ownership split, isolation, and the bounded limits, linking thecli,bindings, andcli.runtimelayers and the usage manual.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?
#-comment/JSDoc-in-string non-matches, duplicate/miscasing diagnostics in Python).lint:arch-docsvalidates the real registrations end to end (full file coverage of both Python packages,attachToresolution); a full bundle build is part of verification.❓ How to test this?
yarn workspace @local/petrinaut-arch-docs lint:arch-docsturbo run dev --filter @apps/petrinaut-docsand open Architecture → optimizer / bindings; the boundary guide hangs off the optimizer page.🤖 Generated with Claude Code