fix(devtools,world-model): resolve atomic fingerprint to artifact version in store and inspector - #10
Open
Adityakk9031 wants to merge 1 commit into
Conversation
…sion in store and inspector
Author
|
@josemontesdeoca have a look |
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
Fixes a critical disconnect in the DevTools S4 inspector where clicking through DAG / timeline frames fails with
404 Not Foundwhenever a node's@atomicfingerprint differs from the store's serialized artifact version.Root Cause
atomicVersion: receipt.fingerprints["@atomic"]./api/node/:id?version=<atomicVersion>.FileSystemWorldModelStoreandInMemoryWorldModelStore, commits were persisted and keyed strictly by raw artifact content addressversion = contentAddressOf(serializeArtifact(files))(stored underversions/<contentAddress>.bin).@atomicfingerprint differs from the whole-artifact byte hash (such as subset facet indexing, projection normalization, or custom canonicalizers),store.readVersion(node, atomicVersion)returnednull.404 Not Found({"error": "no world-model for node@version"}), completely breaking the S4 click-through inspector for those nodes.Changes
packages/reactor/src/world-model/fs-store.ts:commitPublished: Whenfingerprints[ATOMIC_FACET]differs fromversion, an alias pointer file is written atomically atversions/<atomicFp>.aliascontaining the canonical artifact version address.readVersion: Ifversions/<version>.binis not found, checkversions/<version>.aliasand dereference to the artifact version. Also checkspublished.jsonpointer if it matches the current published atomic facet.packages/reactor/src/world-model/store.ts:readVersionaccepts either artifact content address or atomic facet fingerprint.#aliasesmap toInMemoryWorldModelStoreand fallback alias resolution to match filesystem store semantics.packages/reactor-devtools/src/data/index.ts:readNodeWorldModel: Added defensive fallback against published pointer.openWorldModels: Added support for bothworld-models/andworld-model/directories.packages/reactor-devtools/src/server/index.ts:?version=.packages/reactor/src/world-model/__tests__/fs-store-alias.test.tstesting alias resolution across bothFileSystemWorldModelStoreandInMemoryWorldModelStore.packages/reactor-devtools/src/server/server.test.tsensuringGET /api/node/:id?version=<atomicVersion>returns 200 and loads the node's world-model when the atomic fingerprint differs from the artifact version.Verification
node --test packages/reactor/dist/world-model/__tests__/fs-store-alias.test.js(2/2 passing)node --test packages/reactor-devtools/dist/server/server.test.js(8/8 passing)node --test packages/reactor-devtools/dist/data/*.test.js(33/33 passing)node --test tools/eval-harness/eval-harness.test.mjs(10/10 passing)