Skip to content

Adopt rocksdb-js getRegistryStatus() in place of the deprecated registryStatus() alias - #3429

Merged
cb1kenobi merged 11 commits into
mainfrom
adopt-get-registry-status
Oct 23, 2026
Merged

cb1kenobi merged 11 commits into
mainfrom
adopt-get-registry-status

Conversation

@cb1kenobi

@cb1kenobi cb1kenobi commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Moves Harper off rocksdb-js's deprecated registryStatus() alias and calls getRegistryStatus() directly. No runtime behavior changes.

⊙ Problem

rocksdb-js 2.11.0 renamed registryStatus() to getRegistryStatus() (HarperFast/rocksdb-js#887 — Add getRegistryStatus() and deprecate the registryStatus() alias). The old name is now a deprecated alias that rocksdb-js v3.0.0 removes. Harper pins 2.12.0 but still calls the old name everywhere. Closes #3359.

❓ Your call: is a standalone rename worth a PR now?

Yes: it is mechanical, and doing it now means the rocksdb-js v3 bump will not break on a removed export. Folding it into that bump instead would mix a rename into a riskier change.

💡 Solution

  • Every import and call now uses getRegistryStatus(). It is the same function, so behavior does not change.
  • Long-lived transaction reporting calls it directly. The typeof guard and its early returns covered rocksdb-js versions the exact 2.12.0 pin rules out.
  • Tests inject a fake registry through a module-local reader, which works under the compiled build and typestrip alike.

⚖️ Alternatives

  • Also migrate harper-pro: nothing to do. Its only uses live in its core submodule and follow the next pointer bump.
  • Patch the rocksdb-js export from testUtils: tried in an earlier commit. Under typestrip the module binds the separate ESM build, so the fake never applies.
  • Node registerHooks fake in a child process: works under both loaders, but moves about 40 tests into a child.

❓ Your call: overrule the planning review's forwarding helpers?

It suggested keeping fakeRegistryStatus/restoreRegistryStatus and forwarding them to the setter. Overruled on size: against main, that is 124 changed test lines plus a helper, versus 26 rename-only lines here.

❓ Your call: also drop the transactionDetails degraded branch?

Kept, with its warning reworded. The 2.12.0 pin makes it unreachable, and removing it also deletes its test. A small follow-up if you want it gone.

🔧 Changes

✅ Verification

End-to-end route: the existing integration suite, which drives drop, branch and backup/restore through these call sites.

Full unit gates and lint (run before the seam change)
  • test:unit:main (excluding applicationSpawn.test.js, which hangs locally): 7351 passing, 16 failing. All 16 fail the same way on base (module resolution, preload, process-group and bundle-pack suites).
  • test:unit:resources: 4494 passing, 1 failing (transaction.test.js audit refs). That file passes 49/49 on its own, on both branch and base, so the failure is order-dependent.
  • Build, typecheck and prettier pass. oxlint's only warning is in authCredentialDeferral.test.js, which this PR does not touch.

🤖 Generated by Claude Code (Claude Opus 5.5); posted via @cb1kenobi.

Release target: main — dependency-API rename, no backport needed

Related PRs: #3323 overlaps (merged; added the evictionBusy.test.js call site migrated here), #3430 overlaps (its resources/DESIGN.md prune commits are carried here; identical hunks)
Complexity: easy
Framing-Verdict: better-alternative-exists (3815b60cf479)

Review-Coverage: authored=claude; ran=codex,gemini,cursor-grok,cursor-muse; adjudicated=domain; declined=cursor-composer,cursor-kimi; rounds=3; full=2 @ 5bf547d

Review-Attention: study ~15m (critical: rocksdbBackup.ts, branchDatabase.ts +2; decisions: retain-transactiondetails-fallback, setter-default-restores) @ 5bf547d

…tryStatus() alias

rocksdb-js 2.11.0 renamed registryStatus() to getRegistryStatus() and kept the
old name as a deprecated alias slated for removal in v3.0.0. Harper pins 2.12.0,
so switch every call site, log message, and design note to the new name.

Closes #3359

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cb1kenobi cb1kenobi self-assigned this Oct 21, 2026
@cb1kenobi cb1kenobi added this to the v5.4 milestone Oct 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates references from registryStatus to getRegistryStatus across the codebase, including documentation, database resources, transaction managers, and unit tests, to align with the updated @harperfast/rocksdb-js library. Feedback suggests simplifying the initialization of registryStatusFn in resources/longLivedTransactions.ts by removing a redundant runtime check, as getRegistryStatus is unconditionally imported.

Comment thread resources/longLivedTransactions.ts Resolved
cb1kenobi and others added 2 commits October 21, 2026 15:39
The typeof feature-detect and the module-level registryStatusFn existed for
rocksdb-js versions without the registry API; the exact 2.12.0 pin rules those
out. Drop the indirection and the setRegistryStatusForTests seam, and have tests
stub the rocksdb-js export through testUtils' fakeRegistryStatus instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md bars new sinon uses, and testUtils already has a plain save-and-assign
stub. Note in the helper that the fake only reaches the CommonJS build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cb1kenobi
cb1kenobi marked this pull request as ready for review October 21, 2026 21:30
@github-actions
github-actions Bot requested a review from kriszyp October 21, 2026 21:30

@kriszyp kriszyp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Reviewed with Codex

Comment thread unitTests/testUtils.js Resolved
cb1kenobi and others added 7 commits October 22, 2026 21:53
… export

Patching rocksdb-js's CommonJS export never reaches the reporter under
--conditions=typestrip, which binds the package's separate ESM build, so the
synthetic-registry tests would read the real registry there. Restore a
module-local reader with setRegistryStatusForTests, which works under either
loader, and drop the testUtils export-patching helpers. The dead typeof
feature-detect and its early returns stay removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The warning described transactionDetails as a property of the returned array
and offered upgrade advice the exact 2.12.0 pin makes moot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#3322 and #3084 each passed the design-doc check alone and together took
the file to 1001 lines, failing Lint Source Code on main. Tighten the
nested-selection convention and the RocksDB teardown note; no facts dropped
beyond restatements. 991 lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dispatch-Task: main-red-kriszyp_harper_0a030f35a_5684deb1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dispatch-Task: main-red-kriszyp_harper_0a030f35a_5684deb1
Main added 13 lines to resources/DESIGN.md after #3430's prune branched, so
that prune alone leaves the file at 1004 lines. Tighten two notes in the
audit-clock section; only a stage-history clause is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cb1kenobi
cb1kenobi merged commit 489eebc into main Oct 23, 2026
50 of 53 checks passed
@cb1kenobi
cb1kenobi deleted the adopt-get-registry-status branch October 23, 2026 05:18
kriszyp added a commit that referenced this pull request Oct 23, 2026
Apply the resources/DESIGN.md pruning already merged in #3429, preserving this branch's confirmation eligibility notes.

Dispatch-Task: pr-maint-355475e820ee481125db34713182ae84

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 23, 2026
Apply the resources/DESIGN.md prose-only trim from main commit 489eebc (#3429), reducing the note from 1014 to 998 lines so the design-doc gate passes on this PR without rebasing or changing runtime behavior.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
github-actions Bot pushed a commit that referenced this pull request Oct 23, 2026
Apply the resources/DESIGN.md prose-only trim from main commit 489eebc (#3429), reducing the note from 1014 to 998 lines so the design-doc gate passes on this PR without rebasing or changing runtime behavior.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 23, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 24, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
github-actions Bot pushed a commit that referenced this pull request Oct 24, 2026
Apply the resources/DESIGN.md prose-only trim from main commit 489eebc (#3429), reducing the note from 1014 to 998 lines so the design-doc gate passes on this PR without rebasing or changing runtime behavior.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 24, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 26, 2026
…ersion (#3402)

* Send each MQTT client the CONNACK refusal code of its own protocol version

mqtt-packet writes reasonCode to a v5 client and returnCode to a 3.1.1
client, but the refusal sites had the two swapped, so a v5 client got the
3.1.1 code and the reverse. Bad credentials are now 0x86 / 4, not
authorized 0x87 / 5, unspecified 0x80 / 5. An authorizeClient error whose
numeric code is an HTTP status is mapped to Not authorized instead of being
written to the wire; a code is passed on only if it is a refusal code in the
client's own version.

Refs #3298

Dispatch-Task: harper-mqtt-connack-reason-codes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeYyDXfTjDKHwpzUXyTHDZ

* Send 3.1.1 "server unavailable" for an unspecified CONNACK refusal and pass on only CONNACK-legal v5 codes

Dispatch-Task: harper-mqtt-connack-reason-codes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeYyDXfTjDKHwpzUXyTHDZ

* Refuse a bare authorizeClient throw as Not authorized, not as a server fault

A hook refuses a CONNECT by throwing, usually a plain Error. That reached a
3.1.1 client as return code 3 (server unavailable), which clients retry, for
what is a permanent denial. The hook now has its own catch that defaults to
Not authorized; storage and takeover failures keep the unspecified code.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs: reuse upstream design-note trim to restore lint budget

Apply the resources/DESIGN.md prose-only trim from main commit 489eebc (#3429), reducing the note from 1014 to 998 lines so the design-doc gate passes on this PR without rebasing or changing runtime behavior.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf

Co-Authored-By: GPT-5 Codex <noreply@openai.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-5 Codex <noreply@openai.com>
github-actions Bot pushed a commit that referenced this pull request Oct 26, 2026
Apply the resources/DESIGN.md prose-only trim from main commit 489eebc (#3429), reducing the note from 1014 to 998 lines so the design-doc gate passes on this PR without rebasing or changing runtime behavior.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 26, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 27, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 27, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 28, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 29, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 29, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 29, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 30, 2026
…wn protocol version (conflicts → v5.3) (#3555)

* Send each MQTT client the CONNACK refusal code of its own protocol version

mqtt-packet writes reasonCode to a v5 client and returnCode to a 3.1.1
client, but the refusal sites had the two swapped, so a v5 client got the
3.1.1 code and the reverse. Bad credentials are now 0x86 / 4, not
authorized 0x87 / 5, unspecified 0x80 / 5. An authorizeClient error whose
numeric code is an HTTP status is mapped to Not authorized instead of being
written to the wire; a code is passed on only if it is a refusal code in the
client's own version.

Refs #3298

Dispatch-Task: harper-mqtt-connack-reason-codes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeYyDXfTjDKHwpzUXyTHDZ

* Send 3.1.1 "server unavailable" for an unspecified CONNACK refusal and pass on only CONNACK-legal v5 codes

Dispatch-Task: harper-mqtt-connack-reason-codes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BeYyDXfTjDKHwpzUXyTHDZ

* Refuse a bare authorizeClient throw as Not authorized, not as a server fault

A hook refuses a CONNECT by throwing, usually a plain Error. That reached a
3.1.1 client as return code 3 (server unavailable), which clients retry, for
what is a permanent denial. The hook now has its own catch that defaults to
Not authorized; storage and takeover failures keep the unspecified code.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs: reuse upstream design-note trim to restore lint budget

Apply the resources/DESIGN.md prose-only trim from main commit 489eebc (#3429), reducing the note from 1014 to 998 lines so the design-doc gate passes on this PR without rebasing or changing runtime behavior.

Dispatch-Task: pr-maint-3d73ce37e83a10641219417272e78bdf

Co-Authored-By: GPT-5 Codex <noreply@openai.com>

* Resolve the v5.3 cherry-pick conflict in the resources design notes

Keep the upstream prose trim of the audit-record clocks paragraph (the
commit's own change, on a paragraph v5.3 has). Drop the two notes the
conflict hunk pulled in from main, the RocksDB teardown wrapper note
(#3201) and the .mdb rescan note (#3065): both are v5.4 changes whose
code is not on v5.3. v5.3's note stays under the design-doc line budget.

Dispatch-Task: cherry-resolve-kriszyp_harper_3402-f9635b6b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UYJCjxjMDRrj8hBGJebKRi

---------

Co-authored-by: Kris Zyp <kriszyp@gmail.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 30, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Oct 31, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Nov 1, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Nov 2, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Nov 2, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Nov 2, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
kriszyp added a commit that referenced this pull request Nov 5, 2026
Reuse the prose-only cleanup already merged in #3429 so this branch passes the design-documentation lint gate without unrelated runtime changes.

Dispatch-Task: pr-maint-f92ba507f948d116e9103e9b6cf148ff

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt rocksdb-js getRegistryStatus() in place of the deprecated registryStatus() alias

2 participants