Repository navigation
fix(ingest): report unconverged ingest as degraded, not completed - #5663
Conversation
When profile/insight convergence stopped on a retryable target, execute_ingest_operation still finalized outcome=completed, so 'import --demo --wait' and every awaiting caller treated an unconverged ingest as done (#5639 review). The terminal receipt now records profile_convergence_complete; an ingest whose rows committed but whose source admission or convergence did not finish returns 'degraded' with a retryable ingest_convergence_pending error, awaited reads derive the same outcome from the receipt, and import --wait refuses it. The Python API still accepts degraded (its rows are durable) and records converged=False. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35ecc82789
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… and the result contract - IngestResult admits 'degraded', bound to the receipt's recorded convergence, so validate_operation_result accepts the terminal payload. - The durable machine state carries the typed ingest_convergence_pending error, and operation.await and a repeated request id report it. - A repeated request id treats 'degraded' as terminal; the resume branch decodes the nested historical receipt rather than its wrapper. - operation.cancel leaves a settled degraded ingest unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 106216b1b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tract-valid - A receipt recording source_complete=False is not converged even when it predates profile_convergence_complete. - Recorded admission refusals are terminal at this head: they report ingest_source_incomplete (retryable=False); only pending profile convergence reports ingest_convergence_pending (retryable=True). - MutationResult declares the lifecycle error, so operation.await, status and cancel of a degraded ingest satisfy their result contract. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Summary
A committed ingest whose profile/insight convergence stopped now terminates
degradedrather thancompleted, andimport --demo --waitrefuses it.Problem
Review of #5639 (
import_command.py:117):IngestExecution.converge_profilesstops at the first page with an unattempted or unsuccessful target, butexecute_ingest_operationfinalized every ingest withoutcome="completed".import --waitand every awaiting caller therefore treated an ingest whose derived readiness had not converged as done.Solution
converge_profilesrecordsprofile_convergence_complete. It is true only when every page was carried through.IngestTerminalSummaryHistoricalgainsprofile_convergence_complete(nullable for receipts written before it) and aconvergedproperty.ingest_terminal_outcome(history)returnsdegradedwhen either source admission or profile convergence did not finish. The executing request and the awaited read (machine_request_state) both derive the outcome from the receipt, so they agree.ingest_convergence_pendingerror. The rows are durable, and the daemon's convergence continues from there.import --waitrefusesdegradedwith an actionable message.parse_sources) accepts it and recordsconverged: Falsein its batch observation.Verification
devtools test tests/unit/operations/test_machine_receipts.py::test_ingest_terminal_outcome_is_completed_only_when_converged: passed. Its anti-vacuity condition: an unconditionalcompletedturns both degraded rows red.tests/unit/operations/test_daemon_ingest_convergence.py: a stopped convergence records incomplete, and the later page is never attempted.test_import.py: added adegradedrow totest_import_demo_wait_never_verifies_an_unfinished_ingest.test_ingest_await_result_contract.py,test_operation_audit.pyandtest_import.pypassed in the combined focused run before the change moved to this branch.Residuals
machine_receipts.pyis in the schema closure, so this must land before the rebuild.import --waitgets a degraded ingest it refuses; it does not keep waiting for later convergence within its timeout.🤖 Generated with Claude Code
https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4