FE-1056: Move the handle integration guide into the architecture docs - #8926
FE-1056: Move the handle integration guide into the architecture docs#8926kube wants to merge 12 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Semgrep found 4 Detected possible user input going into a View Dataflow Graphflowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>.claude/setup.mjs</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/hashintel/hash/blob/3c80fef937ed2cd8869428222504b8915ebc22eb/.claude/setup.mjs#L226 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 226] _0x2912ea</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/hashintel/hash/blob/3c80fef937ed2cd8869428222504b8915ebc22eb/.claude/setup.mjs#L226 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 226] _0x2912ea</a>"]
end
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/hashintel/hash/blob/3c80fef937ed2cd8869428222504b8915ebc22eb/.claude/setup.mjs#L257 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 257] _0x2912ea</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
|
3c80fef to
52ee22d
Compare
52ee22d to
00a0fb7
Compare
Sort masked depends-on entries so count-driven reordering cannot flag a page; scope every mask to the block shape it targets, keeping embedded README prose untouched. Clean up the scratch tree on any extraction failure and only swallow git-archive pathspec misses; refuse refs with a leading dash. Warn on an empty --diff-base, drop dead custom properties, and mark sidebar links with a data attribute instead of a second class.
e8b0afe to
3454ded
Compare
|
Restacked and revised, per request:
A nice side effect of the stacking: this branch's own diff build flags exactly its footprint — the two guides as 🤖 Generated with Claude Code |
…supply it A Vercel build gets a snapshot of the sources with no usable git clone behind it, so resolving the base ref locally fails and every preview degraded to a plain bundle. When local resolution fails, fetch the ref from the public repository into a scratch repo — blobless, with a sparse checkout of only the covered directories — and log which strategy ran. Verified against github.com from a directory with no clone: 3s to materialize, and the base model matches a local build.
3454ded to
53a4f16
Compare
53a4f16 to
6a1fdd0
Compare
Two linked chips beside the title on diff builds: the deployed PR (or branch) and the base it is diffed against, each with the commit built. The base's PR is looked up by head branch, anonymously; the context is resolved once in astro.config.mjs and injected as a compile-time constant, since a bundled component has no stable path to the manifest.
5f2fdcb to
d4ac80a
Compare
Cache entries are keyed in the file name by the generator-inputs hash then the base commit, so different generator versions keep separate entries instead of overwriting one slot. Every clean build also stores its own side as a future base: the CI cache falls back to the production deployment's, so the entry a main build writes is what a PR targeting main finds on its first build — the common case computes no base at all, and entries shared across branches are only ever written by protected-branch builds.
d4ac80a to
9895f78
Compare
Base-side acquisition (cache lookup, materialization, build, seeding) moves from cli.ts into diff/base-side.ts, leaving the CLI as wiring and logging. Ref validation runs at every entry point that takes a ref, not only in materialization, so no call order lets an unvalidated ref reach a git command line; the credentialed origin-fetch fallback is removed — local resolution either succeeds or the anonymous fetch takes over. ls-remote resolution peels annotated tags to the commit the cache and materialization both key on. The CI resolver's crash costs the highlighting instead of the deploy, and it only prints branch-name shaped output; branch names are URL-encoded in the header chips.
The default stays node_modules/.cache, which CI providers persist without configuration and local builds can always write; a CI whose persisted location differs sets PETRINAUT_ARCH_DOCS_CACHE_DIR instead of the code guessing its layout.
9895f78 to
a0a3b4d
Compare
PR SummaryLow Risk Overview In Reviewed by Cursor Bugbot for commit b8740a9. Bugbot is set up for automated code reviews on this repo. Configure here. |
Two of these were invisible on GitHub: base-cache.ts carried raw NUL bytes as hash separators, so git rendered it as a binary file — now the escape spelling, with identical hash input — and the ref guard's control-character class tripped oxlint's no-control-regex; it is now an allow-list, which also subsumes the empty and leading-dash checks. The prune could evict exactly the shared base entry: eviction now orders by last use (a hit refreshes the timestamp), the cap rises to 16, and seeding runs after the diff has read its base. Cache keys hash package-relative paths, so relocated checkouts sharing a cache directory hit. Seeding is wrapped whole — no failure in a bonus write may fail a passed build. Network git calls get a timeout and prompt suppression; the marker stylesheet reads every hue through its custom property so re-theming works as documented; empty Vercel variables no longer produce empty header chips.
a0a3b4d to
b8740a9
Compare
b8740a9 to
5b9aa22
Compare
🌟 What is the purpose of this PR?
Gives a host application a documented path to implementing its own
PetrinautDocHandle, which is what TOPOS needs to embed Petrinaut in CatCollab (FE-1056). The integration guide moves into the Petrinaut architecture docs, where the build checks its links and layer references. On the code side,SDCPNInputlets hosts author documents without spelling out every extension field.🔗 Related links
🔍 What does this change?
@hashintel/petrinaut-coretypes/sdcpn-input.ts:SDCPNInputis a loose authoring variant ofSDCPN, andnormalizeSDCPN()fills plain-net defaults. Arcs accept theplaceIdshorthand or an explicitendpoint(including component ports);subnets,componentInstances, and placeisPortpass through. A completeSDCPNremains a validSDCPNInput, asserted at compile time in the test.createJsonDocHandleacceptsSDCPNInputand normalizes internally.Architecture docs (
@local/petrinaut-arch-docs)content/handle/host-integration.mdx, attached to thecore.handlelayer: the contract, a per-member table of what the editor does with each handle member, the invariants a custom handle must keep (synchronous atomicchange(), referentially stabledoc(), emit-per-change, stableid), the model-mapping recipe, a worked adapter, the<Petrinaut />prop table, and capabilities (now five extensions, includingsubnets). Two diagrams: a sequence of the local/remote event flows and a pipeline of the adapter's write paths.content/handle/contract-gaps.mdx: where the contract under-specifies or misbehaves today (implicit invariants, readiness and lifecycle, local vs remote changes, validation and versioning, history under collaboration), each with the enhancement it calls for, and a sequencing note. Every claim was checked against the current code.core.handlelayer's Guides section.Removals
libs/@hashintel/petrinaut/INTEGRATION.mdis deleted; its content was rewritten into the two pages above. The package READMEs keep a short embedding section and link to the new guide.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
@hashintel/petrinaut-core: patch. The@hashintel/petrinautchange is README andfilesonly, no changeset.📜 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:
🐾 Next steps
The enhancements listed in
contract-gaps.mdx, cheapest first: TSDoc for the implicit invariants plus a conformance test kit for third-party handles, an error channel and specified readiness semantics, validation shared between file import and handle construction, then local/remote and history semantics alongside the first collaborative backend.🛡 What tests cover this?
types/sdcpn-input.test.ts: default filling, endpoint and subnet passthrough, absent-key preservation for structural equality, idempotence on a complete document, and the compile-timeSDCPN-to-SDCPNInputassignability assertion.lint:arch-docsfails the build on unresolveddoc:/layer:links, unknownattachTotargets, and missing@diagrams/components in the new pages.❓ How to test this?
turbo run test:unit --filter @hashintel/petrinaut-coreyarn workspace @local/petrinaut-arch-docs lint:arch-docsturbo run dev --filter @apps/petrinaut-docs, then open Architecture → core → handle: both guides appear under "Guides", with the diagrams rendered.