Repository navigation
feat(coordinator,orchestrator): add app-gRPC admin pause/resume and unify HandoffMarker - #1857
Closed
nikhilunni wants to merge 4 commits into
Closed
nikhilunni wants to merge 4 commits into
nikhilunni wants to merge 4 commits into
Conversation
…C and unify HandoffMarker
|
The latest Buf updates on your PR. Results from workflow CI / buf (pull_request).
|
The chart rolls the coordinator and the orchestrator at the same time. An orchestrator that calls PauseSession or ResumeSession on a coordinator without those methods gets Unimplemented. This PR now ships only the coordinator methods, the generated clients, and the admin-only policy entries. The orchestrator route cutover moves to a follow-up that merges after this change is deployed. Restore admin.ts and config.ts to the REST proxy, keep the direct-RPC policy gate test, and make the coordinator comments state the current callers of the HTTP routes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The handoff marker type moved to engram-protocol. The successor reads the file that the previous build wrote, so pin the pretty JSON bytes the writer produces. Also cover every post-crash state of the tmp-then-rename write: a torn marker at each byte offset is removed and reads as a fresh start, and a leftover tmp sibling is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…resume-grpc # Conflicts: # Cargo.lock
nikhilunni
marked this pull request as ready for review
December 3, 2026 17:07
Contributor
Author
|
Combined into #1860 with the other audit PRs, so they merge and deploy together. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds in-place admin pause/resume to app-gRPC on the coordinator, and keeps one
HandoffMarkerdefinition. This PR is the coordinator half. The orchestrator cutover is a follow-up (see Rollout).PauseSession/ResumeSession: new RPCs onSessionService(engram/app/v1/session.proto, new messages only, new field numbers,buf breakingpasses). The coordinator handlers call the sameapi/admin.rscore functions as the HTTP routes, so the two paths return the same results and error slugs. Generated Rust/TS bindings are regenerated withbuf generate.manage all) in the orchestrator and the deployment bearer in the coordinator, with no per-org scope. The new RPCs use the same rules:policy-map.tsmaps both tomanage all(nosessionIdField, the same asSnapshot/EvictIdle), and the coordinator handlers check the app-gRPC bearer first.pause-resume-policy.test.tsasserts anonymous →Unauthenticated, member →PermissionDenied, both with zero upstream calls.HandoffMarker: moves tocrates/engram-protocol/src/handoff.rs(re-exported byengram-host-core::shutdown). Field order and serde attributes do not change, so the JSON is byte-identical.handoff.rspins the compact wire bytes. A new host-agent test pins the pretty on-disk bytes and covers every post-crash state of the tmp-then-rename write (a torn marker at every byte offset is removed and reads as a fresh start; a leftover tmp sibling is ignored).Rollout
deploy/helm/engramrolls the coordinator and the orchestrator in parallel. An orchestrator that calls the new RPCs on an old coordinator getsUnimplemented. So the change lands in three steps, each one deployed before the next merges:audit/p1-admin-pause-resume-orch, stacked on this branch):routes/admin.tscallsPauseSession/ResumeSession, removesCONTROL_PLANE_HTTP_URLfromconfig.ts, and addsadmin-routes.test.ts. Merge only after step 1 is deployed. Do not roll the coordinator back past step 1 while step 2 is deployed./api/v1/admin/sessions/{id}/{pause,resume}, theCONTROL_PLANE_HTTP_URLchart env and theorchestrator.controlPlane.httpUrlvalue, and the orchestrator bearer fromENGRAM_AUTH_TOKENSif nothing else uses it. Merge only after step 2 is deployed and no rollback target calls the HTTP routes.I chose a split over an
Unimplemented→ REST fallback inadmin.ts: the split adds no transitional code to the orchestrator, and the HTTP routes already serve as the compatibility surface.Merge order
audit/p0-coordinator-security(fix(coordinator): fail closed on capabilities and internal auth, check host ownership #1850) also editsapi/host_http.rsandapi/mod.rsand makes the coordinator HTTP router fail closed. After it lands, the HTTP leg ofadmin_pause_resume_preserves_state_and_error_mappingincrates/engram-coordinator/tests/grpc_app.rsmust send a bearer token. Whichever PR merges second fixes that test and resolves themod.rscomment conflict.Validation
buf generate,buf breaking,cargo fmt --check,cargo clippy -p engram-protocol -p engram-host-core -p engram-coordinator --all-targets -- -D warnings,cargo hakari generate --diff.cargo test:grpc_app, coordinator unit, protocol, host-core;engram-host-agenthandoff tests.orchestrator:bun run typecheck,pause-resume-policy.test.ts,authz.matrix.test.ts.🤖 Generated with Claude Code