Resolves #13835
This finalizes the REM digest-state closeout by writing terminal extraction failures as digestState: 'undigestible' instead of overloading the legacy deferred state, while keeping legacy deferred rows excluded from the steady cadence. findUndigestedSessions() now filters both bounded-out states, so old rows remain compatible and new terminal rows stop re-serving without pretending they were graph-digested.
Evidence: L2 unit/static covered the state-machine ACs; L3 live load-reduction remains post-merge because it requires the orchestrator processing the real REM backlog.
Deltas from ticket
Earlier merged work delivered the extraction terminality and under-band classification pieces. This PR is the final state-machine delta: terminal max-attempt rows become undigestible, legacy deferred remains a supported excluded state, and the tests cover both the candidate filter and max-attempt terminal writes.
Test Evidence
node --check ai/daemons/orchestrator/services/DreamService.mjs
node --check test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs
npm run agent-preflight -- ai/daemons/orchestrator/services/DreamService.mjs test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs
npm run test-unit -- test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs - 34 passed
git diff --check
- Pre-push freshness:
merge-base HEAD origin/dev == origin/dev; outgoing log contained only fc18b3aeb9 fix(ai): mark terminal REM digests undigestible (#13835)
Post-Merge Validation
Commit
fc18b3aeb9 - fix(ai): mark terminal REM digests undigestible (#13835)
Authored by Euclid (GPT-5, Codex Desktop). Session 2cfc471c-c571-4caf-b0c4-77499f43a0ea.
Resolves #13835
This finalizes the REM digest-state closeout by writing terminal extraction failures as
digestState: 'undigestible'instead of overloading the legacydeferredstate, while keeping legacydeferredrows excluded from the steady cadence.findUndigestedSessions()now filters both bounded-out states, so old rows remain compatible and new terminal rows stop re-serving without pretending they were graph-digested.Evidence: L2 unit/static covered the state-machine ACs; L3 live load-reduction remains post-merge because it requires the orchestrator processing the real REM backlog.
Deltas from ticket
Earlier merged work delivered the extraction terminality and under-band classification pieces. This PR is the final state-machine delta: terminal max-attempt rows become
undigestible, legacydeferredremains a supported excluded state, and the tests cover both the candidate filter and max-attempt terminal writes.Test Evidence
node --check ai/daemons/orchestrator/services/DreamService.mjsnode --check test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjsnpm run agent-preflight -- ai/daemons/orchestrator/services/DreamService.mjs test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjsnpm run test-unit -- test/playwright/unit/ai/daemons/orchestrator/services/DreamService.spec.mjs- 34 passedgit diff --checkmerge-base HEAD origin/dev == origin/dev; outgoing log contained onlyfc18b3aeb9 fix(ai): mark terminal REM digests undigestible (#13835)Post-Merge Validation
Commit
fc18b3aeb9-fix(ai): mark terminal REM digests undigestible (#13835)Authored by Euclid (GPT-5, Codex Desktop). Session 2cfc471c-c571-4caf-b0c4-77499f43a0ea.