Repository navigation
osm/lance lifecycle Phase B: OsmArtifactManager + /api/osm/status (observational) - #134
Conversation
…osm/status Additive-only serving-state visibility, landed as the "observational parts" the plan scoped for Phase B — the OnceLock-backed slab/books/chains serving path in osm_features.rs is untouched; that swap needs real hydration content and is Phase C's job. New: crates/cockpit-server/src/osm_artifact_manager.rs - OsmArtifactManager: two independently atomic-swappable snapshots — ArcSwap<Lifecycle> (real today, starts absent()) and ArcSwapOption<ActiveArtifact> (deliberately an empty marker; Phase C fills it with the RowSlab/books/chains bundle, rotated as ONE unit — replacing four independent OnceLocks that can each drift to a different version). Falsifier proven: a reader holding an Arc from current()/artifact() before a publish_* call keeps observing the old value after the call returns. - cgroup v2 memory telemetry (parse_cgroup_current/parse_cgroup_max pure, read_cgroup_memory Linux-gated with an honest empty fallback elsewhere, per .claude/rules/cross-platform.md). main.rs: AppState gains osm_manager (constructed absent() at startup, no I/O — verified the listener/`/health` independence the plan asked for was already true, not something to fix); new GET /api/osm/status route + handler, with a JSON projection of Lifecycle/Operation/ImportFailure since osm_lifecycle.rs stays serde-free by design. cockpit-server/Cargo.toml: arc-swap = "1.9" promoted from an existing transitive dependency (via lance-namespace/goosefs) to a direct one — no new dependency tree, confirmed via Cargo.lock's one-line diff. 11 new tests (osm_artifact_manager), 160/160 total in cockpit-server (0 regressions). clippy -p cockpit-server --no-deps --all-targets -D warnings: zero findings in the new code, confirmed by grepping the full run for the new file/function names (no matches) — all reported findings are in files this diff never touches. Plan: claude-notes/plans/2026-08-15-osm-lance-lifecycle.md (Phase B section updated; "phase deltas" memory tracking named as a deferred gap rather than attempted without a real phase transition to measure across).
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_3801d3ad-3287-4b3e-a35f-5b2401020554) |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_db78b944-cd82-4424-b2bc-d3db770b69ee) |
Summary
Phase B of the OSM/Lance lifecycle plan (
claude-notes/plans/2026-08-15-osm-lance-lifecycle.md), scoped to the "observational parts" the plan called for — visibility into serving state, without touching the currently-working serving path.New:
crates/cockpit-server/src/osm_artifact_manager.rsOsmArtifactManager— two independently atomic-swappable snapshots:ArcSwap<Lifecycle>(Phase A's coordination type; real today, startsabsent())ArcSwapOption<ActiveArtifact>(deliberately an empty marker — Phase C fills it with the actualRowSlab/books/chains bundle, rotated as ONE unit)Arcfromcurrent()/artifact()before apublish_*call keeps observing the old value after the call returns — the literal "in-flight readers finish against the old Arc" requirement from the plan.parse_cgroup_current/parse_cgroup_max, Linux-gatedread_cgroup_memory()with an honest empty fallback elsewhere (.claude/rules/cross-platform.md).main.rs:AppStategainsosm_manager(constructedabsent()at startup — no I/O); newGET /api/osm/statusroute reporting the manager's snapshot + cgroup memory as JSON.What's explicitly NOT in this PR
OnceLocks inosm_features.rs(SLAB_MMAP/BOOKS/CHAINS/SLAB_DIGEST) are untouched. Replacing them needs real hydration content to publish throughOsmArtifactManager, which is Phase C's job — this PR only builds the swap mechanism and its status surface./healthindependence from hydration — verified already true, not something this PR fixes:health_handleris static JSON with zero OSM reference, and the OSM OnceLocks are lazily first-request-triggered either way.Test plan
cargo test -p cockpit-server osm_artifact_manager— 11/11 new tests passcargo test -p cockpit-server— 160/160 pass (0 regressions)cargo clippy -p cockpit-server --no-deps --all-targets -- -D warnings— zero findings attributable to this diff, confirmed by grepping the full run for the new file/function names (no matches); all reported findings sit in files this PR never touches (osint_gotham.rs,osm_lance.rs,osm_features.rs, and pre-existing lines inmain.rs)cargo fmt—osm_artifact_manager.rsis a leaf module, checked directly (rustfmt --edition 2024 --check, clean);main.rs's new lines checked viacargo fmt -p cockpit-server -- --checkand confirmed absent from the diff — only pre-existing environmental drift shows there (this container's toolchain vs. the committed baseline, same as noted in PR osm/lance lifecycle Phase A: three clocks, one lineage per region #133)Cargo.lockdiff is exactly 1 line —arc-swappromoted from an existing transitive dependency (via lance-namespace/goosefs) to a direct one; no new dependency treeFollow-up (Phase C, not this PR)
osm_features.rs's fourOnceLocks to publish throughOsmArtifactManagerpublish_lifecycle/publish_artifactMaintenanceProvenance::LanceHistoryVerifiedresolver🤖 Generated with Claude Code
Generated by Claude Code