Commit Graph

4 Commits

Author SHA1 Message Date
Peter Chanthamynavong
0a48519561 feat(context): centralize RepoContext API for git operations (#1102)
Centralizes repository context resolution via RepoContext API, fixing bugs where git commands run in the wrong repo when BEADS_DIR points elsewhere or in worktree scenarios.
2026-01-15 07:55:08 -08:00
dave
4440f9e8cb refactor(gate): consolidate numeric ID check and improve workflow matching
Code review improvements:
- Make isNumericRunID delegate to isNumericID (DRY)
- Extract workflowNameMatches() for clearer, more robust matching
- Handle hint→filename matching (e.g., "release" matches "release.yml")
- Add TestWorkflowNameMatches with comprehensive test cases

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

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 23:40:37 -08:00
dave
8528fcaa4e fix(gate): handle workflow name hints in gh:run gate discovery (bd-m8ew)
When a formula specifies a gate with id="release.yml", the AwaitID
now properly functions as a workflow name hint:

- gate discover: finds gates where AwaitID is empty OR non-numeric
- gate discover: filters matching runs by workflow name when hint present
- gate check: gracefully handles non-numeric AwaitID with clear message

Added isNumericRunID/isNumericID helpers and tests for the new behavior.

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

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

Executed-By: beads/crew/dave
Rig: beads
Role: crew
2026-01-06 23:34:30 -08:00
onyx
a89f47cdf2 feat(gate): add bd gate discover for gh:run await_id auto-discovery (bd-z6kw)
Implements automatic discovery of GitHub workflow run IDs for gates
awaiting CI/CD completion. This enables the Refinery patrol to
auto-populate await_id for gh:run gates that were created without one.

Changes:
- Add `bd gate discover` command that:
  - Finds open gh:run gates without await_id
  - Queries recent GitHub workflow runs via gh CLI
  - Matches runs to gates using heuristics (branch, commit, time)
  - Updates gates with discovered run IDs

- Add `--await-id` flag to `bd update` for manual setting
- Add AwaitID to UpdateArgs in RPC protocol
- Add await_id to allowedUpdateFields in storage layer

Matching heuristics (scored, highest match wins):
- Commit SHA match: +100 points
- Branch match: +50 points
- Time proximity (<5min: +30, <10min: +20, <30min: +10)
- In-progress/queued status: +5 points

Usage:
  bd gate discover           # Auto-discover for all matching gates
  bd gate discover --dry-run # Preview without updating
  bd gate discover --branch main --limit 10

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 16:14:35 -08:00