Skip to content

runtime: in .uigraph.yaml, uigraph runtime detect and check (P2) - #29

Draft
Manasa-uigraph wants to merge 1 commit into
mainfrom
autopilot/p2-runtime
Draft

Manasa-uigraph wants to merge 1 commit into
mainfrom
autopilot/p2-runtime

Conversation

@Manasa-uigraph

Copy link
Copy Markdown
Contributor

Adds the runtime: section to .uigraph.yaml (strict, schema shared with uigraph-sandbox via a JSON Schema, fixtures and an identical parity test in both repos), runtime detect (proposes it from CI, Makefile, package.json, Dockerfile, compose, .env.example; secrets by name only) and runtime check (static checks; --run proves it in the sandbox base image with local Docker; --report sends readiness to Autopilot with your own token). Sync uploads the section; the gateway ignores it until it stores it.

Checked: tests with race and lint clean. On copies, uigraph-api detect → check --run is Ready with no secrets; uigraph-ui's setup passes with its registry token and reports needs_secrets without it, then its own build (OOM in an 8GB VM), lint and 4 unit tests fail, which are real.

🤖 Generated with Claude Code

The runtime profile (how to set up, build and test a service, its sidecars
and the names of its secrets) is a runtime: section of .uigraph.yaml. The
CLI owns the schema (pkg/runtime, plus schema/runtime.schema.json and shared
fixtures); uigraph-sandbox carries the same three files and the same
parity test, so drift in either repo fails its CI. Unlike the rest of
.uigraph.yaml, unknown keys in runtime are errors. Sync uploads the section
with the service (the gateway ignores it until it stores it).

`uigraph-cli runtime detect [dir]` proposes the section from, in order of
trust: CI workflow commands, Makefile targets, package.json scripts and
lockfile, go.mod, Dockerfile (HEALTHCHECK, NODE_OPTIONS), compose files and
.env.example. Secrets are names only: a private registry the CI logs in to
becomes a secret plus an .npmrc line that refers to ${NAME}; secrets whose
egress host cannot be read are listed in notes, not guessed. A Makefile
test target that CI does not run is noted, not added: uigraph-api's
test-integration is not in CI and fails on a fresh database, which would
have made the service un-Ready forever. --write appends to .uigraph.yaml,
--force replaces an existing section.

`runtime check` validates the profile and the repo (make targets, package
scripts, compose file exist). With --run it runs setup, build, lint and
tests in the sandbox base image with local Docker: the repo is copied in
without .git and node_modules, postgres and redis sidecars share the
container's network namespace, the network is cut after setup unless egress
hosts are declared, and secrets come from same-named env vars passed by name
(never on the docker command line); steps whose secrets are unset report
needs_secrets instead of running. --report sends the result (status,
reasons, commit, checked profile, steps) to Autopilot with the engineer's
own UIGRAPH_USER_TOKEN; it needs --run and a clean tree.

Verified on copies of uigraph-api (ready, no secrets) and uigraph-ui
(setup passes with the registry secret; needs_secrets without it).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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