Skip to content

fix(daemon): retry domain-level derivation failures and keep byte cost - #5751

Merged
Sinity merged 7 commits into
masterfrom
claude/derivation-admission
Sep 28, 2026
Merged

Sinity merged 7 commits into
masterfrom
claude/derivation-admission

Conversation

@Sinity

@Sinity Sinity commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

The daemon's raw-observation and hook-carrier intake callbacks now map a derivation pass to a fair-intake verdict through one helper, _derivation_admission (polylogue-1tyq5.130). A discovery failure the kernel records under the domain-wide key "*" is retryable, where it was previously acknowledged as a duplicate. An admitted item keeps the byte estimate discovery charged, where it was previously reported as costing one unit.

Problem

Findings from #4970 and #5242, rechecked at master 841bbb3:

Finding Disposition
#4970 daemon/cli.py:3408: a domain-level failure is filtered out and reported as DUPLICATE Fixed here. admit_raw_intake kept only outcomes whose key was the raw id, so a KeyOutcome(key="*", FAILED) from run_domain left report.done == 0 and returned DUPLICATE.
#4970 daemon/cli.py:3428: actual_cost=1 refunds the byte deficit Fixed here. Both callbacks returned actual_cost=1 for items whose estimated_cost is their payload size, so FairIntakeDispatcher gave the difference back to the class deficit.
#4970 daemon/cli.py:3412: terminal parse failures are retried forever Still open, and reproduced at master. An invalid retained payload records a failed membership census, RawObservationDerivation._inspect reports stale, and the kernel returns FAILED, so intake retries it after every restart. An inspect-level terminal classification was tried here and withdrawn after review. A correct fix must keep transient read errors retryable, retire any output the raw already materialized, and bind the refusal to the origin's parser fingerprint. It stays with polylogue-1tyq5.130.
#5242 daemon/cli.py:3018: an interrupted cold-build begin leaves an orphaned generation Fixed later in 675a411 (#5619). ColdBuildGeneration.begin calls _reclaim_abandoned_cold_generations, which discards any inactive cold-build generation before allocating a new one. Evidence: test_next_build_reclaims_abandoned_inactive_candidate_before_capacity.

Solution

  • _derivation_admission(report, key, subject=...) considers outcomes for the key and for "*", and uses the authoritative failure and pending counts when the retained sample is truncated. It returns ADMITTED or DUPLICATE without actual_cost. The raw callback still runs profile convergence after an ADMITTED verdict.

daemon/cli.py is not in the derived-identity closure (devtools schema closure: out).

Verification

agentctl job start polylogue pytest_focused -- tests/unit/daemon/test_derivation_admission.py tests/unit/daemon/test_raw_observation_owner.py tests/unit/daemon/test_raw_materialization_fair_intake.py tests/unit/storage/test_raw_observation_derivation.py on the pushed head (job 1214): Success.

Anti-vacuity:

  • Filtering outcomes to the raw's own key turns the "*" case into DUPLICATE.
  • actual_cost=1 makes reconciled_cost equal -4095.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T22:39:42.927772Z 47ab8bf New commits
🔒 Security Review ✅ Completed 2026-09-28T20:58:27.605229Z c1afcda PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1afcdad7d

ℹ️ 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".

Comment thread polylogue/storage/derived/raw.py Resolved
Comment thread polylogue/storage/derived/raw.py Resolved
Comment thread polylogue/storage/derived/raw.py Resolved
@Sinity
Sinity force-pushed the claude/derivation-admission branch from ea12330 to effbcb8 Compare September 28, 2026 22:07
@Sinity Sinity changed the title fix(daemon): retry domain failures and settle terminal parse refusals fix(daemon): retry domain-level derivation failures and keep byte cost Sep 28, 2026
@Sinity
Sinity enabled auto-merge (squash) September 28, 2026 22:42
@Sinity
Sinity merged commit 3f7d49d into master Sep 28, 2026
3 of 4 checks passed
@Sinity
Sinity deleted the claude/derivation-admission branch September 28, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant