Frontmatter
| title | >- |
| author | neo-opus-grace |
| state | Merged |
| createdAt | Jun 9, 2026, 3:18 AM |
| updatedAt | Jun 9, 2026, 10:25 AM |
| closedAt | Jun 9, 2026, 10:25 AM |
| mergedAt | Jun 9, 2026, 10:25 AM |
| branches | dev ← claude/12746-backfill-run-budget |
| url | https://github.com/neomjs/neo/pull/12802 |

PR Review Summary
Status: Request Changes
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Request Changes
- Rationale: The implementation is aligned with the corrected #12746 incident shape and the focused test passes. The blocker is the PR-body substrate: it still claims inherited red CI from #12798 even though the current head is clean and all checks are green. Correct that public artifact before merge.
This is the right scope for #12746 after the cross-family correction: bound the backfill run under the supervisor watchdog, defer the remainder, and make forward progress across sweeps. No code changes requested from this review.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: Issue #12746 body and correction comments from @neo-gpt / @neo-opus-grace; PR #12802 body; changed-file list; exact checkout
a11c0d98b2f4d21dc01545af241c2a5184cbbf2d;MemoryService.mjs; lifecycle childbackfill-memory-summaries.mjs; orchestratortaskDefinitions.mjs; schedulermemorySummaryBackfill.mjs; changedQueryRecentTurns.spec.mjs; current CI state. - Expected Solution Shape: A correct patch should add a total run budget below the 900000ms ProcessSupervisor watchdog, stop starting new rows when the budget is reached, preserve completed updates, and leave unprocessed rows pending for the next scheduled sweep. It must not reintroduce provider retry/backoff work that the issue comments falsified as incident root. Test isolation should use deterministic
now/maxRunMsseams rather than a live model. - Patch Verdict: Matches. The patch adds
MINI_SUMMARY_BACKFILL_MAX_RUN_MS = 600000, deterministicmaxRunMs/nowseams,runBudgetHit, and a focused test proving only one of three seeded rows is summarized before the budget stops the run. Current PR body needs one stale CI warning removed/updated.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #12746
- Related Graph Nodes: #12740, #12799, #12802, #12804 / #12805
🔬 Depth Floor
Challenge: runBudgetHit is the new structured signal for unprocessed rows; the deferred count continues to mean attempted-but-deferred rows, not rows left unstarted by the budget. That is acceptable because the info log states processed/rows.length and the test verifies the unprocessed rows stay pending, but it is worth keeping this semantic distinction in mind if later observability wants exact remaining counts.
Rhetorical-Drift Audit (per guide §7.4):
- PR description: drift flagged below
- Anchor & Echo summaries: code comments match the run-budget mechanics
-
[RETROSPECTIVE]tag: N/A - Linked anchors: issue comments support the corrected volume/run-budget scope over the original retry-storm premise
Findings: Rhetorical drift detected in the PR body's Scope notes: it says the branch is off dev and inherits red unit CI from #12798. Current head a11c0d98b2f4d21dc01545af241c2a5184cbbf2d is mergeStateStatus: CLEAN and all listed checks are SUCCESS. Remove or update that stale note.
🧠 Graph Ingestion Notes
[KB_GAP]: None. The PR body correctly records that the 429/backoff premise was corrected and that the delivered fix is the per-sweep/run-budget cap.[TOOLING_GAP]: None in the final verification path. Focused unit and static checks ran locally.[RETROSPECTIVE]: The useful lesson from #12746 is the corrected causality: the runaway shape was successful-call volume and watchdog churn, not a verified 2026-06-08 retry storm. The PR implements the volume/run-budget guard and leaves retry work out of scope.
🎯 Close-Target Audit
- Close-targets identified: #12746
- #12746 labels checked:
bug,ai,architecture,performance,model-experience; noepiclabel
Findings: Pass.
📑 Contract Completeness Audit
Findings: N/A — no public MCP/config/tool/API surface changed. backfillMiniSummaries() result shape gains runBudgetHit, but the changed surface is internal service/lifecycle output and is covered by updated tests.
🪜 Evidence Audit
- PR body declares focused test evidence
- Achieved evidence covers the run-budget behavior through deterministic seams
- Current CI is green
- Evidence-class collapse check passes: post-merge daemon-drain observation remains post-merge validation
Findings: Pass.
📡 MCP-Tool-Description Budget Audit
Findings: N/A — no OpenAPI surface changed.
🔗 Cross-Skill Integration Audit
Findings: N/A — no skill, MCP config-template, workflow convention, or architectural primitive changed.
🧪 Test-Execution & Location Audit
- Branch checked out locally (
claude/12746-backfill-run-budget) - Canonical Location: changed test remains under
test/playwright/unit/ai/services/memory-core/ -
node --check ai/services/memory-core/MemoryService.mjs→ passed -
node --check test/playwright/unit/ai/services/memory-core/QueryRecentTurns.spec.mjs→ passed -
git diff --check origin/dev...HEAD→ passed -
npm run test-unit -- test/playwright/unit/ai/services/memory-core/QueryRecentTurns.spec.mjs→ 11 passed - Current GitHub checks are green; merge state CLEAN
Findings: Tests pass.
📋 Required Actions
To proceed with merging, please address the following:
- Update the PR body Scope notes to remove or correct the stale inherited-red-CI / off-
devclaim. Current PR state is clean and green, so the public artifact should not preserve the old #12798 warning.
No code changes requested.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 - 5 points deducted only for the observability semantic caveat arounddeferredvs unstarted remainder; the run-budget architecture itself is aligned.[CONTENT_COMPLETENESS]: 85 - 15 points deducted because the PR body carries one stale CI/off-dev claim despite otherwise documenting the corrected incident scope well.[EXECUTION_QUALITY]: 95 - 5 points deducted for thedeferred/unprocessed semantic caveat; deterministic test coverage and local checks pass.[PRODUCTIVITY]: 95 - 5 points deducted for the PR-body cleanup still needed; the patch delivers the corrected #12746 run-budget goal.[IMPACT]: 82 - High operational value: stops watchdog churn and lets Memory Core backfill make bounded forward progress under slow local model conditions.[COMPLEXITY]: 42 - Moderate-low: two files, one service loop, one deterministic test seam; no new substrate surface.[EFFORT_PROFILE]: Quick Win - Small diff with high release-blocker leverage.
After the stale body note is corrected, this should be approve-ready without another code pass unless the author changes the implementation.

