FE-1322: Migrate the architecture prose into the docs bundle - #9205
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
69bc7b5 to
0b390a8
Compare
93a95ff to
1bd3eca
Compare
0b390a8 to
1ba0b4c
Compare
1bd3eca to
1e831d1
Compare
1ba0b4c to
76514eb
Compare
1e831d1 to
cbb49ba
Compare
76514eb to
82427e7
Compare
cbb49ba to
6b5bf0d
Compare
82427e7 to
c4f2da1
Compare
6b5bf0d to
ea12164
Compare
PR SummaryCursor Bugbot is generating a summary for commit 1e53e0d. Configure here. |
There was a problem hiding this comment.
Pull request overview
Moves Petrinaut’s hand-written architecture documentation into the generated docs bundle alongside layer reference pages.
Changes:
- Adds eight authored MDX architecture guides with layer-aware links.
- Adds reusable React diagram components and styling.
- Removes the obsolete standalone HTML documentation and updates contributor guidance.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
libs/@local/petrinaut-arch-docs/content/working-on-the-architecture.mdx |
Adds contributor guidance. |
libs/@local/petrinaut-arch-docs/content/two-execution-paths.mdx |
Explains simulation execution paths. |
libs/@local/petrinaut-arch-docs/content/simulation/user-code.mdx |
Documents user-code compilation. |
libs/@local/petrinaut-arch-docs/content/simulation/stepping.mdx |
Documents simulation stepping. |
libs/@local/petrinaut-arch-docs/content/simulation/protocol.mdx |
Documents worker messaging and backpressure. |
libs/@local/petrinaut-arch-docs/content/simulation/memory-model.mdx |
Documents frame storage and layout. |
libs/@local/petrinaut-arch-docs/content/simulation/experiments.mdx |
Documents Monte Carlo execution. |
libs/@local/petrinaut-arch-docs/content/index.mdx |
Adds the authored documentation index. |
libs/@local/petrinaut-arch-docs/content/components/sequence.tsx |
Adds sequence diagrams. |
libs/@local/petrinaut-arch-docs/content/components/pipeline.tsx |
Adds pipeline diagrams. |
libs/@local/petrinaut-arch-docs/content/components/lanes.tsx |
Adds lane diagrams. |
libs/@local/petrinaut-arch-docs/content/components/inline.tsx |
Adds inline code formatting. |
libs/@local/petrinaut-arch-docs/content/components/diagram.css |
Styles diagram components. |
libs/@local/petrinaut-arch-docs/content/components/byte-map.tsx |
Adds byte-layout diagrams. |
libs/@hashintel/petrinaut-core/docs/architecture/worker.html |
Removes legacy worker documentation. |
libs/@hashintel/petrinaut-core/docs/architecture/monte-carlo.html |
Removes legacy experiment documentation. |
libs/@hashintel/petrinaut-core/docs/architecture/index.html |
Removes the legacy architecture index. |
libs/@hashintel/petrinaut-core/docs/architecture/engine.html |
Removes legacy engine documentation. |
libs/@hashintel/petrinaut-core/docs/architecture/authoring.html |
Removes legacy authoring documentation. |
libs/@hashintel/petrinaut-core/docs/architecture/architecture.css |
Removes legacy documentation styling. |
AGENTS.md |
Documents authored-page attachment and links. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1e53e0d to
4ca3b4b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated no new comments.
Suppressed comments (6)
libs/@local/petrinaut-arch-docs/content/simulation/stepping.mdx:17
computeNextFramedoes not mutate its input: it constructs and returnsupdatedSimulationwith a newframesarray (libs/@hashintel/petrinaut-core/src/simulation/engine/compute-next-frame.ts:160-167). This wording can make callers assume the original instance advanced. Describe the returned instance as new while retaining the concurrency warning for the shared transition scratch buffers (engine/types.ts:63-87).
Neither is pure. Stepping mutates the instance it is given, and the transition
path reuses kernel staging buffers between calls, so a `SimulationInstance` must
not be stepped concurrently or reused across runs.
libs/@local/petrinaut-arch-docs/content/simulation/protocol.mdx:50
- The worker does not compile user TypeScript.
SimulationConfigexplicitly requires artifacts produced bycompileHirArtifactsand says the engine has no compiler (libs/@hashintel/petrinaut-core/src/simulation/api.ts:78-84); a net containing a lambda, kernel, or dynamics fails initialization when those artifacts are omitted. Change this note to “validate and instantiate precompiled HIR artifacts,” addhirArtifactsto theinitpayload table, and make the same correction instepping.mdx:19.
direction: "right",
label: "`init`",
note: "Builds the simulation, compiles user code, packs frame 0",
libs/@local/petrinaut-arch-docs/content/simulation/protocol.mdx:33
SimulationFramePayloadalso contains the orderednewStringspool delta (simulation/worker/frame-payload.ts:3-24). A protocol consumer implemented from this table would discard that delta, so string token attributes decode against an incomplete pool. IncludenewStrings?here and in the payload row inmemory-model.mdx:79.
| `frame` / `frames` | `{ time, frame }`, single or batch | Appended to the frame store, which republishes count and latest. |
libs/@local/petrinaut-arch-docs/content/components/byte-map.tsx:46
- When both
titleandcaptionare supplied—as inmemory-model.mdx—this renders two<figcaption>elements. HTML permits at most one caption per<figure>, so assistive technology may not associate the detailed bottom caption with the diagram. Keep the detailed text as the figure caption and render the short title as a non-caption element.
{title === undefined ? null : (
<figcaption className="pnd-title">{title}</figcaption>
)}
libs/@local/petrinaut-arch-docs/content/components/diagram.css:257
- This media rule collapses the sequence's actor and message grids to one column. On a narrow screen the actor headings stack, while each row becomes
label → noteornote ← label, so the arrows no longer connect either actor and message direction is unreadable. Keep the sequence and actor grids at three columns; their existingminmax(0, 1fr)columns can shrink and wrap.
.pnd-msg,
.pnd-actors {
grid-template-columns: minmax(0, 1fr);
}
libs/@local/petrinaut-arch-docs/content/index.mdx:31
- The base PR’s known issues state that
lint:arch-docsis not run by CI until #9206, so CI currently does not fail when these pages drift. This promise can lead contributors to rely on a check that never ran; say “the bundle build/check fails” for now or wire the lint task into CI. The same CI-enforcement claim also appears inworking-on-the-architecture.mdx:63,118andAGENTS.md:132.
**Generated pages** — everything under [Architecture](architecture) — are
extracted from annotations in the source on every build, and CI fails if they
drift. Layer sizes and dependency counts all come from the code. If a generated page disagrees with the code, that is a bug in the
annotations, not in the page.
`petrinaut-core/docs/architecture/` was 3,100 lines of hand-written HTML plus a stylesheet, served by nothing and reachable only by opening files off disk. Its content is the half a generated page cannot produce: why a boundary sits where it does, what the alternatives were, which mistakes are easy to make. It moves to `content/` as MDX, where it merges into the generated tree instead of sitting beside it. A page names the layer it explains with `attachTo: core.simulation`, and lands under that layer's page with the generated reference for the same code. Links are written by name — `layer:core.simulation.engine`, `doc:simulation/memory-model` — and resolved at emit time, because a page's depth is only known once `attachTo` is applied. Unresolved targets fail the build. Five simulation deep-dives carry the detail the generated pages do not: the memory model and frame format, the fixed stage order of a step, the HIR pipeline and what the sandbox does not protect against, the worker protocol and its ack contract, and why only aggregates reach the UI from a Monte Carlo run. Four diagram components render the parts that are genuinely visual — byte layouts, lane diagrams, pipelines and message sequences. Migrating surfaced two claims that had gone stale: UUID support described as unimplemented, which is fully implemented, and a sandbox description thinner than what the code now does. These pages are hand-written and can go stale, which is why they avoid restating facts the generated pages own. The generated half is checked against the code; this half is not, and the docs say so.
4ca3b4b to
81e9c30
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 81e9c30. Configure here.

