Repository navigation
Bound fenced intervals and open no interval for a record without a scope - #3237
Conversation
A window read by overlap returned every live interval with no recorded end to every later window. Fenced state intervals keep their end unknown, so each boot left its unit runs open for good, and a focus or workspace record that names no scope became its own scope with an interval nothing could close. An interval now reaches to its end or to the bound its kind declares for an unknown end (fenced_at for state.interval); the store keeps that reach for live intervals and a schema step brings stored fenced intervals up to date. A record that names no scope (focus, workspace) or no host (unit, boot, sleep) opens no interval. Work episodes read the state kinds they use. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UuFixsXwismFLxbfWcuXHU
The live intervals table keeps the end or the bound of an unknown end; the admission page and the vocabulary said it keeps the end. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UuFixsXwismFLxbfWcuXHU
Codex Review Summary: ✅ CompletedThis 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. |
… scope case A state interval without start evidence has an unknown time, so the fixtures of the two new daemon tests were never read by time. The bounds test closed one record by another through a shared native ID with no scope; such records now open no interval. A sleep record without a host still names the focus and workspace days it may interrupt. The episode's affected-range check compares the state kind directly, since admission asks it for every stored state interval. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UuFixsXwismFLxbfWcuXHU
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…t-cannot-change # Conflicts: # crates/sinex-schema/src/upgrades.rs
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
A window that reads an interval kind by overlap is handed every live interval of that kind with no recorded end that started before it, whatever its age. On the deployed store (schema 50, 91.7 million events, 2026-11-26) 475,867 live intervals were open in that sense and were returned, payloads included, to every later window read of their kind. This change makes an interval that can no longer change stop being open, in the read index and in the derivations that produce it.
What was open, and why
Counts from
core.live_intervalsandcore.eventson the deployed store, read-only, 2026-11-26 21:20 CET.state.interval,machine.unitfenced_atand leavesended_atunknown, and the index kept only the end. 340 are runs of the current boot with no end record in the journal.state.interval,machine.bootstate.interval,desktop.focuswindow.focusedrecord that names no scope. One is the current focus.state.interval,desktop.workspaceworkspace.switchedrecord that names no scope. One is current.The focus and workspace records without a scope were written by an earlier parser version (1,002,246 live
window.focusedevents up to 2026-11-13). The fold made a record that names no scope its own scope. A scope of one record has no next transition, so its interval never ended, its day key waited for good and was recomputed on every runner pass, and each recompute read forward to the end of the stored focus history looking for 63,761 closers that cannot exist.What changes
An interval reaches to its end, or to its bound when its end is unknown. An interval kind can declare the payload field that bounds an unknown end (
fenced_atforstate.interval).core.live_intervals.ended_atnow holds how far the interval reaches: the end, else the bound. Admission and restore write it; the reaching read is unchanged, because it already asks which rows contain the window's start and which are open. The query layer and admission's affected-output check already treated a fence this way; the window read now agrees with them. A fenced interval still has an unknown end and an unknown duration.Schema step 52,
fenced_interval_bounds. One statement reads the storedstate.intervalevents that have a fence and sets the reach of their open rows. No event row is written and no derivation recomputes.A record that names no scope opens no interval. This covers a focus or workspace change with no scope, a unit start with no host, and a boot or sleep with no host. Nothing can be matched to such a record, so an interval for it would stay open for good, be listed as current by
nowand reach every later window. The record stays queryable as its own event. An observed span carries its own end and still stands without a scope. The bounded reader of a day's transitions selects no scope for such a record, which removes its fallback lookups by equivalence key, native ID and material. One case goes with them: two records with no scope that shared a native ID were folded as one scope. No typed focus or workspace payload carries a native ID, and a shared record identity is not a place a state lives in.state.intervalsgoes from version 6 to 7 andunit.intervalsfrom 1 to 2.A unit run of the current boot with no end record stays open until the next boot fences it. The journal holds no end record for about three quarters of transient scope runs, nothing stored says when such a run ended, and it may still be running, so no end is made up. It costs nothing while open: its key waits on its host's boots key only, and only a reader that asks for unit runs is handed it.
Work episodes read the state kinds they use. The episode key read every
state.intervalover its extent by overlap, so each episode was handed every open unit run in the store. It now names lock, display and suspend states, in its read and in its affected-range check, so an admitted unit run or focus interval no longer looks up stored episodes.work.episodesgoes from version 5 to 6.Decisions and rejected alternatives
nowand the waiting flag would each need a third state, for an output that restates one input event.core.live_intervals.ended_atkeeps its name. It now holds a reach, which the table's description says; a rename would have needed frozen copies of the version 50 table and indexes for one step.After deploy
Stop the daemon, run the schema upgrade (51 to 52), start the daemon; nothing else has to be run for the open intervals to be corrected.
state.intervalevents only (1.57 million by planner estimate on the deployed store).state.intervalskey they are recomputed, their open intervals are archived and they stop waiting. By the lifecycle rules, archiving those intervals also marks the keys of other derivations whose reads included them (activity hours since that day, for example), which then recompute once; that burst was not measured.state.intervals,unit.intervalsandwork.episodeswith a pending switch for their history (selected on the deployed store today: 1, 1 and 5). None is needed for the above, since the runner computes dirty and waiting keys with the running version. Until a derivation is switched, a plainrecomputeof it is refused. Theunit.intervalsswitch changes no stored output there: no unit record on that store lacks a host. A switch ofstate.intervalsarchives the focus intervals earlier builds computed for the 17 days before 2026-11-12 from records without a scope and computes none in their place, so replaying those records first keeps that history.Verification
The hosted
checkandtestjobs on the head are the verification (run 45899693641 passed on 35729e5, 2,342 tests; the head after merging master is checked by the run on it). The hosted code review of 35729e5 reported no findings. The tests that carry the change:sinex-storea_fenced_interval_reaches_no_window_after_its_fence: a fenced interval is read by windows starting before and at its fence and by none after it, narrowed and whole-type, as admitted and after an archive and restore; an interval with neither end nor fence is read by every later window.sinex-storewindow_reads_over_intervals_equal_the_predicate_over_every_event: the indexed read equals one statement over every event for eleven windows, now with fenced intervals in the fixture.sinex-schemaupgrade_fills_live_intervals_of_every_interval_kind: a version 49 database through the fill and the bound step; bound after start, end and bound, bound at or before start, unreadable bound; catalog equal to a fresh database.sinex-storerecords_that_name_no_scope_do_not_extend_the_read_past_the_closers: 300 records without a scope in a day leave the forward read at the page that reaches the named scope's closer, with 4,096 later records unread.sinex-derivationsa_transition_that_names_no_scope_opens_no_interval_and_its_day_does_not_wait,a_span_that_names_no_scope_is_still_its_own_interval,a_boot_or_sleep_that_names_no_host_has_no_key_and_opens_no_interval,a_unit_record_without_a_host_has_no_key_and_opens_no_interval.sinexda_day_of_focus_records_without_a_scope_stops_waiting: a day key holding 40 stored open intervals for records without a scope, waiting, as the earlier fold left it; after the next pass they are archived, the key is not waiting and one interval is open.sinexdan_episode_reads_absence_states_and_no_unit_run: an episode's read holds the suspend intervals that reach or start in it and no unit run or focus interval; admitting a unit run marks no episode.Not run: the upgrade step against the deployed store, and the counts after deploy. Not measured: the runner's read time after the change, which needs the deployed store.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UuFixsXwismFLxbfWcuXHU
Task: sxnext-pib.23