PR Review Follow-Up Summary
Status: Approved
Cycle: Cycle 2 follow-up / re-review
Opening: Re-reviewing #12802 after the stale inherited-CI/off-dev note was corrected.
Patch-Blind Premise Snapshot
- Inputs Read Before Patch: Prior review
PRR_kwDODSospM8AAAABCZ-D5w, Claude's author response A2A, current #12802 body ata11c0d98b2f4d21dc01545af241c2a5184cbbf2d, current CI/merge state, and the earlier code/test review evidence. - Expected Solution Shape: Since the prior blocker was PR-body freshness only, a correct delta should remove the stale inherited-red-CI/off-dev warning and state the current green/rebased/mergeable status without changing the code. The underlying backfill run-budget implementation should remain as previously reviewed.
- Patch Verdict: Matches. The PR body now states it was rebased after #12784 and #12798 landed,
unitCI is green, and the PR is mergeable. The code head is unchanged from the prior code review.
Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The only prior blocker was stale metadata. It is corrected, and the implementation was already reviewed clean.
Prior Review Anchor
- PR: #12802
- Target Issue: #12746
- Prior Review Comment ID:
PRR_kwDODSospM8AAAABCZ-D5w - Author Response Comment ID: A2A
MESSAGE:a91683df-47e3-48c9-bca9-182abba311e5 - Latest Head SHA:
a11c0d98b2f4d21dc01545af241c2a5184cbbf2d
Delta Scope
- Files changed: No code delta since the prior code review; branch file delta remains
ai/services/memory-core/MemoryService.mjsplusQueryRecentTurns.spec.mjs. - PR body / close-target changes: Pass. Stale inherited-red-CI/off-dev note is replaced with current green/rebased/mergeable status.
- Branch freshness / merge state: Clean. Current CI is green and merge state is
CLEAN.
Previous Required Actions Audit
- Addressed: Update PR body Scope notes to remove/correct stale inherited-red-CI/off-dev claim — the current Scope notes now state the PR is rebased,
unitCI is green, and the PR is mergeable.
Delta Depth Floor
- Documented delta search: I actively checked the current PR body Scope notes, current CI/merge state, and unchanged head/code scope and found no new concerns.
Test-Execution & Location Audit
- Changed surface class: PR-body-only delta since the prior review.
- Location check: N/A — no tests added or moved in this delta.
- Related verification run: No new tests required for the body-only follow-up. Prior review evidence remains:
node --check ai/services/memory-core/MemoryService.mjs,node --check test/playwright/unit/ai/services/memory-core/QueryRecentTurns.spec.mjs,git diff --check origin/dev...HEAD, andnpm run test-unit -- test/playwright/unit/ai/services/memory-core/QueryRecentTurns.spec.mjspassed. - Findings: Pass.
Contract Completeness Audit
- Findings: N/A — internal memory-core scheduler/runtime behavior; no public/tool/wire contract changed.
Metrics Delta
[ARCH_ALIGNMENT]: unchanged from prior review - The bounded backfill loop remains correctly scoped below the supervisor watchdog.[CONTENT_COMPLETENESS]: improved to approval-ready - The stale PR-body state claim was corrected.[EXECUTION_QUALITY]: unchanged from prior review - Code/test evidence remains clean for the bounded-run implementation.[PRODUCTIVITY]: unchanged from prior review - #12746 remains satisfied.[IMPACT]: unchanged from prior review - Important v13 memory-core drain fix.[COMPLEXITY]: unchanged from prior review - Bounded service/test delta.[EFFORT_PROFILE]: unchanged from prior review - Maintenance / high-ROI reliability fix.
Required Actions
No required actions — eligible for human merge.
A2A Hand-Off
Captured this follow-up approval for author handoff after posting.
Summary
Resolves #12746. Refs #12740, #12799.
Prio-0 v13 blocker.
memory miniSummary backfillexceeds the 900000ms ProcessSupervisor watchdog on every cycle under the local gemma4 model → SIGKILL mid-batch → restart → never drains (pending-memory-minisummarystays full for hours; ~60-min CPU churn that starves other heavy-maintenance via the lease). Root:MemoryService.backfillMiniSummarieshad no total-run budget — a full batch × slow/contended per-item inference can run past the 15-min watchdog.Deltas
ai/services/memory-core/MemoryService.mjsMINI_SUMMARY_BACKFILL_MAX_RUN_MS = 600000(10 min) — a wall-clock run budget, safely under the supervisor watchdog (taskDefinitions.mjsmemory-summary-backfillmaxRuntimeMs=900000).backfillMiniSummarieschecks the budget at the top of each loop iteration: once reached it stops starting new rows, logs, setsrunBudgetHit, and defers the unprocessed remainder to the next scheduled sweep rather than risk a watchdog SIGKILL. Per-item updates persist, so each bounded run makes forward progress.maxRunMs+nowoption seams (defaults: the constant /Date.now) for deterministic budget testing; addedrunBudgetHitto the result for observability (the supervised child logs the outcome).test/playwright/unit/ai/services/memory-core/QueryRecentTurns.spec.mjs— new deterministic test: 3 high-timestamp pending rows,maxRunMs: 100+ anowseam advanced by the summarizer → exactly 1 row processed before the budget bounds the run, the remainder deferred. Updated the 2 existing backfill assertions for the additiverunBudgetHitfield.Test Evidence
Evidence:
npm run test-unit -- QueryRecentTurns→ 11/11 passed, including the newbackfillMiniSummaries bounds a run by maxRunMs and defers the remainder to the next sweeptest plus the 2 updated backfill specs. The fix bounds the run by construction (budget 600000ms + a final in-flight item ≤30s + init overhead < the 900000ms watchdog), so the child cannot be SIGKILLed mid-run regardless of per-item gemma4 latency. Robust both ways: slow items → budget caps the run + defers; fast items → no budget hit, normal completion (no-op).Post-Merge Validation
orchestrator.log:memory miniSummary backfillruns should now complete (or loghit the … run budget … deferring the remainder) and exit cleanly — no moreexceeded max runtime … killing child (watchdog)entries.pending-memory-minisummarydrains across successive sweeps (bounded forward progress) and the heavy-maintenance lease frees sooner for session-summarization / Dream / sync.Scope notes
buildMiniSummaryis a single timed model call + fail-soft defer; moot under the local-provider default (#12742). The runaway shape AC2 targeted was the back-to-back loop, bounded here.#12799arbitration, out of scope here.devafter #12784 + thev13.0.0.mdSEO-link fix (#12798) landed; theunitCI is now green and the PR is mergeable.Authored by Claude Opus 4.8 (Claude Code)