Skip to content

fix: Epic PR now properly removes label before adding new - #3423

Merged
integry merged 11 commits into
integry:mainfrom
bharveyos:labels-fix
Nov 9, 2026
Merged

integry merged 11 commits into
integry:mainfrom
bharveyos:labels-fix

Conversation

@bharveyos

Copy link
Copy Markdown

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_LABELS to the next issue. I have been running this from source on my own setup for the past day now and all tests pass.

@integry integry added the AI label Nov 7, 2026
@integry

integry commented Nov 7, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 — completeIssueLabels confirms publication of the done label before attempting trigger removal.

✅ 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Restore a portable database default

  • Required behavior: Default database configuration must resolve to a usable, shared persistent location across backend services.

  • Evidence: .env.example:DB_FILENAME, docker-compose.yml:services.api.volumes

    1. A user creates their configuration from the example, retaining DB_FILENAME=/home/bnh/propr/data/propr.sqlite and leaving the optional PROPR_DATA_DIR unset.
    2. Compose mounts ./data at /usr/src/app/data, while the API startup script explicitly preserves the absolute database filename.
    3. The database connection prioritizes DB_FILENAME over DATA_DIR, so every backend attempts to open the unrelated /home/bnh/propr/data/propr.sqlite path.
    4. Startup either fails because that directory is unavailable or, if created, uses container-local storage outside the shared persistent mount. Backend containers can consequently use separate databases, and container replacement can discard that state.

    The new documentation does not configure the required mount: PROPR_DATA_DIR remains commented out. The modified identity-path test now hardcodes the former relative filename instead of checking the actual example, so it misses this regression. Verification provenance — static trace: the supplied template, Compose mounts and normalization, and getDbFilename.

  • Minimum fix: Restore DB_FILENAME=./data/propr.sqlite; keep absolute host paths as an optional documented configuration.

F2: 🔴 Preserve imported Redis configuration

  • Required behavior: The newly supported external environment file must supply backend defaults unless local settings explicitly override them.

  • Evidence: docker-compose.yml:services.daemon.environment, services.worker.environment, services.indexing-worker.environment, and services.api.environment

    1. An installation supplies PROPR_ENV_FILE containing a working external Redis address and nondefault port, with neither Redis variable set in the shell or local .env.
    2. Each service loads that file through env_file.
    3. The new explicit environment entries nevertheless resolve ${REDIS_HOST:-redis} and ${REDIS_PORT:-6379} using Compose’s interpolation environment; service env_file values do not supply that interpolation.
    4. Those explicit entries override the imported address and port. All four backends connect to the bundled Redis instead of the installation’s configured Redis, leaving its existing queue and task state inaccessible to them.

    Loading the external file first does not protect its values because explicit environment entries take precedence over env_file. Verification provenance — static trace: the four added Redis environment pairs and their external-file declarations.

  • Minimum fix: Resolve Redis defaults only after merging the external and local configuration, preserving imported values when no local override exists. Apply the correction consistently to all four backend services.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Test the actual configuration template

The Compose identity test previously extracted DB_FILENAME from .env.example; it now substitutes a hardcoded relative path. Restoring coverage of the actual template would catch future mismatches between documented defaults and mounted storage. This is optional regression protection beyond correcting the default itself.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 54s
  • Tokens: 57,593 (56,177 in / 1,416 out)
  • Cost: $0.52

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 S1

🤖 Review by ProPR

@integry

integry commented Nov 7, 2026

Copy link
Copy Markdown
Owner

/ultrafix

@propr-dev propr-dev Bot added the ultrafix label Nov 7, 2026
@propr-dev

propr-dev Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /fix

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 5b3fc62

Addressed 1 AI review comment (IDs: 6713218878)

Addressed findings F1, F2

Summary of Changes

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.

🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 4m 57s
  • Tokens: 855,816 (843,850 in / 11,966 out)
  • Cost: $0.68

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6713341719✓

…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
@propr-dev

propr-dev Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 — completeIssueLabels publishes the done marker before removing the trigger, avoiding cancellation during successful cleanup.

✅ 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F3: 🔴 Retry completion after partial label cleanup

  • Required behavior: A recoverable label-removal failure must not permanently prevent a successfully completed no-change issue from advancing its plan.

  • Evidence: src/jobs/issueJobCompletionLabels.ts:18–21, src/jobs/issueJobPostProcessingHelpers.ts:handleNoCodeChanges, and src/jobs/issueJob/github.ts:checkLabelConditions.

    1. A no-change job reaches handleNoCodeChanges. Its done-label publication succeeds, but GitHub rejects removal of its primary label.
    2. completeIssueLabels throws after publishing the done marker. The new failed trigger cleanup prevents no-change completion from advancing the plan test explicitly establishes that no plan-status write occurs.
    3. When a job outside the unfinished-dispatch-sibling exemption retries, checkLabelConditions sees the done marker and returns skipped_issue_done. It never reaches handleNoCodeChanges again.
    4. The issue therefore retains a completion marker without the plan completion that releases its successor. This no-change path has no newly created PR whose merge could supply the missing status transition.

    The sibling exemption only protects qualifying dispatch siblings; the ordinary already-done branch still skips other retries. Queue label reconciliation cannot replace the missing no-change completion status: the new handoff operates after the queue’s status decision permits advancement. static trace: the helper’s write ordering, the explicit failure test, and the worker’s supplied pre-execution label-check path. No retry regression test was executed.

  • Minimum fix: Preserve and replay an incomplete completion obligation before applying the already-done skip. A retry must finish label cleanup and the pending no-change plan-status update without rerunning implementation work. Cover successful done publication followed by failed removal and a non-sibling retry.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Exercise mixed trigger completion states

