feat(team): add standing-team control plane - #545
Draft
Pal Lakatos-Toth (pallakatos) wants to merge 20 commits into
Draft
feat(team): add standing-team control plane#545Pal Lakatos-Toth (pallakatos) wants to merge 20 commits into
Pal Lakatos-Toth (pallakatos) wants to merge 20 commits into
Conversation
Adds the durability-axis primitive (design note §11): a KarsTeam CRD plus reconciler that materializes a principal KarsTask (full envelope) and member KarsTasks (attenuated, parented to the principal), then runs a charter cadence loop that mints and launches task-force KarsTasks on schedule — the autonomous monitoring mechanism for standing operations (monitoring a repo/org, periodic checks). The reconciler authors KarsTasks rather than re-implementing sandbox materialization, so all existing attenuation enforcement, mesh agent loop, receipts, and metering are reused unchanged. Fully additive: a cluster with no KarsTeam objects behaves identically. - controller/src/kars_team.rs: KarsTeam CRD (charter, envelope, roster, cadence, blueprint, reporting_to, knowledge_commons, paused), validation + commons_name - controller/src/kars_team_reconciler.rs: principal/member materialization + charter cadence loop (PHASE_ACTIVE/DEGRADED/HIBERNATING) - crd_validations.rs: kars_team_crd() + CEL (tier range, ceiling<=tier, charter) - helm crd-karsteam.yaml + helm_drift dump/match tests - phase.rs: PHASE_HIBERNATING; field_managers.rs: CLAW_TEAM; main.rs: wire reconciler Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
KarsTeam reconciler needs list/watch/create/update/patch on karsteams (+ /status, /finalizers). Without it the reconciler self-disables with a 403 at startup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements the team knowledge commons (design note §14) — real, in-cluster shared memory that a standing team accumulates across its runs, closing the 'no sign of shared memory' gap. - controller/src/team_commons.rs: ConfigMap-backed commons (kars-commons-<team>), owned by the team. Append-only, provenance-tracked entries (id, author, source run, timestamp, content digest, size), budget-bounded with oldest-first pruning. ensure_commons / record_entry / prior_knowledge. Two load-bearing paths make this functional memory, not a display: - Write path (autonomous): when a standing-operation run completes with a substantive deliverable (tokens spent or artifacts produced — harness-neutral), the reconciler harvests its output into a commons entry, then retires the run's sandbox (launch=false) so runs never pile up. Backpressure caps concurrent runs so the charter loop can't outrun completion. - Read path (functional): when minting the next run, the most recent commons entries are injected as prior knowledge into the run objective, so the team builds on what it already knows instead of starting cold each tick. Runs are driven to completion autonomously via the existing mesh run-request annotation. Verified live: run (13646 tokens) -> harvested with provenance -> sandbox retired -> next run objective carries the prior-knowledge preamble. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Computes a standing team's operational health from run outcomes + cadence punctuality, so the operator can tell at a glance whether the team is actually producing, not merely scheduled (addresses 'monitor that they work autonomously, checking periodically'). - KarsTeamStatus: health (Healthy/Watching/Unproductive/Stalled/Hibernating), runsSucceeded, tokensSpentTotal, commonsEntryCount, lastSuccessAt - harvest pass now tallies substantive vs barren runs + total tokens + newest success; health derives from those + overdue-cadence detection - team_commons::entry_count for shared-memory size - regenerated crd-karsteam.yaml (status fields); helm drift green Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Standing-operation runs stamp run-requested at launch, which raced the sandbox's mesh warm-up: the first delivery fired before the agent was ready, producing a permanent 180s-timeout deliverable that was then retired. - mesh delivery: a transient miss (agent not yet discoverable, or no reply within the window) is now retried on the next poll up to MAX_DELIVERY_ATTEMPTS instead of being recorded as a terminal timeout on the first miss. Only after the warm-up budget is spent is a terminal 'agent never came online' result written. Tracked via the run-attempts annotation. - team retire: a run's sandbox is torn down only once delivery is terminal (deliverable landed AND run-completed stamped), so the team never pulls a sandbox out from under a run that's still warming up / retrying. Verified live: a fresh standing run delivered ok with 28291 tokens and no timeout, then retired cleanly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…itable-only (arch-D) ValidatingAdmissionPolicy that makes a KarsTask/KarsTeam's governance fields controller-writable-only. On UPDATE by any principal other than the controller SA, it denies: - writing .status (the controller-owned governance facts), and - RAISING spec.envelope.tier / authorityCeiling / delegationDepth (self-escalation). Voluntary attenuation (lowering envelope fields) and non-authority spec edits (objective, paused, execution.launch, annotations) remain allowed, so the Bridge BFF and operators keep working. The controller SA is exempt via matchCondition. UPDATE-only (CREATE bounds are the CRD's own CEL); status subresources included. Verified live: self-escalate tier 4->5 DENIED, hand-write status DENIED, voluntary attenuation ALLOWED, controller status writes ALLOWED. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…d (§20) The receipt predicate now opens with the validated launch package — the editable composition (runtime/model/tool-policy/MCP/isolation/memory) the operator reviewed before launch — pinned by a deterministic sha256 digest. This puts what-was-approved at the head of the signed record (the launch ledger), so the receipt binds not just the trust envelope but the concrete plan that ran. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A standing team now publishes a periodic digest — its autonomous-monitoring report — without being asked. On cadence.digestEveryMinutes the reconciler appends a timestamped entry (health, runs generated/delivered, tokens spent, knowledge accumulated) to a rolling kars-team-digest-<team> ConfigMap. - kars_team.rs: cadence.digestEveryMinutes + status.lastDigestAt; CRD regen - team_digest.rs: rolling digest log (last 30), provenance (team/reportingTo) - kars_team_reconciler.rs: publish when the digest interval elapses Verified live: digest published (Healthy: 21 runs, 4 delivered, 56098 tokens, 4 knowledge entries) and surfaced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ntiation, governed promote, capability-readiness gate Closes the durability-axis composition layer (§13/§17/§12/§19), all additive: - KarsSkill CRD (§13): reusable, versioned capability bundle (bounding tool policy + MCP + recipe + knowledge pack), validated + content-digested by its reconciler. Granted to ROLES — the team reconciler merges a Ready skill's tool policy / MCP servers / recipe into the materialized member blueprint, so the grant is a real authority fact, not a label. - KarsProfile CRD (§17): vetted team template (charter + roster + skills + envelope + domain), validated + digested. A KarsTeam with spec.profileRef inherits the profile's charter (if empty) + roster (if empty) — domain-blind platform, domain in the profile. - Governed promote (§12): KarsTeam.spec.requestedTier opens a human tierRaise KarsApproval against the principal; only on approval does the controller widen the envelope (controller-only raise — enforced by the envelope-write VAP), and the approval is bound into the principal's receipt (human-approved + ledgered). - Capability-readiness gate (§19): the charter loop checks every referenced MCP server is provisioned + Ready before minting a run; if not, it pauses-with- reason (clear status detail) instead of dispatching a doomed run that loops. Wiring: 2 new reconcilers + RBAC + helm CRDs + helm-drift tests. 952 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ritance - process_promotion widens the envelope via a merge-patch (not SSA apply) so the other envelope fields are preserved (an apply dropped siblings and failed CRD validation on the next reconcile). - charter CEL now allows an empty charter when spec.profileRef is set, so a profile-instantiated team passes admission and inherits the profile's charter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add skill/profile admission validation, document the standing-team security review, and format the control-plane slice for public CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb3654cd-f1e0-445a-8734-430800af1903
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
KarsTeamas a long-lived governance envelope over short-lived task runsKarsTaskauthority pathKarsSkillandKarsProfileprimitives with admission validationStack
Security properties
Validation
cargo clippy --all-targets --all-features -- -D warnings: passedSecurity audit:
docs/security-audits/2026-09-03-standing-team-control-plane.md.