sync: port default-bucket resolution and the parent-key node descent from constructive-db - #118
Merged
Merged
Conversation
…from constructive-db constructive-db's vendored copy moved ahead again in two packages. Ports the newer side upstream, unchanged, and regenerates both bundles. function-resolution: bucket_matches, default_bucket_tag and resolve_default_bucket (new triples), a resolve_bucket rewritten on top of bucket_matches, and the errors dependency the new code raises through. object-store: insert_nodes_at_paths' dirty-directory descent now joins a child to its parent on the parent's key instead of recursing on depth with a path-prefix filter — a real equijoin the planner hashes once per level, where the filter compared every dirty directory against every row of the level above (300s of a 307s pass on a 22k-directory batch, against 0.4s). Versions stay at 0.39.0 in both trees: the registry tops out at 0.36.0, so 0.39.0 is unpublished and the two trees agreeing on content under it is the point. Everything else that still differs between the trees is tree-specific — the pgsql-test/constructive-test harness import and the pgpm devDependency pin.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The trees drifted again after #115. A full re-diff of all 28 shared packages (excluding
sql/) finds exactly two with real content drift, both with constructive-db ahead; this ports them upstream unchanged and regenerates the bundles.function-resolution— server-side default bucket resolutionThree new triples plus a rewritten
resolve_bucket, which now delegates the matching:resolve_default_bucketraises througherrors, so the control'srequiresand the package's dependencies gain it (@pgpm/errors, reflected in the lockfile importer).object-store—insert_nodes_at_paths, dirty-directory descentThe descent recursed on depth and matched with a path-prefix filter; it now joins a child to its parent on the parent's key, which every directory already carries:
A prefix filter is not a join condition, so every dirty directory was compared against every row of the level above — 9.6M filtered comparisons per level on a 22k-directory batch, each re-deriving the path from the key: 300s of a 307s pass, against 0.4s for the equijoin the planner can hash once per level. The root becomes the descent's seed rather than a child (under
to_jsonb(path[1:0])it is its own parent, so leaving it in the recursive side joins it to itself forever), anddepth/pathdrop out of the CTE entirely since the name is enough to index into the parent'sktree.Versions
Both trees stay at 0.39.0. The registry tops out at
0.36.0, so 0.39.0 is unpublished — no consumer can observe content changing under a fixed version, and the two trees agreeing on content under it is the point of the sync. Bumping would have forced a matching bump and repackage on the constructive-db side for no observable benefit.What is not drift
Every other difference across the 28 packages is legitimately tree-specific, and deliberately left alone:
pgsql-test, vendoredconstructive-test;pgpmdevDependency pin — upstream^5, vendored^5.24.5;defaults"schema public function grants" test (upstream hardening kept in sync all 28 modules to constructive-db's source, lockstep 0.39.0 #115). Ported into the vendored copy separately, in constructive-db.Verification
function-resolution: 7 suites, 79 tests passed (includes the porteddefault-bucket.test.ts).object-store: 6 suites, 28 tests passed.pgpm packageregeneratedpgpm-function-resolution--0.39.0andobject-store--0.39.0(.sql+ bundle).Link to Devin session: https://app.devin.ai/sessions/43b0b10711174fa49d51907bf2b0c25f
Requested by: @pyramation