FE-1443: Declare protocol edges for import-invisible boundaries - #9263
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview The model bumps to version 2: First use: Python bindings Reviewed by Cursor Bugbot for commit 518942e. Bugbot is set up for automated code reviews on this repo. Configure here. |
3b74793 to
640049b
Compare
640049b to
5c86b79
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5c86b79. Configure here.
5c86b79 to
bb7c1e8
Compare
bb7c1e8 to
03b241b
Compare
03b241b to
75189a9
Compare
75189a9 to
9f70a1a
Compare
9f70a1a to
5503bd8
Compare
5503bd8 to
518942e
Compare

🌟 What is the purpose of this PR?
The architecture graph derives every edge from imports, so a coupling that crosses a process boundary is invisible: the Python bindings spawn the CLI and speak JSON lines with no import in either direction, and the
clilayer showed no consumers. This PR adds one annotation for such boundaries, written in the boundary file's doc comment or docstring:The declaring file's own layer is the edge source. The edge renders dashed with the protocol as its label, and layer pages list it in its own "Declared" table.
In stack #9280, FE-1414 (#9230) sits below and FE-1447 (#9264) above.
🔗 Related links
🔍 What does this change?
libs/@local/petrinaut-arch-docs:tags.ts):@talksTo <layer-id> via <protocol>is collected by the same TypeScript-comment and Python-docstring scan as@layerRoot/@role. The tag is repeatable, and a malformed tag is a diagnostic.model.ts):Edgebecomes a discriminated union onprovenance("imports"|"declared"), and declared edges carry aprotocol.graph.ts): declared edges append after import aggregation. The build errors on an unknown target, on a pair the imports already prove, and on a duplicate declaration.d2.ts): declared edges render dashed with the protocol label in all three diagram kinds, and a declared neighbour bypasses the 12-neighbour cap so it cannot be elided.mdx.ts): a "Declared" table (Layer | Protocol) sits under "Depends on" and "Depended on by", separate from the import tables.check.ts): forbidden-edge rules apply to import edges only.cli, so the bundle gains one edge.AGENTS.mdnow says the vocabulary is three tags.Review fixes
@talksTonaming the declaring file's own layer is an error, with a test.viaand the end of the line, with a test; prose on the next line stays out of the label.ARCHITECTURE_MODEL_VERSIONis bumped to 2 for the new edge shape, andbuild.tswrites the constant instead of a literal1.stroke-dash: 2, distinct from the boundary class'sstroke-dash: 4, and three inline provenance checks now callisImportEdge.content/optimizer/subprocess-boundary.mdxnow says the diagrams draw this boundary as a dashed declared edge; its earlier claim that no diagram shows the edge became false with this PR.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?
tags.test.ts: parsing in TypeScript comments and Python docstrings, the line-terminated protocol text, malformed tags, and the miscasing suggestion.graph.test.ts(new): resolution, an unknown target, a self-target, a pair the imports already prove, and a duplicate declaration.d2.test.ts/mdx.test.ts: the dashed edge with its protocol label, and the Declared table in both directions.❓ How to test this?
yarn workspace @local/petrinaut-arch-docs lint:arch-docspasses with the declared edge in place.turbo run dev --filter @apps/petrinaut-docs: thepython-bindingsandclilayer pages show the declared edge dashed in their neighbourhood diagrams and in a "Declared" table.🤖 Generated with Claude Code