Skip to content

feat: expose process administration - #40

Draft
cardmagic wants to merge 2 commits into
mainfrom
fix/administration-process-query-ruby
Draft

feat: expose process administration#40
cardmagic wants to merge 2 commits into
mainfrom
fix/administration-process-query-ruby

Conversation

@cardmagic

Copy link
Copy Markdown
Owner

Summary

  • add SolidObjects.administration.processes for authorized process inspection
  • return frozen process snapshots with live/stale status through the runtime database adapter
  • cover same-process warning behavior and document rolling-deployment overlap
  • prepare the gem as 0.13.2 to match the Node package

Root cause

The polling-only warning is evidence-based. ProcessRegistry only emits it when a live process row has a different hostname or PID. Component rows in one Ruby process do not trigger it; a rolling deployment or recently uncleanly stopped process can legitimately remain live during the configured heartbeat window.

The administration query gives operators a supported, authorization-guarded way to inspect those rows without opening a competing SQLite connection.

Verification

  • focused administration and polling tests
  • bundle exec rake — 521 runs, 1,742 assertions, 0 failures/errors, 15 skips
  • Standard and RuboCop — 209 files, no offenses
  • RBS generation/validation and Steep
  • Brakeman — zero warnings

Provide an authorization-guarded process query through the runtime database adapter so operators can inspect live and stale rows without opening a competing SQLite connection. Keep the polling warning evidence-based and document rolling-deployment overlap.
@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds an authorization-gated process-administration query, process liveness snapshots, related operational guidance and tests, and advances the gem to 0.13.2.

  • Exposes SolidObjects.administration.processes.
  • Computes process staleness using database time and the configured alive threshold.
  • Documents rolling-deployment overlap and extends polling-warning coverage.
  • Updates generated RBS declarations, changelog, lockfile, and version.

Confidence Score: 4/5

The process inspection API should be corrected before merging so its nested metadata cannot mutate an advertised frozen snapshot.

The new API freezes only the outer containers, leaving each snapshot's metadata mutable even though repository snapshot APIs provide deep immutability.

Files Needing Attention: lib/solid_objects/administration.rb, test/integration/administration_test.rb

Important Files Changed

Filename Overview
lib/solid_objects/administration.rb Adds the authorized process-listing API, but nested metadata remains mutable despite the snapshot contract.
lib/solid_objects.rb Loads, memoizes, and resets the new administration facade.
test/integration/administration_test.rb Covers authorization, liveness, and outer freezing but misses nested metadata immutability.
test/integration/polling_test.rb Confirms same-hostname-and-PID process rows do not trigger the cross-process warning.
docs/operations.md Documents rolling deployment overlap, stale process timing, and the new inspection API.
Prompt To Fix All With AI
### Issue 1
lib/solid_objects/administration.rb:17
**Nested metadata remains mutable**

When a caller mutates `snapshot[:metadata]`, the directly assigned metadata hash changes despite the process record being presented as a frozen snapshot, breaking the snapshot's deep-immutability contract.

```suggestion
          metadata: SolidObjects::Serialization.readonly_copy(process_record.metadata),
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat: expose process administration" | Re-trigger Greptile

Comment thread lib/solid_objects/administration.rb Outdated
kind: process_record.kind,
hostname: process_record.hostname,
pid: process_record.pid,
metadata: process_record.metadata,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Nested metadata remains mutable

When a caller mutates snapshot[:metadata], the directly assigned metadata hash changes despite the process record being presented as a frozen snapshot, breaking the snapshot's deep-immutability contract.

Suggested change
metadata: process_record.metadata,
metadata: SolidObjects::Serialization.readonly_copy(process_record.metadata),
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/solid_objects/administration.rb
Line: 17

Comment:
**Nested metadata remains mutable**

When a caller mutates `snapshot[:metadata]`, the directly assigned metadata hash changes despite the process record being presented as a frozen snapshot, breaking the snapshot's deep-immutability contract.

```suggestion
          metadata: SolidObjects::Serialization.readonly_copy(process_record.metadata),
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Deep-freeze metadata returned by process administration so nested values cannot mutate a published snapshot. Add a regression test for nested mutation.
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