🌟 What is the purpose of this PR?
Moves the hand-written architecture documentation from
petrinaut-core/docs/architecture/into the docs bundle, so it appears alongside the generated pages instead of beside them.The old location held 3,100 lines of HTML and a stylesheet. Nothing served it, and it could only be read by opening the files off disk. Its content is what a generated page cannot produce: why a boundary is where it is, which alternatives were rejected, and which mistakes are easy to make.
Second of three PRs, on top of #9204. #9206 renders the result.
🔍 What does this change?
A page names the layer it explains, and is written out below that layer's generated page:
flowchart LR S["content/simulation/<br/>memory-model.mdx"] --> A{"attachTo:<br/>core.simulation"} A --> P["pages/architecture/core/<br/>simulation/memory-model.mdx"] A --> G["Guides link on<br/>the layer page"]The layer's page gains a Guides section linking to it. Because a page's depth depends on
attachTo, links are written by name (layer:core.simulation.engine,doc:simulation/memory-model) and the path is worked out when the page is written. A target that does not resolve fails the build.Five simulation deep-dives carry detail the generated pages do not: the memory model and frame format, the fixed stage order of a step, the HIR pipeline and the limits of the sandbox, the worker protocol and its ack contract, and why only aggregates reach the UI from a Monte Carlo run.
Four diagram components cover the parts that are visual: byte layouts, lane diagrams, pipelines, and message sequences. They are the only reason the bundle asks a host for a React-capable MDX pipeline.
Migrating the pages turned up two claims that were no longer true: UUID support described as unimplemented when it is complete, and a sandbox description narrower than what the code does.
🔗 Related links
Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
Deletes documentation from
petrinaut-core. No runtime code, types or exports change.📜 Does this require a change to the docs?
This PR is a documentation change. The user-facing guide (
libs/@hashintel/petrinaut/docs/) is untouched.AGENTS.mdgains a paragraph onattachToand the link schemes.🕸️ Does this require a change to the Turbo Graph?
content/is not checked against the code. A guide describing a layer that later changes shape will not fail the build. Only itsattachToand its links are checked.🐾 Next steps
🛡 What tests cover this?
No new tests, since this is content. The code that consumes it is covered by
emit/mdx.test.ts(link resolution at different depths, fragments, unresolved targets) and bylint:arch-docs, which fails on anattachTonaming a layer that does not exist, alayer:ordoc:target that does not resolve, and an@diagrams/import naming a component that does not exist.❓ How to test this?
Expect
38 generated pages · 8 authored pages, with the deep-dives underbundle/pages/architecture/core/simulation/.To see the link checking fire: point a
layer:target atlayer:core.nonexistent, or set anattachToto a layer that does not exist. Each failslint:arch-docsand names the file.