Add campaign operational supervisor - #3476
Open
morganmcg1 wants to merge 127 commits into
Open
Conversation
morganmcg1
marked this pull request as ready for review
August 10, 2026 19:17
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 an opt-in, campaign-scoped operational supervisor for Kubernetes Senpai
deployments. It wakes every 15 minutes, builds one timestamped health snapshot,
retains the latest three snapshots, and runs a fresh bounded OpenHands turn. A
separate capability-free assessment runs at most every six hours to detect
sustained research drift against the advisor guidance actually deployed in the
managed role.
This head contains current
mainat901be4b3and the complete PR #3472 headat
8feef8b8. The release candidate is23b40e7785f10c2d8b412a4a51c3c57d58553dba.Operational flow
exact W&B run IDs recorded by configured students, and exact labeled role
pods.
timestamps, measurements, and opaque fingerprints. Missing evidence remains
unknown; raw PR/W&B/log/error text is not persisted or placed in theprivileged operational prompt.
typed
senpai_operationstool.completion tombstones in a campaign-dedicated SQLite PVC.
raw research evidence, no credentials or action capabilities, and one
enum-only output tool. Only
strategic_driftmaps to a fixed, code-owned,state-bound advisor-principles nudge.
Cycles are single-flight and never overlap. A long wake delays the next wake;
it does not create concurrent supervisors or an accumulating model history.
Authority and trust boundaries
credentials, and namespace-scoped Kubernetes credentials. Model-visible
operation results contain only closed statuses, counts, UUIDs, generations,
booleans, and fingerprints; backend text and identifiers are not echoed.
shell container with a private mutable home/workspace and no Kubernetes
token, GitHub token, W&B key, provider secret, campaign state, shared PID
namespace, or access to the control container filesystem. Senpai does not
filter Git or shell syntax there.
model chooses to read arbitrary PR text, logs, files, or command output, that
data must be treated as hostile and can reintroduce prompt-injection risk.
same-UUID context resets, and controller restarts are state-bound,
idempotent, cooldown-limited, and durably audited.
workspace, and pending events while starting a clean active model branch. It
never deletes selected messages or rewinds an event log.
jobs/delegations are active or activity is unknown. The source generation is
rechecked immediately before replacement.
quiesces the controller and descendants, proves that no TCP listener remains,
authenticates over
SO_PEERCRED, and issues a one-use resume capability.Commands are exact-target, timeout/output bounded, replay-safe, and retained
as durable receipts/tombstones.
Kubernetes release and durability
or RWOP PVC, not the student-writable dataset volume.
when their versioned management and repair protocols are compatible.
campaign transaction Lease, and captures the five mutable resources in a
private rollback journal. Failed upgrades quiesce the failed Deployment,
restore security resources first, then restore and verify the old Deployment.
rewrite
last-applied-configuration; the captured postcondition remainsexact while PUT retains optimistic
resourceVersionconcurrency.rolled back. Stale Lease epochs cannot restore over a newer release.
roles, repair sidecars, state, capacity, RBAC, and network policy intact.
denies IPv4/IPv6 link-local metadata access while retaining bounded DNS
exceptions. The launcher requires an explicit dedicated-namespace and CNI
acknowledgement.
Compatibility and launcher hardening
before OpenHands model validation, so existing advisor/student conversations
can resume across the upgrade.
initialization, inbox adoption, interrupted operations, and failed-turn
delivery have bounded, restart-idempotent recovery paths rather than retry
loops.
anonymous, unlinked file descriptor until the worker and descendants are
reconciled, the listener is rebound, and the idle heartbeat is published.
Startup health also remains non-ready until the initial listener is live.
heavyweight training packages pruned by the advisor image. The advisor build
explicitly imports W&B, and render-only canary helpers lazily load the
CLI-only argument parser so host-side rollback capture has no hidden parser
dependency.
The operational supervisor itself remains Kubernetes-only; other backends
reject the flag until their scoped management transports are implemented.
keys. Campaign-owned SSH security groups remove and verify default egress
before instance launch. Cleanup waits for confirmed EC2 termination and
retains access material while any node is unresolved; it does not release
Dedicated Hosts. Native teardown uses an exact role inventory and retries
loaded LaunchDaemon bootout even after plist removal.
Prior review findings
The substantive review of the earlier
e581371head is now addressed:readiness is verified;
credentials;
substitution, compatibility, and documentation contracts have regression
coverage.
Validation
1594 passed, 22 skipped.1611 passed, 6 skipped.26 passed, including immediatesequential requests, shutdown-during-spawn, crashed-worker reconciliation,
and anonymous result-channel coverage.
repair lifecycle.
23b40e7785f10c2d8b412a4a51c3c57d58553dbapassed enforcing metadata isolation, terminal wake isolation, durable typed
repair, authenticated quiescence, process-owner restart, failed-upgrade exact
rollback, interrupted-operation recovery, dedicated SQLite persistence, and
cleanup. The exact canary cluster was removed by the workflow.
47 passed.uv lock --check: 405 packages resolved.git diff --checkpassed.boundary, repair failure paths, response/rebind barrier, portable anonymous
result channel, and exact raw-API rollback reported no remaining blockers.
Current support
The operational supervisor is production-ready for the documented Kubernetes
topology. Docker, AWS GPU, and AWS Mac supervisor transports remain explicitly
planned and disabled; the README/SPEC describe the required broker boundaries
without claiming that those transports exist today.