Repository navigation
fix(patch-db,marketplace): keep unchanged subtrees across updates; open the service preview immediately - #4945
Conversation
The tile debounced the query-param change by 100ms before opening the drawer, and the preview showed only a loader until the full release arrived. On StartOS that is a fresh PatchDB projection, so a server round trip. The tile now opens on navigation and hands its listing to the preview, which shows the icon, title, release notes and flavors at once and a loader where the controls and details go. The preview's unused pkg input is replaced by the listing input. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
helix-white
left a comment
There was a problem hiding this comment.
Reviewed 65b3f44baa174467f217a5eedaeaebc0b92b6c90: immediate URL-driven drawer opening, listing-only loading content, full-release gating of controls/details, version and range selection, and both StartOS and brochure marketplace adapters. No blocking findings. git merge-tree --write-tree origin/master HEAD is clean.
No builds or tests run during review. CI was still running at inspection.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
…rawer, add skeletons Opening a preview acquires a PatchDB projection, and SubtreePatchDB's reselect re-projected the entire replica and re-read every watched node synchronously, even when the selection only widened. With a real registry index (~100 packages) that was a ~160ms main-thread task in the click, before the drawer could paint, and it re-emitted every listing. reselect now prunes through projectNarrowed, which re-projects only the subtrees the dropped selectors reached and keeps the identity of the rest, and notifies only the watches whose subtree changed. Widening drops nothing, so it leaves the document and watchers untouched. The preview renders the About card from the listing with skeletons for the SDK version, license and description, and a skeleton button where the install controls go. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
@helix-white thanks. Your approval covers
The PR description covers it in full. Re-requesting your review on the current head. |
helix-white
left a comment
There was a problem hiding this comment.
Re-reviewed c77f9a63ae1b075c3e23776d895cd641a69f9c4d, including the changes since my previous approval: shared projection recursion and selective pruning, watcher notification behavior, confirmed coverage and in-flight revision handling, the three added regression tests, and the About/install skeleton states. No blocking findings. git merge-tree --write-tree origin/master HEAD is clean.
No builds or tests run during review. CI was still running at inspection.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. c77f9a6 adds shared PatchDB selection-change behavior: widening preserves the replica without notifying existing watches, while narrowing selectively reprojects and notifies. It also renders About/signers from the listing with field and install skeletons, replacing the original loader and About-waits-for-full-release behavior. These substantive scope and loading-UX changes require updating the reviewed brief.
The previous commit fixed one instance of a general pattern in the TS client: updates re-did work proportional to the whole document or to every watcher when only a small part changed. This fixes it at the library layer. - projection: one recursion reuses a previous projection wherever its source subtree is the same object, and returns the previous container when its children are unchanged (reprojectRoot; projectNarrowed is now a use of it). reconcile keeps every subtree a new document deeply equals. - PatchDB: dumps reconcile against the current document, and a watch is notified only when its value is a different object. - SubtreePatchDB: watches remember their source and re-project only what changed; revisions during a selection update and the suspend path reuse instead of re-projecting the whole replica; the selection is recomputed only when a key is first watched or fully released; released watch nodes are dropped instead of being re-projected for no subscribers. - StartOS marketplace: listed releases are reused while a package's projection and selection are unchanged, and tiles are tracked by package id and flavor instead of index. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
@helix-white the head moved to
The description covers it in full. Re-requesting your review. |
helix-white
left a comment
There was a problem hiding this comment.
One correctness fix before approval:
- P2 — distinguish an absent flavor from the named
nullflavor in tile keys (shared-libs/ts-modules/marketplace/src/components/marketplace.component.ts:179). The new concatenation converts the null value to the string"null". A registry can legitimately list both1.0.0:0and#null:1.0.0:0for the same package (the version grammar accepts lowercase flavor names); both then receiveexample#null. This gives Angular duplicate tracking keys (NG0955) and ambiguous tile/drawer reuse when the list changes order or entries are removed. The proposal normalizes the absent flavor to an empty suffix instead.
The proposal also updates the published PatchDB.watch$ contract and architecture text: they still promise emissions whenever a patch touches a watch and updates on every dump, which no longer describes this change.
I reviewed the incremental projection/reconciliation paths, cached watch sources, release/reacquire lifecycle, pending selection revisions, marketplace release caching, and supported callers. No other blocking findings. The reviewed head 123758ccafb77c3f0ff4afc736e011d684ac2574 merges cleanly with origin/master. No builds or tests run during review; the author should verify any adopted proposal.
Proposed changes: 123758c...proposal/4945
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
…ut a null flavor Adopts @helix-white's review proposal: ARCHITECTURE.md and the watch$ doc no longer claim every dump and touching patch re-emits, and the tile key no longer stringifies a null flavor. Adds the identity guarantee to the SubtreePatchDB section. Helix-Harness: claude-code Helix-Model: claude-opus-5-5
|
Adopted the proposal in
Verified on the new head: prettier, |
helix-white
left a comment
There was a problem hiding this comment.
Re-reviewed 21f5f116f349541b114e1625c5eaf0b1f2b628fe against 123758cca and the proposal. Both earlier findings are addressed: unflavored and named null releases now have distinct tile keys, and the published watcher contract and architecture describe the changed emissions. The additional architecture sentence matches the recorded projected-watch guarantee. No remaining blocking findings. The head merges cleanly with origin/master.
Nonblocking description cleanup before handoff: the SubtreePatchDB documentation bullet is broken at “The class doc, the `watchClicking…” and repeats the introduction, Cause, and patch-db change sections. Please remove that duplicated block.
No builds or tests run during review. CI remains pending.
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Dismissed by Helix: the changes require a substantive PR brief update. Since c77f9a6, the PR adds general PatchDB dump reconciliation and unchanged-value emission suppression, affecting StartTunnel as well as StartOS. It also introduces incremental projection caches, released-watch cleanup, marketplace release reuse, and package/flavor-based tile tracking. A correct brief must expand beyond selection-change pruning to explain these notification semantics, lifecycle/rendering changes, broader consumers, and reconnect traversal cost.
Clicking a service in the Marketplace now opens its side drawer within a frame. The drawer immediately shows what the registry listing already holds: icon, title, version, release date, git hash, signers, release notes and other flavors. Skeletons stand in for the SDK version, license, description and install button until the full release arrives.
The underlying fix is in the patch-db TypeScript client, so it applies to every StartOS screen, not just the marketplace. Updates now keep the identity of every subtree they leave unchanged, and a watch is notified only when its value is actually a new object.
Implementation diff: +325 / −115 lines in 9 files (excludes lockfiles, tests, docs, release notes, and changelog).
Cause. Opening a preview subscribes to a PatchDB projection of that package's full release (a projection is a filtered view of part of the document).
SubtreePatchDBthen synchronously re-projected the entire local replica and re-read every watched node, before the drawer could paint. It did this even though the selection only grew, and it re-emitted all ~100 listings, so every tile re-rendered. A CPU profile on a master VM with the Start9 registry put about 156ms of a 185ms click task there.The client repeated the same mistake in several other places:
What changed in patch-db
projection.ts. One recursion now backsprojectValue,projectRoot, the newreprojectRootandprojectNarrowed. Given the previous projection and its source,reprojectRootreturns the previous projected subtree wherever the source subtree is the same object. When a container's children all come back unchanged, it returns the previous container itself.reconcilereturns a new document that keeps every subtree of the previous one it deeply equals.PatchDB(also used by StartTunnel). Dumps reconcile against the current document, and a watch is notified only when its value is a different object.SubtreePatchDB.watch$doc andARCHITECTURE.mdrecord the new guarantee.What changed in the marketplace
MarketplacePkgwhile its projected package entry and registry selection are the same objects. Previously it rebuilt all ~100 on every listing emission.null.pkginput becomeslisting.MarketplaceAboutComponentgains aloadingstate with skeletons and a disabled license button, and falls back to the short description when there is no long one.UnknownSDK-version fallback now goes throughi18n.Decision: reconnects pay one extra walk.
reconcilecompares each dump against the current document, so every subscription start and reconnect walks the whole new document once. The benefit is that unchanged screens don't re-render. You chose this, judging a re-render to cost far more than a walk. First loads are cheap, because the empty starting document has nothing to compare.Behavior that changes for callers. A
watch$orwatchProjection$subscriber no longer receives a repeat emission of a value that is the same object. Code that relied on dumps or prunes re-emitting identical values as a "refresh" tick would stop receiving them. None of the existing tests or app suites depend on that.Neighbors. #4904 and #4895 also change patch-db; neither touches the TS client. #4904 edits
marketplace.component.ts, but not the list loop changed here.Testing
projects/start-os/web/ui/scripts/subtree-patch-db.test.mjsadds eight tests, and all 34 in the file pass. Five check behavior and all fail against the base client:Three property tests run over the file's existing selection and state fixtures. They show that
projectNarrowedandreprojectRootequal a full re-projection, that both return the previous value when nothing changed, and thatreconcilereturns the previous document for deep-equal input.check:rpc-clients(103, including the real PatchDB source lifecycle),check:ui(356),check:marketplace(14),check:tunnel(8),check:brochure, the patch-db client typecheck, production builds ofui,brochure-marketplaceandstart-tunnel, and prettier all pass.Real server. On a
masterStartOS VM at087d17460(this branch's base) with the Start9 registry (~100 packages), Playwright drove master's own UI and this branch's production UI build, injected into the page in place of the server's copy:The ~240ms is the server round trip, now spent behind an open drawer. The run was headless on a fast host, so slower clients see larger absolute numbers on master.
Not exercised live. A registry refresh produced no data changes, so live revisions and reconnect dumps were not measured on the VM. The unit tests above are what establish those paths.
The screenshots come from the mock backend with a 4s delay added to its selection update (not committed), to hold the loading state.
CI on the head was still running at hand-off (product builds, start-core tests and man pages, StartWRT tests, generated bindings).
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5