Add 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 configuration

The 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.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 1m 51s
  • Tokens: 58,691 (56,405 in / 2,286 out)
  • Cost: $0.57

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F3 S2 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit ed2d2cb

Addressed 1 AI review comment (IDs: 6713431354)

Addressed finding F3

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 27m 45s
  • Tokens: 5,057,869 (5,021,091 in / 36,778 out)
  • Cost: $2.31
  • Subscription usage: Weekly +1%, Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 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
@propr-dev

propr-dev Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 -done before releasing the trigger, and epic advancement awaits successful cleanup before moving the cursor.

✅ 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 blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S4: 🟢 Replay retained completions autonomously

src/jobs/noChangeCompletion.ts retains an obligation when the plan-status write fails, but the supplied recovery path replays it only when another issue job arrives. A periodic recovery consumer would make this more reliable after the original job succeeds and its trigger is removed. This is an optional improvement to the pre-existing handling of failed plan-status writes, rather than a demonstrated regression.

S5: 🟢 Exercise actual Compose configuration resolution

The added Compose tests inspect configuration text and simulate environment merging with Object.assign. A follow-up integration test using Compose configuration resolution would better validate imported settings, local overrides, and interpolated paths together. The current tests provide useful structural coverage; this would strengthen verification without changing the implementation.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 59s
  • Tokens: 64,925 (63,616 in / 1,309 out)
  • Cost: $0.59

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S4 S5

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 7, 2026
@integry

integry commented Nov 7, 2026

Copy link
Copy Markdown
Owner

/review fable

@propr-dev

propr-dev Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — fable

Overall Evaluation

The PR addresses a real epic-queue hang: a finished child issue kept its trigger label (AI) next to AI-done, so the successor was never admitted. The fix is layered: completion now publishes -done first and then releases the trigger and processing labels (issueJobCompletionLabels.ts); the epic queue performs its own label handoff before moving the cursor (epicIssueLabelHandoff.ts), blocking and retrying via reconcile when GitHub refuses; label-based intent/admission checks (taskIntent.ts, issueJob/github.ts) treat a present -done marker as non-withdrawn so the cleanup cannot cancel the publishing worker or its dispatch siblings; and the no-change path gets a Redis-held obligation so a published marker with failed follow-up steps is replayed rather than skipped forever. Test coverage for the new behavior is extensive and targeted. The diff also carries unrelated Compose/.env.example changes (data-dir mounts, env-file layering, URL defaults) that are not part of the stated objective.

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 — completeIssueLabels always adds the done marker before deleting trigger/processing labels, and both withdrawnIntentReason and checkLabelConditions were updated so that moment (marker present, trigger gone) is not misread as a user withdrawal; test/issueJobMultiModelSiblings.test.ts and test/taskIntentWithdrawal.test.ts pin the new semantics.

✅ Epic handoff is fenced and recoverable — releaseEpicIssueLabels runs before the cursor-conditional UPDATE ... WHERE cursor = queue.cursor, records blocked_reason on failure, and reconcileEpicExecutionQueues retries the release before starting the successor; the concurrent-observer test in epicExecutionQueueLabelHandoff.test.ts verifies only one start:20 occurs.

✅ No-change obligation uses compare-and-swap — REPLACE_NO_CHANGE_COMPLETION only mutates the record the caller holds, so a settling run cannot clear a newer completion for the same issue; the retain-before-publish ordering guarantees the marker never exists without the record.

Merge blockers

