Skip to content

repo_id: apply CheckSupported on serve/info env paths so deferred scopes error instead of silently mis-resolving #273

@friedenberg

Description

@friedenberg

Context

FDR-0019 added repo_id.CheckSupported to reject the not-yet-implemented repo-id scopes — cwd dot-depth > 1 (..name) and XDG system (//name) — at the core repo builders (command_components_dodder.MakeEnvRepo, genesis, MakeLocalWorkingCopyWithOptions). Those builders cleanly req.Cancel with "system scope is not yet resolvable" / "cwd dot-depth > 1 is not yet implemented".

Gap

A few env-construction paths consume config.RepoId (via repo_id.EffectiveName) but never call CheckSupported, so an unsupported scope silently mis-resolves to a home/cwd repo instead of erroring:

  • go/internal/echo/command_components/env.goMakeEnvWithOptions / MakeEnvWithXDGLayoutAndOptions. This is the env path serve and serve-proto use (then MakeLocalWorkingCopyFromEnvLocal, which also omits the gate). dodder serve -repo_id //backup opens a user-scope repos/backup/ tree with no diagnostic.
  • go/internal/uniform/commands_dodder/info.go — the info env / info xdg subcommands (around lines 113/127) build env_dir.MakeDefault directly and ignore the selector's location type; read-only, but report paths for the wrong scope.
  • go/internal/tango/command_components_dodder/env_repo.goCheckSupported only rejects XDGSystem and cwd-depth>0; obscure %name (XDGCache) and _name (Unknown-with-name) prefixes pass and route to MakeDefault bound to repos/<name>/ regardless of the spelled scope.

Suggested fix

Either call repo_id.CheckSupported(config.RepoId) on the serve/info env paths (so the deferred scopes give the same clean error everywhere), or broaden CheckSupported to reject every location type that isn't yet wired (only XDGUser and Cwd are resolvable today) rather than enumerating just XDGSystem.

Severity

Low / polish — only affects the explicitly-deferred P2/P3 scopes (system, multi-dot) plus obscure cache/unknown prefixes. The common scopes (XDG user name, cwd .name) work correctly. Surfaced by the pre-merge review of the FDR-0019 P1 layout migration.

Environment

dodder smart-pine branch (FDR-0019 P1 scoped-repos layout migration), git rev-parse HEAD at filing time.

:clown: via clown 0.4.1+0a1cc53 (amarbel-llc/clown@0a1cc53)

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds triage / scoping before work begins

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions