Repository navigation
feat(pnpr): keep hosted package metadata in SQLite - #17551
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Configure metadata and route storage operations pnpr/crates/config/*, pnpr/crates/storage/src/lib.rs, pnpr/crates/storage/src/metadata/*, pnpr/crates/pnpr/src/* |
Configuration selects document or SQLite metadata. Storage creates namespace-scoped metadata views and routes package operations through them. |
Persist and render metadata pnpr/crates/storage/src/metadata/sqlite/* |
SQLite stores package state, versions, tags, generations, tag history, and removed-version identities. Package views are rendered from stored data and served through bounded caches. |
Serve metadata and preserve publish state pnpr/crates/pnpr/src/server/*, pnpr/crates/storage/src/journal* |
Package reads and dist-tag mutations use metadata operations. Responses can include catalog generations. Publish principals are carried through journal recovery, and tombstones are recorded before dependent changes. |
Validate integrations and document behavior pnpr/crates/pnpr/tests/*, pnpr/crates/storage/src/*/tests*, pnpr/docs/*, .changeset/* |
Tests cover persistence, conflicts, concurrency, restart, migration, recovery, publishing, unpublishing, and configuration. Documentation describes SQLite setup, backup, migration, and runtime behavior. |
Estimated code review effort: 5 (Critical) | ~90 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant Client
participant PackageMutation
participant Storage
participant MetadataBackend
participant SQLite
Client->>PackageMutation: Submit package or dist-tag mutation
PackageMutation->>Storage: Write metadata with principal
Storage->>MetadataBackend: Apply conditional change
MetadataBackend->>SQLite: Commit state, history, and generation
SQLite-->>MetadataBackend: Return committed result
MetadataBackend-->>PackageMutation: Return result and generation
PackageMutation-->>Client: Return response with generation when available
Suggested labels: product: pnpr
Suggested reviewers: qodo-code-review
Merge Risk: 
Minimal · up to 09b4f
-
No actionable issue remains in the supplied change; it is mergeable after normal checks.
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Same-run syscall checkEach install runs 2 more times per revision, untimed, under
Integrated-Benchmark Report (Linux)Commit: Compared against main at: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.37927632856,
"stddev": 0.14572617972833662,
"median": 2.29603574106,
"user": 1.9299282799999997,
"system": 1.4621436600000002,
"min": 2.23831986406,
"max": 2.58657047406
},
{
"command": "pacquet@main",
"mean": 2.3783275036600005,
"stddev": 0.10585682387195094,
"median": 2.39142034806,
"user": 1.8776401799999995,
"system": 1.5163942600000002,
"min": 2.21313473006,
"max": 2.58055597306
},
{
"command": "pnpr@HEAD",
"mean": 1.48993920316,
"stddev": 0.11743816677539864,
"median": 1.50093560056,
"user": 1.86372978,
"system": 1.4884404599999999,
"min": 1.32311394106,
"max": 1.6708286110600001
},
{
"command": "pnpr@main",
"mean": 1.40099187036,
"stddev": 0.11060327201741407,
"median": 1.36706469356,
"user": 1.7723014799999999,
"system": 1.4905222599999999,
"min": 1.28977362206,
"max": 1.58661580106
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.39255396088,
"stddev": 0.011833904599099698,
"median": 0.38988428517999996,
"user": 0.46440348,
"system": 0.8123435200000001,
"min": 0.37304250718,
"max": 0.41393808718
},
{
"command": "pacquet@main",
"mean": 0.40708880197999997,
"stddev": 0.0263717056159697,
"median": 0.40467957918,
"user": 0.4721676799999999,
"system": 0.84859512,
"min": 0.35605150418,
"max": 0.44422076718000003
},
{
"command": "pnpr@HEAD",
"mean": 0.44603160968,
"stddev": 0.030342584249393977,
"median": 0.43937462017999995,
"user": 0.49362567999999996,
"system": 0.8430267199999999,
"min": 0.41736353818,
"max": 0.50356094418
},
{
"command": "pnpr@main",
"mean": 0.4246443294800001,
"stddev": 0.02871441745729536,
"median": 0.42143386268,
"user": 0.48406547999999994,
"system": 0.8469856200000001,
"min": 0.38009728718,
"max": 0.48941096718
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.011536899199074071,
"stddev": 0.0012213196744214718,
"median": 0.011407201500000002,
"user": 0.006311722222222226,
"system": 0.006231893055555555,
"min": 0.009364016000000001,
"max": 0.016589520000000003
},
{
"command": "pacquet@main",
"mean": 0.011647653735042732,
"stddev": 0.001479202150651834,
"median": 0.011351185500000001,
"user": 0.006989153846153847,
"system": 0.00568455598290598,
"min": 0.008969955,
"max": 0.018992120000000005
},
{
"command": "pnpr@HEAD",
"mean": 0.011149367442553198,
"stddev": 0.0008590234361464007,
"median": 0.011036863000000001,
"user": 0.006947202127659575,
"system": 0.00528323855319149,
"min": 0.009373781000000001,
"max": 0.013635419000000001
},
{
"command": "pnpr@main",
"mean": 0.010664555799180325,
"stddev": 0.001044383176173407,
"median": 0.010531448500000002,
"user": 0.005876364754098358,
"system": 0.005760832704918035,
"min": 0.008793166,
"max": 0.014034994
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.010640531488837209,
"stddev": 0.0010255055981051116,
"median": 0.01054787934,
"user": 0.006077153023255816,
"system": 0.005758693023255812,
"min": 0.00941950834,
"max": 0.022888092340000003
},
{
"command": "pacquet@main",
"mean": 0.01049042117606557,
"stddev": 0.0007864612871038078,
"median": 0.01038692934,
"user": 0.006030420409836069,
"system": 0.005697328688524593,
"min": 0.00891998734,
"max": 0.01310883234
},
{
"command": "pnpr@HEAD",
"mean": 0.010616044473027515,
"stddev": 0.0007243522760769688,
"median": 0.010599439839999999,
"user": 0.006647995779816514,
"system": 0.005224261467889908,
"min": 0.00926777834,
"max": 0.013034692340000001
},
{
"command": "pnpr@main",
"mean": 0.010524613339999999,
"stddev": 0.0008754338489280974,
"median": 0.01051750434,
"user": 0.005690266730769231,
"system": 0.006058808653846157,
"min": 0.00873898834,
"max": 0.01287394134
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6099831015999997,
"stddev": 0.043662309454098255,
"median": 2.6117432759,
"user": 2.48883444,
"system": 1.7782253799999999,
"min": 2.5325515459,
"max": 2.6867570619
},
{
"command": "pacquet@main",
"mean": 2.5528714255,
"stddev": 0.04320792022672076,
"median": 2.5482764473999997,
"user": 2.38149494,
"system": 1.68204098,
"min": 2.4979278699,
"max": 2.6529805458999998
},
{
"command": "pnpr@HEAD",
"mean": 1.6058489519,
"stddev": 0.12766891429471994,
"median": 1.6360208003999999,
"user": 1.7795435399999995,
"system": 1.42258108,
"min": 1.4043507789,
"max": 1.7825786579
},
{
"command": "pnpr@main",
"mean": 1.4954803096,
"stddev": 0.0889819938649053,
"median": 1.4836512349,
"user": 1.7637743399999999,
"system": 1.37450728,
"min": 1.3751200069,
"max": 1.6547765149
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.65038975372,
"stddev": 0.0525152911210869,
"median": 0.66681560222,
"user": 1.00751408,
"system": 1.37680004,
"min": 0.57186903622,
"max": 0.72138794322
},
{
"command": "pacquet@main",
"mean": 0.59847545542,
"stddev": 0.029196835021252025,
"median": 0.60480026722,
"user": 0.95856908,
"system": 1.2330945400000002,
"min": 0.55203407422,
"max": 0.64668959022
},
{
"command": "pnpr@HEAD",
"mean": 0.35257336072,
"stddev": 0.009973388871278955,
"median": 0.35120263922000006,
"user": 0.34107118,
"system": 0.65365544,
"min": 0.33927989722000007,
"max": 0.36806620522000005
},
{
"command": "pnpr@main",
"mean": 0.36214489252000004,
"stddev": 0.013692674967357894,
"median": 0.36100429772000003,
"user": 0.34864497999999994,
"system": 0.6829640399999999,
"min": 0.34131189522000005,
"max": 0.3840955602200001
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6524099215799999,
"stddev": 0.02667075237878778,
"median": 1.65311833788,
"user": 0.9749414399999999,
"system": 0.92252718,
"min": 1.61616675488,
"max": 1.68497552488
},
{
"command": "pacquet@main",
"mean": 1.62270077988,
"stddev": 0.023093289564776003,
"median": 1.61969519538,
"user": 0.9105668399999999,
"system": 0.91041978,
"min": 1.5965916228800001,
"max": 1.67854378988
},
{
"command": "pnpr@HEAD",
"mean": 0.30890101678000004,
"stddev": 0.013656602562794039,
"median": 0.30872755688000003,
"user": 0.26506604,
"system": 0.6182401800000001,
"min": 0.29197424788000004,
"max": 0.33349945788
},
{
"command": "pnpr@main",
"mean": 0.32246581058,
"stddev": 0.01756016709660576,
"median": 0.31614609188000004,
"user": 0.27997584000000003,
"system": 0.65042858,
"min": 0.29641317588000005,
"max": 0.35745172888000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.27492848036,
"stddev": 0.011546540234219636,
"median": 0.27435081126000005,
"user": 0.24891996,
"system": 0.32803976,
"min": 0.25417798576,
"max": 0.29593236476
},
{
"command": "pacquet@main",
"mean": 0.26916015006000005,
"stddev": 0.015722602018914716,
"median": 0.26893326926000005,
"user": 0.25918315999999997,
"system": 0.31009425999999995,
"min": 0.24360372276000003,
"max": 0.29510639176000003
},
{
"command": "pnpr@HEAD",
"mean": 0.09345542636000001,
"stddev": 0.003263284127116019,
"median": 0.09314403926,
"user": 0.040080126666666674,
"system": 0.020213874666666666,
"min": 0.08636401776000001,
"max": 0.10062939576000002
},
{
"command": "pnpr@main",
"mean": 0.09435288799333334,
"stddev": 0.0033727403908915196,
"median": 0.09422186926000001,
"user": 0.031328126666666664,
"system": 0.029424493333333326,
"min": 0.08718067876000002,
"max": 0.10237977276000002
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22140639975777782,
"stddev": 0.0076797232222505065,
"median": 0.22181518098,
"user": 0.24745764000000003,
"system": 0.050178837777777784,
"min": 0.20469989698,
"max": 0.23321781398
},
{
"command": "pacquet@main",
"mean": 0.22739708675777776,
"stddev": 0.011588657124793613,
"median": 0.22184940698,
"user": 0.2546277511111111,
"system": 0.043718726666666666,
"min": 0.21357784698,
"max": 0.24821045298
},
{
"command": "pnpm@HEAD",
"mean": 3.84907380398,
"stddev": 0.0840994342154224,
"median": 3.85708832198,
"user": 5.912663195555555,
"system": 0.3799739488888888,
"min": 3.7304939309800003,
"max": 4.02520869898
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.0895037586369697,
"stddev": 0.005074673981410847,
"median": 0.08799022294000002,
"user": 0.08517581212121213,
"system": 0.054245256969696974,
"min": 0.08218873794,
"max": 0.10549915494
},
{
"command": "pacquet@main",
"mean": 0.09016963467529412,
"stddev": 0.0052523898608525296,
"median": 0.08903761544000001,
"user": 0.08646327647058824,
"system": 0.05513532470588236,
"min": 0.08364610294000001,
"max": 0.10803997894000002
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.10291318054285715,
"stddev": 0.0060928759595200695,
"median": 0.10288012540000001,
"user": 0.036550005714285703,
"system": 0.07506794857142855,
"min": 0.09136547440000001,
"max": 0.1195464224
},
{
"command": "pacquet@main",
"mean": 0.10365415805517239,
"stddev": 0.007717101634943145,
"median": 0.1027577744,
"user": 0.03870925448275862,
"system": 0.0735445717241379,
"min": 0.0944852484,
"max": 0.1227094254
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.578009518040001,
"stddev": 0.17301924363731822,
"median": 4.52852377704,
"user": 2.30576386,
"system": 1.62558488,
"min": 4.42257562804,
"max": 4.98857310204
},
{
"command": "pacquet@main",
"mean": 4.75237294454,
"stddev": 0.1563985763408673,
"median": 4.74539145704,
"user": 2.46542946,
"system": 1.8398360799999995,
"min": 4.52222165104,
"max": 5.07406453704
},
{
"command": "pnpr@HEAD",
"mean": 3.7593864467399998,
"stddev": 0.12580594134993825,
"median": 3.7368516305400004,
"user": 2.29369296,
"system": 1.8392822799999997,
"min": 3.55497563804,
"max": 4.02075950304
},
{
"command": "pnpr@main",
"mean": 3.5221145138400005,
"stddev": 0.08482579581720465,
"median": 3.5247714865399997,
"user": 1.9643324600000003,
"system": 1.4503135800000002,
"min": 3.42512376004,
"max": 3.67529647604
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.18720737803499998,
"stddev": 0.026643009159116555,
"median": 0.19044313216,
"user": 0.2348582225,
"system": 0.20891734249999996,
"min": 0.14666280116,
"max": 0.24016860716000002
},
{
"command": "pacquet@main",
"mean": 0.14968992196000003,
"stddev": 0.018643437107244833,
"median": 0.14285538116000002,
"user": 0.18429842666666668,
"system": 0.17377567999999996,
"min": 0.13197041516000002,
"max": 0.19351441916
},
{
"command": "pnpr@HEAD",
"mean": 0.15300919016,
"stddev": 0.005887323360805219,
"median": 0.15248650916,
"user": 0.17914739529411763,
"system": 0.1680466329411765,
"min": 0.14393782116,
"max": 0.16571661116
},
{
"command": "pnpr@main",
"mean": 0.15616214342666665,
"stddev": 0.005145775001390224,
"median": 0.15515841616,
"user": 0.19414849333333334,
"system": 0.15993921333333336,
"min": 0.14924431116,
"max": 0.16657172216000002
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.26531403414,
"stddev": 0.05870877028277704,
"median": 1.24069083954,
"user": 0.67956974,
"system": 0.25792307999999997,
"min": 1.20156888554,
"max": 1.34356990154
},
{
"command": "pacquet@main",
"mean": 1.25541458564,
"stddev": 0.07263266498089838,
"median": 1.2386836135400001,
"user": 0.70100344,
"system": 0.26168568000000003,
"min": 1.15798683854,
"max": 1.3804962765400002
}
]
}Scenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.035736636898695655,
"stddev": 0.0034281715821289863,
"median": 0.035004110039999994,
"user": 0.02642359217391305,
"system": 0.019752350869565206,
"min": 0.030833996040000002,
"max": 0.044428555040000005
},
{
"command": "pacquet@main",
"mean": 0.03299740004000001,
"stddev": 0.0024047006431783865,
"median": 0.03244582304,
"user": 0.024802597303370782,
"system": 0.017800171460674162,
"min": 0.029702021040000002,
"max": 0.04001627604
}
]
} |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #17551 +/- ##
==========================================
+ Coverage 92.67% 92.69% +0.02%
==========================================
Files 1929 1939 +10
Lines 251557 252586 +1029
==========================================
+ Hits 233129 234137 +1008
- Misses 18428 18449 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4fcbac0 to
63b43b6
Compare
Add a metadata domain interface to pnpr-storage and an embedded SQLite
backend for it, opt-in through `metadata: { backend: sqlite }`.
`Storage` now reaches package documents through `PackageMetadata`: read a
view, commit a document under compare-and-set, change a tag, remove a
package, list packages. The documents backend keeps today's behavior. The
SQLite backend stores an npm packument as rows: insert-only version
manifests and READMEs, tags with an insert-only history, deprecations, and
package-level state. Other ecosystems' documents are stored whole. Every
commit that changes rows advances its catalog's (org's) generation once;
hosted npm responses and dist-tag changes report it in `pnpr-generation`.
Reads render the packument from cached per-version fragments and cache the
assembled view by package generation. Each read revalidates the generation
inside its read transaction, so a cached view is never stale. A tag change
reuses every fragment, and a deprecation re-renders one.
Part of pnpm/tasks#244.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A version and revision always name the same bytes, because an unpublished version is tombstoned and never accepted again, so the fragment cache key needs no generation to tell a re-accepted version apart. Drop the `accepted_generation` column too: nothing else in this store reads it. Only the annotation generation stays, since the full packument embeds a version's deprecation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
63b43b6 to
a4db6ff
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoAdd opt-in SQLite storage for hosted package metadata
AI Description
Diagram
High-Level Assessment
Files changed (41)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Address review findings on the SQLite metadata store: - The SQLite store keeps the identity of every removed version in an insert-only table that survives package removal, and refuses to accept one again. Unpublishing a version and removing a package both record it, so no write path, startup recovery of a sealed publish included, can bring a removed version back. The documents backend refuses a version its tombstone lists as removed in the same way. - Unpublishing a package writes its tombstone before it removes anything, and a packument rewrite records removed versions in the tombstone before it writes, so a failure partway never leaves a name claimable. The rewrite no longer needs a rollback. - Document writes carry the principal that asked for them, so a publish, a full-document update, and a journal roll-forward record who moved a tag. The journal keeps each package's publisher for recovery. - `migrate-storage --from` reads another store's metadata from that store's own default database, or from its documents, instead of the configured database. - Reads use their own WAL connections, so they never queue behind a commit or another read's render on the write connection. The render caches are shared by every read connection. - The changeset states each user-visible change in its own sentence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Code review by qodo was updated up to the latest commit 5aafdb7 |
Summary
Implements steps 1–3 of the SQL metadata storage RFC and the parts of its step 4 conformance suite that apply to an embedded backend. Part of pnpm/tasks#244. This is the base of a stack: atomic workspace publication builds on it.
Opt-in with:
What it covers
pnpr_storage::metadata::PackageMetadatais the domain interface: read a package view, commit a package document under compare-and-set, change a tag, remove a package, list packages.Storageroutes every document operation through it, so handlers, the publish journal, search, export, verify and migration all reach metadata through one interface. Archives, records and tombstones stay in theHostedBackend. The existing behavior is thedocumentsbackend.versions,accepted_manifests,tags,tag_history,annotations,readmes, pluspackagesandcatalogs). Every key column isNOT NULL. An npm packument is stored as rows. A version's manifest and README are insert-only: a write that changes them fails with409 version_already_published. Deprecations, tags and package fields change without touching them. The identity of every removed version (package key, version, revision key) goes into an insert-onlyremoved_versionstable that survives package removal, and the store refuses to accept one again with403. Unpublishing a version and removing a package both record it, so no write path can bring a removed version back, including startup recovery of a sealed publish. Cargo, Python and OCI documents are stored whole in the same database. Existing artifact validation and staging are unchanged: archives are verified and promoted before the metadata commit, as today.pnpr-generation: <org>:<n>.PUT/DELETE /-/package/:pkg/dist-tags/:tagnow callsStorage::change_dist_tag. On SQLite that is one row change plus atag_historyrow with the principal and time. Document writes carry a principal too, so a publish, a full-document update and a journal roll-forward record who moved a tag. The journal keeps each package's publisher, so recovery records the original one. It does not rewrite the packument. The documents backend keeps its read-modify-write, moved from the handler intopnpr-storage.SqliteMetadata::render_stats. Each read checks the package generation inside its own read transaction, so a cached view is never served stale. Reads run on their own WAL connections and share the caches, so a read never waits for a commit or another read's render. Two reads that miss one view at once may both render it.409); a stale compare-and-set; restart durability with an identical retry committing nothing (lost commit response); a transaction cut off beforeCOMMITleaving nothing; a cache that missed an invalidation still serving the current view; per-catalog generations; and a schema-version mismatch being refused; a read completing while the write connection holds an open transaction; and a removed version refused by the store, through HTTP with the tombstone deleted, and by startup recovery of a sealed publish (both backends). Integration tests run publish, read, retag, deprecate, unpublish and restart through HTTP with no package document on disk.Also in this PR
pnpr migrate-storage --fromreads another store's metadata from that store's default SQLite database when it has one, and from its documents otherwise, instead of the configured database.Not covered (remaining work for this RFC)
dist.pnproverlays. Making those fragment-level transforms is follow-up work.selected_revisions. pnpr hosts no registry revisions yet, so every hosted version isordinary.publication_outcomes: added with atomic workspace publication (next PR in the stack).pnpr migrate-storagereads through the interface, so it can already move SQLite metadata to documents in an object store, but it has no import into SQLite.pnpr/AGENTS.md).Design notes for review
synchronous=FULL, andBEGIN IMMEDIATEfor writes. Commits are serialized, and a compare-and-set reads the generation it replaces inside its own transaction. Reads take a connection from a small pool ofquery_onlyconnections.HostedDocumentVersion::Generationis the compare-and-set token, so the journal, the unpublish rewrite and the maintainers path keep working unchanged.s3:block, because it is single-instance.Squash Commit Body
Checklist
are implemented in every affected version. (pnpr only.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
pnpr-generationheader. SQLite-backed npm dist-tag changes retain history and publisher attribution.