Commit graph

9,011 commits

Author SHA1 Message Date
matt wilkie
4dc8dbd2c2
test(export): assert byte-stable JSONL across all record types (#4086)
TestExportMemoryDeterminism (GH#3474) proves only memory lines are
stable. This generalizes the invariant from gh beads 3787: running
`bd export` repeatedly over unchanged data must produce byte-identical
output for every record type, not just memories.

The new test seeds issues at the same priority and creation time (so the
export ORDER BY must fall through to the id tiebreaker — the total-order
property the determinism guarantee depends on), each with multiple
labels, parent-child dependencies, and comments, plus several memories
keyed out of sorted order. It exports five times and asserts every run
is byte-identical, then sanity-checks that each record type was actually
present so a future change can't make the stability assertion pass
vacuously.

Catches any future collection serialized without a stable total order
(Go's randomized map iteration being the usual culprit) before it ships,
rather than spot-fixing per record type.

_claude-opus-4-7-medium on behalf of matt wilkie_

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 23:08:23 -07:00
matt wilkie
3ede7aca4b
Merge pull request #4087 from maphew/fix/4033-empty-auto-export
fix(export): guard empty auto-export over populated JSONL
2026-05-21 22:36:00 -07:00
matt wilkie
9e956dba4e fix(export): guard empty auto-export over populated JSONL
Skip auto-export before writing when the current export would contain no issue records but the target JSONL already contains issues. This prevents an opt-in auto-export from deleting the only visible issue export in empty-DB migration/recovery scenarios.

Add JSONL issue counting coverage and a subprocess regression that preserves a populated export target when a memory-only write triggers auto-export.

Fixes GH#4033.

_codex-gpt-5.5-medium on behalf of matt wilkie_
2026-05-21 22:23:37 -07:00
matt wilkie
73fcd7e639
Merge pull request #4041 from medhatgalal/AI/import-path-config-upstream
Preserve contributor branch commits and land configurable JSONL import path support from PR #4041.

_codex-gpt-5.5-medium on behalf of maphew_
2026-05-21 22:23:17 -07:00
Medhat Galal
99565c0d25 Merge remote-tracking branch 'upstream/main' into AI/import-path-config-upstream
# Conflicts:
#	cmd/bd/config.go
#	cmd/bd/init_templates.go
#	docs/CLI_REFERENCE.md
#	docs/CONFIG.md
#	website/docs/cli-reference/config.md
#	website/versioned_docs/version-1.0.0/cli-reference/config.md
#	website/versioned_docs/version-1.0.4/cli-reference/config.md
2026-05-22 00:40:02 -04:00
Julian Knutsen
220e552a46
fix(init): tighten Dolt marker handling (#4083) 2026-05-21 20:00:36 -07:00
matt wilkie
3988db7e0d
fix(init): make JSONL auto-export opt-in (#4063)
* fix(init): make JSONL auto-export opt-in

Default export.auto and export.git-add to false for new repos, make the init prompt opt-in, and update docs/tests to describe JSONL as an optional viewer/interchange/backup export rather than core sync behavior.

Fixes GH#4062

* refactor(auto-export): check commit before throttle

Move cheap Dolt commit change detection ahead of the auto-export throttle and extract the throttle decision into a tested helper. This keeps the default-off design while carrying the compatible part of Jeremy Longshore's GH#4061 refactor.

Based-on: 313e1f8258

Co-authored-by: jeremylongshore <jeremylongshore@users.noreply.github.com>

* docs: regenerate versioned CLI references
* docs: call out JSONL export opt-in change

---------

_codex-gpt-5.5-medium on behalf of CI Bot_
_codex-gpt-5.5-high on behalf of matt wilkie_
Co-authored-by: CI Bot <ci@beads.test>
2026-05-21 16:21:00 -07:00
Julian Knutsen
e6d825d265
Merge pull request #4079 from gastownhall/fix/server-init-dolt-marker-complete
fix(init): mark server-mode Dolt dirs compatible
2026-05-21 16:12:12 -07:00
Julian Knutsen
8ba0b468df fix(init): surface marker write failures 2026-05-21 22:55:27 +00:00
Julian Knutsen
f4c3adf768 fix(init): mark server-mode Dolt dirs compatible 2026-05-21 22:55:27 +00:00
Harry Miller
9ca6b51b47
ci(nix): auto-update default.nix vendorHash on dependabot Go bumps (#3804)
* chore: track workflow formulas for portability

Force-add gh-issue-to-pr and gh-pr-review formulas so they can be
cloned to new machines. These live in .beads/formulas/ which is
normally gitignored, but formulas are code (not database state).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: untrack workflow formulas

Remove gh-issue-to-pr and gh-pr-review formulas from git tracking.
These are already covered by .gitignore (.beads/) and shouldn't be
sent upstream.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* ci(nix): auto-update vendorHash for dependabot Go bumps (beads-bz5)

Dependabot Go-module bumps consistently fail the `nix build .#default`
CI gate because default.nix has a hardcoded vendorHash that any
go.mod/go.sum change invalidates. PRs sit stuck for days (#3468, #3637,
#3638 currently affected) until a maintainer manually computes the new
hash. This workflow detects the drift, runs the existing
scripts/update-nix-vendorhash.sh, and pushes the hash bump back to the
dependabot branch.

Uses pull_request_target because GITHUB_TOKEN is read-only on
pull_request workflows triggered by dependabot. Safety guards: only
runs when actor and PR user are both dependabot[bot] AND the PR head
is on the upstream repo (dependabot never opens PRs from forks).

Caveat documented in CONTRIBUTING.md: GitHub does not retrigger
pull_request workflows on GITHUB_TOKEN-authored commits, so a
maintainer may need to re-run nix-build once after the auto-fix push.
The workflow's own success serves as the green signal that the hash
is correct.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-21 15:36:16 -07:00
Stephanie Jarmak
05c7835e9d
feat(storage): honor .beads/config.yaml types.custom in server-side validation (#4024) (#4026)
* feat(storage): honor .beads/config.yaml types.custom in server-side validation (#4024)

ResolveCustomTypesInTx previously consulted config.GetCustomTypesFromYAML
only in a narrow error-fallback path: when both the custom_types table AND
the types.custom config-string read had failed. As a result, a project that
declared types.custom in .beads/config.yaml (the version-controlled config
shape that downstream wrappers like gastownhall/gascity expect) could not
create or update beads of those types — server-side schema validation
rejected them because it never saw the YAML entries.

Overlay model (per #4024's proposed behavior):
  - Built-in types stay as the enforced floor (handled by IsValidWithCustom).
  - Database custom_types are the next layer (operator-/agent-installed types).
  - .beads/config.yaml types.custom is the topmost union-add (project-extension
    types declared in version-controlled config).
  - A bead whose type is in none of the three still fails validation cleanly.

Extracts mergeWithYAMLCustomTypes(dbTypes, yamlGetter) as a pure helper so
the union logic is unit-testable without sql.Tx mocking. The new helper:
  - Preserves order: DB types first, YAML-only types appended in declared order.
  - Dedupes whitespace-trimmed entries.
  - Drops empty/whitespace-only entries.
  - Tolerates nil getter and nil dbTypes.

Tests in internal/storage/issueops/config_helpers_test.go:
  - TestMergeWithYAMLCustomTypes — 7 table cases: both empty, yaml-only,
    db-only, db+disjoint-yaml union, db+overlapping-yaml dedup, yaml
    internal-dup dedup, whitespace dropping.
  - TestMergeWithYAMLCustomTypes_NilGetter — explicit nil-getter guard.

The pre-existing ResolveCustomTypesInTx error-fallback path is preserved:
when the config-string read errors AND YAML has types, return the YAML
overlay anyway with the original error — so a stable-bd project running
pre-#3691 doesn't lose its types.custom validation just because the
config-string read errored.

Downstream context: this unblocks gastownhall/gascity#2154 (the Gas City
side, which writes types.custom into .beads/config.yaml via
gc-beads-bd.sh's ensure_types_custom_in_yaml). Once this lands and bd
deployments adopt the fixed build, Gas City projects no longer need the
fallback workaround of mirroring types.custom into the database side.

* fix: address PR #4026 review findings (#4024)

Two findings from Copilot review:

1. ResolveCustomTypesInTx returned the YAML overlay alongside a non-nil
   error when the in-tx config-string read failed. In-tx callers
   (NewBatchContext, UpdateIssueInTx) treat any error as fatal, so the
   YAML-fallback path was effectively unreachable on pre-migration /
   degraded DBs — defeating the #4024 overlay goal precisely in the
   scenario the overlay was meant to cover. Mirror
   ResolveCustomStatusesDetailedInTx: when YAML supplies types, return
   them with a nil error; otherwise propagate the DB error. Extracted
   into customTypesYAMLFallback for unit testing without sql.Tx mocking.

2. getConfigList (the helper backing GetCustomTypesFromYAML /
   GetInfraTypesFromYAML / GetCustomStatusesFromYAML) used
   viper.GetString + comma-split, which silently ignored the YAML
   sequence form named in #4024 (`types: { custom: [step, wisp] }`).
   List-form .beads/config.yaml declarations therefore yielded an empty
   overlay. Try viper.GetStringSlice first (supports both block-list
   and inline-flow syntaxes), keeping the comma-split fallback for the
   legacy `types.custom = "step,wisp"` string form.

Tests: TestCustomTypesYAMLFallback covers the fallback decision;
TestGetCustomTypesFromYAML_ListForm and TestGetCustomTypesFromYAML_InlineListForm
pin both YAML sequence syntaxes.

Refs: gastownhall/beads#4024

---------

Co-authored-by: sjarmak <stephanie.jarmak1@gmail.com>
2026-05-21 10:26:53 -07:00
Julian Knutsen
09a3890877
fix(storage): preserve mixed issue and wisp reads (#3991)
* fix(schema): avoid sweeping dirty data during migrations

* fix: guard schema migration dirty commits (bd-wisp-g6c0g)

* fix(storage): preserve mixed issue and wisp reads

* fix(schema): unstage old tables before migrations

* test(dolt): add generated column cascade repro

* Repair PR 3991 rebase against current storage schema
2026-05-21 06:50:42 -07:00
Julian Knutsen
35b9bbb6a0
fix(schema): unify migration advisory lock path (#4031) 2026-05-20 23:38:14 -07:00
Medhat Galal
eea1cce5ab Merge remote-tracking branch 'upstream/main' into AI/import-path-config-upstream
# Conflicts:
#	docs/CONFIG.md
2026-05-21 02:05:29 -04:00
Jim Wordelman
008508f5c9
test: prevent Cobra command flag cache races (#4011)
* test: prevent Cobra command flag cache races

* chore: release gate PASS for be-psutr9 (cobra/pflag race-fix)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(gate): update be-psutr9 gate — re-review PASS (be-mouz), fix stale file list

Re-review be-mouz confirmed PASS on current HEAD 1b5536624. Correct files
changed: stdio_race_guard_test.go + test_helpers_pure_test.go only (earlier
version listed notion_test.go/stale_test.go which are no longer in the diff).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: address PR review findings (bd-wrntbm)

---------

Co-authored-by: Julian Knutsen <julianknutsen@users.noreply.github.com>
Co-authored-by: Jim Wordelman <jim@wordelman.name>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 20:57:03 -07:00
matt wilkie
39f3148fc2
docs: clarify export versus database backup (#4048)
* docs: clarify export versus database backup
* docs: remove remaining JSONL backup wording
2026-05-20 16:19:23 -07:00
Dustin Brown
6f63ef3730
Merge pull request #4060 from coffeegoddd/db/provider
Db/provider
2026-05-20 15:16:57 -07:00
coffeegoddd☕️✨
479445c9d6 /internal/storage: cleanup 2026-05-20 14:58:19 -07:00
coffeegoddd☕️✨
b1e4652edf /internal/storage/{domain,uow}: dependency 2026-05-20 14:50:25 -07:00
coffeegoddd☕️✨
34ad562689 /internal/storage: remove some comments 2026-05-20 14:25:47 -07:00
coffeegoddd☕️✨
54b83a389f /internal/storage/domain: consolidate 2026-05-20 14:23:42 -07:00
coffeegoddd☕️✨
a873d5e82a /internal/storage/domain/db: handle wisps too 2026-05-20 14:14:55 -07:00
coffeegoddd☕️✨
d56ca3893a /internal/storage/domain/db: dependency 2026-05-20 13:51:18 -07:00
coffeegoddd☕️✨
e346490a2d /internal/storage/domain/db: comments 2026-05-20 13:37:55 -07:00
coffeegoddd☕️✨
93b63c7a65 /internal/storage/domain: add event 2026-05-20 13:19:59 -07:00
coffeegoddd☕️✨
5a1d5b4334 /internal/storage/domain/db: issue 2026-05-20 13:10:38 -07:00
coffeegoddd☕️✨
e8fb231ac6 /internal/storage/{uow,domain}: wip stubs 2026-05-20 12:34:37 -07:00
Julian Knutsen
8517ba1afa
test: add perf reference benchmarks (#4032)
* test: add perf reference benchmarks

* test: tighten perf reference benchmarks

* Fix perf benchmark review findings (bd-fsgqsj)
2026-05-19 18:39:13 -07:00
Dustin Brown
8f5ec4611f
Merge pull request #4047 from coffeegoddd/db/provider
Db/provider
2026-05-19 16:35:31 -07:00
coffeegoddd☕️✨
24a1a93b0a /.github/workflows/ci.yml: run tests in CI 2026-05-19 16:09:43 -07:00
coffeegoddd☕️✨
ba36b678c3 /{cmd,internal}: more cleanup 2026-05-19 16:00:25 -07:00
coffeegoddd☕️✨
e9ece3a127 /{cmd,internal}: cleanup 2026-05-19 15:47:57 -07:00
coffeegoddd☕️✨
98be00c92e /{cmd,internal}: refactoring 2026-05-19 15:37:37 -07:00
coffeegoddd☕️✨
4fcbd58825 /{cmd,internal}: wip, implementing init with proxied-server 2026-05-19 14:17:14 -07:00
Dustin Brown
c79177073a
Merge pull request #4039 from coffeegoddd/db/remove-generated-column
refactor(deps): resolve depends_on_id via typed columns at read time
2026-05-19 13:46:10 -07:00
Medhat Galal
b1c968e91f Document import path portability 2026-05-19 16:34:17 -04:00
Dustin Brown
c959bdac8a
Merge pull request #4042 from coffeegoddd/db/debug-mode
/{cmd,internal}: get debug mode working
2026-05-19 13:24:27 -07:00
coffeegoddd☕️✨
3b1d3b3df9 /internal/storage/issueops/dependencies.go: remove comment 2026-05-19 13:11:24 -07:00
coffeegoddd☕️✨
4b5936df91 /{docs,website}: generate docs 2026-05-19 12:59:04 -07:00
coffeegoddd☕️✨
cc0f80c8d4 /internal/storage/issueops/ready_work_test.go: fix tests 2026-05-19 12:57:22 -07:00
coffeegoddd☕️✨
b456ec58fc /{cmd,internal}: some cleanup 2026-05-19 12:47:34 -07:00
coffeegoddd☕️✨
44d3288107 /internal/storage/issueops/ready_work.go: fix ready work query 2026-05-19 12:43:26 -07:00
coffeegoddd☕️✨
4d3228517f /{cmd,internal}: get debug mode working 2026-05-19 11:48:10 -07:00
coffeegoddd☕️✨
eee26a7329 /internal/storage/{dolt,issueops}: more fixes 2026-05-19 11:45:17 -07:00
Medhat Galal
95930c4449 Regenerate CLI reference docs 2026-05-19 14:39:23 -04:00
coffeegoddd☕️✨
9106148705 /internal/storage/issueops/dependencies.go: fix formatting 2026-05-19 11:04:51 -07:00
coffeegoddd☕️✨
fee553f612 /internal/storage/{dolt,issueops,schema}: remove comments 2026-05-19 11:02:40 -07:00
Medhat Galal
507b2a1fb5 Add configurable JSONL import path 2026-05-19 13:37:32 -04:00
coffeegoddd☕️✨
c2cbfd3fbb /{cmd,internal}: some fixes 2026-05-19 10:17:51 -07:00