Every 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

  • Required behavior: Changed behavior must not make a completed implementation (PR created, done marker published) end as a failed job with its remaining completion steps permanently skipped; the objective is to release the trigger so the epic advances, not to make the release fatal to an already-successful run.

  • Evidence: src/jobs/issueJobCompletionLabels.ts:24 (throw new Error(released.errors.join('; '))), consumed at src/jobs/issueJobPostProcessing.ts:292 (performPostProcessing) and src/jobs/issueJobPostProcessing.ts:344 (handlePRValidation)

    Static trace:

    1. An issue job finishes its implementation; performPostProcessing pushes the branch and creates PR #N before reaching line 292.
    2. completeIssueLabels POSTs AI-done successfully, then safeRemoveLabel for AI gets a transient non-404 error (e.g. GitHub 502); safeRemoveLabel returns false for any non-404 status (labelOperations.ts:33-45, no retry), so released.success is false and completeIssueLabels throws.
    3. The throw propagates out of performPostProcessing before autoAssignCompletedPullRequest (line 295) and, on the validation path, out of handlePRValidation before "Link PR to plan issue if found during validation" (line 346). The job surfaces as a failure although the PR exists.
    4. The issue now carries AI-done and no no-change record, so a BullMQ retry reaches processGitHubIssueJob.ts:264-275: readNoChangeCompletion returns null (only the no-change path retains an obligation), and checkLabelConditions returns "Already done" — the retry is skipped and nothing re-attempts the assignment, the plan-issue link, or task completion. (If isUnfinishedDispatchSibling instead treats the retry as live dispatch work, the outcome is a second full implementation run; either way the original PR's follow-up steps are lost.)

    Observable impact: a successfully created PR is recorded as a failed task, is not auto-assigned, and on the handlePRValidation path is never linked to its plan issue — so the epic queue cannot observe the later merge and the successor never starts, which is the class of hang this PR sets out to fix.

    Before this diff both call sites used safeUpdateLabels and ignored its result, so a failed label mutation never aborted post-processing. The epic handoff introduced by this PR (releaseEpicIssueLabels) already removes a leftover AI once AI-done is present and retries via reconcile, so throwing here buys nothing for the epic case. Assumption I could not verify from the supplied context: there is no catch between line 292/344 and the end of these functions that resumes the remaining steps; if an outer catch routes to handlePostProcessingFailure, the run is still recorded as a failure for a PR that was created. Proposed regression: stub DELETE .../labels/AI to return 502 after PR creation and assert the task completes, the PR is assigned/linked, and the leftover AI is logged rather than fatal.

  • Minimum fix: On the PR-producing paths (performPostProcessing and handlePRValidation), treat a failed trigger release as non-fatal: have completeIssueLabels return the aggregated result (or catch at those two call sites), log the leftover labels at warn level, and continue with assignment/linking/task completion. Keep the throwing behavior only where a retained obligation (no-change path) or the epic handoff can replay it.

Suggestions

These are optional follow-ups and are not sent to /fix.

S6: 🟢 Merged head without a worker-published -done wedges the epic

epicIssueLabelHandoff.ts:34-37 throws "Waiting for '-done'" whenever the head is MERGED and any configured primary label (or its -processing) is still on the issue without -done. That is correct while a worker is still finishing, but nothing distinguishes it from a run that will never publish -done: a user-stopped task (clearUserStoppedProcessingLabel removes only -processing, leaving AI), a failed post-processing run with canMarkDone=false, or an orphaned worker. If a human then fixes and merges the PR — the exact recovery the blocked_reason text ("Reopen, fix and merge it to continue") invites — the queue blocks indefinitely with "Could not release issue #N: Waiting for 'AI-done'" until someone edits labels by hand. The fixture change in packages/api/test/mcpEpicDispatch.test.ts ("PR status hook and resume route release a head held by pause") had to add AI-done manually to keep passing, which illustrates the new precondition. I could not verify from the supplied context which paths set a plan issue to MERGED without a worker (PR-link timing is outside the diff), so this stays a follow-up. Consider waiting only while ${label}-processing is present or a non-terminal task exists for the issue, and releasing a bare trigger otherwise.

S7: 🟢 Removing the trigger no longer cancels siblings once a marker exists

withdrawnIntentReason now treats AI-done as live intent. The rewritten test/taskIntentWithdrawal.test.ts cases show the consequence: after one model publishes completion, a user removing AI to stop the remaining models of a multi-model request no longer cancels them (terminalReason stays undefined). This is a deliberate trade-off needed to make the system's own cleanup safe, but it is a user-visible change to the label-removal stop path. Document it (UI stop still works), or distinguish the system's cleanup from user removal (e.g. by checking whether the removal happened after the marker was added, or by a short-lived "releasing" marker in Redis).

S8: 🟢 Unrelated Compose/env changes bundled with the fix

docker-compose.yml, docker/compose-backend-defaults.env, .env.example and test/composeApiIdentityPath.test.mjs change data-dir mounting, env-file precedence and URL defaults; none of this is tied to the epic-label objective, and it widens the review and rollback surface. Two points worth checking before shipping it: (a) with PROPR_DATA_DIR=/custom/data but the example's relative DB_FILENAME=./data/propr.sqlite, the API/daemon/worker resolve the DB to /usr/src/app/data/propr.sqlite, which is no longer a bind mount, so the database silently lives on container storage; the .env.example comment documents the intended pairing with an absolute DB_FILENAME, but nothing guards the mismatch. (b) web-ui now defaults PROPR_UI_PUBLIC_API_URL to http://localhost:4000, whereas previously the entrypoint wrote an empty apiBaseUrl; deployments that relied on same-origin/relative API access need to set VITE_API_BASE_URL/PROPR_UI_PUBLIC_API_URL explicitly. Splitting these into their own PR would make both easier to validate.

S9: 🟢 No-change obligation records have no expiry and allow a duplicate comment

retainNoChangeCompletion SETs issue:no-change-completion:* without a TTL. A record whose done marker was never published (failure at the first POST), or an issue that never receives another job, leaves the key forever; retainNoChangeCompletion on a later run overwrites it, but PR-producing runs never touch it. Also, two concurrent jobs for the same issue can both pass readNoChangeCompletion and both POST the completion comment before the CAS in replaceNoChangeCompletion decides the owner (noChangeCompletion.ts:65-70); the status write is correctly single-owner, the comment is not. A long TTL and moving the CAS (or a SET NX claim) before the comment would close both.

S10: 🟢 Handoff releases every configured primary label, not the one the queue applied

releaseIssueLabels iterates all getPrimaryProcessingLabels() entries (e.g. AI,propr from .env.example) and removes any present, while labelPlanIssueForProcessing only ever applies processingLabels[0]. If a user intentionally labels an epic child with a second trigger for separate work, the handoff either removes it (closed/terminal policy) or blocks on Waiting for 'propr-done' (merged policy). Restricting the release to the label the queue applied (or to labels whose -done is present) would avoid interfering with unrelated triggers. Also verify that a successful advance clears blocked_reason set by a previous failed release; the handoff tests check cursor but not that the stale reason is removed.

Score

The core design is sound and well tested, but the PR turns previously tolerated label-mutation failures into fatal errors on the PR-creating completion paths, which can leave a created PR unlinked/unassigned with no retry able to recover — a localized correction (F1) is needed before merge, and the bundled Compose changes add unreviewed scope.

Score: 6/10


🤖 Review Details

  • Model: Claude Fable 5.1
  • Time: 5m 14s
  • Tokens: 115,884 (93,094 in / 22,790 out)
  • Cost: $2.30

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F4 S6 S7 S8 S9 S10

🤖 Review by ProPR

Repository owner deleted a comment from propr-dev Bot Nov 8, 2026
Repository owner deleted a comment from propr-dev Bot Nov 8, 2026
@integry

integry commented Nov 8, 2026

Copy link
Copy Markdown
Owner

/fix all

@propr-dev

propr-dev Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 700e200

Addressed 4 AI review comments (IDs: 6713218878, 6713431354, 6713746553, 6713859841)

Addressed finding F4 · suggestions S1, S2, S3, S4, S5, S6, S7, S8, S9, S10

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 19m 45s
  • Tokens: 11,397,171 (11,330,238 in / 66,933 out)
  • Cost: $4.49
  • Subscription usage: Weekly +1%, Fable +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6728723363✓

…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
@integry

integry commented Nov 9, 2026

Copy link
Copy Markdown
Owner

/review astra fable

@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 2 reviews:

View Task Details

@propr-dev

propr-dev Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F12: 🔴 Failed status writes discard recovery records

  • Required behavior: A retained no-change completion must remain recoverable until its required plan-status write succeeds.

  • Evidence: src/jobs/noChangeCompletion.ts, markNoChangePlanIssueMerged and settleNoChangeCompletion.

    1. A queued no-change issue publishes its done marker, removes its trigger, and delivers its comment.
    2. markNoChangePlanIssueMerged calls updatePlanIssueStatus, whose database update fails.
    3. The supplied implementation of updatePlanIssueStatus catches and logs that failure without rethrowing or returning failure.
    4. The new wrapper therefore returns true, and settlement deletes the retained completion.

    The plan issue remains nonterminal, its trigger is gone, and the recovery sweep has no record to replay. The epic consequently remains stuck. The wrapper’s catch cannot detect an error swallowed by its callee. The added tests mock updatePlanIssueStatus as throwing, so they do not exercise the production failure contract.

    static trace: verified against the new settlement code and the supplied planIssueManager.ts:335–367 implementation.

  • Minimum fix: Obtain an explicit success result from the status-writing operation, or verify the persisted status before deleting the obligation. Add coverage using the actual failure contract rather than a throwing mock.

F13: 🔴 Superseded completion can still mark renewed work merged

  • Required behavior: Once renewed work is admitted, an older retained completion must not mark that work merged or advance its epic queue.

  • Evidence: src/jobs/noChangeCompletion.ts, the final dropIfSuperseded check in settleNoChangeCompletion and the awaited lookups in markNoChangePlanIssueMerged.

    1. An older completion has only its status write remaining. Recovery settles its labels and passes the final request-generation check.
    2. It enters markNoChangePlanIssueMerged and awaits findPlanIssueByRepoAndNumber or getEpicExecutionQueue.
    3. During that window, the user restores the trigger for renewed work and a new worker reaches admitNoChangeRequest. Admission updates the request key and deletes the older retained record.
    4. The older settlement resumes its lookup, sees an active queue or its saved auto-merge label, and calls updatePlanIssueStatus(..., MERGED) without checking ownership again.

    The old result now marks the newly requested implementation merged and can release its successor prematurely. Admission’s compare-and-set deletion protects Redis records, but does not revoke the in-memory settlement’s subsequent status write. The comment claim does not cover this path, and the existing supersession tests change ownership before settlement or during label operations, not during these later lookups.

    static trace: verified through admission, settlement, the two awaited plan lookups, and the supplied status-write queue notification.

  • Minimum fix: Pass the retained completion’s applicability check into the status-finalization path and recheck it after the plan/queue lookups, immediately before invoking the status write. Cover renewal during each lookup. This closes the demonstrated avoidable window without requiring an atomic transaction across Redis and SQLite.

Suggestions

These are optional follow-ups and are not sent to /fix.

S22: 🟢 Separate deployment configuration changes

The 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.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 58s
  • Tokens: 87,548 (86,046 in / 1,502 out)
  • Cost: $0.83

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F12 F13 S22

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit a4c2cd9

Addressed 1 AI review comment (IDs: 6730044148)

Addressed findings F12, F13

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 8m 13s
  • Tokens: 1,842,546 (1,824,358 in / 18,188 out)
  • Cost: $1.10

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 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
@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F14: 🔴 Recheck ownership inside the status writer

  • Required behavior: An older no-change completion must not mark renewed work merged or release its successor.

  • Evidence: src/jobs/noChangeCompletion.ts, markNoChangePlanIssueMerged; packages/core/src/config/planIssueManager.ts, updatePlanIssueStatus.

    1. Request A publishes its completion labels and comment, then passes the final stillApplies() check.
    2. A enters updatePlanIssueStatus, which awaits the initial plan_issues lookup before executing its update.
    3. During that database await, the user removes AI-done and reapplies AI; request B passes worker admission. admitNoChangeRequest records B and deletes A’s retained completion.
    4. A’s database lookup completes. The writer unconditionally updates the issue to MERGED and notifies the epic queue, despite B now owning the issue.

    The incorrect persisted status can advance the epic while B’s implementation remains unfinished. The ownership check precedes an additional asynchronous database lookup; neither the writer nor its update predicate checks ownership afterward. Deleting A’s Redis record does not interrupt the already-entered writer. The supplied supersession tests interrupt the earlier plan and queue lookups, not this lookup inside the writer.

    static trace: followed the final ownership check into the complete supplied updatePlanIssueStatus implementation. proposed regression: pause that writer’s initial lookup, admit B, then resume and assert that no merged update or queue notification occurs.

  • Minimum fix: Allow the no-change caller to supply an ownership guard that the status writer evaluates after its initial lookup and immediately before the update. Abandon the update and notification when ownership was lost, and cover the demonstrated interruption point.

F15: 🔴 Keep independent trigger completions separate

  • Required behavior: Work under another configured trigger must not discard an independent trigger’s owed completion.

  • Evidence: src/jobs/noChangeCompletionObligation.ts, requestKey and admitNoChangeRequest; src/jobs/processGitHubIssueJob.ts, processIssueWithAdmission.

    1. An issue has independently queued work for configured triggers AI and Assistant, with different correlation IDs.
    2. The AI worker publishes AI-done and removes its trigger, but its completion comment fails. Its retained record still owes the comment and plan-status settlement.
    3. The already-queued Assistant worker starts while Assistant remains present and Assistant-done is absent. Its trigger-specific label check permits execution.
    4. Its admission writes the same issue-wide request key and deletes the AI completion because the correlation IDs differ.
    5. Recovery can no longer deliver the AI report or settle its retained status obligation.

    Both records contain trigger information, but neither the request key nor the deletion filter uses it. The compare-and-set protection prevents an overtaken admission from deleting records; it does not distinguish independent triggers. The new epic handoff implementation explicitly treats another trigger without its own done marker as separate work.

    static trace: followed trigger-specific worker admission into the issue-wide supersession key and unconditional different-request deletion. proposed regression: retain an interrupted AI completion, admit queued Assistant work, and verify that the AI completion survives and remains recoverable.

  • Minimum fix: Scope request ownership and superseded-record deletion to the effective triggering label, consistently across admission, retention, and recovery, including the legacy trigger fallback.

Suggestions

These are optional follow-ups and are not sent to /fix.

S23: 🟢 Exercise Compose tests in CI

The 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.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 1m 24s
  • Tokens: 96,132 (94,069 in / 2,063 out)
  • Cost: $0.93

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F14 F15 S23

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 6598d98

Addressed 1 AI review comment (IDs: 6730182149)

Addressed findings F14, F15

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 11m 21s
  • Tokens: 2,637,972 (2,616,391 in / 21,581 out)
  • Cost: $1.37

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 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
@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F16: 🔴 Older jobs can supersede newer requests

  • Required behavior: Recovery must preserve a newer request’s completion obligations and prevent older work from reclaiming ownership merely because it executes later.

  • Evidence: src/jobs/noChangeCompletionObligation.ts, admitNoChangeRequest; src/jobs/processGitHubIssueJob.ts, processIssueWithAdmission; src/jobs/issueJob/github.ts, checkLabelConditions.

    1. Request A dispatches multiple model jobs. One completes, while another unfinished sibling is delayed or awaiting a retry. The documented retry behavior preserves its original correlation ID.
    2. The user reapplies the trigger to request new work. Request B is admitted and writes B’s request ID. B subsequently completes without changes, publishes AI-done, and removes AI, but its plan-status write fails. Its retained completion remains necessary to advance the epic.
    3. A’s delayed sibling resumes. The changed label check permits unfinished dispatch siblings to run with AI-done present and the primary trigger absent.
    4. Admission unconditionally executes store.set(key, requestId, ...), replacing B’s generation with A’s. Its subsequent loop deletes B’s retained completion because B’s request ID differs from A’s.
    5. If A then fails before completing, B’s successful no-change result has no remaining recovery record. The plan status remains nonterminal and the epic stays blocked.

    The interruption point is A’s delayed execution or retry, during which B is admitted and completes. No ordering check prevents A from overwriting B. The Lua guard only verifies that the admission still owns the key it just overwrote; it does not establish that its request is newer. The pre-admission replay also cannot reliably rescue B: its status write can still be failing when A resumes, leaving the record retained until A deletes it.

    static trace: the unconditional generation write and deletion loop establish this sequence, together with the changed sibling exemption and documented preservation of retry identity. Existing supersession tests cover overlapping admissions after their writes, but not an older request returning after a newer admission.

    proposed regression: retain B’s failed status obligation, resume an unfinished sibling from A, and assert that B’s generation and obligation survive.

  • Minimum fix: Establish request ordering once and preserve it across siblings and retries. A returning older request must neither overwrite the newer generation nor delete its obligations. Apply that check before the admission write and superseded-record cleanup.

Suggestions

These are optional follow-ups and are not sent to /fix.

S24: 🟢 Exercise scripts against Redis

The 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.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 1m 28s
  • Tokens: 97,759 (95,933 in / 1,826 out)
  • Cost: $0.94

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F16 S24

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 94701bd

Addressed 1 AI review comment (IDs: 6730355427)

Addressed finding F16

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 10m 22s
  • Tokens: 2,882,668 (2,852,740 in / 29,928 out)
  • Cost: $1.70
  • Subscription usage: Weekly +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 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
@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F17: 🔴 Recovery can merge an issue with an unmerged sibling PR

  • Required behavior: Recovery of a no-change completion must not overwrite a subsequently published PR’s review status or release its epic successor before that PR merges.

  • Evidence: src/jobs/noChangeCompletion.ts, markNoChangePlanIssueMerged and settleNoChangeCompletion; src/jobs/noChangeCompletionObligation.ts, admitNoChangeRequest.

    1. Two models from the same dispatch execute concurrently, sharing a correlation ID. Model A finishes without changes, publishes the done marker and comment, but its plan-status write fails. The new implementation retains its completion and returns successfully.
    2. Model B subsequently publishes a PR. The existing PR-linking path records its PR number and sets the plan issue to under_review.
    3. After the recovery grace period, the sweep finds A’s retained completion and the issue’s done marker. A still passes the ownership checks: both models belong to the same request, and A’s record remains retained.
    4. markNoChangePlanIssueMerged fetches the current plan issue but ignores its PR number and review status. It writes merged, notifying the epic queue and allowing the successor to start while B’s PR remains unmerged.

    The request-generation checks protect against another request, not subsequent publication within the same dispatch. The comment claim protects delivery only. The persistent result is an incorrect merged plan status and premature epic advancement.

    static trace: The supplied worker tests establish shared-request sibling execution; the retained-status-failure tests establish that A’s obligation survives successful completion. The supplied linkPRToPlanIssue implementation writes under_review, while recovery subsequently performs an unconditional merged-status update after checking request ownership.

  • Minimum fix: Before replay writes merged, check whether a PR has since been linked and remains unmerged. Preserve that PR’s status and settle or defer the obsolete no-change status obligation accordingly. Apply the check to both worker-triggered replay and periodic recovery, with a regression covering concurrent no-change and PR-producing siblings.

Suggestions

These are optional follow-ups and are not sent to /fix.

S25: 🟢 Exercise the actual Redis scripts

The 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.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 1m 34s
  • Tokens: 101,421 (99,643 in / 1,778 out)
  • Cost: $0.98

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F17 S25

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 9115746

Addressed 1 AI review comment (IDs: 6730516885)

Addressed finding F17

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (xhigh)
  • Requested By: @propr-ultrafix
  • Time: 19m 40s
  • Tokens: 6,595,036 (6,533,780 in / 61,256 out)
  • Cost: $3.32

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 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
@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S26: 🟢 Exercise Lua against Redis

The 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 behavior

The supplied .env.example sets REDIS_HOST=127.0.0.1, which overrides the new Compose defaults file. Consider documenting the required container hostname adjustment and asserting the intended Redis endpoint in the template-rendering test. This template mismatch predates the PR’s layering change, so it is a follow-up rather than a blocker.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 1m 39s
  • Tokens: 104,503 (102,709 in / 1,794 out)
  • Cost: $1.01

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S26 S27

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 9, 2026
@integry

integry commented Nov 9, 2026

Copy link
Copy Markdown
Owner

/review fable

@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — fable

Overall Evaluation

The PR's stated goal is narrow: when an epic's head issue finishes, release its trigger label (AI) so the queue's next issue can be picked up, rather than leaving AI + AI-done on the old issue. The diff does implement that — completeIssueLabels* now publishes <trigger>-done and then removes <trigger>/<trigger>-processing, advanceEpicQueue calls releaseEpicIssueLabels before moving the cursor, checkLabelConditions treats a done marker ahead of a missing trigger, and withdrawnIntentReason no longer reads "trigger removed while -done present" as a cancellation. Those pieces are coherent and well tested.

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 updatePlanIssueStatus ownership/linked-review guard; and an unrelated Docker Compose overhaul (PROPR_DATA_DIR mounts, PROPR_ENV_FILE layering, a bundled Redis defaults file, a core-level data-mount guard that refuses startup, new FRONTEND_URL/GH_OAUTH_CALLBACK_URL/API_PUBLIC_URL defaults, PROPR_UI_PUBLIC_API_URL on the web-ui). I traced the label handoff and the no-change state machine statically and found no reachable, demonstrable incorrect outcome; the ownership checks are placed where they need to be and the external-API races that remain are ones Redis + GitHub + SQLite genuinely cannot close atomically. But no test or lint workflow ran on the current head (all three checks are skipped), several correctness assumptions are not verifiable from the diff (real tasks/task_history column names, whether the UI image consumes PROPR_UI_PUBLIC_API_URL), and the compose/data-dir changes introduce a deliberate hard startup refusal for a configuration that previously worked. I would call this "needs minor changes / verification" rather than merge-ready, mostly on verification and scope grounds.

✅ Publish-before-release ordering is enforced and tested at both ends — src/jobs/issueJobCompletionLabels.ts adds -done before removing the trigger, keeps the trigger when -done cannot be published (so the request is never lost), and packages/core/test/epicExecutionQueueLabelHandoff.test.ts asserts the exact add:done → remove:AI → remove:AI-processing → start:next sequence, the "bare trigger with no running task" release, and concurrent-observer single-start.

✅ Linked-PR guard is part of the UPDATE itself — packages/core/src/config/planIssueManager.ts applies pr_number IS NULL OR status NOT IN (review statuses) inside the status update rather than as a separate read, so a sibling's PR linked between the lookup and the write still keeps under_review; test/noChangeCompletionLinkedPr.test.ts drives this against real SQLite with the real migration.

✅ Durable obligation is retained before the irreversible GitHub mutation — completeNoChangeIssue writes the Redis record before adding -done, so there is no moment where the issue looks finished while nothing records the owed comment/status write; all record transitions go through a Lua compare-and-set keyed on the exact prior payload.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S28: 🟢 Split the Compose/data-dir work from the label fix

The objective is "release the old issue's trigger before labeling the next one". The docker-compose.yml, .env.example, docker/compose-backend-defaults.env, packages/core/src/db/dataMountGuard.ts, connection.ts, and the two compose test files are an independent feature (importable env files, relocatable data dirs, new API/UI URL defaults) with its own risk surface (see S7, S8). Landing them separately would make the handoff fix reviewable and bisectable on its own. Optional, but the mixed scope is the main reason this review cannot call the PR merge-ready.

S29: 🟢 Verify hasUnfinishedIssueTask against the real task schema

packages/core/src/services/taskPlanning/epicIssueLabelHandoff.ts queries tasks.repository/issue_number/task_type joined to task_history.history_id/state (latest row). epicExecutionQueueLabelHandoff.test.ts creates those tables by hand rather than via migrations, so a column-name mismatch would not be caught. If the query errors, the "merged + processing + no done" path throws on every reconcile until the worker publishes -done, and a stopped task's bare AI-processing would block the queue indefinitely. A test built on the real tasks/task_history migrations (as noChangeCompletionLinkedPr.test.ts does for plan_issues) would close this gap.

S30: 🟢 The daemon sweep opens the worker's Redis client

src/daemon/noChangeCompletionRecoverySweep.ts lazily imports ../jobs/noChangeCompletionRecovery.js, which statically pulls noChangeCompletionObligation.ts → issueJob/config.ts, whose top level does new Redis({... maxRetriesPerRequest: null}). After the first sweep (5 min in) the daemon holds a second, unmanaged Redis connection that close() never destroys. If daemon shutdown relies on the event loop draining rather than process.exit, that connection keeps the process alive. Passing store explicitly everywhere (the functions already accept it) and dropping the default-parameter import would avoid instantiating the worker config in the daemon.

S31: 🟢 Replaying someone else's owed completion can fail the arriving job

src/jobs/processGitHubIssueJob.ts replays every owed record before checkLabelConditions; replayNoChangeCompletion throws when a label mutation fails (completeIssueLabels). A multi-model sibling B arriving at an issue where A's cleanup is owed will fail (via handleIssueProcessingError) on a transient GitHub error in A's cleanup, losing B's run even though before this PR B would have proceeded under the sibling exemption. Since the recovery sweep already exists, non-owner replay could be best-effort (log, continue to the label check) and only the owner's own redelivery needs to surface the failure.

S32: 🟢 A no-change label failure now becomes a "post-processing error" comment

Previously handleNoCodeChanges used safeUpdateLabels (never throws), so a failed removal still posted the no-change comment and wrote status. Now completeNoChangeIssue throws on any label error, which — through performPostProcessing's catch — posts "Post-processing encountered an error", marks the run failed, and later the sweep posts the "No code changes needed" comment too. The eventual state is correct, but the user sees a spurious failure. Consider treating the trigger-release failure as non-fatal when the record is already retained (the obligation makes it recoverable), reserving the throw for the -done publication failure.

S33: 🟢 Waiting head depends on periodic reconcile and surfaces as a thrown error

When a PR merges before the worker publishes -done, releaseEpicIssueLabels writes blocked_reason and throws; nothing re-triggers advanceEpicQueue when -done later lands, so advancement waits for reconcileEpicExecutionQueues. Also startEpicQueueHead now rejects with "Waiting for 'AI-done'" to API/MCP callers (pause/resume, implement) in what is a normal transient state. Returning a "blocked" result for the wait case (keeping the throw for genuine GitHub failures) and/or nudging the queue from the worker's completion path would reduce latency and avoid 500s on benign waits.

S34: 🟢 New compose URL defaults and PROPR_UI_PUBLIC_API_URL semantics

docker-compose.yml now injects API_PUBLIC_URL into daemon/worker/indexing-worker and defaults FRONTEND_URL/GH_OAUTH_CALLBACK_URL to localhost in the API container, while .env.example says these are derived automatically in tunnel mode and warns against an active localhost callback. The old gitfix.dev defaults were worse, but the compose still overrides derivation. Separately, PROPR_UI_PUBLIC_API_URL already meant "public API URL the hosted UI talks to" in the tunnel section and now also configures the local web-ui container; the diff does not show the UI image/entrypoint consuming it, so whether the new environment: entry does anything is unverified from this PR.

S35: 🟢 Data-mount guard edge cases and migration impact

dataMountGuard.ts rejects relative === '' with an "outside the mounted data directory" message (the path is the mount directory) and rejects any in-mount filename starting with .. (e.g. data/..snapshot.sqlite). A relative PROPR_DATA_DIR produces an invalid non-absolute bind target. More importantly, PROPR_DATA_DIR is already a documented launcher/CLI variable; a user whose .env carries it and keeps the template's relative DB_FILENAME now gets a hard refusal from daemon, worker, indexing-worker and api where the dev compose previously started. The error text is clear, but a note in the migration/changelog or auto-resolving a relative filename onto the mount would soften this.

S36: 🟢 Handoff falls back to 'AI' when primary labels are not loaded

releaseIssueLabels uses the synchronous getPrimaryProcessingLabels() and falls back to ['AI'] when empty. In the API process (webhook → updatePlanIssueStatus → advanceEpicQueue) nothing in this diff guarantees loadPrimaryProcessingLabelsFromConfig ran, so an instance with PRIMARY_PROCESSING_LABELS=propr could release nothing and advance with propr still on the old issue — the original symptom. labelPlanIssueForProcessing shares the same assumption (pre-existing), so this is not a regression, but issueDetection.ts:176-179 shows the lazy-load pattern that could be reused here.

S37: 🟢 A superseded stale sibling's no-change result vanishes silently

When a delayed sibling of an older request completes with no changes after a newer request was admitted, settleNoChangeCompletion drops the record before any mutation and handleNoCodeChanges returns success: true with no comment, no label change and updatedLabels: [AI_DONE_TAG] that was never applied. Correct for ownership, but the user gets no trace of that model's finding. Posting the comment without the status/label steps, or logging at info with the task ID, would keep the result visible.

Score

No verified code blocker in the traced label-handoff and obligation paths, and the core ordering invariants are tested. The PR is not merge-ready as presented: no CI test/lint evidence on the current head, several schema/runtime assumptions are unverifiable from the diff, and a large out-of-scope Compose/data-dir change with a deliberate new startup refusal is bundled with the fix.

Score: 7/10


🤖 Review Details

  • Model: Claude Fable 5.1
  • Time: 8m 22s
  • Tokens: 198,473 (160,981 in / 37,492 out)
  • Cost: $3.89

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S28 S29 S30 S31 S32 S33 S34 S35 S36 S37

🤖 Review by ProPR

@integry

integry commented Nov 9, 2026

Copy link
Copy Markdown
Owner

CI is red on the current head (9115746) and needs a fix.

Build & Lint Check → Validate Changes failed on one ESLint warning (the lint runs with --max-warnings 0):

packages/api/test/mcpEpicDispatch.test.ts
  32:14  warning  Async method 'request' has a complexity of 21. Maximum allowed is 20  complexity

✖ 1 problem (0 errors, 1 warning)
ESLint found too many warnings (maximum: 0).

Please reduce the complexity of the request method in that test (split it into helpers or a lookup table) so npm run lint -- --max-warnings 0 passes in packages/api.

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.

Workflow: https://github.com/integry/propr/actions/runs/42550956810

@propr-dev

propr-dev Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit a11053a

Summary of Changes

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.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 17m 48s
  • Tokens: 1,819,023 (1,809,170 in / 9,853 out)
  • Cost: $0.82

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6738349341✓

…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
@integry
integry merged commit fdfc407 into integry:main Nov 9, 2026
44 checks passed
motherskitchenblr2 pushed a commit to motherskitchenblr2/propr that referenced this pull request Nov 23, 2026
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]>
motherskitchenblr2 pushed a commit to motherskitchenblr2/propr that referenced this pull request Nov 23, 2026
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]>
motherskitchenblr2 pushed a commit to motherskitchenblr2/propr that referenced this pull request Nov 23, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants