Repository navigation
feat: add store-contract package - #26
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
The persistence port for process models and their run overlays as a versioned oRPC contract (v1): save, load, list and delete models, set run state, upsert items read from a source, structural ready, blocked-chain and impact queries, and a change feed as an event iterator. Inputs and outputs reuse graph-schema's model and overlay schemas, so the port carries the model as it is. createGraphStoreRouter builds the router on a plain GraphStore implementation and owns abort handling, error mapping and eager subscription, so a caller holding the change iterator cannot miss its own next write. Every write is checked with validate and validateOverlay and takes the next store-wide revision. The queries are structural (transitions and run state only, decision loop edges excluded, control elements passed through), so a SQL store can answer them without evaluating conditions; on models without conditions or artefacts ready agrees with graph-domain's readySet. An in-memory fake and a conformance kit (separate ./conformance entry, optional vitest peer) ship with it; the fake passes the kit in process and over a MessageChannel.
… without a decision The model fixtures move into the ./conformance entry so adapters can reuse everyFieldModel and queryModel in their own tests, for example to check a database file round-trips every field. A new conformance case saves a model whose transitions cycle without a decision: the queries must still terminate and never report the element asked about. It caught a SQL walk that reported the start element when a cycle led back to it.
|
@codex security review |
There was a problem hiding this comment.
🛡️ Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit: e1985e7eb6
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
A subscriber that stopped reading made every later change pile up in its subscription without limit. A subscription now holds at most its capacity of undelivered changes; when another arrives, the held changes are replaced by one missed event, so memory stays bounded and the subscriber knows to load the model again. A subscriber that keeps reading receives every change directly and misses nothing. The capacity is a ChangeFeed option, overridable per subscription. The default, defaultSubscriptionCapacity, holds one change: the only thing a change asks of a subscriber is to read the model again, and the model read after one pending change already reflects every later one. A conformance case checks that a subscriber that stops reading under sustained writes is never left unaware of a change it lost, and the kit's helpers move to their own module.
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds
@exadev/process-graph-store-contract, the persistence port from phase 3 of the plan, as a versioned oRPC contract (graphStoreContract.v1,@orpc/contract2.0.0-beta.41) with Zod inputs and outputs taken from graph-schema'smodelSchemaandoverlaySchema.Procedures:
models.list|save|load|delete,overlay.set,items.upsert(participants, bound activities and transitions merged by id, plus overlay entries),query.ready|blockedChain|impact, andchangesas an event iterator with asincerevision that yieldsmissedwhen the subscriber fell behind. Every write is validated withvalidateandvalidateOverlayand takes the next store-wide revision; failures areNOT_FOUNDandUNPROCESSABLE_CONTENTwith data.The queries are structural on purpose: transitions and run state only, decision loop edges (graph-domain's
loopTransitions) excluded, decisions and pseudo-states passed through. That is what lets the SQLite store answer them withWITH RECURSIVEin the next PR. A unit test checksreadyagrees with graph-domain'sreadySeton models without conditions or artefacts.Adapters implement a plain
GraphStoreand get the router fromcreateGraphStoreRouter, which owns abort handling, error mapping and subscribing before the change iterator is returned. The in-memory fake passes the conformance kit (./conformance, optional vitest peer) both in process and over aMessageChannelwith oRPC's message-port adapter.One thing the v2 beta taught: an oRPC client is a proxy over a function, so a procedure named
applyis shadowed byFunction.prototype.applyand the call goes to the parent path. The overlay procedure isoverlay.setfor that reason.Stacked PRs follow for
graph-store-sqliteand the node and wasm drivers. The browser driver choice is recorded in #22.npm name to reserve before the first release:
npm-reserve @exadev/process-graph-store-contract --trust ExaDev/process-graph --workflow ci.yml.