beads/internal/storage
Julian Knutsen f3c47390e7
fix(storage): refuse graph_mode workspaces on library opens (#7721)
#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>
2026-10-20 09:29:54 +00:00
..
backendnames ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
backends ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
batchbench ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
batchfixtures ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
contextinfo ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
createbatchequiv bd versions + a config switch for versioned history — the minimum cut that makes versioned beads usable (#6138) (#6661) 2026-10-18 17:28:16 +00:00
dberrors ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
dbproxy test: fix the three causes of Main's Test (macOS) failures (#7494) 2026-10-11 02:31:35 +00:00
depid ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
dolt fix(storage): refuse graph_mode workspaces on library opens (#7721) 2026-10-20 09:29:54 +00:00
doltutil ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
domain test(storage): versioned-history flag-off differential and statement pins (#6132, #6135) (#7681) 2026-10-19 03:47:00 +00:00
embeddeddolt test(storage): versioned-history flag-off differential and statement pins (#6132, #6135) (#7681) 2026-10-19 03:47:00 +00:00
externaldeps perf(httpclient): remember the server's external-dependency policy across processes (#7700) 2026-10-19 19:05:55 +00:00
fs ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
git ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
historyoffequiv test(storage): versioned-history flag-off differential and statement pins (#6132, #6135) (#7681) 2026-10-19 03:47:00 +00:00
issueops test(storage): versioned-history flag-off differential and statement pins (#6132, #6135) (#7681) 2026-10-19 03:47:00 +00:00
journalscan ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
kvkeys ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
memoryops fix(memory): preserve presence for empty values (#5964) 2026-10-12 19:28:54 +00:00
rowid ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
schema Phase 3 (R20): epoch-transition enforcement + minted-address CAS - gastownhall/beads#6136 (#6664) 2026-10-18 21:20:57 +00:00
sqlbuild fix(sqlbuild): bind time bounds as their UTC instant (#7655) 2026-10-17 16:19:50 +00:00
sqlclass ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
sqlcount ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
storagecontract ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
unsupportedgen ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
uow test(storage): versioned-history flag-off differential and statement pins (#6132, #6135) (#7681) 2026-10-19 03:47:00 +00:00
versioncontrolops ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414) 2026-10-09 05:13:07 +00:00
advanced_queries.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
annotation_queries.go Update internal/storage/annotation_queries.go 2026-03-06 15:40:56 -08:00
batch.go fix(import): tolerate only typed dependency refusals, not walk-query errors (#7630) 2026-10-16 23:55:53 +00:00
batch_apply.go feat(httpclient): BatchApplier over HTTP — handshake cap, dep_add lineage on the wire, gc mappings (S5) (#7265) 2026-10-09 01:05:39 +00:00
batch_apply_test.go feat(httpapi): opt-in large issues:batchApply envelope (≤1000 items, one transaction) (#7051) 2026-10-01 08:32:56 -07:00
batch_close_policy.go fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
batch_close_policy_test.go fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
blocked_recomputer.go fix(http): bd show --current, recompute-blocked and search over http through issueops entries (S6e/S25/S26) (#7528) 2026-10-13 04:12:54 +00:00
blocked_recomputer_test.go fix(http): bd show --current, recompute-blocked and search over http through issueops entries (S6e/S25/S26) (#7528) 2026-10-13 04:12:54 +00:00
BUILD.bazel test(storage): versioned-history flag-off differential and statement pins (#6132, #6135) (#7681) 2026-10-19 03:47:00 +00:00
bulk_issues.go feat(reclaim): scope filters --label/--label-any/--exclude-label/--assignee/--id (wy-jpd3.3) 2026-07-24 05:31:23 -07:00
child_counter_reservation.go fix(create): commit labels during initial issue creation (#4149) 2026-05-24 19:23:46 -07:00
compaction.go fix(compact): archive content before destructive compaction; make restore work (#4464) 2026-06-20 14:12:07 -07:00
config_metadata.go feat: custom status categories (active/wip/done/frozen) 2026-03-21 12:35:03 -07:00
contract_leg_registry_test.go feat(httpclient): write-role conformance on the http leg — ceiling to zero, sweeper extension (S4) (#7251) 2026-10-08 16:28:56 +00:00
dependency_queries.go feat(storage): events + dependents reads, batched blocked, public claim surface (#4926) 2026-07-22 07:41:47 -07:00
diff_store.go perf(export): incremental auto-export via dolt_diff (#5806) 2026-08-22 06:49:19 -07:00
directory_size.go fix(backup): report embedded database size (#4920) (#4928) 2026-07-25 16:14:07 -07:00
directory_size_test.go fix(backup): report embedded database size (#4920) (#4928) 2026-07-25 16:14:07 -07:00
errors_unsupported.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
event_queries.go feat(storage): events + dependents reads, batched blocked, public claim surface (#4926) 2026-07-22 07:41:47 -07:00
federation.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
history_presence.go fix(export): heal the delete wedge — prove deletions via store history instead of refusing forever (#5896) (#6059) 2026-08-29 21:24:29 -07:00
history_viewer.go feat(storage): add ExternalRefHistoryQuerier capability for external-ref history (#4733) 2026-07-12 13:43:27 -07:00
hook_batch_applier.go fix: a re-close that runs on_close, a silent cycle-gate walker, and a leaf that contradicts the wire (#5537) 2026-08-10 02:37:34 -07:00
hook_batch_applier_test.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
hook_batch_closer.go fix(mol): molecule reads, auto-close and close --continue over http through issueops entries (S16) (#7513) 2026-10-12 19:50:34 +00:00
hook_batch_closer_test.go fix(externaldeps): guard explicit claims and batch closes (#6738) 2026-10-01 01:35:54 -07:00
hook_batch_creator.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_batch_getter.go feat(roles): BatchGetter role and POST issues:batchGet (#7248) 2026-10-05 12:09:18 -07:00
hook_blocked_lister.go feat(http): bd blocked over bd serve (blocked.list), plus bd blocked --flags [--raw] (#7649) 2026-10-17 12:29:13 +00:00
hook_blockingannotator.go feat(list): put bd list behind Reader.List and the new BlockingAnnotator role (bd-5k21g) 2026-08-06 02:56:57 +00:00
hook_bootstrapper.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_commenter.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_commenter_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_counter.go feat(issueops): put bd count behind the Counter role (bd-m8hn7) 2026-08-05 05:27:39 +00:00
hook_cycle_detector.go feat(issueops): put bd dep cycles behind the CycleDetector role (bd-wfkbv) 2026-08-05 09:36:14 +00:00
hook_decorator.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
hook_decorator_internal_test.go perf(http): answer a command's repeated reads from one response; bd show --json makes 1 request (port of bd-enterprise e626072b8) (#7588) 2026-10-16 04:26:37 +00:00
hook_decorator_test.go fix(telemetry): wire WrapStorage decorator into bd storage chain (#3858) 2026-07-06 22:27:32 -07:00
hook_deleter.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_dependency_editor.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_dependency_editor_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_edgereader.go feat(issueops): put multi-id bd dep list behind the EdgeReader role (bd-nhsno) 2026-08-05 09:42:06 +00:00
hook_graph_counter.go Add issueops.GraphCounter: how many edges, in one named direction (ga-itny5) (#5485) 2026-08-09 11:29:32 -07:00
hook_heartbeater.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
hook_heartbeater_test.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
hook_init_verifier.go feat(init): put bd init's identity seam behind Bootstrapper and InitVerifier (bd-zl3u8) 2026-08-06 03:01:33 +00:00
hook_issue_claimer.go Add issueops.Claimer and route the HTTP claim through it (#5334) 2026-08-04 08:40:18 -07:00
hook_issue_claimer_test.go Add issueops.Claimer and route the HTTP claim through it (#5334) 2026-08-04 08:40:18 -07:00
hook_issue_operations.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
hook_issue_operations_test.go feat(http): bd heartbeat over bd serve (issues.heartbeat), and close the re-arm orphan-lease race (#7600) 2026-10-16 22:38:23 +00:00
hook_issue_reader.go feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00
hook_issue_reader_test.go test(telemetry,storage): pin the Reader decorators the way Lifecycle is pinned 2026-07-31 18:37:26 +00:00
hook_lease_reclaimer.go feat(roles): LeaseReclaimer role, POST issues:reclaim, and bd reclaim on both routes (S9) (#7412) 2026-10-09 14:56:32 +00:00
hook_lease_reclaimer_test.go feat(roles): LeaseReclaimer role, POST issues:reclaim, and bd reclaim on both routes (S9) (#7412) 2026-10-09 14:56:32 +00:00
hook_memories.go Put the memory plane behind memoryops, conformance-tested at three backends (#5387) 2026-08-07 03:57:04 -07:00
hook_metadata_cas.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
hook_metadata_cas_test.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
hook_molecule_stepper.go fix(mol): molecule reads, auto-close and close --continue over http through issueops entries (S16) (#7513) 2026-10-12 19:50:34 +00:00
hook_querier.go feat(query): put bd query behind the Querier role and stop it dropping matches (bd-pohmh) 2026-08-05 16:36:05 +00:00
hook_ready_claimer.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_ready_claimer_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_ready_counter.go feat(ready): put bd ready's published total behind the ReadyCounter role (bd-s10oa) 2026-08-05 09:47:24 +00:00
hook_relations.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_relations_test.go feat(issueops): put every issue capability behind one library surface 2026-08-04 12:27:56 -07:00
hook_releaser.go Add issueops.Releaser: give a claim back, optionally only a named holder's (#5482) 2026-08-09 07:48:56 -07:00
hook_releaser_test.go Add issueops.Releaser: give a claim back, optionally only a named holder's (#5482) 2026-08-09 07:48:56 -07:00
hook_role_census_test.go Publish POST /v0/beads/issues/{id}/comments, the wire half of issueops.Commenter (ga-rslox) (#5594) 2026-08-10 18:59:57 -07:00
hook_stats_reporter.go feat(issueops): put bd status behind the StatsReporter role (bd-4ze25) 2026-08-05 09:27:16 +00:00
hook_sweeper.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_tree_walker.go feat(issueops): put bd dep tree behind the TreeWalker role (bd-lx5iu) 2026-08-06 03:09:18 +00:00
hook_version_reconciler.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
hook_workspace_config.go Trim this series' comments toward the repo's own density 2026-08-06 08:06:59 +00:00
issue_create_dependencies.go feat(storage): one guarded issue-lifecycle surface for the CLI and linked consumers (#5191) 2026-07-31 11:26:38 -07:00
iter.go Reapply "Simplify the supported backends: roll back the direct PostgreSQL and MySQL adapters" (#4857) 2026-07-18 02:43:56 +00:00
journal_facade_test.go feat(journalops): the mutation journal becomes the third facade namespace (#5552) 2026-08-10 10:58:05 -07:00
leg_contract_wiring_test.go Phase 3 (R20): epoch-transition enforcement + minted-address CAS - gastownhall/beads#6136 (#6664) 2026-10-18 21:20:57 +00:00
merge_slot.go feat: add MergeSlot methods to Storage interface (fix-merge PR #2787) 2026-03-26 19:34:21 -07:00
metadata.go fix(contracts): JSON contract fixes before 1.3.0 freezes them — string revision tokens, --set-metadata scalar typing, create --json nano timestamps (#6053) 2026-08-29 05:20:27 +00:00
metadata_cas.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
metadata_cas_test.go Add issueops.MetadataCAS: compare-and-set over one metadata key (#5473) 2026-08-09 04:15:34 -07:00
metadata_edit_value_test.go fix(contracts): JSON contract fixes before 1.3.0 freezes them — string revision tokens, --set-metadata scalar typing, create --json nano timestamps (#6053) 2026-08-29 05:20:27 +00:00
metadata_jsonpath_test.go fix(query): make slash and mixed-case metadata keys queryable (#4896) 2026-07-24 17:52:22 -07:00
metadata_schema_test.go feat: config-driven metadata schema enforcement (GH#1416 Phase 2) (#2027) 2026-02-24 22:24:56 -08:00
metadata_test.go feat: allow UpdateIssue metadata updates via json.RawMessage/[]byte (#1417) 2026-02-03 17:55:23 -08:00
remote.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
remote_ref.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
remote_ref_test.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
role_accessor_decorator_test.go feat(http): bd blocked over bd serve (blocked.list), plus bd blocked --flags [--raw] (#7649) 2026-10-17 12:29:13 +00:00
storage.go perf(httpclient): remember the server's external-dependency policy across processes (#7700) 2026-10-19 19:05:55 +00:00
sync.go /internal/storage: add interfaces for methods not covered by Storage 2026-03-06 15:30:10 -08:00
version_control.go fix: commit server-mode config and memory writes (GH#4078, carries #4383) (follow-up to #7299) (#7608) 2026-10-16 13:48:30 +00:00
version_lister.go bd versions + a config switch for versioned history — the minimum cut that makes versioned beads usable (#6138) (#6661) 2026-10-18 17:28:16 +00:00
versioned.go feat(storage): carry the git data ref of a git-backed Dolt remote (#6521) 2026-09-27 15:56:18 -07:00
wake_defers.go fix(deps): enforce external capability blockers across ready/claim/close (#4769) (#4753) 2026-09-02 16:56:23 -07:00