Repository navigation
Give collection, skill and database-settings typed wire types and updates, and close project and query's gaps (closes #3453) - #3488
Conversation
Pragmatic Code Review — PR #3488Review Type: Initial Review (no prior reviews or comments on the PR; head Recommendation: REQUEST CHANGES — one blocker in the frontend create path for skills. The backend half (wire types, service, proto, daemon, Tauri, dev-proxy, generated TypeScript) follows the What I ran: Requirements Check (#3453)
Node-type checklist: no undeclared keys, no literal Code Review Findings🔴 Critical1. A new skill typed at normal speed is never saved: the create drops the required 📁 if (field.readOnly || field.wire in staged || value === undefined || value === null) continue;Trace for "+ New" on a skill:
The exclusion is only safe for a field the schema defaults (the The existing test ( Recommendation: let the create carry the node's current value for every typed field, staged or not, and drop the non-null staged entries it carried (firing their Principle: correctness of state transitions. A create must be self-sufficient against the schema's required fields, and must not depend on a follow-up write that only runs if the create succeeds. 🟡 Important2. 📁 #[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
...
pub tool_whitelist: Option<Vec<String>>,
Recommendation: reject Principle: fail loudly on an invalid input instead of reinterpreting it. 🟢 Suggestions3. The query rename still writes around the store 📁 View-config writes now go through the store's per-node persistence queue; the rename calls Related, same file: I checked the paths I was asked to: load (store first, then backend, epoch check added before the store write), eviction (the tab's node id is an open document root, so the query node stays reachable), the error path (covered by the new 4. 📁 The sheet lists four fields and says the typed update carries "these four"; the struct, the update, 5. Test gaps worth closing while here
Nitpicks
What is solid
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks requesting changes on your own pull request). Full findings in the review comment above.
Review addressed (
|
Pragmatic Code Review — PR #3488Review Type: Re-Review (head Recommendation: APPROVE — the blocker is fixed and nothing new blocks. Two 🟡 findings below are small and worth folding in before merge: one is a failure-path regression the rename change introduces, the other is a narrower path to the same "skill never saved" state as the original blocker. Previous Review Summary: 5 findings and 2 nits. 3 findings fully addressed (1, 2, 5), 1 half addressed with the other half skipped (3), 1 skipped (4); 1 nit addressed, 1 skipped. All three skips are reasonable. 2 new 🟡 findings, 1 🟢, 2 nits. What I ran: the three changed frontend test files (50/50 pass) and Per-finding status
New Findings🟡 A. A failed rename leaves the unsaved name in the header, and the same name cannot be retried📁 sharedNodeStore.updateNode(queryNode.id, { content: name }, …, {
persist: 'immediate',
onPersistError: (e) => {
log.error('QueryNodeViewer: failed to rename query', { error: e.message });
saveError = `Failed to rename query: ${e.message}`;
}
});
Before this commit the store was written only after the RPC succeeded, so a failure left the old name on screen and a retry worked. Success and version-conflict paths are fine: on a conflict the store hydrates from the server's node, the header shows the server's name and the conflict toast appears. Recommendation: capture Principle: an optimistic write needs a compensating action on failure; the UI must not present unsaved state as saved. 🟡 B. A new skill whose description is empty when the create fires is still never saved📁 // Not created yet: the create path sends the staged fields once it lands.
if (!this.persistedNodeIds.has(nodeId)) return;The create is queued once, 500 ms after the first character, and a later typed write on an unpersisted node only stages. Trace: type The same line means any failed create of a typed node (a daemon restart, say) is not retried by typed-field edits, and the staged writes' This is much narrower than the original blocker (it needs the field to be empty at the moment the debounce fires), so I am not blocking on it. Recommendation: in the not-persisted branch of Principle: a write path must not have a state from which later writes are accepted locally and never sent. 🟢 C. Emptying a saved skill's description still shows a connection error📁 The wire now refuses Recommendation: do not send a clear for a required typed field. Principle: validate at the edge that knows the rule, so the user gets a specific message instead of a transport error. Nitpicks
Checked and found fine
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review addressedAddressed
Skipped
Not fixed here, as the re-review notes it predates this PR: a typed node whose create fails for an unrelated reason (the daemon is down) is not retried by typed-field edits alone. Frontend unit suite passes (304 files, 5572 tests); frontend lint and type-check are clean. This commit touches no Rust; Re-review: not needed. Both changes are small, each follows a pattern the re-review pointed to, and each has a test written against the failing case (not run against the pre-fix code). |
…h a typed update (#3453) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…, and write the query viewer through the store (#3453) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… a required skill field, rename a query through the store - A create now carries every typed field its node holds, staged or not. A skill typed one keystroke at a time staged its description after the first character, the debounced create left it out, and the backend rejected the node for good. - SkillNodeUpdate refuses null for description and tool_whitelist instead of reading it as absent. - The saved-query rename goes through the store, so it is ordered with a view-config write instead of racing it at a stale version. - The typed-update routing test asserts the update called is the type's own; the typed-client refusal is asserted for skill and database-settings too. Skipped: deriving the query viewer's active view from the store (a larger viewer refactor than this change needs), listing node_types on the skill sheet (the skill-to-schema relationship removes the field), and trimming exclusion in the dev-proxy mirror (dev-only, whitespace-only values). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…and start a completed placeholder's create at once - A failed rename left the unsaved name in the header and could not be retried under the same name. The saved name is put back, unless the header has moved on. - A placeholder completed by its first character queued a debounced create; emptying the field in that window sent a node the backend rejects, and nothing queued another create. The create now starts as soon as the placeholder is complete. - The rename no longer passes a persist option that the store does not read as a mode. Skipped: keeping an emptied required field local in the schema form instead of sending a clear the backend refuses. The refusal is correct and retyping saves; it belongs with the form's own handling of required fields. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
4917d59 to
27c07b1
Compare
Closes #3453.
What this does
Gives the three remaining flat core types a typed wire shape and a typed update, and closes
projectandquery's gaps (ADR-086 §4).Kind and category:
collection,skillanddatabase-settingsare concrete core types, category flat. No type, field, relationship or rule is added or removed: every field below is already declared by its schema.collectionCollectionNodedescriptiondescriptiontri-stateskillSkillNode(envelope +SkillFields)description,exclusion,tool_whitelist,max_iterations,node_typesdescriptionandtool_whitelistset-only; the rest tri-statedatabase-settingsDatabaseSettingsNoderequired_extensionsrequired_extensionstri-stateupdate_nodenow refuses their declared fields, as it does fortask.SkillNodewas a reader with no envelope. The reader is nowSkillFields(likeQueryFields), andSkillNodeis the wire shape. Call sites pass the skill's name separately.project:statusandprioritywere already extensible enums onmain. This adds the OCC conflict test and a test that a value the schema does not declare is refused.query: OCC conflict tests, and the query viewer now writes its view config throughsharedNodeStore.updateQueryNodeand reads the query node from the store.CollectionNodeand its unused helpers are deleted;CollectionInfois the generated node plus its counts.Two things worth a look
skilltyped, its requireddescriptionlives at the top level, and the store's create sent onlyproperties, so "+ New" on a skill would have been rejected. The store now folds unstaged typed fields into the create under their storage names, andneedsUnsavedPlaceholderdecides by the schema alone instead of excluding typed types. Onlyskillchanges behaviour: it is the one typed type with a required field that has no default.node_typesis on the typed skill shape. The skill schema still declares it, and the registry test pins the promoted fields to the schema. Theapplies_torelationship (Seed built-ins from fixed-UUID tables with Markdown bodies, order agent guidance, and link skills to their schemas #3418) has not landed; that change removes the field from the schema and the struct together. The docs sheet describes the four fields that stay.Docs
components/node-types.md: wire names and typed-update lines for the three sheets (nodespace-docsf4b92cd).Tests
nodespace-types: wire contract per type (full envelope, emptiedproperties, defaults, a malformed skill keeps its node), update structs (tri-state, unknown key).core:typed_flat_updates_test— write, clear, conflict and wrong type for each of the three; pipeline validation for skill; project and query conflicts; project vocabulary.daemon: write and typed conflict header for each of the three; conflict header for project and query.bun run test:changedpasses (frontend, scripts, browser, generated-TypeScript drift, Rust workspace).bun run quality:fixis clean.🤖 Generated with Claude Code