#7671 fences graph workspaces in cmd/bd: command admission, the store
factories and the other CLI paths refuse one, and #7722 extends that
fence to a .beads holding the graph-preview-format marker whatever its
metadata says. But the public library opens (beads.OpenBestAvailable,
OpenBestAvailableWith, OpenFromConfig, OpenGated) and the Dolt store's
metadata-driven constructors (NewFromConfig, NewFromConfigWithOptions,
NewFromConfigWithCLIOptions) still opened either kind of graph workspace
as an Issue store and ran Issue schema migrations into the graph
database (or, with no metadata beside the marker, created an Issue
database inside the graph workspace).
- Move the typed refusal into internal/configfile
(UnsupportedWorkspaceFormatError with BeadsDir, GraphMode and
FormatMarker; CheckWorkspaceFormat; GraphFormatMarkerFile;
HasGraphFormatMarker) with byte-identical text and hints for both the
graph_mode and the marker refusal, and move cmd/bd's discovery
pre-checks there as LoadAndCheckWorkspaceFormat and
CheckDiscoveredWorkspaceFormat (LoadForDiscovery, which never migrates
a legacy config.json; unreadable metadata beside the marker is refused
as the marker's format). cmd/bd's checkWorkspaceFormat,
loadAndCheckWorkspaceFormat, hasGraphFormatMarker and
checkDiscoveredWorkspaceFormat become thin delegates, so the CLI keeps
its behaviour (exit 16 with the same hints) and every caller of them is
unchanged; bootstrap's ancestor walk builds the configfile type.
- Every public metadata-driven open runs CheckDiscoveredWorkspaceFormat
as its first statement: before OpenGated takes its gates and before
OpenBestAvailableWith's Load can migrate config.json. A refused open
leaves the workspace byte-identical. The type is exported as
beads.UnsupportedWorkspaceFormatError.
- The Dolt constructors run CheckDiscoveredWorkspaceFormat before
configfile.Load, so a graph workspace marked only by a legacy
config.json, or by the marker beside stripped, missing or unparseable
metadata, is refused before Load can migrate it into metadata.json
(and drop graph_* keys this build does not know). requireDoltBackend
re-checks the loaded config as a backstop, so they also refuse before
resolving a server or writing a port file or Dolt root.
Tests: configfile unit tests for both refusals (exact marker text and
hint, graph_mode winning over the marker, unparseable metadata with and
without the marker); the public opens and the three Dolt constructors
against graph_mode workspaces and against marker-only, stripped
(metadata.json and legacy config.json), server, explicit dependency and
unparseable-metadata marker workspaces, each refused with the typed
error and the workspace left unchanged.
Agent-Signature: claude-code-claude-opus-5-5-unknown-reasoning on behalf of Julian Knutsen
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>