Repository navigation
Key the Postgres tenant on an id minted at Project.init (#109) - #111
Merged
Merged
Conversation
project.json gets a tenant_id at init, preserved by write_spec and the graph migration. Postgres keys the graph on it, so a recreated project at the same path and title starts empty. Projects without one keep their historical tenant, so existing graphs stay readable. open_graph_store / iter_scope_stores gain an optional tenant argument. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fixes #109.
Under the Postgres backend a project's tenant was a hash of root + title (or the song's hash), so a folder removed and recreated with the same path and title inherited the old graph,
project-metarow and stable id.Project.initmintstenant_id(uuid4 hex) intoproject.json.write_specand the legacy-graph migration preserve it.nw.storage.tenant_id_of/FolderStorage.tenant_id/migrate.project_tenant_id: the minted id when present, else the historicalasset_id_ofvalue.open_graph_store/iter_scope_storestake an optionaltenant(string or lazy callable, defaultasset_id); the project graph and the storyboard pass the tenant id.asset_idis untouched and still anchors media references.tests/test_tenant_id.pyuses a stand-inPostgresStorewith one in-memory store perproject_id(no Postgres binary here; the real-Postgres suite skips): remove the folder,Project.initagain at the same path and title, graph is empty (fails without the mint).Compatibility: public API only widened. Existing stored data stays readable: a project without
tenant_idkeeps its historical tenant (so an old project recreated by hand is still exposed; only projects created throughProject.initfrom this version on are protected). SQLite is unaffected (the graph lives in the folder).project.jsongains one key;ProjectSpecignores it. reelee needs no floor bump to keep working; it needs one to get the fix (the next nw release, which this merge publishes).Judged low-stakes (inactive backend, additive), so no adversarial review; full suite 791 passed, 3 skipped.
🤖 Generated with Claude Code