feat: expose process administration - #40
Conversation
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 SummaryThe PR adds an authorization-gated process-administration query, process liveness snapshots, related operational guidance and tests, and advances the gem to 0.13.2.
Confidence Score: 4/5The 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
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 |
| kind: process_record.kind, | ||
| hostname: process_record.hostname, | ||
| pid: process_record.pid, | ||
| metadata: process_record.metadata, |
There was a problem hiding this 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.
| 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.
Summary
SolidObjects.administration.processesfor authorized process inspection0.13.2to match the Node packageRoot cause
The polling-only warning is evidence-based.
ProcessRegistryonly 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
bundle exec rake— 521 runs, 1,742 assertions, 0 failures/errors, 15 skips