Commit Graph

2524 Commits

Author SHA1 Message Date
Steve Yegge
28fc861127 bd sync: 2025-11-25 21:39:38 2025-11-25 21:40:18 -08:00
Steve Yegge
762d158ca1 bd sync: apply DB changes after import 2025-11-25 20:56:48 -08:00
Steve Yegge
6c06f5cb5f gh2jsonl: add intra-batch collision detection for hash IDs
When using --id-mode hash, the script now tracks generated IDs and
retries with increasing nonce (0-9) then increasing length (up to 8)
if a collision is detected within the same import batch.

This matches the collision handling behavior in the Go implementation
(internal/storage/sqlite/ids.go).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 20:33:35 -08:00
Steve Yegge
384debad0f Merge pull request #383 from deangiberson/main
gh2jsonl: Add hash-based ID generation support
2025-11-25 20:29:38 -08:00
Steve Yegge
4b9671d152 bd sync: apply DB changes after import 2025-11-25 19:50:46 -08:00
Steve Yegge
3458956ecf refactor: consolidate check-health DB access and expand hook checks
- bd-b8h: Extract getCheckHealthDBPath() to DRY up path resolution
- bd-xyc: Open DB once in runCheckHealth, pass connection to check functions
- bd-2em: checkHooksQuick now verifies all 4 hooks (pre-commit, post-merge,
  pre-push, post-checkout) instead of just post-merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 19:50:46 -08:00
Steve Yegge
031193e445 bd sync: 2025-11-25 19:50:26 2025-11-25 19:50:46 -08:00
Steve Yegge
205f68af86 bd sync: apply DB changes after import 2025-11-25 19:32:05 -08:00
Steve Yegge
cd1cbbbfdd bd sync: 2025-11-25 19:32:04 2025-11-25 19:32:05 -08:00
Steve Yegge
7964b07ac2 bd sync: apply DB changes after import 2025-11-25 19:28:13 -08:00
Steve Yegge
3fe94f280f feat: add bd doctor --check-health for lightweight git hook health checks
- Add --check-health flag for quick, silent health checks (exit 0 on success)
- Check version mismatch (CLI vs database), sync.branch config, outdated hooks
- Add hints.doctor config option to suppress doctor hints globally
- Update post-merge/post-checkout hooks to call bd doctor --check-health
- Suggest running bd doctor in upgrade notification
- Modernize post-checkout hook (bash→sh, use bd sync instead of bd import)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 19:28:13 -08:00
Steve Yegge
44b286c655 bd sync: 2025-11-25 19:27:53 2025-11-25 19:28:13 -08:00
Steve Yegge
6109675bba bd sync: apply DB changes after import 2025-11-25 19:18:23 -08:00
Steve Yegge
6408845f09 bd sync: 2025-11-25 19:18:22 2025-11-25 19:18:23 -08:00
Steve Yegge
03d62d0f8e ci: add provenance attestation to npm publish 2025-11-25 18:31:40 -08:00
Steve Yegge
611d1e6e80 ci: add automated npm publish to release workflow 2025-11-25 18:25:08 -08:00
Steve Yegge
ddced40153 fix: add nosec annotations for gosec lint warnings 2025-11-25 18:22:05 -08:00
Steve Yegge
9fc0285987 chore: Bump version to 0.25.1 2025-11-25 18:16:49 -08:00
Steve Yegge
8915026fed docs: update CHANGELOG for upcoming 0.25.1 release
🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 18:12:44 -08:00
Steve Yegge
e4f9c3556f feat(sync): prevent zombie resurrection from stale clones
Add JSONL sanitization after git pull to remove deleted issues that
git's 3-way merge may resurrect. Also add bd doctor check to hydrate
deletions.jsonl from git history for pre-v0.25.0 deletions.

