beads/internal
Peter Chanthamynavong 2cbf3a5497
fix: Validate sync-branch at config-time and runtime (closes #1166) (#1168)
* fix(config): validate sync-branch at config time

Add sync-branch validation to validateYamlConfigValue() to reject
main/master at config time, preventing the validation bypass in GH#1166.

- Add case for sync-branch and sync.branch keys
- Inline validation logic to avoid import cycle (config <-> syncbranch)
- Add unit tests for rejection (main/master) and acceptance (valid names)

Part of: #1166

* fix(sync): add runtime guard for sync-branch == current-branch

Add dynamic runtime check before worktree operations to catch cases
where sync-branch matches the current branch. This provides defense
in depth for manual YAML edits, pre-fix configs, or non-main/master
branch names (trunk, develop, production, etc.).

- Check IsSyncBranchSameAsCurrent() after hasSyncBranchConfig is set
- Position check BEFORE worktree entry (CWD changes inside worktree)
- Add integration test TestSync_FailsWhenOnSyncBranch

Part of: #1166

* docs: note main/master restriction in sync-branch FAQ

Clarifies that git worktrees cannot checkout the same branch in
multiple locations, so main/master cannot be used as sync branch.
2026-01-19 10:11:06 -08:00
..
audit feat(audit): add append-only agent audit trail (.beads/interactions.jsonl) 2025-12-20 03:24:51 -08:00
autoimport fix: NixOS symlink compatibility for mtime and permission checks (#459) 2025-12-05 13:22:09 -08:00
beads feat(context): centralize RepoContext API for git operations (#1102) 2026-01-15 07:55:08 -08:00
compact feat(context): centralize RepoContext API for git operations (#1102) 2026-01-15 07:55:08 -08:00
config fix: Validate sync-branch at config-time and runtime (closes #1166) (#1168) 2026-01-19 10:11:06 -08:00
configfile feat(storage): add --backend flag for Dolt backend selection 2026-01-14 21:42:31 -08:00
daemon feat(context): centralize RepoContext API for git operations (#1102) 2026-01-15 07:55:08 -08:00
debug test(coverage): add tests to meet 45% CI threshold 2025-12-18 17:45:49 -05:00
export test(coverage): add tests to meet 45% CI threshold 2025-12-18 17:45:49 -05:00
formula test: add gate field parsing tests (bd-4bt1) 2026-01-02 13:45:10 -08:00
git Fix git hooks not working in worktrees (#1126) 2026-01-16 12:01:43 -08:00
hooks refactor: remove unused bd pin/unpin/hook commands (bd-x0zl) 2025-12-27 16:02:15 -08:00
idgen fix(idgen): correct test vectors in hash_test.go 2025-12-19 18:13:56 -08:00
importer fix(sync): use town-level routes for prefix validation 2026-01-17 09:51:46 -08:00
linear fix(linear): use project_id when creating issues via sync --push (GH#973) (#1012) 2026-01-10 23:46:00 -08:00
lockfile fix: eliminate 5+ second delays from stale daemon.lock files (bd-htwx) 2025-12-31 13:03:49 -08:00
merge fix(merge): add QualityScore field to merge Issue struct 2026-01-11 18:46:12 -08:00
molecules feat(types): remove Gas Town types from core built-in types 2026-01-17 05:07:11 -08:00
recipes feat: add Junie agent integration 2026-01-13 08:41:25 -06:00
routing fix(routing): default to Maintainer when no git remote exists (#1185) 2026-01-19 10:11:00 -08:00
rpc feat(types): remove Gas Town types from core built-in types 2026-01-17 05:07:11 -08:00
storage fix(sqlite): add missing agent fields to scanIssues and related queries (#1176) 2026-01-19 10:11:03 -08:00
syncbranch feat(context): centralize RepoContext API for git operations (#1102) 2026-01-15 07:55:08 -08:00
templates/roles chore: add role templates and gitignore bd_test 2026-01-13 18:03:43 -08:00
testutil Fix test compilation errors: add context.Background() to sqlite.New() calls 2025-11-21 14:57:18 -05:00
timeparsing feat(dates): add --due and --defer timestamp options with natural language parsing (#847) 2026-01-01 20:06:13 -08:00
types feat(types): remove Gas Town types from core built-in types 2026-01-17 05:07:11 -08:00
ui feat(ux): visual improvements for list tree, graph, and show commands 2026-01-08 20:50:56 -08:00
util fix(types): consolidate enhancement alias and fix update command 2026-01-16 16:02:51 -08:00
utils fix(utils): prevent nil pointer panic in ResolvePartialID (#1132) 2026-01-17 00:00:56 -08:00
validation fix(create): validate explicit IDs against allowed_prefixes using starts-with matching (#1137) 2026-01-19 10:08:56 -08:00