Commit Graph

4036 Commits

Author SHA1 Message Date
Steve Yegge
80cf1d7b03 fix: actually restore issues.jsonl (80 issues)
Previous commit only restored deletions.jsonl. This restores
issues.jsonl from bb39c8b6 with all 80 issues.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 15:45:01 -08:00
Steve Yegge
60034e3dfa fix: restore beads database after swarm corruption
A bd sync during the swarm incorrectly purged all 80 issues from
issues.jsonl at commit 93718056. This restores the database state
from bb39c8b6 (the last good state before corruption).

Corruption occurred at 2025-11-29 13:35:28 during parallel polecat
syncs. Root cause investigation needed.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 15:39:35 -08:00
Steve Yegge
10a7b44eaf bd sync: 2025-11-29 15:05:34 2025-11-29 15:05:34 -08:00
Steve Yegge
8becf0d9b9 fix: handle multi-hyphen prefixes with hash IDs (#419)
Fixed bug where issue IDs with multiple hyphens in the prefix and hash
suffixes were incorrectly parsed. For example, `web-app-a3f8e9` was
being parsed with prefix `web-` instead of `web-app`.

Root cause: ExtractIssuePrefix() only checked for numeric suffixes.
When it encountered a hash suffix, it fell back to using the first
hyphen instead of the last hyphen.

Changes:
- Added isLikelyHash() helper to detect hexadecimal hash suffixes (4-8 chars)
- Updated ExtractIssuePrefix() to handle both numeric and hash suffixes
- Added comprehensive test cases for various prefix patterns

Test coverage includes:
- web-app-123 (numeric suffix)
- web-app-a3f8e9 (hash suffix)
- my-cool-app-a3f8e9 (three-part prefix with hash)
- super-long-project-name-1a2b (four-part prefix)
- Various hash lengths and case variations

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

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 15:05:25 -08:00
Steve Yegge
f321857f18 Merge pull request #412 from joelklabo/fix/secure-jsonl-paths
Security fix for JSONL path handling - adds path traversal protection
2025-11-29 15:05:10 -08:00
Steve Yegge
db9b466cf2 bd sync: 2025-11-29 15:04:32 2025-11-29 15:04:32 -08:00
Steve Yegge
3ded265e37 Merge branch 'main' of github.com:steveyegge/beads 2025-11-29 14:25:11 -08:00
Steve Yegge
64a5905c08 bd sync: 2025-11-29 14:25:04 2025-11-29 14:25:04 -08:00
Steve Yegge
93718056d5 bd sync: 2025-11-29 13:35:28 2025-11-29 13:35:28 -08:00
Steve Yegge
bb39c8b677 bd sync: 2025-11-29 13:35:12 2025-11-29 13:35:12 -08:00
Steve Yegge
b2f6f53fa6 bd sync: 2025-11-29 13:34:57 2025-11-29 13:35:03 -08:00
Steve Yegge
697491d350 bd sync: 2025-11-29 13:33:06 2025-11-29 13:33:06 -08:00
Steve Yegge
46ce16f35c Merge branch 'main' of github.com:steveyegge/beads 2025-11-29 13:33:02 -08:00
Steve Yegge
ef50e80c2d Resolve merge conflicts in issues.jsonl and main.go
- issues.jsonl: Keep closed status for bd-5kj (already resolved)
- main.go: Clean up JSONL-only mode detection, include BD_ACTOR env check

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 13:32:51 -08:00
Steve Yegge
614a82047d bd sync: 2025-11-29 13:31:16 2025-11-29 13:31:16 -08:00
Steve Yegge
54af3a333f bd sync: 2025-11-29 13:31:09 2025-11-29 13:31:16 -08:00
Steve Yegge
189d15d8aa bd sync: 2025-11-29 13:31:00 2025-11-29 13:31:16 -08:00
Steve Yegge
53aca85783 bd sync: 2025-11-29 13:30:53 2025-11-29 13:31:16 -08:00
Steve Yegge
83ea1bf37f bd sync: 2025-11-29 13:31:10 2025-11-29 13:31:10 -08:00
Steve Yegge
d29ab0e548 bd sync: 2025-11-29 13:30:59 2025-11-29 13:31:10 -08:00
Steve Yegge
cf834d5dc3 bd sync: 2025-11-29 13:31:07 2025-11-29 13:31:07 -08:00
Steve Yegge
92c1a7e1f9 bd sync: 2025-11-29 13:30:51 2025-11-29 13:31:06 -08:00
Steve Yegge
622e16ce63 bd sync: apply DB changes after import 2025-11-29 13:31:01 -08:00
Steve Yegge
57bb3a7577 bd sync: 2025-11-29 13:30:51 2025-11-29 13:31:00 -08:00
Steve Yegge
33aa1eaef5 bd sync: 2025-11-29 13:30:57 2025-11-29 13:30:57 -08:00
Steve Yegge
d933caffd8 bd sync: 2025-11-29 13:30:51 2025-11-29 13:30:51 -08:00
Steve Yegge
10239812bc bd sync: 2025-11-29 13:28:39 2025-11-29 13:28:39 -08:00
Steve Yegge
595b794378 bd sync: 2025-11-29 13:20:30 2025-11-29 13:20:30 -08:00
Steve Yegge
69d6754e96 bd sync: 2025-11-29 13:20:14 2025-11-29 13:20:24 -08:00
Steve Yegge
559526a4f5 bd sync: 2025-11-29 10:07:08 2025-11-29 10:07:08 -08:00
matt wilkie
21720237d8 fix: add gosec lint suppressions
Add #nolint:gosec comments for reviewed file operations:
- cmd/bd/main.go:299 - G304: ReadFile from .beads/config.yaml (safe, constructed path)
- cmd/bd/daemon_health_unix.go:18 - G115: overflow is safe in disk space calculation
2025-11-29 01:06:01 -07:00
matt wilkie
9b55c4d953 fix: add countIssuesInJSONLFile wrapper function
The upstream main branch has calls to countIssuesInJSONLFile in doctor.go and init.go,
but the previous fix removed the function definition. Add it back as a simple wrapper
around countJSONLIssues that returns only the count.
2025-11-29 01:03:05 -07:00
matt wilkie
ce36a6f6b4 remove ephemeral _working_on_ note 2025-11-29 01:00:08 -07:00
matt wilkie
3e0ae1c555 bd sync: apply DB changes after import 2025-11-29 00:54:42 -07:00
matt wilkie
e3e7db355f Merge branch 'fix-ci' of https://github.com/maphew/beads into fix-ci 2025-11-29 00:54:27 -07:00
matt wilkie
a043e34d3f bd sync: 2025-11-29 00:54:21 2025-11-29 00:54:21 -07:00
matt wilkie
2eec4f038a fix: clean up .beads directory before Nix Flake test
The Nix Flake CI test was failing because the repository has an existing
.beads/issues.jsonl file checked in, which caused bd init to refuse to
initialize (detecting it as a fresh clone with existing data).

Solution: Remove .beads before running bd init in the test to start fresh.
2025-11-29 00:54:03 -07:00
matt wilkie
9182e9f30d fix: suppress gosec lint warnings for file operations
All file reads/writes are from controlled paths (.beads/, .git/, or git root).
Add #nosec comments to suppress G304 and G204 warnings.

- cmd/bd/doctor.go:664 - ReadFile from .beads/config.yaml
- cmd/bd/main.go:645 - ReadFile from .beads/{issues,beads}.jsonl
- cmd/bd/doctor/fix/database_config.go:166 - ReadFile from git root .gitattributes
- cmd/bd/doctor/fix/untracked.go:61 - exec Command with whitelisted JSONL files
2025-11-29 00:54:03 -07:00
matt wilkie
e24147c2fe fix: remove duplicate countIssuesInJSONLFile function
Fixes build failure in Test, Lint, Test (Windows), and Test Nix Flake jobs.
The function was defined in both init.go and doctor.go. Removed the init.go
version which is now unused. The doctor.go version (which calls
countJSONLIssues) is the canonical implementation.

Fixes #19780439467
2025-11-29 00:54:03 -07:00
matt wilkie
83c2a8c196 fix: clean up .beads directory before Nix Flake test
The Nix Flake CI test was failing because the repository has an existing
.beads/issues.jsonl file checked in, which caused bd init to refuse to
initialize (detecting it as a fresh clone with existing data).

Solution: Remove .beads before running bd init in the test to start fresh.
2025-11-29 00:49:33 -07:00
matt wilkie
dee16db0c0 fix: suppress gosec lint warnings for file operations
All file reads/writes are from controlled paths (.beads/, .git/, or git root).
Add #nosec comments to suppress G304 and G204 warnings.

- cmd/bd/doctor.go:664 - ReadFile from .beads/config.yaml
- cmd/bd/main.go:645 - ReadFile from .beads/{issues,beads}.jsonl
- cmd/bd/doctor/fix/database_config.go:166 - ReadFile from git root .gitattributes
- cmd/bd/doctor/fix/untracked.go:61 - exec Command with whitelisted JSONL files
2025-11-29 00:44:23 -07:00
matt wilkie
f134a3d658 fix: remove duplicate countIssuesInJSONLFile function
Fixes build failure in Test, Lint, Test (Windows), and Test Nix Flake jobs.
The function was defined in both init.go and doctor.go. Removed the init.go
version which is now unused. The doctor.go version (which calls
countJSONLIssues) is the canonical implementation.

Fixes #19780439467
2025-11-29 00:39:28 -07:00
Steve Yegge
078efdf07b bd sync: 2025-11-28 23:37:56 2025-11-28 23:37:56 -08:00
Steve Yegge
65baeecce1 bd sync: 2025-11-28 23:36:21 2025-11-28 23:36:21 -08:00
Steve Yegge
a4e0f9dbc8 fix(no-db): auto-detect JSONL-only mode when config has no-db:true (bd-5kj)
When .beads exists with issues.jsonl but no SQLite database, and config.yaml
has no-db: true, automatically enable JSONL-only mode instead of failing
with 'no beads database found'. Also improved error message to mention
--no-db option.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:36:11 -08:00
Steve Yegge
092863b4dd bd sync: 2025-11-28 23:34:12 2025-11-28 23:34:12 -08:00
Steve Yegge
cd114b7bd5 feat: extract error handling helpers FatalError/WarnError (bd-s0z)
Create reusable error handling helpers to reduce boilerplate and
enforce consistency across the codebase:

- FatalError(format, args...): writes "Error: ..." to stderr and exits
- FatalErrorWithHint(message, hint): includes actionable suggestion
- WarnError(format, args...): writes "Warning: ..." to stderr

Prototyped in create.go to validate the approach - converted 13 error
patterns and 5 warning patterns. This reduces code from:

    fmt.Fprintf(os.Stderr, "Error: %v\n", err)
    os.Exit(1)

To simply:

    FatalError("%v", err)

Also fixed countIssuesInJSONLFile reference after earlier refactoring.

See docs/ERROR_HANDLING.md for the three-pattern guideline.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:28:30 -08:00
Steve Yegge
0ab815dd5a bd sync: 2025-11-28 23:28:10 2025-11-28 23:28:17 -08:00
Steve Yegge
642f1c286b bd sync: 2025-11-28 23:27:36 2025-11-28 23:27:36 -08:00
Steve Yegge
50f64ecece docs: extend error handling audit with Phase 2 (bd-3gc)
Audited 10 additional cmd/bd files for error handling consistency:
- daemon_sync.go, list.go, show.go, dep.go, label.go
- comments.go, delete.go, compact.go, config.go, validate.go

Key findings:
- Pattern compliance is excellent (~97% for Pattern A, ~95% for Pattern B)
- Identified good patterns: batch operations continue, daemon fallback
- Updated compliance scorecard with new results

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 23:27:24 -08:00