Changes:
- Add sanitizeJSONLWithDeletions() in sync.go (Step 3.6)
- Add checkDeletionsManifest() in doctor.go (Check 18)
- Add HydrateDeletionsManifest() fix in doctor/fix/deletions.go
- Add looksLikeIssueID() validation to prevent false positives
- Add comprehensive tests for sanitization logic

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 18:11:45 -08:00
Steve Yegge
8051cc911b bd sync: 2025-11-25 17:52:56 2025-11-25 17:52:56 -08:00
Steve Yegge
c5103e90b1 fix(sync): commit all .beads/ files before pull
bd sync was only committing beads.jsonl, leaving other tracked files
like metadata.json unstaged. This caused 'git pull --rebase' to fail
with 'You have unstaged changes' error.

Now checks and commits the entire .beads/ directory to ensure a clean
worktree before pulling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 17:45:11 -08:00
Steve Yegge
e7b89341b2 bd sync: 2025-11-25 17:12:46 2025-11-25 17:12:46 -08:00
Steve Yegge
d453c6e9ea bd prime: Auto-detect ephemeral branches and adjust workflow
When running on a branch with no upstream (e.g., gastown polecats), output
different SESSION CLOSE PROTOCOL instructions:
- Use 'bd sync --from-main' instead of 'bd sync'
- Skip git push step (branch is local-only)
- Update Sync & Collaboration section to show --from-main
- Update Completing work workflow accordingly

Detection: git rev-parse --abbrev-ref --symbolic-full-name @{u} returns
error if no upstream configured.

Closes bd-4l5
2025-11-25 17:12:42 -08:00
Dean Giberson
eb4b52dd6a gh2jsonl: Add hash-based ID generation support
Adds --id-mode flag to gh2jsonl.py with support for both sequential
and hash-based IDs, matching the algorithm in internal/storage/sqlite/ids.go.

New features:
- encode_base36() function for base36 encoding
- generate_hash_id() matching Go implementation (SHA256 + base36)
- --id-mode {sequential|hash} CLI flag (default: sequential)
- --hash-length {3,4,5,6,7,8} for configurable hash length (default: 6)

Hash IDs are deterministic and content-based, using title, description,
creator, and timestamp. Sequential mode remains the default for backward
compatibility.

Examples:
  python gh2jsonl.py --repo owner/repo --id-mode hash | bd import
  python gh2jsonl.py --file issues.json --id-mode hash --hash-length 4
2025-11-25 16:57:25 -08:00
Steve Yegge
9b58241417 bd sync: 2025-11-25 16:56:23 2025-11-25 16:56:23 -08:00
Steve Yegge
47d39fb845 Update beads metadata to v0.25.0 2025-11-25 16:56:18 -08:00
Steve Yegge
c43cc41d31 bd sync: 2025-11-25 16:55:56 2025-11-25 16:56:18 -08:00
Steve Yegge
afacb5231e docs: add stealth mode and --from-main to v0.25.0 changelog 2025-11-25 16:49:52 -08:00
Steve Yegge
d5dd01c8ff chore: Bump version to 0.25.0
Updated all component versions:
- bd CLI: 0.24.4 → 0.25.0
- Plugin: 0.24.4 → 0.25.0
- MCP server: 0.24.4 → 0.25.0
- npm package: 0.24.4 → 0.25.0
- Documentation: 0.24.4 → 0.25.0

Generated by scripts/bump-version.sh
2025-11-25 16:39:09 -08:00
Steve Yegge
6bf0472573 docs: add deletion propagation to changelog
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 16:38:12 -08:00
Steve Yegge
4088e68da7 feat(deletions): complete deletions manifest epic with integration tests
Completes the deletion propagation epic (bd-imj) with all 9 subtasks:
- Cross-clone deletion propagation via deletions.jsonl
- bd deleted command for audit trail
- Auto-compact during sync (opt-in)
- Git history fallback with timeout and regex escaping
- JSON output for pruning results
- Integration tests for deletion scenarios
- Documentation in AGENTS.md, README.md, and docs/DELETIONS.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 16:36:46 -08:00
Steve Yegge
6bab015616 bd sync: 2025-11-25 16:36:33 2025-11-25 16:36:33 -08:00
Steve Yegge
4898c424aa feat(deletions): auto-compact during sync and git history fallback fixes
- Add Count function to deletions package for fast line counting
- Add maybeAutoCompactDeletions to sync (opt-in via deletions.auto_compact config)
- Fix regex escaping in batchCheckGitHistory (bd-bgs)
- Add 30s timeout to git history commands (bd-f0n)
- Use git rev-parse --show-toplevel for proper repo root detection (bd-bhd)
- Add tests for Count and auto-compact functionality

