Skip to content

Expose the lifecycle journal over RPC and in the console - #342

Merged
athNdev merged 2 commits into
mainfrom
feat/operation-journal-rpc
Nov 4, 2026
Merged

athNdev merged 2 commits into
mainfrom
feat/operation-journal-rpc

Conversation

@athNdev

@athNdev athNdev commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Problem

An interrupted start, stop or delete left a durable journal row that nothing could read. The projection from #336 existed and the CLI could list it, but the console showed a server that appeared stuck with no explanation, and there was no supported way to release the lock from the UI.

What changed

OperationService (proto/carbonpanel/v1/operation.proto):

  • ListOperations — a server's journal, newest first, with an optional outcome filter and per-outcome counts.
  • GetOperation — one row, refusing a server that does not own it.
  • ResolveOperation — releases a lifecycle lock, records the operator note, writes an audit entry and nudges the reconciler.

Every call carries server_id, which is the RBAC object id. A scoped grant reads exactly one server's journal; omitting server_id becomes * and stays an admin action.

Projection accuracy. Describe gained DescribeAt and now distinguishes:

phase before now
executing, advanced recently unknown / resolve running / wait
executing, past ExecutionStaleAfter unknown / resolve unknown / resolve
recovered unknown / contact_operator unknown / none

recovered was previously falling through to the unrecognised-phase branch and telling operators to contact support about a row that was already settled.

Console. A "Lifecycle operations" panel above the audit log on the Activity tab: outcome tags, what happened, the safe next step, the redacted error text, and a "Release lock" action — offered only when the server is actually blocked. A running row polls; a settled journal does not.

Verification

  • go build ./..., go vet ./..., go test ./... green
  • New service tests: scoping, outcome filtering (both sides of the execution window), idempotent resolve, note bounding, credential redaction
  • New negative authorization tests at the interceptor: another server is denied, and omitting server_id does not widen the query
  • knowledge-lint: 30 concepts, 10/10 queries, indexes current
  • Frontend: bun run check 0 errors, bun run test 67 pass

Refs OSS-245

An interrupted start, stop or delete left a durable row nobody could
read: the projection existed, the CLI could list it, and the console
showed a server that appeared stuck with no explanation.

OperationService lists, reads and releases journal rows, scoped by the
server id that is also the RBAC object id, so a scoped grant reads one
journal and an empty id stays an admin action. Resolving a lock records
an operator note, writes an audit entry and nudges the reconciler instead
of waiting for the safety-net sweep.

The projection now distinguishes an operation that is genuinely still in
flight (running) from one that stopped reporting (unknown), and a
recovered row reads as settled rather than as an unrecognised phase.
@athNdev
athNdev force-pushed the feat/operation-journal-rpc branch from 7b334e8 to 8df8ef1 Compare November 4, 2026 04:21
protobuf-es v2 timestamps are plain {seconds, nanos} messages with no
toDate() method, so the shared formatTime helper fell through to
new Date(object) and printed Invalid Date on the audit log, the backup
list and the new lifecycle journal.

formatTimestamp uses timestampDate from @bufbuild/protobuf/wkt and is
unit tested, so the three copies of the broken helper are gone.
@athNdev
athNdev merged commit 8736a85 into main Nov 4, 2026
11 checks passed
@athNdev
athNdev deleted the feat/operation-journal-rpc branch November 4, 2026 08:01
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