Skip to content

FE-1443: Declare protocol edges for import-invisible boundaries - #9246

Draft
kube wants to merge 1 commit into
cf/fe-1340-webgpu-experiment-backendfrom
cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible
Draft

FE-1443: Declare protocol edges for import-invisible boundaries#9246
kube wants to merge 1 commit into
cf/fe-1340-webgpu-experiment-backendfrom
cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible

Conversation

@kube

@kube kube commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Proposal for FE-1443: the architecture graph derives every edge from imports, so couplings that cross a process or thread boundary are invisible. The Python bindings spawn the CLI and speak JSON lines with no import in either direction, so the cli layer shows no consumers.

This adds one annotation. In the boundary file's doc comment or docstring:

@talksTo cli via JSON lines over stdio (spawned subprocess)

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 under a separate "Declared" block.

Sits on top of stack #9226: the seed declaration lives in the Python bindings package, which FE-1414 below made scannable.

🔗 Related links

  • FE-1443 (internal): this PR
  • FE-1415 (internal): complementary, Python import edges. No Python import crosses the subprocess boundary either, so both are needed.

🔍 What does this change?

libs/@local/petrinaut-arch-docs:

  • Tag (tags.ts): @talksTo <layer-id> via <protocol> collected by the same TS-comment and Python-docstring scan as @layerRoot/@role. Repeatable; malformed tags are diagnostics.
  • Model (model.ts): Edge becomes a discriminated union on provenance ("imports" | "declared"); declared edges carry protocol.
  • Graph (graph.ts): declared edges append after import aggregation. Build errors on an unknown target, on a pair the imports already prove, and on a duplicate declaration.
  • Diagrams (d2.ts): declared edges render dashed with the protocol label in all three diagram kinds; a declared neighbour bypasses the 12-neighbour cap so it cannot be elided.
  • Pages (mdx.ts): a "Declared" table (Layer | Protocol) under "Depends on" and "Depended on by", separate from the import tables.
  • Rules (check.ts): forbidden-edge rules apply to import edges only.
  • Seed: the bindings package declares its edge to cli; the bundle gains exactly one edge (197 → 198).
  • Docs: "Declaring a protocol edge" sections in the maintaining guide and the package README; the root AGENTS.md vocabulary claim updated from two tags to three.

Open question for review: ARCHITECTURE_MODEL_VERSION stays at 1. The only in-repo consumer reads manifest.json, not edges; bump it if you consider the edge shape part of the bundle contract.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies a workspace but not a publishable library

📜 Does this require a change to the docs?

The changes in this PR:

  • require changes to docs which are made as part of this PR

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • tags.test.ts: parsing in TS comments and Python docstrings, malformed tags, miscasing suggestion.
  • graph.test.ts (new): resolution, unknown target, duplicate-of-import, duplicate declaration.
  • d2.test.ts / mdx.test.ts: dashed edge with protocol label; the Declared block, both directions.

❓ How to test this?

  1. yarn workspace @local/petrinaut-arch-docs lint:arch-docs — reports 198 edges, one declared.
  2. turbo run dev --filter @apps/petrinaut-docs — the python-bindings and cli layer pages show the declared edge dashed in their neighbourhood diagrams and in a "Declared" table.

🤖 Generated with Claude Code

@kube kube self-assigned this Aug 19, 2026
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 20, 2026 10:52am
petrinaut Ready Ready Preview Aug 20, 2026 10:52am
petrinaut-docs Ready Ready Preview Aug 20, 2026 10:52am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 20, 2026 10:52am

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team labels Aug 19, 2026
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from fbd1b4e to 77d0ee9 Compare August 19, 2026 11:21
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from 77d0ee9 to bf4fd28 Compare August 19, 2026 15:49
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from bf4fd28 to 99caa55 Compare August 19, 2026 21:12
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from 99caa55 to 710e04c Compare August 19, 2026 21:44
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from 710e04c to 021b281 Compare August 19, 2026 21:53
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from ddbcaf2 to 7eb763a Compare August 19, 2026 23:45
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from 7eb763a to dbd2d52 Compare August 20, 2026 00:26
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from dbd2d52 to 3a06f93 Compare August 20, 2026 00:29
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from 3a06f93 to 1264f15 Compare August 20, 2026 00:50
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from 1264f15 to ba3ef72 Compare August 20, 2026 01:12
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from ba3ef72 to c9f11df Compare August 20, 2026 01:56
@kube
kube force-pushed the cf/fe-1443-arch-docs-declared-protocol-edges-for-import-invisible branch from c9f11df to caaebda Compare August 20, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant