FDR-0019: Implement scoped repo resolution prototype#271
Open
friedenberg wants to merge 1 commit into
Open
Conversation
Implement the user-visible slice of FDR-0019 entirely within dodder, ahead of the madder env_dir.RepoId grammar change the FDR ultimately routes through. Several named repos can now coexist per scope under a repos/<name>/ layout and are addressed by the name portion of -repo_id (and DODDER_REPO_ID). - internal/bravo/repo_id: new location selector type parsing the FDR grammar (name / .name / ..name / //name / /name / ~name, plus the legacy nameless . / / / empty) with canonical single-dot String(). - env_dir.NestUnderRepoName: append repos/<name>/ to the dodder XDG category dirs so a named repo's whole metadata tree nests. Wired into MakeEnvRepo, genesis OnTheFirstDay, and MakeLocalWorkingCopy. - repo_config_cli: -repo_id / DODDER_REPO_ID accept the full grammar. - env_repo genesis: tolerate a pre-existing default blob store config so named repos in one scope share the content-addressed blob pool while keeping independent metadata/index/identity. Prototype limitations (documented): blobs are shared not isolated (madder re-derives the blob-store XDG); empty id stays legacy user scope; only single-dot cwd depth resolves (..name rejected); /name resolves to system scope (remote-first not implemented). Tests: repo_id grammar unit tests; scoped_repos.bats covers two user-scoped named repos isolated, DODDER_REPO_ID addressing, and multi-dot rejection. Docs: docs/plans/2026-06-14-fdr-0019-scoped-repos-prototype.md. https://claude.ai/code/session_01KnD7hCXXKPqnX1SG4ofL5S
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.
Implements the dodder-side prototype for FDR-0019 (Scoped Repo Resolution), allowing multiple named repositories to coexist per scope under a
repos/<name>/layout while maintaining independent metadata trees.Summary
This PR introduces a new
repo_id.Idtype that extends the legacy location-only selector (.,/, empty) with an optional name and cwd dot-depth, mirroring madder's blob_store_id grammar. Named repos are addressed via the-repo_idflag andDODDER_REPO_IDenvironment variable, with each repo maintaining fully isolated metadata (config, index, inventory log, lock) while sharing the content-addressed blob store.Key Changes
New
internal/bravo/repo_idpackage: Implements the FDR-0019 grammar parser withIdtype supporting:nameor~name(parse-only alias).nameor..name(dot-depth; multi-dot rejected by prototype)//nameor/name(remote-first not implemented).,/, empty (auto)env_dir.NestUnderRepoName: New function that appendsrepos/<name>/to dodder's XDG category directories (data/config/state/cache/runtime), so a named repo's entire metadata tree nests automatically. Blob store XDG is deliberately NOT nested (madder re-derives it, discarding suffixes).Integration points: Wired
repo_id.Idinto three env-construction sites:MakeEnvRepo: Applies nesting for readsOnTheFirstDay(genesis): Applies nesting for initializationMakeLocalWorkingCopyWithOptions: Applies nesting for working copy accessCheckPrototypeSupported()to reject multi-dot cwd depthCLI/config: Updated
repo_config_cli.Config.RepoIdto userepo_id.Idinstead of madder'senv_dir.RepoId; updated flag help text to document the full grammar.Genesis idempotency: Modified
writeBlobStoreConfigIfNecessaryto tolerate pre-existing blob store config, allowing multiple named repos in the same scope to share madder's content-addressed blob pool.Tests:
repo_id/main_test.go): Grammar parsing, canonical round-trip, error cases, depth gatescoped_repos.bats): Two user-scoped named repos isolated,DODDER_REPO_IDaddressing, multi-dot rejectionNotable Implementation Details
Prototype limitations (by design, pending madder env_dir.RepoId change):
default"), preserving backward compatibility.name) resolves;..nameparses but is rejected at resolution/nameresolves straight to system scope; remote-first lookup not implementedMadder projection:
Id.GetMad()converts to madder's legacyenv_dir.RepoIdfor scope routing, so existingMakeDefaultAndInitializelogic continues working unchanged.Documentation: Added
docs/plans/2026-06-14-fdr-0019-scoped-repos-prototype.mdexplaining the prototype scope, limitations, and path to the full FDR implementation.https://claude.ai/code/session_01KnD7hCXXKPqnX1SG4ofL5S