Commit graph

39 commits

Author SHA1 Message Date
matt wilkie
bb6b8f226b
Fix ready/list UX regressions (#3481)
* fix(ready): honor filter.ExcludeTypes in GetReadyWorkInTx (GH#3397)

The --exclude-type CLI flag was silently ignored by bd ready. The CLI
correctly populated filter.ExcludeTypes, and the type's godoc promised
that values are "Appended to the default exclusion list", but the
no-Type branch of GetReadyWorkInTx built the NOT IN clause from the
hardcoded defaults only.

Merge user-supplied ExcludeTypes into the default exclusion list (with
dedup against defaults and empties) before building the placeholders.
This matches the pattern already used by issueops/filters.go and
dolt/queries.go for bd list.

Fixes GH#3397.

* fix(ready): --parent returns transitive descendants, not direct children only (GH#3396)

The SQL clause in GetReadyWorkInTx's ParentID branch was a one-hop join
against the parent-child dependency table, so only direct children
surfaced. The --parent help text in cmd/bd/ready.go:672 and the
WorkFilter.ParentID godoc (internal/types/types.go:1295) both promise
"descendants (recursive)".

Add a BFS helper GetDescendantIDsInTx alongside GetChildrenOfIssuesInTx
in blocked.go — BFS rather than a recursive CTE because the existing
children helper already iterates across both dependencies and
wisp_dependencies tables, and composing that inside a single CTE gets
ugly. The visited set breaks cycles and a depth cap (default 100,
matching the cycle-detection CTE elsewhere in issueops) guards against
malformed data.

Rewrite the ParentID branch in GetReadyWorkInTx to resolve descendants
via the new helper and OR that with the prior dotted-ID prefix match
(for implicit-parent IDs with no explicit parent-child dep), preserving
the original semantics for dotted IDs.

MoleculeID is deliberately left as one-hop — its inline comment
explicitly scopes it to "direct children" unlike ParentID.

Fixes GH#3396.

* Improve ready and list UX regressions (bd-main-typ)

* fix(list): make --ready flag use blocker-aware GetReadyWork semantics (GH#3478)

bd list --ready previously only filtered by status=open, showing issues
that bd ready correctly excluded as blocked. Now both commands use the
same GetReadyWork path, ensuring consistent results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add list ready blocker regression coverage (bd-qo1)

* Fix ready list review regressions

---------

Co-authored-by: Daniel Jasiński <daniel.jasinski@gmail.com>
Co-authored-by: kev <kglynn@pryoninc.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-26 20:29:30 -07:00
matt wilkie
cf88aa760d test: fix regression workflow gate 2026-04-24 10:55:11 -07:00
Steven Syrek
f0057c7828
ci: install dolt binary on Linux and macOS test runners (#3440)
* ci: install dolt binary on Linux and macOS test runners

Install dolt via the official install.sh on Linux and via Homebrew on
macOS so the main test job can exercise the ~24 test gates that
previously silently skipped on every PR when dolt was absent from PATH.

Matches the installation pattern already used by nightly.yml.
Docker-testcontainer gates (testDoltServerPort == 0 skips) remain
skipped — a known GitHub Actions hang documented in
scripts/repro-dolt-hang/INCIDENT-REPORT.md and nightly.yml:37-41
prevents enabling testcontainers here.

* test: require dolt binary under GITHUB_ACTIONS

Add testutil.RequireDoltBinary: skips when the dolt CLI is absent
locally but fails the test under GITHUB_ACTIONS. Replace bare
exec.LookPath("dolt") skip-gates with the helper so ~24 tests that
previously fell through silently in CI now run — and hard-fail if
the CI workflow ever drops the dolt install step.

tests/regression/regression_test.go uses an inline variant because
its gate lives in TestMain, and internal/remotecache/cache_test.go
duplicates the helper inline to avoid an import cycle
(testutil -> doltutil -> remotecache).
2026-04-24 06:58:40 -07:00
matt wilkie
66af62221e
fix(ci): drop ICU linkage from test jobs, use -tags gms_pure_go everywhere (#3240)
* fix(ci): drop ICU linkage from Linux/macOS test jobs (bd-sz5, GH#3506)

Align the CI test matrix with how we ship: all Go build/test invocations
now use -tags gms_pure_go, matching the Windows job, goreleaser, and the
install scripts. Remove libicu-dev / icu4c installs and CGO_* env setup
from ubuntu-latest and macos-latest jobs in ci.yml, plus nightly,
migration-test, and cross-version-smoke workflows.

Upstream dolthub/go-mysql-server#3506 confirmed -tags=gms_pure_go is the
sanctioned escape hatch; testing an ICU-linked config nobody installs was
wasting CI minutes and producing spurious duplicate-rpath / malformed
LC_DYSYMTAB linker warnings on macOS.

Update docs/ICU-POLICY.md to reflect that the CI matrix no longer
intentionally omits the tag; scripts/test-cgo.sh remains as the local
developer tool for exercising the ICU code path on demand.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): add -tags gms_pure_go to test-helper go build shell-outs (bd-sz5)

Addresses review feedback on 7b36ab653. Several integration tests shell
out to `go build ./cmd/bd` (or `go build .`) from TestMain / t.Helper
setup functions. The outer `go test -tags 'integration gms_pure_go'`
tag does not propagate into these subprocesses, so the inner builds were
still trying to link ICU and failing with
`unicode/uregex.h: No such file or directory` in the nightly workflow.

Repo-wide audit of `exec.Command("go", "build", ...)` test helpers:
- internal/beads/beads_hash_multiclone_test.go (reviewer's cite)
- tests/regression/regression_test.go
- cmd/bd/protocol/helpers_test.go
- cmd/bd/doctor/dolt_e2e_test.go
- cmd/bd/{scripttest,import_prefix,explicit_db_nodb,init_embedded,
  main,init,cli_fast,shared_server_integration,doctor_repair,
  dolt_autostart_lifecycle_integration}_test.go

All 15 call sites now pass `-tags gms_pure_go`. `cmd/bd/preflight.go`
is production code (`bd preflight` user command), not a test helper,
and is intentionally left as-is.

Also narrow docs/ICU-POLICY.md "Common Mistakes" #3 -- libicu-dev is
needed only for local on-demand testing via scripts/test-cgo.sh, not
for CI test workflows (which no longer exercise the ICU path).

Verified: `go test -tags 'integration gms_pure_go' -run '^$' ./...`
passes cleanly from the worktree root (previously failed in
internal/beads).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(preflight): add -tags gms_pure_go to test/lint shell-outs (bd-sz5)

preflight is a beads-maintainer pre-PR tool. On dev machines without
ICU dev libraries installed, `bd preflight --check` was failing at the
`go test -short ./...` step with the same `unicode/uregex.h` error we
fixed in nightly CI (bd13871bd).

Apply the gms_pure_go tag consistently:
- runTestCheck: `go test -tags gms_pure_go -short ./...`
- runLintCheck: `golangci-lint run --build-tags=gms_pure_go ./...`
- Update the user-visible Command labels to match
- Update the static checklist printed by `bd preflight` (no --check)
  so copy-pasted commands work on no-ICU machines

Matches the tag golangci-lint is now passed in CI, keeping local and
CI runs consistent.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 10:01:46 -07:00
Harry Miller
5d4aafd27e
Merge pull request #2821 from harry-miller-trimble/fix/idempotent-claim
fix: make bd update --claim idempotent for same user
2026-03-26 08:40:51 -07:00
beads/crew/emma
84494b7e1a cleanup: remove daemon infrastructure remnants (GH#2431)
Remove all BEADS_NO_DAEMON env var handling from test files (dead code
since daemon removal in v0.50.0), delete stopRepoDaemon() and daemon
file guards from test setup, remove no-daemon config key from tests,
and update daemon→server wording in docs and comments.

37 files changed, -193 lines net.

Co-Authored-By: davetashner <davetashner@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:24:27 -07:00
obsidian
3872308568 refactor(tests): migrate all test files from StartTestDoltServer to container-native API
Migrate 12 TestMain files to use EnsureDoltContainerForTestMain/TerminateDoltContainer
instead of the removed StartTestDoltServer/TestDoltServer API.

Replace testServer.IsCrashed()/CrashError() crash detection with standalone
testutil.DoltContainerCrashed()/DoltContainerCrashError() in 6 test files.

(bd-m7sy)
2026-03-03 10:07:32 -08:00
beads/crew/collins
41cd0953fe style: fix gofmt formatting in discovery_test.go
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:06:31 -08:00
beads/crew/collins
e10dbb957e fix(readiness): evaluate conditional-blocks deps in computeBlockedIDs()
conditional-blocks was declared as AffectsReadyWork() but never included
in the computeBlockedIDs() SQL query, so conditionally-blocked issues
silently appeared in bd ready. Add conditional-blocks to both the
readiness and blocked-list SQL queries, matching blocks semantics:
while the precondition is open, the fallback is blocked.

Resolves the gap identified in PR #2026 (Option A).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 13:30:07 -08:00
Xexr
376122ba46
fix: prevent test suite from leaking databases onto production Dolt server (#2089)
Set BEADS_TEST_MODE=1 unconditionally in all 9 TestMain functions that
interact with Dolt, before the test server nil check. Previously, test
mode was only set when the test Dolt server started successfully — if it
failed, tests silently connected to production on port 3307 and created
testdb_/beads_* databases that were never cleaned up.

Also:
- Fix doctorTestServerPort() fallback from 3307 (production) to 0
- Add dolt_purge_dropped_databases() to both cleanup functions
- Add isolated test Dolt server to integration test TestMain which had
  no server at all, causing bd init subprocess to hit production

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: beads/crew/lydia <steve.yegge@gmail.com>
2026-02-24 22:26:30 -08:00
onyx
6a21757419 fix(init): use prefix directly as database name instead of beads_ prefix
bd init --prefix was creating databases named beads_<prefix> (e.g.,
beads_sky, beads_gt). Convention should use the rig name directly as
the database name. This aligns with gastown doltserver.go which
already uses just the rig name.

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

Executed-By: beads/polecats/onyx
Rig: beads
Role: polecats
2026-02-24 14:57:01 -08:00
beads/crew/emma
a08f8bae87 fix(regression): improve test isolation and snapshot reliability
- Use full FNV hex hash instead of % 100000 for database prefixes,
  eliminating collision risk in parallel test runs
- Unify prefix strategy: discovery_test.go now uses FNV hash of
  workspace dir (matching regression_test.go) instead of rand.Intn
- Add --all to snapshot() bd list call so closed issues are captured,
  matching old bd export behavior
- Log warning when bd show returns unparseable JSON instead of silently
  skipping issues

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 13:13:58 -08:00
Joseph Turian
4e15ee4489 docs(regression): session 8c — blocked parent, label idempotency, dep tree
3 new failing discovery tests (BUG-69 through 71):
- blocked --parent nonexistent returns empty (no validation)
- label remove nonexistent says "Removed" (false positive)
- label add duplicate says "Added" when already exists

1 new protocol test:
- dep tree --max-depth -1 properly rejected

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:05 -08:00
Joseph Turian
8e0a57ca9f docs(regression): session 8b — stale edge, search comma-status, type filter
3 new failing discovery tests (BUG-61 through 63):
- stale --days 0 returns brand-new issues as "stale"
- search --status "open,closed" silently returns empty (same as BUG-44)
- list --type nonexistent silently returns empty (no validation)

5 new protocol tests confirming correct behavior:
- query priority range validation, unknown field rejection
- delete nonexistent --force errors, pin closed issue handled

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:05 -08:00
Joseph Turian
1b2b43048f docs(regression): session 8 — lifecycle validation, ready filters, duplicate cycles
5 new failing discovery tests (BUG-56 through BUG-60):
- reopen already-open issue succeeds silently
- undefer non-deferred issue succeeds silently
- ready --priority 5 (out of range) accepted silently
- children of nonexistent parent returns empty
- duplicate cycle (A dup B, B dup A) undetected

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:05 -08:00
Joseph Turian
a683708b10 docs(regression): session 7c — empty comments, past due date, ID filter
Discovered 4 more seams (BUG-52 through BUG-55):

- BUG-52: comments add accepts empty comment text (same pattern
  as empty label BUG-14 and empty title BUG-12).
- BUG-53: update --due with past date gives no warning — unlike
  --defer which warns, --due silently accepts past dates.
- BUG-54: list --id requires exact match (protocol — by design).
- BUG-55: comments special chars preserved (protocol — correct).

Test results: 2 FAIL (confirm bugs), 2 PASS (protocol).
Total: 55 items catalogued, 38 failing discovery tests, 39 passing
protocol tests.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:04 -08:00
Joseph Turian
9bac57acfe docs(regression): session 7b — protocol tests for status, all, type, show
Added 4 protocol tests documenting correct behavior (BUG-48 through 51):

- BUG-48: --status in_progress vs --claim — documents that status
  change doesn't auto-assign (--claim does). Protocol test.
- BUG-49: list --all includes closed issues. Protocol test.
- BUG-50: create --type "" correctly rejected. Protocol test.
- BUG-51: show --json always returns array. Protocol test.

Total: 51 items catalogued, 36 failing discovery tests, 37 passing
protocol tests.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:04 -08:00
Joseph Turian
bf03c23895 docs(regression): session 7 — deferred state, comma status, filter conflicts
Discovered 5 more seams (BUG-43 through BUG-47):

- BUG-43: update --status deferred without --defer date creates
  permanently deferred issue with no way to auto-wake.
- BUG-44: list --status "open,closed" silently returns empty —
  comma-separated not parsed, treated as invalid literal.
- BUG-45: list --assignee alice --no-assignee contradictory flags
  both applied, result is always-false predicate → empty.
- BUG-46: create --parent <closed-issue> accepted — child appears
  in bd ready despite parent being closed (DECISION).
- BUG-47: dep add --type custom accepted by design (protocol test).

Code review: bd sync is deprecated no-op, doctor --fix has
multiple no-op checks.

Test results: 4 FAIL (confirm bugs), 1 PASS (protocol).
Total: 47 bugs catalogued, 36 failing discovery tests, 33 passing
protocol tests.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:04 -08:00
Joseph Turian
3a937ba69d docs(regression): session 6c — whitespace title, config ambiguity, dep rm
Discovered 3 more seams (BUG-40 through BUG-42) + 1 protocol test:

- BUG-40: update --title "   " accepts whitespace-only title
  Extension of BUG-12 — update doesn't trim/validate whitespace.
- BUG-41: config set "" then config get shows "(not set)"
  Human-readable output ambiguous between "set to empty" and
  "never set" — JSON output correctly distinguishes.
- BUG-42: dep rm on nonexistent dep reports "Removed dependency"
  DELETE with 0 rows affected returns success message anyway.
- Protocol: count --by-status sum matches total (PASS)

Test results: 3 FAIL (confirm bugs), 1 PASS (protocol invariant).
Total: 42 bugs catalogued, 32 failing discovery tests, 32 passing
protocol tests.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:04 -08:00
Joseph Turian
f89af048c5 docs(regression): session 6b — reversed ranges, negative limit, duplicate
Discovered 4 more seams (BUG-36 through BUG-39):

- BUG-36: --priority-min 4 --priority-max 0 returns empty silently
  No min<=max validation, SQL becomes always-false predicate.
- BUG-37: --created-after > --created-before returns empty silently
  Same pattern — reversed date range not validated.
- BUG-38: bd list -n -1 silently accepted as unlimited
  Negative limit passes through "effectiveLimit > 0" check.
- BUG-39: bd duplicate on closed issue succeeds (protocol test)
  Idempotent behavior, not a bug — dep link correctly added.

Test results: 3 FAIL (confirm bugs), 1 PASS (protocol invariant).
Total: 39 bugs catalogued, 29 failing discovery tests, 31 passing
protocol tests.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:04 -08:00
Joseph Turian
4a3966c600 docs(regression): session 6 discovery — stale, sort, reparent cycle, overdue
Discovered 4 new seams (BUG-32 through BUG-35):

- BUG-32: bd stale --days -1 silently inverts logic (HIGH)
  Negative days makes cutoff = tomorrow, so ALL issues appear stale.
- BUG-33: bd list --sort unknown_field is a silent no-op
  Unknown sort fields fall through to default case (compare=0).
- BUG-34: Reparent parent to child creates parent-child cycle
  bd update parent --parent child succeeds, both issues now
  have parent-child deps pointing at each other.
- BUG-35: bd list --overdue works correctly (protocol test)

Also documents code review findings: createInRig skips prefix
validation, same-prefix rig ambiguity, batch import no UTC.

Test results: 3 FAIL (confirm bugs), 1 PASS (protocol invariant).
Total: 35 bugs catalogued, 26 failing discovery tests, 29 passing
protocol tests.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:03 -08:00
Joseph Turian
e4cfbee51a test(discovery): session 5 — dead label filter, flag conflicts, filter bypass
New discoveries (all 4 tests fail, confirming bugs):
- BUG-28: --label-pattern filter is dead code in SearchIssues (HIGH)
- BUG-29: --claim + --status open overwrites claim silently
- BUG-30: --ready silently overrides explicit --status flag
- BUG-31: --assignee "" becomes no-filter instead of unassigned

Code review findings documented in DISCOVERY.md:
- Pull doesn't check merge conflicts (silent corruption)
- Schema migration non-transactional (partial state possible)
- Import silently drops dependencies with missing targets
- SQLite-to-Dolt migration drops all structured comments

Total: 31 bugs catalogued across 5 discovery sessions.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:03 -08:00
Joseph Turian
d6ebf85c9f test(discovery): session 4 — close guard bypass, cycles, supersede, defer
New discoveries:
- BUG-25: conditional-blocks cycle undetected (test fails)
- BUG-26: reopen superseded keeps supersedes dep (test fails, DECISION)
- BUG-27: defer with past date creates invisible issue (test fails)

New protocol tests (pass, documenting behavior):
- Stats ready count matches bd ready for standard types
- Dep add on closed blocker + reopen = surprise block (documented)

Code review findings documented in DISCOVERY.md:
- Update --status closed audit trail gap (close_reason empty, wrong hook)
- Epic eligible for closure misses wisp children
- Wisp merge breaks SearchIssues sort order

Total: 27 bugs catalogued, 10 with PRs, 17 holding for feedback.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:03 -08:00
Joseph Turian
372e7246eb test(discovery): session 4 — close guard bypass, supersede reopen, defer past date
New CLI-testable discoveries (3 fail, 1 passes with log):
- BUG-21: bd update --status closed bypasses close guard for blocked issues
- BUG-22: reopen superseded issue keeps supersedes dep (semantic corruption)
- BUG-23: bd defer with past date creates invisible issue (never returns to ready)
- OBS: bd search includes closed issues by default, bd list doesn't (intentional)

Code-review finding documented:
- BUG-24: scanWispIDs loses SQL sort order (GH#1880 fix missing for wisps)

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:03 -08:00
Joseph Turian
2bc8dd201f test(discovery): session 3 — five new candidate-only seams
New CLI-testable discoveries (all tests fail, confirming bugs):
- BUG-18: bd count vs bd list disagree on default filtering
- BUG-19: bare waits-for dep doesn't block readiness
- BUG-20: children of blocked parent not in bd blocked

Code-review-only findings documented in DISCOVERY.md:
- interactions table not cleaned on delete (orphaned records)
- PromoteFromEphemeral() non-atomic (silent data loss on crash)
- RunInTransaction() last-writer-wins on concurrent same-field updates

Updated DISCOVERY.md with all session 3 findings (BUG-16 through BUG-20).

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:03 -08:00
Joseph Turian
fc6a9212e2 test(discovery): add tests for external blocker and conditional-blocks gaps
External blockers (external:project:capability) are silently ignored by
computeBlockedIDs() because they're not in the local activeIDs map. This
means issues with external blocking deps appear in bd ready and can be
closed without close guard intervention.

conditional-blocks deps are declared as AffectsReadyWork() in types.go
but the SQL in computeBlockedIDs() only queries WHERE type IN ('blocks',
'waits-for'), so conditional-blocks are never evaluated.

Both are DECISION-class: maintainer must decide whether these should gate
readiness or remain advisory.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:02 -08:00
Joseph Turian
7e2858192a fix(regression): set BEADS_DOLT_SERVER_PORT in test harness env
The regression test harness set only BEADS_DOLT_PORT (used by
applyConfigDefaults as a fallback), but main.go reads
BEADS_DOLT_SERVER_PORT via configfile.GetDoltServerPort() before
applyConfigDefaults runs. This caused all tests to silently connect
to the production Dolt server (port 3307) instead of the isolated
test server, producing "issue_prefix config is missing" errors for
every test.

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:02 -08:00
Joseph Turian
98707aa1db docs(regression): fix DISCOVERY.md to reference DECISION PRs not issues
Closed duplicate GH issues #2018-2020 — DECISION PRs already exist
from previous session: PR #1999 (BUG-7), PR #2000 (BUG-13), PR #2001 (BUG-8).

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:02 -08:00
Joseph Turian
b966c10def docs(regression): add GH issue numbers for BUG-7, BUG-8, BUG-13
Filed GitHub issues for bugs needing PO decisions:
- BUG-7: GH#2018 (dep add type overwrite)
- BUG-8: GH#2019 (reparent dual parent)
- BUG-13: GH#2020 (reopen-of-deferred limbo)

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:02 -08:00
Joseph Turian
547bed2990 docs(regression): update DISCOVERY.md with PR status and bug triage
All fix PRs now shipped with protocol tests:
- BUG-2+3: PR #1992 (merged)
- BUG-10: PR #2014
- BUG-11+12+14: PR #1994
- BUG-4: PR #2017

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:02 -08:00
Joseph Turian
5e0602a6c4 docs(regression): Phase 3 triage — 95+ pass, 15 fail (all known bugs)
Update DISCOVERY.md with Phase 1-3 results:
- Session log entry for snapshot harness + full parity run
- BUG-1 and BUG-6 marked RESOLVED in test harness
- New BUG-15: labels missing from dependent sub-objects
- Detailed test infrastructure notes for snapshot harness
- Parity run results table (95+ PASS, 10 known bug FAIL,
  3 new finding FAIL, 10 SKIP)
- BEADS_TEST_MODE bypass documentation

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:01 -08:00
Joseph Turian
a5fa36c6c3 fix(regression): normalization for snapshot-based parity
Phase 2 normalization fixes discovered from first full regression run:
- Use unique prefix per workspace for Dolt database isolation
  (beads_t<hash> instead of shared beads_test)
- Strip closed_at, close_reason from dep/dependent sub-objects
- Canonicalize parent field (raw issue ID → ISSUE-N)
- Handle dependents array same as dependencies (volatile fields,
  dependency_type→type rename, ID canonicalization, sorting)

Results: 83 pass → 95+ pass (normalization-only failures eliminated)

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:01 -08:00
Joseph Turian
5fd7fe352f feat(regression): replace bd export with snapshot harness (list+show)
The bd export command was removed from main, breaking all 85 regression
tests. This replaces the export-based approach with a snapshot() method
that uses bd list --json + bd show --json to capture workspace state.

Changes:
- Add BEADS_TEST_MODE=1 to runEnv() for Dolt test isolation
- Implement snapshot() method: list all issues, show each, emit JSONL
- Rewrite export() to translate old flags and delegate to snapshot()
- Update compareExports() to call snapshot() directly
- Add normalization for show-vs-export field differences:
  - Strip content_hash, events (show-only fields)
  - Rename dependency_type → type in deps
  - Strip thread_id, created_by from deps
  - Handle metadata "{}" vs nil

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

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-24 12:27:01 -08:00
quartz
87fba0ca4c fix: set BEADS_TEST_MODE=1 in all test server setups for DB isolation
Without BEADS_TEST_MODE=1, applyConfigDefaults() uses the shared "beads"
database instead of deriving unique testdb_<hash> names from temp paths.
This caused tracker tests to see 400+ pre-existing issues from prior runs.

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

Executed-By: beads/polecats/quartz
Rig: beads
Role: polecats
2026-02-23 20:26:29 -08:00
mayor
eb84f6f5c0 fix: one dolt server per town, not per worktree
Under Gas Town (GT_ROOT set), all dolt server operations now resolve to
$GT_ROOT/.beads/ with fixed port 3307, so N worktrees share one server
instead of spawning N servers (was accumulating 62 servers / 9GB RAM).

- Add resolveServerDir/ResolveServerDir for canonical path resolution
- DefaultConfig uses fixed port 3307 under Gas Town, DerivePort standalone
- EnsureRunning resolves internally; bd dolt start/stop/status resolve at CLI
- Add bd dolt killall to find and kill orphan dolt sql-server processes
- Extract shared test server helper (internal/testutil/testdoltserver.go)
  with PID file tracking, stale cleanup, and signal handler for Ctrl+C
- Refactor 3 test files to use shared helper (-224 lines of duplication)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:45:13 -08:00
beads/crew/emma
f236701f26 fix(test): isolate regression tests from production Dolt server
- Skip regression tests in TestMain when dolt binary not in PATH
- Skip config tests when Dolt server not available (setupTestDB)
- Update doctor tests: no more JSONL fresh-clone concept post-removal
- Update ValidateSyncConfig test: empty config now requires federation.remote
- Windows smoke test: remove bd init (requires Dolt), keep version+help

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:20:52 -08:00
mayor
e7d0d93a8a fix(test): isolate regression tests from production Dolt server
Regression tests were connecting to the production Dolt server on port
3307, polluting it with test databases. Start a dedicated Dolt server
on a dynamic port in TestMain and pass BEADS_DOLT_PORT to all bd
subprocess invocations via runEnv().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 19:01:35 -08:00
beads/crew/collins
6219b8692d fix: CI formatting, lint, and test failures blocking release
1. FORMATTING: gofmt 14 files.

2. LINT:
   - Delete dead code cmd/bd/bootstrap.go (unused bootstrapEmbeddedDolt)
   - Prefix unused 'actor' param in wisps.go updateWisp with _
   - Prefix unused 'ctx' param in telemetry.go buildTraceProvider with _

3. TESTS: Add skipIfNoDolt to test helpers that call dolt.New() without
   a running test server. In CI (no dolt installed), these tests now skip
   instead of failing with "server unreachable at 127.0.0.1:3307".
   Delete TestOpenFromConfig_Embedded and TestOpenFromConfig_DefaultsToEmbedded
   which tested removed embedded Dolt functionality.

   Fixed packages: beads_test, cmd/bd, cmd/bd/doctor, cmd/bd/doctor/fix,
   internal/tracker, internal/utils

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:53:35 -08:00
Joseph Turian
f456a2667c
test(regression): Dolt migration regression discovery (long-lived branch) (#1906)
* feat(test): differential regression suite (v0.49.6 baseline)

Adds 53 regression test scenarios comparing current bd behavior against
v0.49.6 SQLite baseline. Tests run identical CLI scenarios against both
binaries in isolated workspaces, capture JSONL snapshots via bd export,
normalize volatile fields, and fail on any unexpected difference.

44 PASS, 9 SKIP (documenting known regressions/intentional changes), 0 FAIL.

Build-tagged `//go:build regression` so it never runs in normal `go test`.
Run with: `go test -tags=regression -timeout=10m -v ./tests/regression/...`

* test(regression): add 17 scenarios targeting recent open bugs

New scenarios covering subtle bugs found by surveying GH issues since v0.50:

Epic lifecycle (GH#1495):
- TestEpicAllChildrenClosedNotBlocked: epic with all children closed
  should not show as BLOCKED with "0 dependencies"
- TestBlockedEpicChildrenNotReady: children of blocked epic should not
  appear in bd ready

Dependency semantics (GH#1524, GH#1858):
- TestCloseGuardNonBlocksDepTypes: close guard should not reject close
  for non-blocks dep types (caused-by, validates, tracks)
- TestListResolvedBlockerAnnotation: bd list should not show "blocked by"
  after blocker is closed

CLI surface coverage (GH#1840, GH#1954):
- TestListAllOverridesLimitWithLabel: --all should override limit of 50
  when combined with --label filter
- TestDepTreeOutput: bd dep tree should show full parent-child hierarchy
- TestChildrenCommand: bd children parity between backends
- TestBlockedCommandParity: bd blocked --json agreement
- TestCountCommandParity: bd count agreement
- TestStaleCommandParity: bd stale agreement
- TestQueryDSLParity: bd query DSL returns same results

Data integrity (GH#1914, GH#1926, GH#1927, GH#1969, GH#1973):
- TestShowJSONFieldCompleteness: bd show --json includes all fields from
  baseline (catches scan projection drift)
- TestExportImportEpicTree: multi-level epic tree export → import round-trip
- TestRapidLabelAddRemoveStability: rapid label churn not silently rolled back
- TestRapidDepAddRemoveStability: rapid dep churn consistency
- TestRapidCommentAddStability: 10 rapid comments all survive
- TestLargeExportImportRoundTrip: 20 issues with deps/labels/comments
  round-trip at scale

* test(regression): add bug discovery tests and 14 confirmed bug reports

Systematic manual testing against current main (Dolt server mode) found
14 bugs and confirmed 23 protocol invariants. All tests require a running
Dolt server on :3307 and use unique prefixes for test isolation.

Bug reproduction tests (10 FAIL = confirmed bugs):
- BUG-2: dep tree shows no children (ParentID never set)
- BUG-3: dep tree shows [READY] on blocked root
- BUG-4: list --status blocked returns empty
- BUG-7: dep add silently overwrites dep type
- BUG-8: reparented child appears under both parents
- BUG-10: close guard / claim exit 0 on soft failure
- BUG-11: update --status accepts arbitrary values
- BUG-12: update --title "" stores empty title
- BUG-13: reopen of closed+deferred creates limbo state
- BUG-14: empty string label accepted

Protocol invariant tests (23 PASS):
Close guard, epic lifecycle, delete cleanup, reopen preservation,
transitive blocking, cycle detection, force close, defer/undefer,
claim semantics, notes, supersede, duplicate, count grouping,
special chars, SQL injection safety, dep remove, self-dep prevention,
status/type/due-date round-trips, label/comment round-trips.

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

* docs(regression): add audit verdicts and session log to DISCOVERY.md

Triage all 14 bugs: 5-6 clear fix PRs, 2 need design discussion,
5-6 wontfix/by-design. Add session log to avoid redoing work.

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

* docs(regression): revised audit, protocol test classifications, prior art

- Updated bug verdicts based on code review: BUG-4 upgraded to DOCS FIX,
  BUG-5 upgraded to INVESTIGATE (INSERT IGNORE is correct but concurrent
  Dolt working-set commits may race), BUG-7 downgraded to FILE ISSUE
  (upsert is intentionally coded, needs product decision)
- Tagged all 32 protocol test ideas as DATA INTEGRITY, POLICY/UX, or
  MESSAGE CONTRACT to distinguish hard invariants from policy decisions
- Added "Prior Art" section documenting key Dolt migration fixes already
  merged (PRs #1797, #1816, #1909, #1914, #1966-1969, #1948) and
  Dolt-specific constraints learned from them

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 15:18:56 -08:00