Skip to content

fix: serve demanded profiles first; bind grown Drive revisions - #5716

Merged
Sinity merged 6 commits into
masterfrom
claude/profile-demand-first
Sep 28, 2026
Merged

Sinity merged 6 commits into
masterfrom
claude/profile-demand-first

Conversation

@Sinity

@Sinity Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

Periodic profile ticks now serve demanded session work before the archive-wide audit, and never re-run the audit once it has swept (polylogue-6remh). Phased Drive catch-up binds a grown document as an asserted revision again instead of quarantining it. The halted-units status test gets a genuinely green baseline.

Problem

  • Demand starved behind the audit (6remh). Two landed contracts conflicted. fix(derived): discover composed session work from pending demand #5540 says a periodic tick publishes demanded work and an idle tick inspects nothing. fix(daemon): recover session profiles after promotion and restart #5570 made every unscoped tick run the startup audit one domain slice at a time (summary, usage rollup, profile; 128 keys each) before any demand pass. Take a one-session archive with pending session_profile_demand: the first callback(None) returned outcomes=(), and no profile was published. On a large archive, demanded profiles waited for all three domains to sweep after every daemon start. test_two_accepted_revisions_survive_one_periodic_profile_pass and test_working_dir_demand_withholds_profile_readiness were red on master.
  • Drive scratch missed a relation. Phased Drive preparation classifies revision lineage against an in-memory snapshot of the cohort. Since feat(ingest): page accepted source manifests and receipts #5630, membership classification also reads source_item_raw_members, and the scratch did not carry that table. Every grown Drive document was therefore quarantined instead of being bound to its predecessor (test_drive_phased_matches_ordinary_document_growth).
  • Halted-units test baseline. The healthy frontier fixture set only overall_status over unknown sub-checks. That is not a proof, and it refutes ok, so the test's "green before the halt" baseline was not green.

Solution

  • Decision recorded on 6remh: fix(derived): discover composed session work from pending demand #5540's contract wins. callback(None) runs only the demand pass. The startup/promotion audit advances in bounded slices through ComposedSessionProfiles.converge_backlog after that demand pass, and it does not repeat once swept (only promotion resets it). Tests that encoded the per-tick audit now drive audit_pass / converge_backlog. The insights race test now models the replacement at the record the route actually compares.
  • _prepare_ingest_unit_sync snapshots the cohort's source_item_raw_members into the scratch alongside the other relations, and revalidates it at publish in the same way.
  • The halted-units test pins every collector to a measured healthy value, keeping the archive's real raw-failure lifecycle, and the shared frontier fixture proves each sub-check.

devtools schema closure: both source files are out, so the derived identity does not move.

Verification

  • devtools gate mypy: Success: no issues found in 3095 source files
  • devtools test on session profile composition, the periodic-pass test, insights browser endpoint, convergence restart law, raw-materialization fair intake, Drive catch-up execution, status observations and status unmeasured: pending; this body is updated with the receipt when it reports

Residuals

  • None known for these three changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6

Sinity and others added 3 commits September 28, 2026 09:30
… per tick

A periodic profile tick ran the archive-wide startup audit, one domain
slice at a time, before any demanded session work (#5570). Demanded
profiles therefore waited for the whole sweep after every start, and an
idle tick kept inspecting. Decision (polylogue-6remh): #5540's contract
wins. Every tick runs the demand pass first. The startup/promotion audit
advances only in bounded slices through converge_backlog after demand,
and does not repeat once swept.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Phased Drive catch-up classifies revision lineage against an in-memory
snapshot of the cohort. Since #5630 membership classification also
reads source_item_raw_members, which the scratch lacked, so every grown
Drive document was quarantined instead of bound as an asserted
revision. The cohort's generation members are now snapshotted, and
revalidated at publish like the other relations.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
The healthy collector fixture's frontier set only overall_status over
unknown sub-checks, which is not a proof and refutes ok. The halted-units
test now pins those healthy collectors, with a measured raw
materialization and this archive's real raw-failure lifecycle, so its
baseline is green before the halt.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@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-28T15:45:38.542387Z 062ae63 New commits
ℹ️ 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: d24905f6c8

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

Sinity and others added 2 commits September 28, 2026 10:26
- The demand-only sweep pages the demand keyspace from its own cursor.
  Sharing the archive cursor let a demand pass resume and finish the
  audit's partial position, so the next audit slice wrapped to its first
  key and a large archive never reached its tail.
- The hot-session probe attaches the source tier through the read-only
  helper on a query-only reader. The profiled reader's authorizer denied
  the parameterized ATTACH, so the probe failed open and deferred no hot
  session (test_real_factory_defers_hot_target_without_losing_the_no_hint_cursor).
- Status tests: the healthy raw-materialization fixture is a measured,
  fully materialized population, and the component metadata expectation
  names the completion fields the collector now reports.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
The added regression for polylogue-6remh used one fake key set for both
the demand-only frame and the archive audit frame, so consuming a key
through demand silently emptied the audit's pending set too -- the test
passed even with a shared cursor, and failed once cursors were split
apart because the demand pass legitimately finished the only key it
was allowed to see. Give the fake distinct keyspaces per frame kind, as
session_profile_demand and the archive scan actually are.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

@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: c029d54f9c

ℹ️ 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/daemon/convergence.py Resolved
…e scratch

The demand-only cursor now restarts when frame.source_revision changes, so
a promoted index generation never resumes the previous generation's keyset
position. The Drive preparation scratch carries source_item_raw_members as
schema only: the Drive route classifies without a source generation, so no
ownership row can match, and copying the cohort's rows let a raw retained
across many generations exceed the row cap and go permanently stale.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@Sinity
Sinity enabled auto-merge (squash) September 28, 2026 15:42
@Sinity
Sinity merged commit 5312edb into master Sep 28, 2026
3 checks passed
@Sinity
Sinity deleted the claude/profile-demand-first branch September 28, 2026 15:47
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