Skip to content

osm/lance lifecycle Phase B: OsmArtifactManager + /api/osm/status (observational) - #134

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/q2-osm-lifecycle-phase-b
Aug 15, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
claude/q2-osm-lifecycle-phase-b

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

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.rs

  • OsmArtifactManager — two independently atomic-swappable snapshots:
    • ArcSwap<Lifecycle> (Phase A's coordination type; real today, starts absent())
    • ArcSwapOption<ActiveArtifact> (deliberately an empty marker — Phase C fills it with the actual RowSlab/books/chains bundle, rotated as ONE unit)
    • Falsifier proven: a reader holding an Arc from current()/artifact() before a publish_* call keeps observing the old value after the call returns — the literal "in-flight readers finish against the old Arc" requirement from the plan.
  • cgroup v2 memory telemetry — pure parse_cgroup_current/parse_cgroup_max, Linux-gated read_cgroup_memory() with an honest empty fallback elsewhere (.claude/rules/cross-platform.md).

main.rs: AppState gains osm_manager (constructed absent() at startup — no I/O); new GET /api/osm/status route reporting the manager's snapshot + cgroup memory as JSON.

What's explicitly NOT in this PR

  • The four OnceLocks in osm_features.rs (SLAB_MMAP/BOOKS/CHAINS/SLAB_DIGEST) are untouched. Replacing them needs real hydration content to publish through OsmArtifactManager, which is Phase C's job — this PR only builds the swap mechanism and its status surface.
  • "Phase deltas" (memory before/after a real phase transition) — named as a deferred gap rather than attempted; there's no real phase transition to measure across until Phase C exists.
  • Listener//health independence from hydration — verified already true, not something this PR fixes: health_handler is 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 pass
  • cargo 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 in main.rs)
  • cargo fmt — osm_artifact_manager.rs is a leaf module, checked directly (rustfmt --edition 2024 --check, clean); main.rs's new lines checked via cargo fmt -p cockpit-server -- --check and 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.lock diff is exactly 1 line — arc-swap promoted from an existing transitive dependency (via lance-namespace/goosefs) to a direct one; no new dependency tree

Follow-up (Phase C, not this PR)

  • Migrate osm_features.rs's four OnceLocks to publish through OsmArtifactManager
  • Wire real hydration (versioned local import, origin/import seals, reconciliation) that actually calls publish_lifecycle/publish_artifact
  • A real MaintenanceProvenance::LanceHistoryVerified resolver
  • Phase-delta memory tracking, once there's a real transition to measure

🤖 Generated with Claude Code


Generated by Claude Code

…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).
@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8df5c979-0b2b-4c7b-bd15-d7031609a2af


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review August 15, 2026 23:31
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@AdaWorldAPI
AdaWorldAPI merged commit 40725e5 into main Aug 15, 2026
5 checks passed
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.

2 participants