You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(bud-closure): stop firing repo scans on BUD close
Closing a BUD via PATCH /api/v1/buds/{id} (status -> closed/prod) was
dispatching an incremental repo scan through
bud_closure._trigger_impacted_repo_scan against whichever HEAD the repo
happened to point at -- no main-branch / merge / deployment / HEAD-advance
check. On 2026-06-02 this caused BUD #8's close to deactivate 10
cross-cutting features (Permissions & Roles, Auth Context, Sandbox
Refunds, etc.) at a SHA the BUD never even shipped to main.
Repo scans now live exclusively in the PR-merge GitHub webhook
(api/v1/github_webhook.py -> services/scan/pr_merge_update.py), which
already gates on main_branch and only fires when a real merge advances
the tracked HEAD.
on_bud_closed keeps every other side effect: contributor XP, BUD-shipped
SP, BUD learning metrics (CLOSED only), and the post-close Learning
Agent. The linked-features in_progress -> done transition continues to
run upstream in bud.py via feature_lifecycle.transition_feature_for_bud,
unchanged.
CLAUDE.md and CHANGELOG.md updated so future readers find the scan
trigger in the right place.
Verified locally: with the patch loaded, PATCH BUD 246 prod -> closed
produced no new row in scans and no features.is_active flips on the
impacted repo (taskflow-web stayed at 5 active / 0 inactive).
Signed-off-by: Arun Rajkumar <mickyarunr@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ First public release. Bodhiorchard™ ships as an open-source, local-first AI de
25
25
-**Async job pattern** — backend returns `202` + job ID; frontend tracks via `useJobSocket` over `/ws/jobs/{job_id}`.
26
26
-**Event bus fan-out** — `event_bus.publish(...)` reaches in-process subscribers (dashboard `/ws`) and external transports (Colyseus, future Slack/metrics sinks) via a single `register_transport()` hook.
27
27
-**Bug auto-linking** — pgvector cosine search at 0.40 threshold links new bug reports to the BUDs that introduced them.
28
-
-**Contributor-XP economy** — closing a BUD awards XP and triggers a repo re-scan via the single `on_bud_closed()` entry point.
28
+
-**Contributor-XP economy** — closing a BUD awards XP and SP, computes learning metrics, and spawns the post-close Learning Agent via the single `on_bud_closed()` entry point.
-`on_bud_closed()` in `services/bud_closure.py` is the single entry point for contributor-XP + repo-scan side effects — called from both manual PATCH and auto-close.
116
+
-`on_bud_closed()` in `services/bud_closure.py` is the single entry point for contributor-XP, BUD-shipped SP, learning metrics, and the post-close Learning Agent — called from both manual PATCH and auto-close.
117
+
- Repo scans are NOT triggered on BUD close. They are owned by the PR-merge GitHub webhook (`api/v1/github_webhook.py` → `services/scan/pr_merge_update.py`), which gates on the repo's `main_branch`.
118
+
- Linked-feature `in_progress → done` transitions run in `api/v1/bud.py` via `services/feature_lifecycle.transition_feature_for_bud` on every status change, independent of `on_bud_closed`.
117
119
- Release detection has two paths: fast (`bud_id` on PR) and SHA-walk (release PRs without `bud_id`).
118
120
119
121
### Shared code
@@ -147,7 +149,7 @@ The stored `claude_auth_mode` on the org decides which path agent runs take.
147
149
## BUD Lifecycle Completeness
148
150
149
151
- BUDs get embeddings at creation time (for bug linker vector search)
150
-
-`on_bud_closed()` in `bud_closure.py` handles: contributor XP + repo scan (called from both manual PATCH and auto-close)
152
+
-`on_bud_closed()` in `bud_closure.py` handles: contributor XP, BUD-shipped SP, BUD learning metrics, and the post-close Learning Agent (called from both manual PATCH and auto-close). Repo scans live in the PR-merge webhook, not here.
151
153
- Release detection: fast path (bud_id on PR) vs SHA-walk path (release PRs without bud_id)
0 commit comments