Repository navigation
fix: Epic PR now properly removes label before adding new - #3423
Conversation
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses epic handoff by publishing completion before removing trigger labels and releasing the current issue before advancing the queue. It needs changes before merge because the accompanying configuration changes introduce two deployment regressions. ✅ Ordered completion — ✅ Recoverable handoff failures — Failed label release preserves the queue cursor and records a blocked reason. Added tests cover retry and concurrent observers. This review uses static tracing only; no commands or tests were run. Current head checks show three neutral/skipped checks and no passing, pending, or failed checks. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Restore a portable database default
F2: 🔴 Preserve imported Redis configuration
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Test the actual configuration templateThe Compose identity test previously extracted ScoreThe label handoff implementation has useful targeted coverage, but the configuration regressions prevent merge readiness. The supplied current checks provide no executed validation of the head. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ Applied the requested follow-up changes in commit 5b3fc62
Summary of ChangesI fixed both findings, F1 and F2. I checked them with the real Docker Compose binary (v2.39.4, F1: database default restored
F2: imported Redis settings kept
Tests
Related issues found, not changed
🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…eal Docker Compose binary (v2.39.4, `docker compose config`) and with the updated regression test.
I fixed both findings, F1 and F2. I checked them with the real Docker Compose binary (v2.39.4, `docker compose config`) and with the updated regression test.
**F1: database default restored**
- `.env.example` is back to `DB_FILENAME=./data/propr.sqlite`. The note about `PROPR_DATA_DIR` for absolute host paths stays as an optional setting.
- The test in `test/composeApiIdentityPath.test.mjs` had hardcoded the filename. It now reads the value from `.env.example` again, so the same regression would be caught.
- In Compose, a config copied from the example now gives every backend `./data/propr.sqlite` with `DATA_DIR=/usr/src/app/data`. That path is inside the shared `./data` mount.
**F2: imported Redis settings kept**
- I removed the four `REDIS_HOST=${REDIS_HOST:-redis}` / `REDIS_PORT=${REDIS_PORT:-6379}` entries. Explicit `environment` entries always beat `env_file`, which is why they were overriding the imported values.
- The defaults now live in a new file, `docker/compose-backend-defaults.env`. Daemon, worker, indexing-worker and API each load it first. The order is: bundled defaults, then `PROPR_ENV_FILE`, then the local or staging `.env`, and later files win. I used a file rather than adding defaults to the start-up commands because `docker-compose.dev.yml` replaces the daemon and worker commands, which would drop them.
- Compose output for all four services:
- nothing set anywhere: `redis:6379`
- import sets `ext-redis:6390`: that value is used
- local `.env` sets `REDIS_HOST=local-redis`: it wins, and the imported port is kept
- One behaviour change: a `REDIS_HOST` exported only in the shell no longer reaches the containers. This branch had added that; `main` never did it. `docker compose run -e REDIS_HOST=…` (used by the `test:docker*` scripts) still works.
- A new test checks that each service loads the defaults file before `PROPR_ENV_FILE`, has no explicit Redis entries, and resolves imported, local and fallback values correctly.
**Tests**
- The updated test file passes (2/2). Run against the old `docker-compose.yml` and `.env.example`, both tests fail.
- `ciChangeClassification` and `deployPrPreview` still pass (98/98).
**Related issues found, not changed**
- **`API_PUBLIC_URL` has the same problem.** The entry this PR added to daemon, worker and indexing-worker overrides any `API_PUBLIC_URL` in `PROPR_ENV_FILE` with the localhost default. I didn't apply the same fix because its default depends on `API_PORT`, and `deploy-pr.sh` sets this value from the shell for preview environments. Moving it into a defaults file would change how previews behave, so it needs its own decision.
- **Older API entries.** `FRONTEND_URL`, `GH_OAUTH_CALLBACK_URL` and `SESSION_REDIS_*` on the API service also override env-file values. Those entries were there before this PR.
- **Example still points Redis at loopback.** `.env.example` sets `REDIS_HOST=127.0.0.1`, so a `.env` copied unchanged sends the containers to loopback rather than the bundled Redis. This was true before the PR too.
- **Example's staging placeholder blocks Compose.** `.env.example` sets `STAGING_ENV_FILE=/path/to/staging/.env`, so a copied, unedited `.env` stops `docker compose config` with "env file not found". It does the same on the unfixed branch.
PR: integry#3423
Comment by: @integry (ID: 6713341719)
Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses the stalled epic handoff by publishing completion before removing trigger labels and requiring cleanup before queue advancement. It needs changes before merge because a partial cleanup failure can leave completion unrecoverable through the normal retry path. ✅ Ordered label publication — ✅ Guarded queue advancement — Cleanup errors retain the queue cursor and record a blocked reason; added tests cover removal failures and concurrent observers. No check runs were reported for the current head. This review used static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F3: 🔴 Retry completion after partial label cleanup
SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Exercise mixed trigger completion statesAdd coverage for an issue carrying multiple configured primary labels when only one has a done marker. The final-child test currently supplies done markers for every trigger, while the handoff requires all active triggers to have them. Testing the mixed state would clarify recovery expectations for unused or cancelled triggers; this is additional coverage, not a separately demonstrated blocker. S3: 🟢 Validate actual Compose configurationThe Compose tests inspect text and simulate environment merging. A follow-up integration test using rendered Compose configuration would better exercise imported environment files, interpolation, and custom database mounts together. This is optional validation beyond the supplied static assertions. ScoreThe implementation has useful ordering and concurrency coverage, but partial completion recovery remains a merge blocker. Current-head automated validation is unreported. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit ed2d2cb
Summary of ChangesI've fixed F3. If a no-change job publishes the done label but then can't remove its trigger label, a later retry of any kind now finishes the job's remaining steps before the "already done" skip. Those steps are the label cleanup, the completion comment and the plan-status write that lets the next issue start. It doesn't rerun the implementation work. How it works
Tests
Separate findings (not fixed)
There are no previews because nothing here changes the UI. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…but then can't remove its trigger label, a later retry of any kind now finishes the job's remaining steps before the "already done" skip. Those steps are the label cleanup, the completion comment and the plan-status write that lets the next issue start. It doesn't rerun the implementation work. I've fixed F3. If a no-change job publishes the done label but then can't remove its trigger label, a later retry of any kind now finishes the job's remaining steps before the "already done" skip. Those steps are the label cleanup, the completion comment and the plan-status write that lets the next issue start. It doesn't rerun the implementation work. **How it works** - **Saved record:** before the done label is added, `handleNoCodeChanges` saves a per-issue record in Redis (`src/jobs/noChangeCompletionObligation.ts`). The record lists what's still owed: the trigger and processing labels to remove, the labels the run saw (these decide whether the plan status gets written), and the comment. Saving it first means there's no moment when the done label is on the issue without the record. - **Finishing the steps** (`src/jobs/noChangeCompletion.ts`): it removes the labels, posts the comment, then writes the plan status. Once the comment is posted it's dropped from the record, so a retry won't post it twice. The record is deleted only after the status write succeeds or turns out not to be needed. If the status write fails it's still logged and swallowed as before, but the record now stays for the next job. Updates and the delete only go through if the stored record is still the one this run saved, so an older run can't wipe out a newer one. - **Worker change** (`src/jobs/processGitHubIssueJob.ts`): when the issue has the done label and a record exists, the worker finishes the record's steps first. Then the normal label check runs on the updated labels, so the retry ends as "Already done". If finishing still fails, the job fails like any other error and the record stays. A record whose done label was never published is left alone. - `markNoChangePlanIssueMerged` moved into the new module and now returns whether anything is still owed. `completeIssueLabels` shares a small `releasedTriggerLabels` helper with it. **Tests** - New `test/noChangeCompletionRetry.test.ts` drives the real worker and the real `handleNoCodeChanges`. The first job publishes the done label and then fails to remove "AI". A retry outside any dispatch removes the labels, writes `merged` and posts the comment once, without rerunning the work. A third delivery is a plain skip, and a retry whose label removal fails again keeps the record. With the worker change switched off, both tests fail. - `test/noChangePlanIssueCompletion.test.ts`: the old test that only proved a failed removal blocks the plan now also checks that the steps are finished later. New cases cover a failed status write (finished later, comment not repeated), a record whose done label never landed (not replayed), and an older run not deleting a newer record. - Three existing test mocks had no Redis `get`/`set`, so I added them: `issueJobMultiModelSiblings`, `taskSubmissionLifecycle` and `mcpEpicDispatch`. The last one now also checks that the record is cleared. - Ran 11 related test files with `scripts/run-test-suite.mjs`; all pass, including `mcpEpicDispatch` (72/72). Typecheck and lint on `src/` pass with no warnings. One existing complexity warning remains in `mcpEpicDispatch.test.ts` at line 32; it was already there before this change. **Separate findings (not fixed)** - If the worker crashes after saving the record but before the done label is added, the record stays. It's harmless until some later run adds the done label to that issue, for example a PR run. The next job would then mark the issue merged in the plan from this stale record. - If the worker crashes after posting the comment but before updating the record, the retry will post the comment again. GitHub and Redis can't be updated in one step, so this can't be fully avoided. There are no previews because nothing here changes the UI. PR: integry#3423 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses the label handoff problem by publishing completion before removing trigger labels and withholding epic advancement until cleanup succeeds. The supplied code supports merge readiness within scope; no check runs were reported for the current head. ✅ Ordered label handoff — Completion publishes ✅ Recovery coverage — Added tests cover failed label removal, concurrent queue observers, custom labels, and replay of interrupted no-change completions. This review used static tracing of the supplied diff and context. No commands or tests were run. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S4: 🟢 Replay retained completions autonomously
S5: 🟢 Exercise actual Compose configuration resolutionThe added Compose tests inspect configuration text and simulate environment merging with ScoreThe implementation directly addresses the reported handoff problem and includes focused failure-path coverage. Static review found no verified merge blocker, although current-head automated validation remains unreported. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/review fable |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — fableOverall EvaluationThe PR addresses a real epic-queue hang: a finished child issue kept its trigger label ( Verdict: needs minor changes. One PR-introduced regression in failure propagation on the PR-creating completion paths should be corrected before merge; the rest are follow-ups. ✅ Done-before-release ordering is applied consistently — ✅ Epic handoff is fenced and recoverable — ✅ No-change obligation uses compare-and-swap — Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F4: 🔴 Trigger-release failure now aborts PR post-processing after the PR exists, with no recovery path
SuggestionsThese are optional follow-ups and are not sent to S6: 🟢 Merged head without a worker-published
|
|
/fix all |
|
✅ Applied the requested follow-up changes in commit 700e200
Summary of ChangesI've applied F4 and S1–S10. All 19 affected suites pass (plus the 72-test API epic dispatch suite), and lint and typecheck are clean. One request I couldn't follow: S8 asked to split the Compose changes into their own PR, but this run isn't allowed to create PRs. I fixed the two points it raised here instead. F4: a failed trigger release no longer fails a job whose PR exists
Epic handoff (S2, S6, S10)
No-change completions (S4, S9)
S7: I documented the trade-off in Compose (S1, S3, S5, S8)
Separate findings, not fixed
No visual previews: none of these changes are visible in the UI. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…us the 72-test API epic dispatch suite), and lint and typecheck are clean. One request I couldn't follow: S8 asked to split the Compose changes into their own PR, but this run isn't allowed to create PRs. I fixed the two points it raised here instead. I've applied F4 and S1–S10. All 19 affected suites pass (plus the 72-test API epic dispatch suite), and lint and typecheck are clean. One request I couldn't follow: S8 asked to split the Compose changes into their own PR, but this run isn't allowed to create PRs. I fixed the two points it raised here instead. **F4: a failed trigger release no longer fails a job whose PR exists** - `completeIssueLabels` (in `issueJobCompletionLabels.ts`) still throws, but now only the no-change path uses it, because a later job can replay that path's retained record. - The two PR-producing paths (`performPostProcessing` and `handlePRValidation`) and the post-processing failure handler now use a new non-throwing version. It logs the leftover labels as a warning and the run carries on with assignment, PR-to-plan linking and the failure comment. - If even `AI-done` can't be added, it removes only `AI-processing` and keeps the trigger as the record of the request, which is how it behaved before this PR. - New test `test/prCompletionTriggerReleaseFailure.test.ts` makes GitHub return 502 on removing `AI`. Its four cases all fail on the old code. **Epic handoff (S2, S6, S10)** - **S6:** a merged head now waits only while `AI-processing` is present without `AI-done`. A bare `AI` (stopped task, failed run, or a PR a human fixed and merged) is released instead of blocking the queue forever. I removed the manual `AI-done` the API test fixture had to add. - **S10:** the handoff now removes only the label the queue applied, plus any other trigger whose own `-done` marker is present. Other triggers are left alone. - **S2 / blocked reason:** new tests cover mixed completion states and check that a successful advance clears the earlier blocked reason. **No-change completions (S4, S9)** - **S9:** retained records now expire after 30 days. The completion comment is claimed with a compare-and-set before it's posted, so two concurrent settlers post it once. If the post fails, the comment is handed back for a later retry. The concurrency test fails on the old code. - **S4:** a new daemon sweep (every 5 minutes) replays owed records once they're older than 10 minutes and their done marker is published. The plan-status write no longer waits for another job on the same issue. **S7:** I documented the trade-off in `docs/docs/architecture/worker.md` rather than changing behaviour: once `<trigger>-done` exists, removing the trigger no longer cancels the remaining models. Use the UI stop action or `propr task stop` instead. **Compose (S1, S3, S5, S8)** - **S8(a):** backends now refuse to start when a relative `DB_FILENAME` would land outside the mounted data directory, instead of silently keeping the database on container storage. A core guard covers the daemon and workers; the API startup script has the same check. Explicit absolute paths are left alone. - **S8(b):** the web UI still defaults to `http://localhost:4000`, but setting `PROPR_UI_PUBLIC_API_URL` to empty now keeps same-origin access behind a reverse proxy. - **S1:** the identity test now builds its environment from the real `.env.example` and the values Compose would interpolate, rather than a hardcoded `DATA_DIR`. - **S3/S5:** new `test/composeRenderedConfig.test.mjs` renders the real config with `docker compose config`. It skips when Compose isn't installed; I ran it with Compose v2.39.4 (`PROPR_TEST_DOCKER_COMPOSE` points it at a standalone binary). **Separate findings, not fixed** 1. The new rendered test found that a bare relative `PROPR_ENV_FILE` such as `imported.env` makes Compose reject the whole project: the daemon's mount reads it as a named volume. I documented "use an absolute or `./`-relative path" in `.env.example` and added a test for it; the mount itself is unchanged. 2. On main too, copying `.env.example` to `.env` doesn't give a working Compose setup: - `REDIS_HOST=127.0.0.1` overrides the bundled `redis` default, so containers point at themselves. - The placeholder `STAGING_ENV_FILE=/path/to/staging/.env` makes `docker compose config` fail. No visual previews: none of these changes are visible in the UI. PR: integry#3423 Comment by: @integry (ID: 6728723363) Model: Claude Opus 5.5
|
/review astra fable |
|
✅ AI Code Review Complete requested by @integry Posted 2 reviews: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses epic handoff by releasing completed issue labels before advancing the queue, and adds recovery for interrupted no-change completions. It needs changes before merge because recovery can discard an unfinished status write or apply a superseded completion. ✅ Ordered label handoff — Completion publishes the done marker before removing the trigger; epic advancement waits for successful label cleanup. ✅ Recoverable comment delivery — Retained comments use compare-and-set claims and hidden markers to reconcile uncertain GitHub responses. This review is a static trace of the supplied code; no commands were run. No current-head check runs were reported. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F12: 🔴 Failed status writes discard recovery records
F13: 🔴 Superseded completion can still mark renewed work merged
SuggestionsThese are optional follow-ups and are not sent to S22: 🟢 Separate deployment configuration changesThe Compose environment layering, public URL defaults, and data-mount guard are substantial changes independent of epic label handoff. Separating them would simplify validation and rollback. This is optional organization advice, not a merge requirement. ScoreThe label sequencing and recovery coverage are useful, but two recovery correctness defects remain. The supplied tests do not cover the production status-write failure contract or the later supersession window. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit a4c2cd9
Summary of ChangesI fixed F12 and F13. A failed plan-status write now keeps the no-change completion owed, and an older completion re-checks that it still owns the issue before it marks anything merged. F12: failed status writes no longer discard the recovery record
F13: an older completion can no longer mark renewed work merged
Regressions
Verification: 395 root tests across 13 suites and 30 core tests pass. Found separately, not changed: There are no visual changes, so I didn't create previews. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…he no-change completion owed, and an older completion re-checks that it still owns the issue before it marks anything merged.
I fixed F12 and F13. A failed plan-status write now keeps the no-change completion owed, and an older completion re-checks that it still owns the issue before it marks anything merged.
**F12: failed status writes no longer discard the recovery record**
- `updatePlanIssueStatus` (`packages/core/src/config/planIssueManager.ts`) now returns `Promise<boolean>`: `true` once the database update has persisted. It still logs failures instead of throwing, so the other callers, which ignore the result, behave as before. A failure in the later draft-status or activity steps doesn't make it return `false`.
- `markNoChangePlanIssueMerged` keeps the record owed unless that result is `true`, so it no longer relies on a callee that swallows its own errors.
- **Same defect found in the same function:** `findPlanIssueByRepoAndNumber` also swallows database errors and returns `null`, which the wrapper read as "not part of a plan" and then deleted the record. It now takes an opt-in `{ throwOnError: true }`, and the no-change path uses it. Other callers are unchanged.
**F13: an older completion can no longer mark renewed work merged**
- The status step now gets a check that this completion still applies: its record is still retained and its request is still the newest. The check runs after both the plan-issue and queue lookups, just before the write. If it fails, the step writes nothing and drops the record if it was superseded.
- The status step now ends in one of three results: settled (record released), owed (record kept for replay) or superseded (nothing written).
- A small gap remains between that Redis check and the SQLite write. It sits between two separate stores and can't be closed without a transaction spanning both, so I left it.
**Regressions**
- The status-write mocks in the no-change and submission suites now follow the real contract (`false` on failure, `true` on success) instead of throwing.
- New tests:
- the real `updatePlanIssueStatus` returns `false` when the update fails, and `true` when only the later draft sync fails.
- `throwOnError` passes a lookup failure through, while the default still returns `null`.
- a failed plan lookup keeps the status write owed, and a later replay completes it.
- renewal during the plan-issue lookup and during the queue lookup produces no status write and leaves no record.
- I removed each fix in turn and confirmed the matching new tests fail without it.
**Verification:** 395 root tests across 13 suites and 30 core tests pass. `tsc` is clean for root, core and api (after rebuilding core). Lint passes on both changed source files. To keep `planIssueManager.ts` under the 400-line limit, I merged the parameter lists of the two edited functions onto single lines.
**Found separately, not changed:** `notifyEpicQueue` inside `updatePlanIssueStatus` logs and ignores queue-notification failures. A status can therefore persist while the epic queue never hears about it. That behaviour predates this PR and is outside F12/F13.
There are no visual changes, so I didn't create previews.
PR: integry#3423
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses epic handoff by publishing completion before removing trigger labels and retaining unfinished no-change completion steps for recovery. It needs changes before merge because request ownership can still be lost during status publication, and independent triggers share one supersession key. ✅ Ordered label handoff — Queue advancement waits for successful label removal, with failures retained as a blocked reason. ✅ Recoverable comment delivery — Retained comments, compare-and-set claims, and hidden markers support recovery after failed or uncertain delivery. This was a static review of the supplied code; no commands were run. No current-head check runs were reported. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F14: 🔴 Recheck ownership inside the status writer
F15: 🔴 Keep independent trigger completions separate
SuggestionsThese are optional follow-ups and are not sent to S23: 🟢 Exercise Compose tests in CIThe rendered-configuration suite usefully checks actual Compose behavior, but skips when Compose v2 is unavailable. Running it in a designated CI job would strengthen evidence for the unrelated deployment changes. This is optional; no current check failure was reported. ScoreThe implementation provides substantial recovery coverage, but the two ownership defects can discard completion obligations or advance an epic incorrectly. Both need correction before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 6598d98
Summary of ChangesI fixed F14 and F15. All 13 affected suites pass, root and core typecheck are clean, and lint passes with zero warnings in both root F14: the status writer now rechecks ownership itself
F15: completions are tracked per trigger
I found no other issues to report. No preview, since nothing here is visible to a user. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…core typecheck are clean, and lint passes with zero warnings in both root `src/` and core. I also ran each new regression against the unfixed code, and every one failed there.
I fixed F14 and F15. All 13 affected suites pass, root and core typecheck are clean, and lint passes with zero warnings in both root `src/` and core. I also ran each new regression against the unfixed code, and every one failed there.
**F14: the status writer now rechecks ownership itself**
- `updatePlanIssueStatus` (`packages/core/src/config/planIssueManager.ts`) takes an optional `stillApplies` check. It runs after the writer's own `plan_issues` lookup, right before the update. If the check fails, the writer makes no update, doesn't notify the epic queue, doesn't run the draft sync, and returns `false`. Other callers don't pass the check and behave as before.
- `markNoChangePlanIssueMerged` (`src/jobs/noChangeCompletion.ts`) passes its ownership check into the writer. A check that fails inside the writer is reported as "superseded", so the old record is dropped rather than kept as owed.
- To stay under core's 400-line lint limit, I put the writer's existing lookup and update queries on fewer lines. They do the same thing.
- Regressions:
- Using the real writer (`test/planIssueManager.ultrafix.test.ts`): request B is admitted while the writer waits on its lookup. The test checks that the status stays pending and the queue gets no notification. A second test covers the normal case, where the check runs once after the lookup and the update goes through.
- At the caller level (`test/noChangeCompletionSupersession.test.ts`): a `status-writer` case, next to the existing plan and queue lookup cases.
- One gap can't be closed: if B is admitted after the check passes but before the database update lands, A can still write. Redis and Postgres can't be updated atomically together.
**F15: completions are tracked per trigger**
- The request key now includes the trigger label (`…#<n>:<trigger>`). It's set when a job is admitted and read by `isCurrentNoChangeRequest`, which is behind every supersession check: before label changes, the comment claim, the status write and recovery replay.
- `admitNoChangeRequest` now takes `{ requestId, triggeringLabel }` and only deletes records for the same trigger. `processIssueWithAdmission` passes the job's trigger (`AI_PRIMARY_TAG`), which already falls back to the default trigger for older jobs.
- A new `noChangeCompletionTrigger` helper works out a record's trigger. Records without `triggeringLabel` get it from the processing tag, the same fallback `releasedTriggerLabels` uses, so admission, retention and recovery all agree.
- Regressions:
- An interrupted `AI` completion survives when `Assistant` work is admitted. A replay then still posts the `AI` comment and the status write without touching the `Assistant` label.
- The `AI` record still counts as current after the `Assistant` admission.
- A legacy record with no trigger is dropped only by new work under its fallback trigger.
- I updated the existing tests to the new key format and admission signature.
- Request keys written in the old issue-wide format by earlier builds of this branch are now ignored and expire through their TTL. Records with no matching key count as current, so nothing gets stuck.
I found no other issues to report. No preview, since nothing here is visible to a user.
PR: integry#3423
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses the label handoff problem and adds substantial recovery coverage, but it needs changes before merge: a delayed job can incorrectly reclaim ownership from a newer request and discard its unfinished completion. ✅ Ordered label handoff — Completion publishes the done marker before removing the trigger, and epic advancement waits for successful label cleanup. ✅ Recoverable comment delivery — Retained completion records, comment claims, and hidden markers support recovery after interrupted or uncertain comment delivery. This review used static tracing of the supplied code; no commands were run. No check runs were reported for the current head. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F16: 🔴 Older jobs can supersede newer requests
SuggestionsThese are optional follow-ups and are not sent to S24: 🟢 Exercise scripts against RedisThe in-memory completion store reproduces the intended compare-and-set behavior rather than executing the Lua scripts. A small integration suite using Redis would strengthen confidence in admission and recovery concurrency. This is optional additional coverage; it does not replace the targeted regression required for F1. ScoreThe label ordering and recovery tests are strong, but the request-generation regression can discard recovery state and leave an epic blocked. The correction appears localized. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 94701bd
Summary of ChangesI've fixed F16. A late job from an older request can no longer take over the issue from a newer request or delete the completion that request still owes. What was wrong: What changed:
Tests:
Verification: 50 of 50 tests pass across the 7 affected root suites. Separate observation, not changed: request IDs are only as shared as correlation IDs are. When a dispatched job has no correlation ID, each child makes its own, so those siblings count as separate requests. That was already true before this PR. There are no visual previews because nothing user-visible changed. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ger take over the issue from a newer request or delete the completion that request still owes. I've fixed F16. A late job from an older request can no longer take over the issue from a newer request or delete the completion that request still owes. **What was wrong:** `admitNoChangeRequest` always wrote the admitting job's request ID, and then deleted records from other requests. So a delayed sibling or retry of request A, arriving after request B had been admitted, replaced B's request ID and deleted B's owed completion. **What changed:** - **Each request gets a place in the issue's order, once** (`noChangeCompletionObligation.ts`). A per-issue counter in Redis gives each request ID a number the first time it is seen. Siblings and retries keep the same correlation ID, so they find the number already assigned and stay older. - **The number is assigned at dispatch** (`issueJobDispatcher.ts`), before any child job is queued. This covers the case where every job of request A runs after B's: A was still dispatched first, so it still counts as older. Jobs that never go through the dispatcher get their number on first admission instead. The Redis code is loaded only when used, so tests that import the dispatcher don't open a Redis connection. - **Admission checks the order first, in one Redis script.** It takes over only if no request ordered after it currently holds the issue. A stale admission writes nothing, deletes nothing, and returns 0. The stale job still runs; if it then finishes without changes, its own completion is dropped as superseded by the existing check. - **Cleanup never deletes a newer request's completion.** It still stops if a newer admission takes over during the loop. Records with no order number (from before this change) are treated as older, as before. **Tests:** - **End-to-end** (`test/noChangeCompletionRetry.test.ts`), the finding's scenario through `processGitHubIssueJob`: 1. A's first model finishes. 2. B is admitted and finishes without changes, but its plan-status write fails. 3. A's delayed sibling passes the label check while B's write is still failing, then crashes. 4. B still holds the issue and its completion is still owed; the next delivery finishes it and the plan advances. On the unfixed code this test fails: the stored request ID is `request-a` instead of `request-b`. - **Unit tests** (`test/noChangeCompletionSupersession.test.ts`): an older request re-admitted after a newer one; order set at dispatch beating admission order; cleanup sparing a newer request's record. - **Dispatcher** (`test/issueJobDispatcher.handleDispatch.test.ts`): the request is ordered before its child is queued. - The shared in-memory Redis stand-in now models the ordering scripts. **Verification:** 50 of 50 tests pass across the 7 affected root suites. `tsc` is clean, and `eslint --max-warnings 0` on root `src/` passes. My first version pushed `handleDispatchWithDeps` over the complexity limit, so the ordering call now sits in `enqueueChildren`. I didn't rerun `packages/api/test/mcpEpicDispatch.test.ts`: it only uses the stand-in's record-update path, which I didn't change. **Separate observation, not changed:** request IDs are only as shared as correlation IDs are. When a dispatched job has no correlation ID, each child makes its own, so those siblings count as separate requests. That was already true before this PR. There are no visual previews because nothing user-visible changed. PR: integry#3423 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses the epic handoff by releasing completed issues’ trigger labels before advancing the queue. It also adds durable recovery for interrupted no-change completions. It is not ready to merge because that recovery can overwrite a sibling’s subsequently published PR status and advance an epic prematurely. ✅ Ordered label handoff — Queue advancement awaits successful label cleanup; failed removal retains the cursor and records a blocked reason. ✅ Recoverable comment delivery — Retained comments use compare-and-set claims and hidden markers to reconcile uncertain POST responses. This review is based on static tracing of the supplied code. No commands were run. No current-head check runs were reported. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F17: 🔴 Recovery can merge an issue with an unmerged sibling PR
SuggestionsThese are optional follow-ups and are not sent to S25: 🟢 Exercise the actual Redis scriptsThe new tests extensively exercise an in-memory implementation of the Redis operations, but that double reproduces the intended behavior rather than executing the Lua. A small integration suite against Redis would improve confidence in compare-and-set, request ordering, and expiry behavior. This is additional verification, not a demonstrated merge blocker. ScoreThe handoff and failure-recovery coverage are substantial, but recovery currently permits an incorrect terminal status and premature queue advancement. That requires correction before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 9115746
Summary of ChangesI've fixed F17. Recovery can no longer mark an issue merged while a sibling's PR is linked and unmerged, so it no longer starts the next epic issue early. The new regressions pass, and all but one control test fail on the unfixed code. The fix
Behaviour changes to know about
Tests
Verification: 26 affected root and core suites pass. Root and core Found separately, not changed: This is backend logic only, so I made no visual previews. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
… while a sibling's PR is linked and unmerged, so it no longer starts the next epic issue early. The new regressions pass, and all but one control test fail on the unfixed code. I've fixed F17. Recovery can no longer mark an issue merged while a sibling's PR is linked and unmerged, so it no longer starts the next epic issue early. The new regressions pass, and all but one control test fail on the unfixed code. **The fix** - **Where the check lives:** I put it in the plan-status write itself, as a condition on the database update. With the new `onLinkedReview` option, `updatePlanIssueStatus` (`packages/core/src/config/planIssueManager.ts`) leaves the row alone when it has a linked PR in `under_review`, `in_refinement` or `refinement_processing`. In that case it doesn't notify the epic queue and returns `false`. - **Why not check first and write after:** a check followed by a separate write leaves a gap where B's PR can be linked in between. Doing it in one update closes that gap. One race is left, and I didn't change it: if A's merged write lands *before* B links its PR, the queue has already moved on and B's link then sets the status back to `under_review`. That's two siblings writing in some order, and fixing it would mean changing the PR-linking path, which wasn't part of F17. - **What happens to A's owed write:** `markNoChangePlanIssueMerged` (`src/jobs/noChangeCompletion.ts`) now treats it as done and releases the record. I chose that over keeping it for later. If it stayed owed, it could still write `merged` after B's PR was closed without merging. B's PR's own merge or close now decides the status. - **Which paths it covers:** the first write, a later job's replay and the periodic recovery sweep all go through this one function, so the check applies to all three. **Behaviour changes to know about** - A no-change result now never marks an issue merged while *any* linked PR is under review or in refinement. That includes an older PR from an earlier request that is still open. - If the linked PR was closed without merging, a no-change result still writes `merged`, as before. **Tests** - **New suite, `test/noChangeCompletionLinkedPr.test.ts`:** runs the real status writer against an in-memory SQLite database, with two models sharing one request. It covers: - the recovery sweep. - a later job's replay with the PR in refinement. - a PR linked between the writer's last ownership check and its update. - a control case where `merged` is still written (closed earlier PR, or no PR at all). - **Worker-level test in `test/noChangeCompletionRetry.test.ts`:** model A's status write fails, model B links a PR, and a redelivered job replays A's owed write. The issue stays under review and nothing is left owed. - **Checked against the unfixed code:** the first three new tests and the worker test fail there; the control test passes both before and after. The third test also fails against a weaker version that checks a value read before the write, so it does catch that gap. **Verification:** 26 affected root and core suites pass. Root and core `tsc` are clean, the two test files typecheck, and lint has zero warnings in root `src/` and all of core. `planIssueManager.ts` was at 397 of its 400-line lint limit, so I folded the guarded update into a single `if`. It now sits exactly at 400. **Found separately, not changed:** `closeFailedPlanIssue` in `src/jobs/issueJob/completion.ts` writes `closed` without any check when a task ends without success or a PR. A failing sibling could probably overwrite another sibling's `under_review` the same way, but I haven't confirmed that. That code predates this PR and wasn't selected. This is backend logic only, so I made no visual previews. PR: integry#3423 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR addresses epic handoff stalls by releasing completed issues’ trigger labels before advancing the queue. It also adds retained no-change completions and periodic recovery. The supplied code is merge-ready within scope; no actionable defect was verified through static review. ✅ Ordered handoff — Label-release failures preserve the queue cursor and record a blocked reason, allowing reconciliation to retry before starting the successor. ✅ Recoverable completion — Retained records preserve unfinished cleanup, comments, and status writes. Comment claims and delivery markers handle concurrent settlers and uncertain POST responses. ✅ Linked PR protection — The status update itself excludes linked PRs awaiting review, protecting against a PR being linked after the initial lookup. No commands or tests were run. No current-head check runs were reported. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S26: 🟢 Exercise Lua against RedisThe new request-ordering and compare-and-set tests use an in-memory double that reproduces the intended script behavior. An optional integration suite against Redis would independently validate the actual Lua, return values, and expiration behavior. The supplied tests already cover substantial application-level interleavings, so this is additional assurance rather than a verified merge requirement. S27: 🟢 Clarify template Redis behaviorThe supplied ScoreThe implementation directly addresses the reported stall and provides extensive recovery and concurrency coverage. Static review found no merge blocker, though execution results for the current head remain unavailable. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/review fable |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — fableOverall EvaluationThe PR's stated goal is narrow: when an epic's head issue finishes, release its trigger label ( However, the PR has grown far beyond that objective (+2924/-163 across 43 files): a Redis-backed "no-change completion obligation" with request ordinals, compare-and-set records, comment claims, a daemon recovery sweep; a ✅ Publish-before-release ordering is enforced and tested at both ends — ✅ Linked-PR guard is part of the UPDATE itself — ✅ Durable obligation is retained before the irreversible GitHub mutation — Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S28: 🟢 Split the Compose/data-dir work from the label fixThe objective is "release the old issue's trigger before labeling the next one". The S29: 🟢 Verify
|
|
CI is red on the current head ( Build & Lint Check → Validate Changes failed on one ESLint warning (the lint runs with Please reduce the complexity of the Full Test Suite → Shard 4/4 also failed on this head: https://github.com/integry/propr/actions/runs/42550956779. Please check that shard's failing test and fix it too, then verify both locally before pushing. |
|
✅ Applied the requested follow-up changes in commit a11053a Summary of ChangesBoth CI failures are fixed and pass locally. Two files changed. 1. Lint: 2. Shard 4/4: Checked locally
The epic dispatch test only passes when run the way CI runs it: through the suite runner from the repo root. Run directly from inside 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ged. Both CI failures are fixed and pass locally. Two files changed. **1. Lint: `request` complexity in `packages/api/test/mcpEpicDispatch.test.ts`** The GitHub mock's `request` method was one long `if` chain. I moved each route into a small lookup table (`githubRoutes`), where each entry pairs a route check with its handler. `request` now just finds the matching entry and calls it, or throws `Unexpected route` as before. The routes are checked in the same order and do the same things. `npm run lint -- --max-warnings 0` in `packages/api` now passes with no warnings. **2. Shard 4/4: `test/ultrafixDaemonResumeSweep.test.ts` › "the daemon schedules the sweep and stops it on shutdown"** The failure came from this branch. An earlier commit collapsed the shutdown `clearInterval(...)` calls in `src/daemon.ts` into one loop, to stay under the 400-line lint limit. This test checks the source text for the exact line `clearInterval(ultrafixResumeSweepInterval);`, so it stopped matching. I put that one call back as its own line before the loop and kept the loop for the other timers. The no-change completion recovery sweep is still cleared on shutdown, and `src/daemon.ts` stays under the line limit. **Checked locally** - `eslint --max-warnings 0` passes on `packages/api` and on `src/daemon.ts`. - `test/ultrafixDaemonResumeSweep.test.ts`: 3 of 3 pass. - `packages/api/test/mcpEpicDispatch.test.ts`: passes through `scripts/run-test-suite.mjs` with `NODE_ENV=test` (7.5s). - `tsc --noEmit` is clean at the root and in `packages/api`. The epic dispatch test only passes when run the way CI runs it: through the suite runner from the repo root. Run directly from inside `packages/api`, it fails or hits the timeout, and the unmodified HEAD copy fails the same way there, so that's how it's set up locally, not a problem with this change. PR: integry#3423 Comment by: @integry (ID: 6738349341) Model: Claude Opus 5.5
Operator release of a held follow-up handoff asks the settled-worktree release to free the branch. When the worktree directory is gone, only its Git registration is consulted; a registration whose HEAD is already a detached commit (failure cleanup or an earlier release did that) was reported as "not settled", and the release was refused with worktree_holds_unpublished_work although the branch was free and nothing was unpublished. integry#3423 sat behind such a hold for a day. The branch is free in that case, which is all a release needs: report it as released. Co-Authored-By: Claude Fable 5.1 <[email protected]>
GitHub delivers the check runs of a fork pull request with an empty
pull_requests array, and GET /commits/{sha}/pulls lists no pull request
for the fork's head commit in the base repository. The commit lookup
therefore found no PR, so failed-CI follow-ups, the Ultrafix check hook
and auto-merge were never evaluated for fork PRs (integry#3423:
a failed lint check produced no follow-up comment).
When the commit lists no open PR, scan the repository's open pull
requests for a matching head SHA (pages of 100, bounded). Results are
cached as before, so a default-branch push pays the listing once per
cached lookup.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…d MCP A follow-up handoff held for an operator blocks every later command on its pull request, and until now the only ways to settle one were the admin REST routes and a CLI release that the installed CLI did not have. integry/propr integry#3423 sat behind such a hold for a day with no visible way out. Settings → Workflow & PR Rules gains a Maintenance section (administrators with instance.manage_runtime) that lists every tracked handoff with its reason, branch, unpublished commit and next action, and offers Resume and Release. A forced release, for a worktree that still holds unpublished work, needs an explicit checkbox. Refusals show the server's reason. MCP gains list_followup_handoffs, get_followup_handoff, resume_followup_handoff and release_followup_handoff under the same permission, calling the same recovery entry points as the routes. A refusal is a failed receipt that names the reason. The retained worktree's host path stays on the REST route and CLI; chat results are redacted anyway. Docs: capability matrix row, MCP guide paragraph, operator workflow row, and the four operator surfaces in the maintenance guide. Co-Authored-By: Claude Fable 5.1 <[email protected]>
When running Epic PRs I noticed that it would pickup one issue, finish, then the second issue would hang. Upon checking I found that it added the "AI-done" label to the issue but kept the "AI" label. That caused the bot to not pick up the next issue with "AI" labeling. This pr forces the check on the old issue before adding the chosen
PRIMARY_PROCESSING_LABELSto the next issue. I have been running this from source on my own setup for the past day now and all tests pass.