You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 04cab78
Browse filesBrowse the repository at this point in the historyBrowse files
feat(objectql): the lifecycle sweep keeps a last-swept watermark in sys_lifecycle_state
A kernel that reboots onto an existing datastore reads one row at the
initial delay and skips a first sweep the interval has not come due for.
The watermark lives in a new engine-owned, tenant-less object,
sys_lifecycle_state, declared and registered by platform-objects, with
its roster line, census row and ownership-inventory row in this same
commit because the roster test holds both directions.
Carries the released branch claude/project-thread-0jjbbb@4a9c5296
(session_01Utp6CaGhTo68T8rcfBh8Zv) onto current main as one commit, and
reattaches the docblock of firstSweepDueAtInitialDelay to its method.
Claude-Session: https://claude.ai/code/session_016WV4cxAY2io7s5aVJa6YL4
Co-authored-by: Claude <noreply@anthropic.com>
Clause-②: yes (widening) — `PLATFORM_OBJECTS_BY_PACKAGE['platform-objects']` (and so `PLATFORM_PROVIDED_OBJECT_NAMES` / `isPlatformProvidedObjectName`) lists one more real platform object, `sys_lifecycle_state`. Its readers resolve references against the roster and none refuses an author declaration, so a stack that references the object now resolves it instead of drawing the unknown-platform-name advisory; nothing that was accepted is refused.
9
+
Metadata-protocol: added
10
+
Skills-docs: no move — `skills/**` and `content/docs/**` enumerate no platform object roster and teach nothing about the lifecycle sweep's schedule; the object is internal clock state with no data API, so there is nothing for an author to write against it.
11
+
12
+
The lifecycle sweep remembers when it last completed, so a kernel that reboots onto an existing datastore no longer re-sweeps within a minute of every boot.
13
+
14
+
`LifecycleService` now keeps a watermark in a new engine-owned, tenant-less object, `sys_lifecycle_state` (declared and registered by `@objectstack/platform-objects`, one row per datastore, id `lifecycle`). At the initial delay the scheduler reads that one row: when the last completed sweep is younger than the sweep interval, the first sweep waits for the interval and the read is the only statement issued. An older or missing watermark, a kernel without the object, or a read that fails (logged at `warn`) sweeps at the initial delay as before. Every sweep that completes with no policy error and a finished reference audit advances the row; a failed or partial sweep leaves it alone. A datastore the process created from empty still defers its first sweep one interval, and now seeds the row. A direct `sweep()` call still always sweeps.
15
+
16
+
The row is internal state, not a setting: no settings key, no environment variable, no audit row per sweep and no data API (`apiEnabled: false`). `OS_LIFECYCLE_DISABLED=1` still arms nothing. `os migrate organization-ownership` inventories the new table as deployment-level state with no organization column.
0 commit comments