Closes: bd-qsm, bd-bgs, bd-f0n, bd-bhd
2025-11-25 15:08:12 -08:00
Steve Yegge
2f5ef33c08 bd sync: 2025-11-25 15:07:58 2025-11-25 15:07:58 -08:00
Steve Yegge
ecc5830a31 fix(deletions): track deletions.jsonl in git for cross-clone propagation
Fixes bd-44e: Remove deletions.jsonl from .gitignore.

The deletions manifest MUST be tracked in git for cross-clone deletion
propagation to work (bd-imj). Previously it was incorrectly gitignored
with a "local-only" comment that contradicted the design.

Changes:
- Remove .beads/deletions.jsonl from .gitignore
- Add comment explaining why it is tracked
- Track existing deletions.jsonl file

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 14:57:55 -08:00
Steve Yegge
941c65f1a7 bd sync: 2025-11-25 14:57:33 2025-11-25 14:57:33 -08:00
Dane Bertram
c33e984d66 feat(init): add --stealth flag for invisible beads usage (#381)
Adds `bd init --stealth` to enable beads usage without affecting repo collaborators:
- Global gitattributes: configures beads merge driver across all repos
- Global gitignore: prevents .beads/ and .claude/settings.local.json from being committed
- Claude Code integration: adds 'bd onboard' instruction automatically
- Respects existing global git config files, only creates when necessary

Perfect for personal experimentation or contributing to repos where not everyone uses beads.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-25 14:46:01 -08:00
Steve Yegge
25ccdf9892 bd sync: 2025-11-25 14:45:06 2025-11-25 14:45:06 -08:00
Steve Yegge
02b23f701c Ignore .beads/deletions.jsonl (cleanup tracking file)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 14:45:01 -08:00
Steve Yegge
2a39579189 bd sync: 2025-11-25 14:40:35 2025-11-25 14:40:35 -08:00
Steve Yegge
898bc2ac18 bd sync: apply DB changes after import 2025-11-25 14:29:25 -08:00
Steve Yegge
2ef0cfd40a Add --from-main flag for ephemeral branch sync (gt-ick9)
Enables bd sync to work with local-only branches that don't have
upstream tracking. Auto-detects this case and syncs beads from
origin/main instead of requiring an upstream branch.

Also fixes hasJSONLConflict() to recognize both issues.jsonl and
beads.jsonl filenames.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 14:29:25 -08:00
Steve Yegge
eb8b7f13f9 bd sync: 2025-11-25 12:55:13 2025-11-25 12:55:13 -08:00
Steve Yegge
907759ce3f bd sync: apply DB changes after import 2025-11-25 12:41:36 -08:00
Steve Yegge
a79f48d980 bd sync: 2025-11-25 12:41:35 2025-11-25 12:41:36 -08:00
Steve Yegge
3f84ec3774 feat(deletions): add pruning and git history fallback
Implements two P1 tasks for the deletions manifest epic:

bd-v2x: Add deletions pruning to bd compact
- PruneDeletions function removes records older than retention period
- Default retention: 7 days (configurable via metadata.json)
- CLI --retention flag for override
- Atomic file rewrite prevents corruption
- Called automatically during all compact operations

bd-pnm: Add git history fallback for pruned deletions
- Catches deletions where manifest entry was pruned
- Uses git log -S to search for ID in JSONL history
- Batches multiple IDs for efficiency (git -G regex)
- Self-healing: backfills manifest on hit
- Conservative: keeps issue if git check fails (shallow clone)

Tests added for both features with edge cases covered.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 12:41:36 -08:00
Steve Yegge
1804a91787 bd sync: apply DB changes after import 2025-11-25 12:33:39 -08:00
Steve Yegge
f7adb935df bd sync: 2025-11-25 12:03:21 2025-11-25 12:03:21 -08:00
Steve Yegge
be784a0b4b bd sync: 2025-11-25 11:46:06 2025-11-25 11:46:06 -08:00