Uh oh!
There was an error while loading. Please reload this page.
feat(server): add oRPC 2 control-plane transport - #25
Merged
Conversation
Add apps/server: a typed oRPC 2 router (health, tasks.list/get/create, approvals.decide) over a plain Node HTTP listener, plus one aggregate GET /api/dashboard endpoint for the operational dashboard to consume. The router validates at the boundary with Zod and delegates to runTask, the single composition root that resolves repository policy and constructs a runner; procedures never execute a shell or touch a checkout directly. Task history persists through a narrow KeyValueStorage contract (filesystem by default; Redis, KV, or Nitro storage drop in unchanged), is redacted before it is written, and never stores review input or checkout paths. TaskScheduler bounds concurrency globally and per repository and rejects work once its queue is full. This restores the control-plane half of the productionization work merged as #21, adapted to main as it stands after #22 and #23: built with tsdown like the other apps instead of the Nitro/vue-tsc pipeline apps/dashboard already owns, and listening on 3001 by default so `aube run dev` can start the dashboard and the control plane together without a port collision. Refs #10 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ked queueing Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
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 freeto 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
apps/server: a typed oRPC 2 control-plane transport exposinghealth,tasks.list/get/create, andapprovals.decideover a plain Node HTTP listener, plus one aggregateGET /api/dashboardendpoint for the dashboard to consume. This restores the control-plane half of the productionization work merged as PR #21 (6277cd2in the original branch), which was stripped out of that PR before merge —maincurrently ships the frontend-only dashboard shell with no data source behind it.Review follow-up (97be63c)
Control-plane mutations now fail closed behind an operator-issued access policy:
AGENT_ZERO_CONTROL_PLANE_TOKENS(comma-separatedname:tokenbearer credentials) authenticates callers,AGENT_ZERO_CONTROL_PLANE_REPOSITORIESallow-lists the pathstasks.createmay target, and approval decisions record the authenticated principal's name instead of a wire-supplied actor. Reads stay open for the dashboard.TaskScheduleralso now enforcesmaxQueuedfor per-repository-blocked submissions even while global capacity is free, so blocked work can no longer grow the queue without bound.Review follow-up (5e838dd)
Execution modes are now part of the per-principal policy:
AGENT_ZERO_CONTROL_PLANE_MODES(comma-separatedname:mode|modegrants) controls which modes each principal may request,tasks.createrejects ungranted modes, and principals without a grant are limited to the non-writableobserveandsuggestmodes, sofixandautonomousrequire an explicit operator grant.Why
main'sapps/dashboardhas no backend: the index page renders an emptyDashboardOverviewwith a no-op refresh.apps/serveris the composition root that resolves repository policy, constructs a runner, persists task history, and schedules work — the missing piece the dashboard is meant to read from.Ported forward rather than copied verbatim, adapted to
mainas it stands after #22 (runner write-anchoring/local review scope) and #23 (Node 22.18 baseline):tsdownlikepackages/cli, instead of the Nitro 3 beta +vue-tscpipelineapps/dashboardalready owns (Nitro 3/h3v2/unstorageare all pre-release; a plain Node HTTP listener needed none of that).KeyValueStoragecontract with a filesystem implementation by default (FileKeyValueStorage), so Redis, KV, or a Nitro storage driver drop in unchanged without pulling Nitro into this package.PORTenv override) soaube run devcan start the dashboard (3000) and the control plane together without a port collision.Verification
aube run check:repoaube run lint:ciaube run typecheckaube test— all packages pass except@agent-zero/runner, which has 2 pre-existing Windows-only failures (descriptor-anchored writes are not supported on this platform) unrelated to this change and already present onmainafter fix(runner): resolve unresolved review feedback on write anchoring and local review scope #22; every other package, including the newapps/server(42/42 tests), passes.aube run buildSafety and compatibility
router.test.ts(ported),control-plane.test.ts(ported),rpc.test.ts,dashboard.test.ts,storage.test.ts,index.test.ts— none touch the network or depend on wall-clock timing.observestays read-only; the control plane'srunTaskis the same composition root the CLI uses and still resolvesmayModifyRepositorybefore constructing a runner.packages/runner;apps/serveronly validates, delegates, and persists.redactSecrets) before persistence and never include review input or checkout paths.docs/architecture.md,AGENTS.md/CLAUDE.md,README.md, and added theorpc-serverAgent Skill (with its.agents/skillssymlink) describing the transport's boundaries.Reviewer notes
2.0.0-beta.26(same version the original branch used) since 2.x is still in beta;@orpc/server's stable1.xline predates the context-based procedure API this router relies on.packages/runner's 2 failing tests are unrelated to this PR — they fail identically onmainatc3642cfon this Windows environment and are out of scope here.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.Confidence Score: 5/5
No blocking failure remains.
No accepted blocking findings remain after the scheduler capacity scenario was exercised against the current implementation.
What T-Rex did
Reviews (3): Last reviewed commit: "fix(server): validate mode grants with a..." | Re-trigger Greptile