Skip to content

backfill missing compat manifest on open - #952

Open
chm-diederichs wants to merge 1 commit into
mainfrom
backfill-compat-manifest
Open

chm-diederichs wants to merge 1 commit into
mainfrom
backfill-compat-manifest

Conversation

@chm-diederichs

Copy link
Copy Markdown
Contributor

Cores migrated from hypercore 10 storage can have blocks but no stored manifest. On open, if the stored tree signature verifies against the default signer manifest for the key, persist that manifest.

Cores migrated from hypercore 10 storage can have blocks but no stored
manifest. On open, if the stored tree signature verifies against the
default signer manifest for the key, persist that manifest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chm-diederichs
chm-diederichs requested a review from a team November 13, 2026 11:31
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5 Tier: apex

[Medium impact] The change affects writable Hypercore opens that have a missing manifest.

The PR appears safe to merge, with a non-blocking gap in the persistence test.

Fix All in Claude CodeFindings

  1. P2 Test misses unsaved manifests ▶
Fix with agent prompt
### Issue 1
test/manifest.js:1822-1824
The “manifest persisted” check can pass even if nothing was saved. `again.ready()` runs recovery again when storage still has no manifest, so removing the recovery write would leave this assertion green. Check the stored `getAuth()` result after the first recovery, or reopen with read-only storage so recovery cannot hide a missing write.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Restores a missing compat manifest on open when the stored tree signature verifies against the core key.

  • Writable opens restore a missing compat manifest when its tree signature verifies.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Open stored core] --> B{Manifest missing and storage writable?}
  B -- No --> F[Finish opening]
  B -- Yes --> C{Stored signature verifies?}
  C -- No --> F
  C -- Yes --> D[Set default signer manifest]
  D --> E[Save manifest]
  E --> F
Loading

Reviews (1) · Last reviewed commit: "backfill missing compat manifest on open" · Reviewed by Greptile

Comment thread test/manifest.js
Comment on lines +1822 to +1824
const again = await open(key)
await again.ready()
t.ok(again.core.header.manifest, 'manifest persisted')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Test misses unsaved manifests

The “manifest persisted” check can pass even if nothing was saved. again.ready() runs recovery again when storage still has no manifest, so removing the recovery write would leave this assertion green. Check the stored getAuth() result after the first recovery, or reopen with read-only storage so recovery cannot hide a missing write.

Prompt To Fix With AI
This is a comment left during a code review.
Path: test/manifest.js
Line: 1822-1824

Comment:
**Test misses unsaved manifests**

The “manifest persisted” check can pass even if nothing was saved. `again.ready()` runs recovery again when storage still has no manifest, so removing the recovery write would leave this assertion green. Check the stored `getAuth()` result after the first recovery, or reopen with read-only storage so recovery cannot hide a missing write.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

This branch has not been deployed

No deployments
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.

1 participant