diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fdec0ad2c0..5aad20d6dc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,10 @@ -# Dependabot config (issue #118). Keeps both Go modules' go.mod/go.sum and the -# SHA-pinned GitHub Actions current — supply-chain hygiene that travels with the -# engine library when the downstream consumer pins it. +# Dependabot config (issue #118). Keeps every Go module's go.mod/go.sum and the +# SHA-pinned GitHub Actions current — supply-chain hygiene for the root binary, +# importable engine, reusable authn adapter, and opt-in providers. # -# Dependabot processes each gomod directory INDEPENDENTLY, so the workspace's two -# modules (root + engine) each get their own update config. Minor+patch bumps are -# GROUPED into a single PR per ecosystem to cut review noise; majors stay separate +# Dependabot processes each gomod directory INDEPENDENTLY, so every workspace +# module gets its own update config. Minor+patch bumps are GROUPED into a single +# PR per ecosystem to cut review noise; majors stay separate # (they can break, so they deserve an individual PR). # # The repo SHA-pins every GitHub Action with a `# vX.Y.Z` comment. Dependabot @@ -45,6 +45,22 @@ updates: - minor - patch + # Opt-in caller-identity adapter module (ADR 0103; not a provider). + - package-ecosystem: gomod + directory: "/authn/oidc" + schedule: + interval: weekly + open-pull-requests-limit: 10 + commit-message: + prefix: "chore(deps)" + labels: + - dependencies + groups: + go-minor-patch: + update-types: + - minor + - patch + # Opt-in LLM-provider submodules (ADR 0093) — each its own go.mod closure. - package-ecosystem: gomod directory: "/provider/anthropic" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b78a1fb729..f6ec669ec4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum provider/ssefilter/go.sum provider/anthropic/go.sum provider/openai/go.sum @@ -67,6 +68,9 @@ jobs: - name: go build (engine module) run: cd engine && go build ./... + - name: go build (OIDC authn module) + run: cd authn/oidc && go build ./... + # provider/ holds the opt-in LLM-provider Go submodules (ADR 0093), each # its own module under the workspace — build them explicitly too. - name: go build (provider modules) @@ -92,6 +96,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum provider/ssefilter/go.sum provider/anthropic/go.sum provider/openai/go.sum @@ -110,6 +115,9 @@ jobs: - name: go test -race (engine module) run: cd engine && go test -race ./... + - name: go test -race (OIDC authn module) + run: cd authn/oidc && go test -race ./... + # provider/ submodules (ADR 0093) — each its own module under the workspace. - name: go test -race (provider modules) run: | @@ -134,6 +142,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum provider/ssefilter/go.sum provider/anthropic/go.sum provider/openai/go.sum @@ -164,6 +173,9 @@ jobs: - name: golangci-lint (engine module) run: cd engine && golangci-lint run --config ../.golangci.yml --allow-parallel-runners --timeout=8m ./... + - name: golangci-lint (OIDC authn module) + run: cd authn/oidc && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners --timeout=8m ./... + # provider/ submodules (ADR 0093) — each its own module, sharing the ROOT # golangci config so the depguard allowlists stay the single source of truth. - name: golangci-lint (provider modules) @@ -179,6 +191,9 @@ jobs: - name: go vet (engine module) run: cd engine && go vet ./... + - name: go vet (OIDC authn module) + run: cd authn/oidc && go vet ./... + - name: go vet (provider modules) run: | (cd provider/ssefilter && go vet ./...) @@ -233,6 +248,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum provider/ssefilter/go.sum provider/anthropic/go.sum provider/openai/go.sum @@ -388,6 +404,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum provider/ssefilter/go.sum provider/anthropic/go.sum provider/openai/go.sum @@ -431,6 +448,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum provider/ssefilter/go.sum provider/anthropic/go.sum provider/openai/go.sum @@ -459,6 +477,13 @@ jobs: cd engine && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... \ | go run ../.github/scripts/govulncheck-gate.go # v1.1.4 + - name: govulncheck (OIDC authn module — strict, no allowlist) + shell: bash + run: | + set -o pipefail + cd authn/oidc && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... \ + | go run ../../.github/scripts/govulncheck-gate.go # v1.1.4 + # provider/ submodules (ADR 0093) — each its own module; scan against its # own go.mod so the provider library's closure is checked independently. - name: govulncheck (provider modules — strict, no allowlist) @@ -494,6 +519,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum provider/ssefilter/go.sum provider/anthropic/go.sum provider/openai/go.sum diff --git a/.github/workflows/k8s-e2e.yml b/.github/workflows/k8s-e2e.yml index 85fe702bca..8d94bd0636 100644 --- a/.github/workflows/k8s-e2e.yml +++ b/.github/workflows/k8s-e2e.yml @@ -1,10 +1,11 @@ # kind-based k8s e2e suite for mecak8s (ADR 0048). # # Spins a real kind cluster + Redis StatefulSet + two storage-free mecak8s agent -# replicas and asserts lease exclusion, graceful failover, and session persistence. -# The suite lives under e2e/k8s/ (build tag `kind_e2e`); `task e2e:k8s` runs -# `go test -tags kind_e2e -count=1 -timeout 15m ./e2e/k8s/...`. Slow (~3-5 min) and -# needs Docker, so it is NOT part of `task test` and runs only on relevant-path +# replicas and asserts lease exclusion, graceful failover, session persistence, +# and caller identity against an in-cluster Dex OIDC provider. The suite lives +# under e2e/k8s/ (build tag `kind_e2e`); `task e2e:k8s` runs +# `GOWORK=off go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/...`. Slow +# (~5-8 min) and needs Docker, so it is NOT part of `task test` and runs only on # changes (the mecak8s binary, the Redis store, the server surface it composes, the # deploy manifests, the suite itself, and the build config). # @@ -28,26 +29,36 @@ on: branches: [main] paths: - cmd/mecak8s/** + - internal/cliconfig/** - internal/adapter/redisstore/** + - internal/adapter/server/authn.go - internal/adapter/server/service.go - internal/adapter/server/errors.go - internal/adapter/server/grpc.go - internal/adapter/server/http.go - deploy/mecak8s/** + - deploy/mecak8s-oidc/** - e2e/k8s/** + - go.mod + - go.sum - .ko.yaml - Taskfile.yml - .github/workflows/k8s-e2e.yml pull_request: paths: - cmd/mecak8s/** + - internal/cliconfig/** - internal/adapter/redisstore/** + - internal/adapter/server/authn.go - internal/adapter/server/service.go - internal/adapter/server/errors.go - internal/adapter/server/grpc.go - internal/adapter/server/http.go - deploy/mecak8s/** + - deploy/mecak8s-oidc/** - e2e/k8s/** + - go.mod + - go.sum - .ko.yaml - Taskfile.yml - .github/workflows/k8s-e2e.yml @@ -71,8 +82,8 @@ jobs: k8s-e2e: name: k8s e2e (kind) runs-on: ubuntu-24.04 - # The suite normally finishes in ~3-5 minutes; 20 covers a slow kind pull day. - # This is the cheap backstop UNDER the suite's own 15m `go test -timeout`. + # The suite normally finishes in ~5-8 minutes; 20 covers a slow kind pull day. + # This is the cheap backstop UNDER the suite's own 30m `go test -timeout`. timeout-minutes: 20 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -94,6 +105,17 @@ jobs: version: 3.x repo-token: ${{ secrets.GITHUB_TOKEN }} + # Validate the published base and OIDC overlay before the runtime suite. The + # Dex fixture adds its test-only private-issuer relaxation imperatively, so + # it cannot prove the operator-facing overlay remains safe or well-formed. + - name: Install deploy manifest validators + run: | + go install sigs.k8s.io/kustomize/kustomize/v5@v5.7.1 + go install github.com/yannh/kubeconform/cmd/kubeconform@v0.7.0 + + - name: task deploy:check + run: task deploy:check + # kind: pinned version, installed via `go install` (no third-party action — # the house idiom for go-installable tools, matching actionlint/govulncheck # in ci.yml). v0.32.0 is the current release. @@ -109,7 +131,7 @@ jobs: # kubectl is pre-installed on ubuntu-24.04 runners; no install step. # `task e2e:k8s` == `task build` (deps), then - # `go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/...`. + # `GOWORK=off go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/...`. # KO_DOCKER_REPO=ko.local keeps the image local (no push, no credentials). # The suite builds + resolves in a SINGLE `ko resolve` step (one image ref, # no retagging), then ` save` + `kind load image-archive` loads the diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca0d1bd3b2..a4be46c99f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,11 @@ # below does NOT match `provider//v*` (the tag has a leading path segment), # so a provider release never fires this container build, and an image release # never re-tags a provider module. +# +# Authn-module note (ADR 0103): the reusable OIDC validator is the separate +# github.com/stacklok/mecatl/authn/oidc module, released as authn/oidc/vX.Y.Z. +# It is not a provider module. Its path-prefixed tags likewise do not match the +# root image trigger below. name: Release on: @@ -117,6 +122,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum - uses: ko-build/setup-ko@61b4d1d396f5b2e7d6bb6fefdce3dc38d1a13445 # v0.10 - uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 @@ -241,6 +247,7 @@ jobs: cache-dependency-path: | go.sum engine/go.sum + authn/oidc/go.sum - uses: ko-build/setup-ko@61b4d1d396f5b2e7d6bb6fefdce3dc38d1a13445 # v0.10 - uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 diff --git a/.golangci.yml b/.golangci.yml index 980a66e831..005aee2a55 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -464,6 +464,22 @@ linters: deny: - pkg: os desc: 'agent (application loop) must not import os (CLAUDE.md layering rule); side effects belong in adapters/composition' + # --- authn/oidc opt-in caller-identity module (ADR 0103) --------------- + # Production verification depends only on stdlib, the narrow engine + # principal projection, and ToolHive's authn implementation. Tests are + # exempt per the repository convention for local fixtures. + authn-oidc: + list-mode: strict + files: + - '**/authn/oidc/**.go' + - '!$test' + allow: + - $gostd + - github.com/stacklok/mecatl/engine/session + - github.com/stacklok/toolhive-core/authn + deny: + - pkg: os + desc: 'the OIDC adapter must not touch the host OS or import the root module' # --- provider/* opt-in LLM-provider submodules (ADR 0093) ---------------- # The real provider wire-format adapters graduated OUT of internal/adapter # into their own opt-in Go modules (consumers import the SDK transitively diff --git a/AGENTS.md b/AGENTS.md index 1dd1d3f234..83a8dbf1bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,7 +66,8 @@ consumed in-repo via the committed `go.work` and a root `replace …/engine => . its standalone dep closure is just `doublestar` + `robfig/cron` + `go.yaml.in/yaml/v3` + `x/sync` + test-only `goleak`, so an external consumer's graph stays small. The repo stays a monorepo — the engine module, -the opt-in `provider/*` submodules (ADR 0093), and the root module all move in lockstep. +the opt-in `authn/oidc` caller-identity module (ADR 0103), the opt-in `provider/*` +submodules (ADR 0093), and the root module all move in lockstep. - `engine/session/` — DOMAIN: the `Session` aggregate (state machine), Conversation, the `ToolCall`/`ToolResult`/`Usage` value objects, the `Event` taxonomy. - `engine/governance/` — DOMAIN: permission `Effect`/`Scope`/`Rule` + `Evaluator`, bash splitting/canonicalization, hook event types. **Session-free** (`session` imports it, never the reverse). @@ -75,8 +76,10 @@ the opt-in `provider/*` submodules (ADR 0093), and the root module all move in l - `engine/port/` — the PORT interfaces the loop consumes (`LLMProvider`, `SessionStore`, `HookRunner`, `PermissionPolicy`, `Clock`, `Diagnostics`, `ToolCallRecorder`, `EventSink`). - `engine/agent/` — APPLICATION: the loop (`Engine`/`Run`), dispatch, permission pause/resume, compaction, the Subagent delegation tool, the agent-team `Supervisor`/`TeamTool`. Read-only subagents (Subagent default + read-only team members) run their Bash in an isolated git worktree via a sandboxed runner, TRUST-GATED (issue #40): an untrusted workspace nils the runner — no read-only subagent/member shell, honest Spec note — while Mutating members/Parallel branches keep their HARDENED shells (`buildForceCopyRunner`: force-copy forking runs NO git, so the fork-time checkout RCE the gate closes can't fire there; their run-time git over the verbatim-copied untrusted `.git` is the accepted main-session-parity residual). A `mode:"read-write"` Subagent (ADR 0077, superseding 0040's writable path) is DIRECT-WRITE: no fork, no copy, no merge — it runs Edit/Write/Bash DIRECTLY against the REAL parent workspace (the MAIN session's command runner, main-session parity), exactly as the main agent does, and git is the rollback layer; it stays mutate-serial via the `parentMutatingCaller` seam (now decoupled from any merger) and is NOT isolated (`isolated:false` removes the A2 auto-approve). Default-wired (no flag), per-call default still read-only; a crashed/cancelled child can leave PARTIAL edits (recoverable via git). Scope is the serial Subagent ONLY — Parallel branches and mutating members keep force-copy + serialized merge for genuine concurrency. See `docs/adr/0014-agent-teams.md`, `docs/adr/0077-direct-write-subagent.md`, and the subagent-shell gotcha. - `engine/adapter/` — the REFERENCE adapters that travel with the importable core (offline tests + sane defaults for any engine consumer): `mockllm`, `memfs`, `memstore`, `sessnap`, `eventsource` (the reference event-log→`*session.Session` fold for event-sourced `SessionStore.Load`, ADR 0038), `permpolicy`, `permstore`, `wallclock` (the production `port.Clock`), `fstools` (the correctness/security-critical FS tool BODIES — Read/Edit/Write/Grep/Glob + the optional Bash — graduated into the importable module per issue #269 so consumers get Edit's read-before-edit/exact-match/uniqueness invariants by import; the root `internal/adapter/tools` re-exports them via alias and adds the host-coupled WebFetch/FetchMcpResource), `search` (the graduated web-search tool body + Exa/HTTP/SearXNG providers + offline fake, per #363; the root `internal/adapter/tools` re-exports it via alias), `agentfs` (the filesystem `.claude/agents` agent-def discovery adapter graduated per #328; the root `internal/adapter/agents` re-exports it via alias), `skillfs` (the read-only `.claude/skills` discovery core + Skill tool body graduated per #328; the writable SkillDraft half stays in root `internal/adapter/skills` and reaches the core via alias), `rulesfs` (the `.claude/rules` discovery adapter, issue #329; the root `internal/adapter/rules` re-exports it via alias), `fsconformance`, `memconformance`, `storeconformance`, `sourceconformance` (SkillSource/SoulSource/AgentDefSource/CommandSource/RulesSource suites + the canonical fixtures `Fixture`/`AgentFixture`/`CommandFixture` and their `New*FixtureSource` references). Stdlib + engine-only (memfs adds doublestar); strict depguard allowlists; core PRODUCTION code still must not import them (test files may). +- `authn/oidc/` — the reusable OIDC caller-identity adapter as an OPT-IN Go submodule (ADR 0103). It wraps `toolhive-core/authn`, returns only `session.Principal`, and keeps JWT/JWKS dependencies out of engine. It is not a provider module. - `provider/` — the REAL LLM-provider adapters as OPT-IN Go submodules (ADR 0093): `anthropic` (native Messages API), `openai` (Responses API), `openaichat` (Chat Completions API), and `ssefilter` (the shared SSE keepalive filter). Each is its OWN Go module (`github.com/stacklok/mecatl/provider/`) requiring the engine module + its SDK (+ `provider/ssefilter` for the openai-go family) — a consumer `go get`s exactly the provider(s) it wants and pulls only that SDK, never the root module. Released under `provider//vX.Y.Z` tags; the `v*` image trigger never fires on them. See `docs/adr/0093-provider-modules.md`. - `internal/adapter/` — ADAPTERS: `llmresilience` (retry/breaker + stream-idle watchdog wrapper), `openaicompat` (stdlib-only OpenAI-compatible lister leaf), `osfs`, `permconfig`, `workspacetrust`, `soul`, `memory`, `skills`, `agents`, `rules` (the root alias shim for `engine/adapter/rulesfs`, issue #329), `providercatalog` (embedded models.dev subset), `openrouter`, `toolhivellm` (ToolHive LLM gateway leaf; the ONLY ToolHive-Go-importing file in the package is `tokensource.go` — the in-process OIDC token source for direct mode, issue #265, ADR 0102, sibling to `internal/adapter/mcp/source/toolhive.go`; the rest of the package (`detect*.go`) stays stdlib + `go.yaml.in/yaml/v3`), `gitenv`, `hashutil`, `xdgconfig`, `hookexec`, `slogdiag` (the only slog bridge), `store/jsonlstore`, `redisstore` (Redis-backed SessionStore + EventLog + PrunableStore + ToolCallRecorder, ADR 0048; a transport alternative to jsonlstore, validated by the same conformance suites over miniredis), `grpcdriver` (remote session/memory store + skill/soul/agent-def/command source driver clients + server wrappers), `tools`, `server`, and more — see the directory. (The real provider wire adapters live in `provider/` — ADR 0093.) +- `internal/syscaller/` — the internal-caller registry (ADR 0100): one `Root` const per internal context root (`childgc`, both consolidators, the scheduler, the JWKS refresh) and `Context(ctx, root)`, which stamps the explicit **system** `session.Principal` those goroutines run under. A stdlib + `engine/session` leaf, the `internal/cliconfig` shape — internal work has no caller, so it gets an explicit system identity, never an absent one. - `internal/app/` — COMPOSITION (not domain): the single shared assembly (`app.Build`) of provider registry + catalog + policy + engine into a `server.Service`. The ONLY package allowed to import adapters + `engine/agent`. Per-session provider/model routing, live model listing, capability intersection, trust/soul selection all live here. See `docs/adr/0016-multi-provider.md`. - `contracts/proto/mecatl/v1/` — gRPC contract (source of truth); `contracts/proto/mecatl/driver/v1/` — the driver protocol (SessionStoreService/MemoryStoreService stores; SkillSourceService/SoulSourceService/AgentSourceService/CommandSourceService content sources) a remote driver process implements; `contracts/gen/` is generated, **never hand-edit**. - `cmd/mecated/` — standalone server (composition root): flags, TLS/auth/rate-limit, HTTP + metrics listeners. `cmd/mecademo/` — the offline demo. `cmd/mecatequi/` — single-shot HEADLESS composition root (peer of mecademo over `app.Build`): one prompt → a git-diff patch + a JSON Summary + an optional JSONL log + an exit code. It is **FORGE-AGNOSTIC** — knows nothing about GitHub; the glue that turns an issue into a PR lives ONLY in `.github/` + shell, NEVER the binary or `engine/`, and keeps a **split-privilege token boundary** (the agent job holds NO GitHub write token; the publish job runs NO agent code, applies the patch as DATA). See `docs/adr/0028-mecatequi.md`. `cmd/mecak8s/` — storage-free k8s-native agent (ADR 0048), a thin peer of mecated that composes `app.Build` with k8s-native defaults (Redis store + k8s lease + drain gate); no PVC, no local state — state is a managed service (Redis + k8s API server). The four real-provider mains share credential/base-URL wiring via `internal/cliconfig`. @@ -112,12 +115,13 @@ Dependencies point **inward only**, machine-enforced THREE ways (all run under ` - **Provider is FIXED per session.** A per-session engine re-derives ALL provider-closing Deps via `engineDepsForProvider` (LLM, Compactor, Model, TokenCounter, prompt model, context-window *resolver*) — never clone-and-swap-LLM, or it compacts/counts through the wrong model. The context window is a RESOLVE-AT-USE closure (`Deps.ContextWindow func() int`, built by `reg.windowResolver` in composition: override→live→catalog→128k floor) read on every `maybeCompact`/`Engine.ContextWindow`, NOT a frozen scalar — so a post-construction live-catalog `Swap` self-corrects the (never-rebuilt) shared engine on the next turn, and the `resolved_model` echo (`Service.ResolvedModel` over `Config.ResolveContextWindow`) cannot diverge from it; `--context-window-override` wins for both. The echo wires the SIBLING `reg.echoWindowResolver` (NOT `windowResolver`): both share the `resolveWindowCore` precedence so they agree byte-for-byte on every override/catalogued/live window, differing ONLY in the terminal unknown branch — the ECHO resolver may return **0 = PROVISIONAL** (live refresh still in flight, model not yet known at a real value; the mecatui footer-heal gate keys off `==0` and refetches on turn-end), then floors an uncatalogued model to 128k once the refresh SETTLES (`liveMetaStore.completed atomic.Bool`, set on every settle path, never on shutdown-cancel — no-network boundedness), whereas the ENGINE resolver always floors to 128k (it must NEVER see 0). A wired-resolver `0` is distinct from a nil `ResolveContextWindow` (no window scalar at all). The closure is stdlib (`engine/agent` imports no adapter). - **Per-session/selector catalogs are assembled by the SAME `assembleCatalog` as the shared one** (`internal/app/catalog.go`; issue #42 — the THIRD firing of the per-session-drift class, so the fix is structural: ONE registration path, no second list to forget). Phase A (`buildCatalog`) builds the process-wide `catalogAssets` once — the shared global MCP manager (reused-not-reconnected; a selector session must NOT silently strip github/slack/fetch/etc.), the `tool.MemoryStore` pair (interface-threaded; the flocked `memory.New` calls in `buildCatalog`/`buildUserModelStore` remain the sole construction sites, never re-opened per session), the resolved skills, the ONE process-wide preserved-fork LRU — and `sessionEngineFactory` assembles every per-session catalog over them: core + global MCP (+ the `MCPResourceTools` meta-tools) + client MCP + Subagent trio + Parallel + Team + the six memory tools + Skill/SkillDraft (that order; global-wins on collision). The ONLY sanctioned per-session deltas: the client MCP tools, and the unwrapped hooks (`maybeWrapUserModelReview` is main-engine-only) — guarded by `TestPerSessionCatalogMatchesSharedCatalog` (exact tool-name-set equality). The shared `globalMgr` is owned by `Build`: its `Close` is NEVER folded into the per-session `SessionEngineResult.Close` (a per-session `CloseSession` closing it kills MCP for all other sessions); `globalMgr` is also the `reference:`-resolution mainMgr for per-session subagents. - **Mid-stream stalls are bounded by `llmresilience.StreamIdleTimeout` (180s default set at BOTH `cmd/` composition roots — mecated AND mecatui, both `--llm-stream-idle-timeout`-overridable; ≤0 disables), NOT `PerAttemptTimeout`.** Post-first-chunk idle gaps get a per-chunk watchdog that synthesizes a terminal `*StreamIdleError` (`errors.Is(_, context.DeadlineExceeded)`) — the openai/anthropic adapters SWALLOW the ctx error on cancel (yield nothing), so the wrapper MUST synthesize it. The stall is TERMINAL, never retried (no-replay-after-first-chunk holds). **`PerAttemptTimeout` (300s default on BOTH roots, `--llm-per-attempt-timeout`; ≤0 disables) bounds ONLY establishment (connect + first chunk) via a SEPARATE `time.Timer` stopped+joined at the first chunk — NOT a `context.WithTimeout` whose absolute deadline would stay live through streaming and silently truncate a slow reasoning turn (the GLM-5.2 60001ms-cut bug). The inner stream rides a deadline-free `context.WithCancel(ctx)`; the est-timer fires `cancel()` only if no first chunk arrived in time, mapped to `attemptError(DeadlineExceeded, errFirstChunkTimeout)` so retry/breaker/diagnostics stay identical.** Pre-first-chunk stalls stay on `PerAttemptTimeout`+retry. Both are `Config` Options threaded through composition — NOT new `port.LLMRequest` fields. +- **No fabricated principal.** The verified caller rides the CONTEXT (`session.WithPrincipal` / `session.PrincipalFromContext`, an unexported empty-struct key) — no `port` interface gains a principal parameter, so the layering rule is untouched (ADR 0100). Absent identity is a **nil `*Principal`**, NEVER a fabricated anonymous one (the ToolHive anonymous-middleware anti-pattern: a minted `sub: "anonymous"` with forged `exp`/`iat` that downstream code cannot tell from a real caller); `WithPrincipal(ctx, nil)` returns ctx UNCHANGED so "no identity" can't be laundered into a present-but-empty principal, and the stored principal is a COPY so a caller can't mutate what the context reports. Identity is the `(Issuer, Subject)` PAIR, never `Subject` alone — two IdPs or realms collide on `sub`. Pinned by `TestInvariant_no_fabricated_principal`. - **`Session` is an aggregate** — mutate it through its methods (`RecordUserPrompt`, `RecordAssistant`, `ReplaceHistory`, …), not by poking `Conversation` directly. - **Compaction must NEVER emit unpaired history, and the recent USER instruction must survive verbatim.** Both compactors compute the kept tail in this ORDER: count-cut (`len-keep`) → **back-snap to recent user turns** (`snapCutToRecentUserTurn`, so the most-recent user instruction(s) survive verbatim instead of falling into the summarised head — the role-blind count-tail bug where a tool-heavy run lost the user's actual task; pin the first GENUINE user message, snap up to `recentUserTurnsKept`=3 recent user turns into the tail, BOUNDED by `maxUserSnapLookback` so an ancient lone turn can't drag everything in; the SHARED genuine-user predicate `isGenuineUserTurn` (used by `firstUser`/`userSnapFloor`/`preservedHead`/`isRecentUserTurn` in lockstep) SKIPS prior synthesised compaction summaries (the LOAD-BEARING `isSynthesisedSummary` arm) and — DEFENSE-IN-DEPTH — any PERSISTED harness-injected turn-0 fragment via `prompt.IsInjectedTurn0Fragment` (the assemblers' own headers are the source of truth); as of ADR 0043 the turn-0 fragments are EPHEMERAL (prepended to the request per-run, never persisted), so they normally do not appear in the history — the pin anchors on the user's ACTUAL goal, NOT a prior summary or an injected soul (the count of leading fragments was config-variable 0–4+, so a positional "first N" is wrong — the anchor must be content-identified); floor keeps the first-user pin out of the tail) → **forward-snap past leading tool results** (`snapCutToTurnBoundary`, applied LAST so the orphan guarantee always holds) so the tail never starts on a `RoleTool` orphan whose call was dropped. The contract is HONEST best-effort: first GENUINE + recent user turns verbatim, earlier/superseded intent summarised by tier-4 (its `## User instructions and intent` section) or dropped — NOT every user message. (Related — ADR 0043: the turn-0 fragments are NO LONGER persisted; `recordPrompt` records only the genuine prompt, and `buildRequest` assembles the fragments once per run and PREPENDS them to the request ephemerally on every turn incl. resume. This fixes the resume bloat structurally — a resumed run cannot re-inject soul/AGENTS.md/memory into the persisted history — and converges the snapshot + event-sourced rehydration paths fragment-free.) Then self-validate with `session.ValidateToolPairing` (bidirectional) and **abort to the original history** on failure (`agent.ErrCompactionWouldOrphan`, handled in `maybeCompact` reusing the existing compaction-fail WARN — do NOT add a diagnostics line). `Session.ReplaceHistory` rejects unpaired slices too. Why it matters: an orphaned tool result → provider HTTP 400 → `failed`; the compaction fix removes the trigger, and `failed` is now ALSO recoverable at the run-entry funnel (`Session.Recover`, issue #51) — keep both defenses. **`maybeCompact` also emits `EvCompactionArchive` (cloud-native Phase 3b) carrying the pre-compaction conversation** (`session.CompactionArchivePayload.Replaced`) — capture `archived := sess.Conversation.Messages` BEFORE `ReplaceHistory` (messages are immutable per-element, so the slice ref is safe to hold across it), emit only AFTER a SUCCESSFUL replace (the degrade branches emit nothing). It's the parent's OWN history (no child content ever enters the parent conversation → no gauntlet-#7 concern). The loop only EMITS it; the relay persists it (never call `EventLog.Append` from the loop). Like `EvApproval` it is log-only (skipped on the client wire in both relays). **`EvUserPrompt` is the THIRD log-only sibling:** the loop emits one (the single `emitUserPrompt` site) at EVERY user-message-record site — the genuine prompt plus the synthetic continuations (no-progress / background-pending nudge, background-completion notice) — both relays skip it on the client wire alongside `EvApproval`/`EvCompactionArchive`, it carries the same gauntlet-#7 child-isolation contract (a child's prompt stays on the child run, never crosses to the parent log), and it exists so the durable log records WHAT THE USER ASKED and `engine/adapter/eventsource.Fold` can reconstruct user turns (`docs/adr/0038-event-sourced-rehydration.md`, closing the ADR-0027 row-11 reconstruction gap). -- **Every run-entry path must reopen-if-completed, interrupt-if-cancelled, OR recover-if-failed.** A turn drives the session to a terminal state within one `Engine.Run`; the engine does NOT recover it. Any path handing a *reused* session to `Run` must recover the terminal state first or `RecordUserPrompt` rejects it. `completed → Reopen → idle`; `cancelled → Interrupt → idle`; `failed → Recover → idle` (issue #51 — Interrupt and Recover both history-repair via `closeOutInterruptedTurn`: they close out tool calls orphaned by a mid-dispatch cancel/failure with synthetic error results, so the replay has no dangling `tool_use`/`function_call`; Recover makes retry POSSIBLE, not guaranteed — a permanent-cause failure re-fails cleanly). `Reopen` stays completed-only and `Interrupt` cancelled-only — the three seams never widen into each other. The subagent `resume:` policy keeps its OWN per-state switch (`resolveResumeSession`, not `loadAndReopen` — a child resume also owns the in-flight guard, tighten-only limits and the fresh fork) but now matches the SAME discipline: all three terminals recover, `failed` included (ADR 0077, issue #318 — a long-running direct-write child accumulates applied mutations, so discarding it costs MORE than a main session's transcript; only a non-terminal state like a still-`running` snapshot is refused). In the service layer: **`loadAndReopen`, never `GetSession`, before a PROMPT run** — it drives the right seam per state (`GetSession` is read-only snapshots). All PROMPT wire surfaces funnel through `Service.StartRunContent`, which routes through `loadAndReopen`. Guarded by `TestStartRunContentReopensCompletedSession` + `TestStartRunContentRecoversCancelledSession` + `TestStartRunContentRecoversFailedSession`. - - **The durable event log persists at the RELAY, not the loop (cloud-native Phase 3a).** `port.EventLog` (`engine/port/eventlog.go`: `Append` + a streamable `Read` returning `iter.Seq2[session.Event, error]`, `session`+stdlib only; durability + at-most-once + concurrency contract pinned in the doc-comment for the 3c conformance suite) is a NEW seam, SEPARATE from `port.EventSink` (a Sink mirrors live; the log is durable storage a later consumer reads back). The loop is storage-agnostic: it ONLY emits — it must NEVER import `port.EventLog` or call `Append`. Persistence lives in `internal/adapter/server/{grpc.go,http.go}` (`Service.appendEvent`). The `Append` is DECOUPLED from the client send: it runs for EVERY observed event, BEFORE/independent of the drain-to-discard guard, so a dead client never stops the log (it must record the post-disconnect tail incl. the terminal `EvResult` — the log exists to survive the client) — UNLIKE the awaiting-ask `Persist`, which is snapshot semantics gated to the healthy path. It uses a cancel-detached `context.WithoutCancel` so a dead client's cancelled ctx can't abort the durable write; a failure WARNs, never aborts. Verdicts cross as `EvApproval` (`session.ApprovalPayload`: tool NAME + `Verdict` STRING passthrough — `allow_once`/`allow_always`/`deny`, the `session.VerdictString*` consts, no proto enum, no `task generate` — + askID + `AllowAlways` (NOT "Learned": `Policy.Learn` no-ops on unlearnable Bash, so the flag honestly mirrors the VERDICT, not the policy outcome; a 3b replay re-derives the real rule); NEVER raw args, NEVER the deny-reason body, gauntlet #7), emitted at BOTH verdict sites (`dispatch.go` `authorize` live path + `resolvePendingCall` resume path — the resume emit is reachable only via the HTTP `resumeFromAwaiting` rehydrate, since the gRPC ResumeApproval frame resolves the in-flight run) via the one `session.VerdictString` projection. The log stores ALREADY-REDACTED events (it inherits the stream's redaction; adds none). In 3a `EvApproval` is consumed by the log ONLY — appended before `toProto`, NOT relayed to clients. The jsonlstore `Store` triples as `SessionStore`+`ToolCallRecorder`+`EventLog` (a `.events.jsonl` sidecar, `eventlog-json/1` per-record tag, cumulative `Read`, `Delete`-removed before the session file); memstore has an in-memory `EventLog` sibling. Nothing model-facing. See `docs/adr/0027-cloud-native.md` Phase 3a. - - **The durable log's CONSUMERS (cloud-native Phase 3b).** Two consumers of the 3a log, both keeping the loop storage-agnostic. (1) **Non-destructive compaction archive** — `EvCompactionArchive`, see the compaction gotcha above (loop emits, relay persists, log-only). (2) **permstore verdict-replay (kills the Phase 2 re-ask wart)** — the per-session permstore is in-memory and lost on restart, so a previously-allow-always'd tool would re-ask. The consumer lives in COMPOSITION (`internal/app/approvalreplay.go` `replayApprovals`), NEVER the loop: it is invoked by `Service.maybeReplayApprovals` from the run-entry funnel (`loadAndReopen`) at most ONCE per id (`Service.replayedApprovals`), reads `EventLog.Read`, filters `EvApproval{AllowAlways}`, correlates each metadata-only `EvApproval` back to its `ToolCall` in the LOADED conversation via the STRUCTURED `session.ApprovalPayload.Call` field (NOT a grammar parse — there is no `callIDFromAskID` function; the request half is the new `session.PendingAsk.Call`, ADR-0044, #148), and re-drives the EXISTING `Policy.Learn` on that call to re-derive the real rule from history. The askID grammar is `:::` where the trailing discriminator is the host-supplied `RunRequest.AskIDDiscriminator` when set (cross-process-reconstructable, ADR-0044, #117) else the process-global `r`; the leading `:` prefix stays a STABLE consumed contract (cmd/mecatui `isChildAsk`), but the correlation no longer parses the grammar. NO port widened, and the event STAYS metadata-only (the real args come from the session's own history, never the log → no leak). `buildEngine` now also returns the `port.PermissionPolicy` so `Build` closes the replay over `eventLog`+`policy`; the closure is nil (no-op) when there is no durable log. The Phase 3 GATE is MET — `internal/app/phase3_gate_test.go` reconstructs a 3-verdict + 1-compaction session from `SessionStore.Load`+`EventLog.Read` ALONE, with a Subagent no-child-leak mutation-verify. See `docs/adr/0027-cloud-native.md` Phase 3b. - - **The FOURTH, awaiting-only run-entry seam (cloud-native Phase 2).** `Approve`/`Deny` on a session whose process died while parked AWAITING re-enters the loop AT the ask: `Engine.ResumeApproval` → `driveFromAwaiting` (mirrors `Engine.Run`'s preamble via the shared `startRun`, then continues through the shared `runLoop` factored out of `drive` — ONE loop, not two), reached from `Service.resumeFromAwaiting` (via `ApproveRun`) only on a `LookupRun` MISS (SAME-PROCESS channel path tried FIRST, unchanged). It drives the EXISTING awaiting-only `ResumeWith` (clears pending, **preserves Counters/Usage**) — NOT `resetToIdle`, and NOT a new transition verb. It applies the verdict to the pending call EXACTLY ONCE (deny→`denyResult`; allow→the existing `preHook`+`execute` tail so PostToolUse/audit/`EvToolResult` fire identically; allow-always→also `Policy.Learn`), closes out every OTHER unanswered tool call on the trailing assistant message as a synthetic aborted result (the `closeOutInterruptedTurn` analogue, so `ValidateToolPairing` holds — no dangling `tool_use`→400), records ONE ordered `RecordToolResults` slice, then `runLoop`. **`ErrNoActiveRun` is no longer terminal for awaiting** (still terminal for idle/completed/cancelled/failed — the state gate in `resumeFromAwaiting`). No proto change (HTTP relays the resumed run as SSE via `relayRunSSE`; gRPC same-process unchanged). A restored awaiting PARENT session always holds a parent-OWN ask (a surfaced CHILD ask sets the child's pending, never the parent's), so no `PendingAsk` marker field. Guarded by `TestApproveAfterRestartE2E` (offline two-Build) + `engine/agent/resume_approval_test.go` + `internal/adapter/server/resume_awaiting_test.go`. See `docs/adr/0027-cloud-native.md` Phase 2. +- **Every run-entry path must reopen-if-completed, interrupt-if-cancelled, OR recover-if-failed.** A turn drives the session to a terminal state within one `Engine.Run`; the engine does NOT recover it. Any path handing a *reused* session to `Run`/`RunContent` must recover the terminal state first or `RecordUserPrompt` rejects it. `completed → Reopen → idle`; `cancelled → Interrupt → idle`; `failed → Recover → idle` (issue #51 — Interrupt and Recover both history-repair via `closeOutInterruptedTurn`: they close out tool calls orphaned by a mid-dispatch cancel/failure with synthetic error results, so the replay has no dangling `tool_use`/`function_call`; Recover makes retry POSSIBLE, not guaranteed — a permanent-cause failure re-fails cleanly). `Reopen` stays completed-only and `Interrupt` cancelled-only — the three seams never widen into each other. The subagent `resume:` policy keeps its OWN per-state switch (`resolveResumeSession`, not `loadAndReopen` — a child resume also owns the in-flight guard, tighten-only limits and the fresh fork) but now matches the SAME discipline: all three terminals recover, `failed` included (ADR 0077, issue #318 — a long-running direct-write child accumulates applied mutations, so discarding it costs MORE than a main session's transcript; only a non-terminal state like a still-`running` snapshot is refused). In the service layer: **`loadAndReopen`, never `GetSession`, before a PROMPT run** — it drives the right seam per state (`GetSession` is read-only snapshots). All PROMPT wire surfaces funnel through `Service.StartRunContent`, which routes through `loadAndReopen`. Guarded by `TestStartRunContentReopensCompletedSession` + `TestStartRunContentRecoversCancelledSession` + `TestStartRunContentRecoversFailedSession`. + - **The durable event log persists at the RELAY, not the loop (cloud-native Phase 3a).** `port.EventLog` (`engine/port/eventlog.go`: `Append` + a streamable `Read` returning `iter.Seq2[session.Event, error]`, `session`+stdlib only; durability + at-most-once + concurrency contract pinned in the doc-comment for the 3c conformance suite) is a NEW seam, SEPARATE from `port.EventSink` (a Sink mirrors live; the log is durable storage a later consumer reads back). The loop is storage-agnostic: it ONLY emits — it must NEVER import `port.EventLog` or call `Append`. Persistence lives in `internal/adapter/server/{grpc.go,http.go}` (`Service.appendEvent`). The `Append` is DECOUPLED from the client send: it runs for EVERY observed event, BEFORE/independent of the drain-to-discard guard, so a dead client never stops the log (it must record the post-disconnect tail incl. the terminal `EvResult` — the log exists to survive the client) — UNLIKE the awaiting-ask `Persist`, which is snapshot semantics gated to the healthy path. It uses a cancel-detached `context.WithoutCancel` so a dead client's cancelled ctx can't abort the durable write; a failure WARNs, never aborts. Verdicts cross as `EvApproval` (`session.ApprovalPayload`: tool NAME + `Verdict` STRING passthrough — `allow_once`/`allow_always`/`deny`, the `session.VerdictString*` consts, no proto enum, no `task generate` — + askID + `AllowAlways` (NOT "Learned": `Policy.Learn` no-ops on unlearnable Bash, so the flag honestly mirrors the VERDICT, not the policy outcome; a 3b replay re-derives the real rule); NEVER raw args, NEVER the deny-reason body, gauntlet #7), emitted at BOTH verdict sites (`dispatch.go` `authorize` live path + `resolvePendingCall` resume path — the resume emit is reachable only via the HTTP `resumeFromAwaiting` rehydrate, since the gRPC ResumeApproval frame resolves the in-flight run) via the one `session.VerdictString` projection. The log stores ALREADY-REDACTED events (it inherits the stream's redaction; it adds no CONTENT — the one thing `appendEvent` DOES add is the `Event.Actor` attribution stamp, ADR 0100, read from the loaded session's owner and log-only). In 3a `EvApproval` is consumed by the log ONLY — appended before `toProto`, NOT relayed to clients. The jsonlstore `Store` triples as `SessionStore`+`ToolCallRecorder`+`EventLog` (a `.events.jsonl` sidecar, `eventlog-json/1` per-record tag, cumulative `Read`, `Delete`-removed before the session file); memstore has an in-memory `EventLog` sibling. Nothing model-facing. See `docs/adr/0027-cloud-native.md` Phase 3a. + - **The durable log's CONSUMERS (cloud-native Phase 3b).** Two consumers of the 3a log, both keeping the loop storage-agnostic. (1) **Non-destructive compaction archive** — `EvCompactionArchive`, see the compaction gotcha above (loop emits, relay persists, log-only). (2) **permstore verdict-replay (kills the Phase 2 re-ask wart)** — the per-session permstore is in-memory and lost on restart, so a previously-allow-always'd tool would re-ask. The consumer lives in COMPOSITION (`internal/app/approvalreplay.go` `replayApprovals`), NEVER the loop: it is invoked by `Service.maybeReplayApprovals` from the run-entry funnel (`loadAndReopen`) at most ONCE per id (`Service.replayedApprovals`), reads `EventLog.Read`, filters `EvApproval{AllowAlways}`, correlates each metadata-only `EvApproval` back to its `ToolCall` in the LOADED conversation via the STRUCTURED `session.ApprovalPayload.Call` field (NOT a grammar parse — there is no `callIDFromAskID` function; the request half is the new `session.PendingAsk.Call`, ADR-0044, #148), and re-drives the EXISTING `Policy.Learn` on that call to re-derive the real rule from history. The askID grammar is `:::` where the trailing discriminator is the host-supplied `RunOptions.AskIDDiscriminator` when set (cross-process-reconstructable, ADR-0044, #117) else the process-global `r`; the leading `:` prefix stays a STABLE consumed contract (cmd/mecatui `isChildAsk`), but the correlation no longer parses the grammar. NO port widened, and the event STAYS metadata-only (the real args come from the session's own history, never the log → no leak). `buildEngine` now also returns the `port.PermissionPolicy` so `Build` closes the replay over `eventLog`+`policy`; the closure is nil (no-op) when there is no durable log. The Phase 3 GATE is MET — `internal/app/phase3_gate_test.go` reconstructs a 3-verdict + 1-compaction session from `SessionStore.Load`+`EventLog.Read` ALONE, with a Subagent no-child-leak mutation-verify. See `docs/adr/0027-cloud-native.md` Phase 3b. + - **The FOURTH, awaiting-only run-entry seam (cloud-native Phase 2).** `Approve`/`Deny` on a session whose process died while parked AWAITING re-enters the loop AT the ask: `Engine.ResumeApproval` → `driveFromAwaiting` (mirrors `RunContentWith`'s preamble via the shared `startRun`, then continues through the shared `runLoop` factored out of `drive` — ONE loop, not two), reached from `Service.resumeFromAwaiting` (via `ApproveRun`) only on a `LookupRun` MISS (SAME-PROCESS channel path tried FIRST, unchanged). It drives the EXISTING awaiting-only `ResumeWith` (clears pending, **preserves Counters/Usage**) — NOT `resetToIdle`, and NOT a new transition verb. It applies the verdict to the pending call EXACTLY ONCE (deny→`denyResult`; allow→the existing `preHook`+`execute` tail so PostToolUse/audit/`EvToolResult` fire identically; allow-always→also `Policy.Learn`), closes out every OTHER unanswered tool call on the trailing assistant message as a synthetic aborted result (the `closeOutInterruptedTurn` analogue, so `ValidateToolPairing` holds — no dangling `tool_use`→400), records ONE ordered `RecordToolResults` slice, then `runLoop`. **`ErrNoActiveRun` is no longer terminal for awaiting** (still terminal for idle/completed/cancelled/failed — the state gate in `resumeFromAwaiting`). No proto change (HTTP relays the resumed run as SSE via `relayRunSSE`; gRPC same-process unchanged). A restored awaiting PARENT session always holds a parent-OWN ask (a surfaced CHILD ask sets the child's pending, never the parent's), so no `PendingAsk` marker field. Guarded by `TestApproveAfterRestartE2E` (offline two-Build) + `engine/agent/resume_approval_test.go` + `internal/adapter/server/resume_awaiting_test.go`. See `docs/adr/0027-cloud-native.md` Phase 2. - **The Team tool returns the LEAD's consolidated synthesis** (a final synthesis turn in `Supervisor.Run`, output on `TeamOutcome.Report`), NOT concatenated member `LastText` (that is the degraded `joinTeamFallback` only). Synthesis reads three fenced-UNTRUSTED layers: the findings ledger (members append via `RecordFinding`) + a LastText/completed-task digest for non-recording members + the lead's inbox. **The team GOAL is TRUSTED by default** — rendered as the member's/lead's genuine instruction (plain, NOT inside an `<<-` (the SINGLE id-scheme source the supervisor save AND the PULL `InspectMember` tool share — don't let them drift; collision-free across concurrent teams). A budget-stopped lead — and, since ADR 0077, one whose round ended in `StopError` — is still resumable, so the one synthesis turn still runs: the supervisor dispatches its per-round recovery on `m.sess.State` (`StateFailed`→`Recover`, else `Reopen`; NOT on `stop`, because `terminateComplete` lands a text-bearing `StopError` turn in `StateCompleted`), and `memberRT.nonResumable` is set ONLY when that transition itself fails. **An errored round is BOUNDED-RETRIED, not always terminal** (ADR 0077, the last #318 acceptance bullet): `runTurn` leaves a RECOVERED `StopError` member schedulable while `memberRT.errorRounds <= s.memberErrorRetries` (`WithMemberErrorRetries`, default 1; 0 = the old bench-on-first-error), releases its task claim (`ReleaseTasks` — a kept claim short-circuits `planRound`'s auto-claim and strands the work) and sets it back to `team.MemberIdle`, and `planRound` FORCE-SCHEDULES it once via `memberRT.retryPending` (the commonest stall shape — dying on the first exploration turn before any task exists — has no message and no claimable task, so "not stopped" alone reschedules nothing) with the trusted `retryTurnNote`. `errorRounds` is MONOTONIC — that is the termination proof: a permanently-failing member runs exactly cap+1 rounds and is then benched with the UNCHANGED disposition (`stopped` + `StopReasonError` + tasks released). Never retried: a failed recovery (`nonResumable`), a CANCELLED member, or a turn-budget-exhausted one. Honesty is an additive COUNT, never a new `MemberDisposition` value (closed enum, mirrored on the wire): `MemberOutcome.ErrorRounds` → `session.TeamMemberDisposition.ErrorRounds` → proto `error_rounds` (field 4) → mecatui's `done (retried)`; the LEAD learns it through the EXISTING trusted status section (`writeTeamStatus`, renamed from `writeStoppedMemberStatus`), never a new source layer. `EvTeamFindings` mirrors `EvTeamTasks` end-to-end (session → proto `TeamFinding` → mecatui) — don't half-wire it. Both entry points (Team tool + gRPC `RunTeam`) share synthesis because it lives in `Run`. **The Team ToolResult MUST surface the team id** (`renderTeamResult` prepends a `Team id: ` line, BOTH on the synthesis-report and the `joinTeamFallback` path) — the id otherwise rides only the client-only `EvTeamStart` event, so without it the parent MODEL can never discover the id `InspectMember` requires. Render it VERBATIM (the published Team call id) per the `MemberSessionID` contract. The gRPC `RunTeam` consumer already holds the id (from `CreateTeam`/`EvTeamStart`), so the header is the in-process-tool fix only. - **A completed turn with NO tool call AND no meaningful text is NUDGED, never silently ended.** A reasoning model can emit a "done" turn carrying only a reasoning blob (`text==""`, `calls==nil`). The loop (Step 5, `finishTurnNoTools`) injects a BOUNDED continuation user message (`noProgressNudgeText`) up to `Deps.MaxNoProgressNudges` times (`Config.MaxNoProgressNudges` → composition; default 2 applied in `NewEngine`; `<0` disables), emits a visible `EvNoProgress` event each time, and on exhaustion terminates CLEANLY via the completed path with `StopNoProgress` (a NON-error terminal → session ends `completed`, stays Reopen-recoverable) — NEVER an infinite loop, NEVER a silent `StopEndTurn`. The empty assistant turn IS recorded first (so its reasoning blob replays across the nudge); the nudge loop is ALSO bounded by `Limits.MaxTurns` (each nudged turn goes through `BeginTurn`). **The nudge fires ONLY on a BENIGN end** (`streamStop ∈ {StopEndTurn, StopNone}`): both adapters' `mapStop` relay a REAL terminal condition (`max_tokens`/`refusal`/`incomplete`/`failed`→`StopError`, `cancelled`→`StopCancelled`, limits) on the ChunkDone stop, NOT as a Go error, and a truncated/refused turn can also be empty — `finishTurnNoTools` surfaces that reason verbatim (StopError→`terminate`, else `terminateComplete`) BEFORE the no-progress branch, so a real terminal is never nudged or relabeled `StopNoProgress` (masking it would be the same silent-mislabel bug). **No `tool_choice` forcing** to fix this: forcing tool use is incompatible with Anthropic extended thinking and our OpenAI reasoning path — the fix is the bounded-nudge + per-model persistence prompt (`agencyDelta`), both provider-agnostic, never a `port.LLMRequest` field. `EvNoProgress` is an EVENT (transient status line in mecatui, like `EvCompaction`), NOT a diagnostics line (the "loop emits exactly THREE lines" invariant holds). Works for the SHARED engine: main + Subagent + Parallel + team member + lead synthesis (a no-progress synthesis is driven to a real report, not a skeleton). `EvNoProgress`/`StopNoProgress` are STRING passthroughs on the wire (proto `type`/`stop` are strings, not enums — no `task generate` needed). Unknown tool calls also get an `EvToolCall` card BEFORE the error result (card-before-the-gate holds for the unknown-tool path too). @@ -126,11 +130,11 @@ Dependencies point **inward only**, machine-enforced THREE ways (all run under ` - **Subagent fan-out is bounded by the child concurrency gate for ALL children — forking AND forker-less.** `SubagentTool.childGate` (default `defaultMaxConcurrentChildren = 8`, `WithMaxConcurrentChildren`) is acquired at the TOP of `run()`, not only on the worktree-forking path — Subagent is read-only so the dispatcher fans out N concurrent Subagent calls per turn and each consumes a child session + an LLM slot. The team supervisor's round was ALREADY bounded (`errgroup.SetLimit(s.concurrency)`, `WithTeamConcurrency`, default 8) — don't add a redundant bound, and don't drop `SetLimit` (guarded by `TestSupervisorRoundConcurrencyBounded`). read-parallel/mutate-serial is UNCHANGED (the gate bounds child START, not dispatch ordering). Per-call `subagentArgs.MaxTurns`/`MaxToolCalls`/`TimeoutMs` are OPTIONAL pointers, TIGHTEN-ONLY (`tightenLimit` may only lower `session.Limits`, never raise — the model can't escape the operator's bound) + a `context.WithTimeout`; domain-only, NO wire/proto change. **`background: true` detaches a Subagent child, RUN-scoped:** the call returns the immediate started-result (agentId trailer FIRST line); a goroutine owns fork→drive→persist→`markDoneResult`; the result BODY's SOLE channel is the read-only `SubagentStatus` tool (roster/poll + `wait_ms` park, capped 120s; reads `parentCaps.children`; registered wherever Subagent is, never in child catalogs — distinct from InspectSubagent's persisted cross-run transcripts). Background gate acquisition is FAIL-FAST (the error lists live background ids, ids ONLY — abort BEFORE the ids read, or it lists the failing call's own id) while foreground stays blocking. At run end `drainChildren` (TOP of both terminate paths) cancels+joins live background children in TWO phases — `childDrainCap` (10s), then `abortEmits()` + `childDrainGrace` (1s) so a child parked in its own end-emit (consumer backpressure) JOINS instead of being misreported — then seals the registry: ALL child emits route through `safeEmit` (a post-seal emit is a no-op, never a panic; emitAbort closes BEFORE emitMu or seal deadlocks — pinned by `TestSealUnblocksEmitParkedSend`), and only a still-unjoined child is the ONE abandon WARN (the third diagnostics line); a cancelled child's still-pending surfaced asks are retracted at its registry terminal (`markDoneResult`, pre-doneCh-close ⇒ pre-seal ⇒ before `EvResult`; abandoned children get a pre-seal drain sweep; each retract is gated on `childAskRouter.unregister`'s answered-vs-pending bool, so an answered ask never draws a spurious retract). **Every guarded send on the run gives up when the seal's abort closes OR the run's `hardAbort` fires** — `Run.Cancel` arms `hardAbort` (a `hardAbortGrace`=1s timer, armed BEFORE the ctx cancel): the explicit unwedge signal, DISTINCT from the registry's `emitAbort` (seal-time, reachable only from the terminate paths) and from ctx (a cancelled run with a DRAINING consumer still delivers in-flight events incl. the terminal `EvResult` — that rationale is preserved TWO ways: the try-send-first shape in `emit`/`emitOrAbort`/the supervisor's member→evCh forward gives deterministic delivery while the buffer has room — a bare two-arm select would RANDOMLY drop post-cancel events — and the GRACE lets a merely-BACKLOGGED consumer absorb the tail before parked sends give up; once fired it is sticky, so the unwedge cost is paid once per run, never per event). Without it a consumer that stops draining wedges the run PERMANENTLY (the terminate paths that seal are themselves blocked behind the parked sends) — pinned by `TestCancelUnwedgesStalledTeamRun`. Both relays (gRPC `Converse` + HTTP SSE) are drain-to-discard after the FIRST Send/Write error: record the error, `run.Cancel()`, keep ranging `run.Events()` discarding until close (no further writes, no `EvPermissionAsk` Persist on the error path), then (gRPC only — the SSE handler returns nothing) return the recorded error — never stop draining on a send error or a busy run wedges in its own emits after the client dies. A run-end-cancelled background child persists and is resumable. Pre-start failures REMOVE the registry entry (never a done+StopNone phantom; a failed RESUME attempt reinstates the displaced prior terminal + its undelivered result); a cancel-while-queued keeps a meaningful StopCancelled entry; a never-driven team member is removed at cleanupAll. **Completion delivery is notice + nudge, both EVENT-SILENT ordinary recorded history (A2/A9/D10):** every turn boundary (drive Step 2a, BEFORE `preTurnTerminal`) announces newly-finished background children in ONE harness-note user message — ids + stop labels ONLY, nothing child-authored; the registry `noticed` flag is SEPARATE from `delivered` (never re-noticed, still collectible; an already-collected result is noticed silently, not listed) and `e.save` runs right after the record (replay-durable). A would-be CLEAN end (meaningful text, benign stop) with LIVE background children is deferred ONCE per run by the background-pending nudge (`finishTurnNoTools`, ids only) — it MUST stay before the clean-terminal calls (`drainChildren` at their top has already cancelled+sealed), never fires on the no-progress/empty-turn path or any non-clean terminal, never relabels the eventual stop, and emits NO `EvNoProgress`; the second clean end terminates normally and the drain cancels+persists what is left. -- **Subagent per-call `model` override re-derives via the engine FACTORY, never clone-and-swap.** `subagentArgs.Model` mints the override child through `WithSubagentEngineFactory` (a composition closure `func(model string)(*Engine,bool)` built by `buildSubagentEngineFactory` over `newChildEngineForProvider`), so Compactor/TokenCounter/`Env.Model`/ContextWindow are RE-DERIVED for the override model — the same "Provider is FIXED per session" discipline. `agent` + `model` together is SUPPORTED via `WithAgentModelEngineFactory` (`buildAgentModelEngineFactory`): the override REBUILDS the named specialist's SCOPED engine (catalog/prompt/skills/hooks/memory, via the shared `buildAgentDefEngine` step) on the override model — NOT the generic explorer set; the override runs on the def's resolved provider, the model taken verbatim (no alias resolution, parity with the model-only path); the pre-built `agentEngines` map is never mutated (fresh engine per call); per-def limits still bind. A def with INLINE MCP servers is declined on the agent+model path (v1 scope limit — the inline manager's live session has no process-lifetime owner on a per-call engine); reference-only MCP is supported (borrows `mainMgr`). `read-write`+`agent` is SUPPORTED via `WithAgentWritableEngineFactory` (`buildAgentWritableEngineFactory`: the specialist's scoped engine rebuilt `allowMutating=true` on the def's resolved provider/model, MAIN runner, direct-write parity — ADR 0058; inline-MCP defs decline, reference-only supported); `read-write`+`agent`+`model` stays REJECTED (v1 scope limit — a writable specialist runs on its own resolved model). Reasoning-effort stays an adapter Option (the factory owns adapter construction), never a `subagentArgs`/`LLMRequest` field. Per-call `subagentArgs.MaxTokens` rides `RunRequest.MaxRunTokensOverride` on `Engine.Run` (a Run-scoped TIGHTEN-ONLY budget over the SHARED child engine — `effectiveMaxRunTokens` takes the lower non-zero of override and `Deps.MaxRunTokens`); a call with no override fields set is the legacy run. None widen `port.LLMRequest`. +- **Subagent per-call `model` override re-derives via the engine FACTORY, never clone-and-swap.** `subagentArgs.Model` mints the override child through `WithSubagentEngineFactory` (a composition closure `func(model string)(*Engine,bool)` built by `buildSubagentEngineFactory` over `newChildEngineForProvider`), so Compactor/TokenCounter/`Env.Model`/ContextWindow are RE-DERIVED for the override model — the same "Provider is FIXED per session" discipline. `agent` + `model` together is SUPPORTED via `WithAgentModelEngineFactory` (`buildAgentModelEngineFactory`): the override REBUILDS the named specialist's SCOPED engine (catalog/prompt/skills/hooks/memory, via the shared `buildAgentDefEngine` step) on the override model — NOT the generic explorer set; the override runs on the def's resolved provider, the model taken verbatim (no alias resolution, parity with the model-only path); the pre-built `agentEngines` map is never mutated (fresh engine per call); per-def limits still bind. A def with INLINE MCP servers is declined on the agent+model path (v1 scope limit — the inline manager's live session has no process-lifetime owner on a per-call engine); reference-only MCP is supported (borrows `mainMgr`). `read-write`+`agent` is SUPPORTED via `WithAgentWritableEngineFactory` (`buildAgentWritableEngineFactory`: the specialist's scoped engine rebuilt `allowMutating=true` on the def's resolved provider/model, MAIN runner, direct-write parity — ADR 0058; inline-MCP defs decline, reference-only supported); `read-write`+`agent`+`model` stays REJECTED (v1 scope limit — a writable specialist runs on its own resolved model). Reasoning-effort stays an adapter Option (the factory owns adapter construction), never a `subagentArgs`/`LLMRequest` field. Per-call `subagentArgs.MaxTokens` rides `RunOptions.MaxRunTokensOverride` on `Engine.RunContentWith` (a Run-scoped TIGHTEN-ONLY budget over the SHARED child engine — `effectiveMaxRunTokens` takes the lower non-zero of override and `Deps.MaxRunTokens`); `RunContent`/`Run` delegate to `RunContentWith` with a zero `RunOptions` (legacy run). None widen `port.LLMRequest`. - **Subagent `fork: true` seeds the child from a DEEP COPY of the parent conversation (issue #34), TRUST-NEUTRAL, SAME-PROVIDER only.** The dispatcher binds `parentCaps.forkHistory` (in `Engine.parentCaps`, over the parent `*session.Session`) returning `session.ForkSnapshot(&sess.Conversation)` — a `CloneMessages` (fresh backing array; `Message` is immutable so the shallow per-element copy is sound — child only appends) with the TRAILING UNANSWERED tool calls stripped (the fork-call orphan, whose result is recorded AFTER dispatch, would otherwise dangle → provider 400). The fresh child is primed via the idle-only `session.Session.SeedHistory` (StateIdle sibling of running-only `ReplaceHistory`; both re-validate `ValidateToolPairing` — double-defended with `ForkSnapshot`'s strip). Copied history is carried VERBATIM, not re-fenced — NOT because the content was "vetted" (the main loop records tool results RAW/UNFENCED via `RecordToolResults`; fencing exists only at team/adjudicator render boundaries), but because the fork is TRUST-NEUTRAL: the child inherits the parent's EXACT raw message posture (whatever fencing the parent applied travels WITH the copied content), runs in a strictly-LESS-privileged read-only explorer sandbox, and introduces NO new untrusted ingress — and re-fencing would bust the byte-stable prompt-cache prefix the feature relies on. It rides `LLMRequest.Messages`; the explorer prompt rides `LLMRequest.System` (no collision). Reasoning/ProviderPhase replay verbatim — safe because `validateFork` REJECTS `fork`+`model` (also `+agent`/`+resume`, first-conflict-wins; then `forkHistory==nil` → "not supported on this run" for plain `Execute`). Snapshot taken SYNCHRONOUSLY in `run()` on the dispatch goroutine (parent keeps appending after a background detach), so the SNAPSHOT SLICE — not the closure — threads into `backgroundChild`/`buildChildSession`. Turn-0 parent → empty snapshot, fork degrades to fresh-context child (benign). No-nesting holds (child catalog has no Subagent). Domain-only, no `port.LLMRequest`/proto change. -- **Subagent structured output is bounded validation-retry, NOT `tool_choice` forcing; the agentId is in the RESULT TEXT.** `subagentArgs.OutputSchema` gives the child a synthetic `SubmitResult` tool (injected run-scoped via `RunRequest.ExtraTools`, never registered into the shared catalog) whose params ARE the schema; the child is PROMPTED to call it (no `tool_choice` — incompatible with Anthropic thinking + the OpenAI reasoning path). `SubmitResult.Execute` validates via `session.ValidateJSON` (a JSON-schema SUBSET validator, FAIL-OPEN on unsupported keywords — the SINGLE structured-output choke point, DISTINCT from `ValidateMediaParts`); on a miss the Subagent tool re-injects a correction and re-drives the SAME child (`session.Reopen`) up to `defaultStructuredOutputRetries` (2), then ends with the new `session.StopStructuredOutput` CLEAN terminal rendered as a MODEL-VISIBLE validation-error tool result (never only a log line). The retry lives in `driveChild`, NOT in the hot shared `finishTurnNoTools`. The Subagent RESULT is labelled by stop reason (success / `[subagent stopped: …]` note / structured-output error / error) and ALWAYS carries an `agentId: ` trailer on EVERY terminal incl. error/timeout (mirroring `renderTeamResult`'s Team-id line) — the runtime-discoverability axis: the id must be where the MODEL reads it, not only on the client-only `subagent.*` events (it is the verbatim handle `InspectSubagent` loads by; children persist best-effort via `WithSubagentStore`, and `resume: ` continues a persisted child — default engine only, fresh fork + a resume note that is `resumePosture.note()`'s THREE-cell decision over TWO INDEPENDENT axes (WHERE it runs = THIS call's `mode`; WHAT survived = the EARLIER run, `prepareChildSession`'s `editsSurvived` = writable AND the resumed snapshot's persisted `Workspace` equals the real parent root): `!writable`→`resumeStalenessNote`, `writable && editsSurvived`→`resumeWritableNote`, `writable && !editsSurvived`→`resumeWritableFreshNote`. Keying only on `editsSurvived` told a previously READ-ONLY child resumed as `read-write` that it "is running in a FRESH workspace checkout" while it held Edit/Write on the REAL repo (a writable call passes `forker = nil`), and keying only on the call's `mode` would tell it its torn-down worktree's edits "are STILL IN PLACE" — both axes are needed and `TestResumeNoteMatrixCoversBothAxes` asserts the whole product, every terminal recoverable incl. `failed` (ADR 0077), in-flight-guarded; a `StopError` result carries `subagentErrorResumeHint` so the model can DISCOVER the resume path (ADR 0070) — that hint lives in `renderSubagentResult`, never in the Parallel-shared `subagentErrorBody`, because a `parallel-*` branch id is not resumable, and it is STORE-GATED (no `WithSubagentStore` ⇒ no hint, since `validateResume` would refuse the call); the recovered session is re-homed onto the fork via the StateIdle-only `session.Session.Rehome`). Default (no `output_schema`) = free-text, unchanged. **Per-attempt vs cross-attempt limits:** each correction re-drive `Reopen()`s the child, which RESETS its `Counters`, so per-call `MaxTurns`/`MaxToolCalls` (and `WithChildLimits`) bound EACH ATTEMPT — a structured-output child can use up to `(1+defaultStructuredOutputRetries)×` its turn/tool budget across the whole call (bounded, not a runaway). The cross-attempt brake is the TOKEN budget: `driveChild` SUMS usage across drives and RE-PASSES the same `runReq` (with the tighten-only `MaxRunTokens` override) to each `Engine.Run`, so `Deps.MaxRunTokens`/the per-call `max_tokens` accumulate and cap the whole call. +- **Subagent structured output is bounded validation-retry, NOT `tool_choice` forcing; the agentId is in the RESULT TEXT.** `subagentArgs.OutputSchema` gives the child a synthetic `SubmitResult` tool (injected run-scoped via `RunOptions.ExtraTools`, never registered into the shared catalog) whose params ARE the schema; the child is PROMPTED to call it (no `tool_choice` — incompatible with Anthropic thinking + the OpenAI reasoning path). `SubmitResult.Execute` validates via `session.ValidateJSON` (a JSON-schema SUBSET validator, FAIL-OPEN on unsupported keywords — the SINGLE structured-output choke point, DISTINCT from `ValidateMediaParts`); on a miss the Subagent tool re-injects a correction and re-drives the SAME child (`session.Reopen`) up to `defaultStructuredOutputRetries` (2), then ends with the new `session.StopStructuredOutput` CLEAN terminal rendered as a MODEL-VISIBLE validation-error tool result (never only a log line). The retry lives in `driveChild`, NOT in the hot shared `finishTurnNoTools`. The Subagent RESULT is labelled by stop reason (success / `[subagent stopped: …]` note / structured-output error / error) and ALWAYS carries an `agentId: ` trailer on EVERY terminal incl. error/timeout (mirroring `renderTeamResult`'s Team-id line) — the runtime-discoverability axis: the id must be where the MODEL reads it, not only on the client-only `subagent.*` events (it is the verbatim handle `InspectSubagent` loads by; children persist best-effort via `WithSubagentStore`, and `resume: ` continues a persisted child — default engine only, fresh fork + a resume note that is `resumePosture.note()`'s THREE-cell decision over TWO INDEPENDENT axes (WHERE it runs = THIS call's `mode`; WHAT survived = the EARLIER run, `prepareChildSession`'s `editsSurvived` = writable AND the resumed snapshot's persisted `Workspace` equals the real parent root): `!writable`→`resumeStalenessNote`, `writable && editsSurvived`→`resumeWritableNote`, `writable && !editsSurvived`→`resumeWritableFreshNote`. Keying only on `editsSurvived` told a previously READ-ONLY child resumed as `read-write` that it "is running in a FRESH workspace checkout" while it held Edit/Write on the REAL repo (a writable call passes `forker = nil`), and keying only on the call's `mode` would tell it its torn-down worktree's edits "are STILL IN PLACE" — both axes are needed and `TestResumeNoteMatrixCoversBothAxes` asserts the whole product, every terminal recoverable incl. `failed` (ADR 0077), in-flight-guarded; a `StopError` result carries `subagentErrorResumeHint` so the model can DISCOVER the resume path (ADR 0070) — that hint lives in `renderSubagentResult`, never in the Parallel-shared `subagentErrorBody`, because a `parallel-*` branch id is not resumable, and it is STORE-GATED (no `WithSubagentStore` ⇒ no hint, since `validateResume` would refuse the call); the recovered session is re-homed onto the fork via the StateIdle-only `session.Session.Rehome`). Default (no `output_schema`) = free-text, unchanged. **Per-attempt vs cross-attempt limits:** each correction re-drive `Reopen()`s the child, which RESETS its `Counters`, so per-call `MaxTurns`/`MaxToolCalls` (and `WithChildLimits`) bound EACH ATTEMPT — a structured-output child can use up to `(1+defaultStructuredOutputRetries)×` its turn/tool budget across the whole call (bounded, not a runaway). The cross-attempt brake is the TOKEN budget: `driveChild` SUMS usage across drives and RE-PASSES the same `runOpts` (with the tighten-only `MaxRunTokens` override) to each `RunContentWith`, so `Deps.MaxRunTokens`/the per-call `max_tokens` accumulate and cap the whole call. - **A free-text Subagent result is NEVER a silent "(subagent produced no summary)" on an EMPTY terminal (issue #48 / #152).** `driveChild`'s free-text path runs a TWO-STAGE recovery whenever the child ends on an EMPTY-terminal allow-set (`isEmptyTerminalStop` = `StopMaxTurns`/`StopMaxToolCalls`/`StopBudget`/`StopNoProgress`/`StopEndTurn`) with a BLANK finalText — the blank-finalText guard leaves a NORMAL text answer untouched. Stage 1 `salvageEmptyStop` (renamed from `salvageEmptyLimitStop`): ONE bounded wrap-up turn (`child.Reopen()` + `MaxTurns=1` pin + `salvageWrapUpPrompt`), with `ResetUsage` scoped to `StopBudget` ONLY (`StopNoProgress`/`StopEndTurn` must NOT ResetUsage — they did not stop on the ceiling, so the carried budget keeps braking the salvage turn). Stage 2 `digestChildActivity`, only if salvage was ALSO empty: the child's last non-empty `RoleAssistant` text walked backwards out of its own history (`clampRunes`-clamped, framed by `recoveredDigestPrefix`). **Framing discipline (UX): the stop reason is stated in exactly ONE place** — `renderSubagentResult` stamps `StopNoProgress` with the canonical note `[subagent stopped: ended without a final summary — treat as partial; resume it with the agentId above to continue]`; `recoveredDigestPrefix` states ONLY provenance + partial-ness — NEITHER the stop reason NOR the next action, because the note owns both and the two render one after the other (the prefix used to duplicate `treat as partial; resume it with the agentId above to continue` byte-for-byte, and a model reading one imperative twice can't tell it from two); it still reads standalone on the note-less empty-`StopEndTurn` path, which is a BENIGN clean end and owes no next action (the agentId trailer is on the result either way). The floor placeholder + the note both carry the resume next-action hint, so the result is never a dead end. The floor stands ONLY when both stages are empty, and even then the stop-reason note names WHY — never opaque. (The loop's `lastText` carries ANY text-bearing turn's text into the result, so for salvage to run the original drive produced no assistant text at all and the digest then finds none either — it is genuine belt-and-suspenders the live loop provably can't reach, internal-unit-tested.) Don't re-narrow the salvage trigger to limit/budget only, don't ResetUsage outside `StopBudget`, and don't restate the stop reason OR the next action in the digest prefix. @@ -139,7 +143,7 @@ Dependencies point **inward only**, machine-enforced THREE ways (all run under ` - **The filesystem is OPTIONAL per session (`CreateSessionRequest.profile = "no-fs"`, issue #55).** A no-fs session MUST route through the per-session engine factory (`needPerSession` includes the profile — the shared engine has FS tools baked in); its workspace is the honest `engine/adapter/nofs` Workspace registered as the CREATE-TIME per-session override (never memfs — silent write-loss; never the osfs factory on root ""); the workspace requirement is PROFILE-AWARE (default requires one, no-fs requires EMPTY, the combination rejected loudly); the catalog is EXACTLY default − {Read,Edit,Write,Grep,Glob,Bash,Parallel,SkillDraft} (`TestNoFSCatalogProfile`) — note WebSearch (issue #26), like WebFetch, is an outbound read present in BOTH profiles, so it is NOT in the excluded set; Subagent/Team children get the file-less `noFSChildCatalog` (memory six + WebFetch + WebSearch + global MCP), NO forkers/shell, and the honest posture (`WithSubagentNoFSNote`, `noFSPostureNote`). **Restart rehydration is NO LONGER no-fs-only (cloud-native Phase 1):** the per-session engine is rebuilt at the run-entry seam (`Service.StartRunContent`) for ANY session that `needsRehydration` — the no-fs profile OR a persisted provider/model selector OR an empty workspace — via `Service.rehydrateSession` (generalized from `rehydrateNoFSSession`), reading the PERSISTED `Profile`/`ProviderID`/`ModelID` labels off the loaded session so the rebuild is the SAME engine (no-fs catalog AND/OR same model), never the default-provider floor; a DEFAULT FS session (empty selector, default profile, non-empty workspace) does NOT rehydrate (it keeps the shared engine). Only the engine-rebuild trigger widened — the awaiting-approval mid-turn loop entry stays Phase 2. Details: IMPLEMENTATION-NOTES "Session profiles" + "Snapshot fidelity". - **Guardrails (issue #27, the `modelhook` adapter): `PostToolUse` Block does NOT veto.** The tool has ALREADY run by the time the post hook fires (`dispatch.go` ~642-648 only emits an `EvHook` annotation), so enforce-blocking a bad INBOUND result rewrites it via `HookOutcome.Mutated` to `{content:"blocked by guardrail: …", is_error:true}` — NOT Block; only `PreToolUse` Block is a real veto. The loop's effective-payload guarantee (recorded history == client stream == model view, all show the mutated result) carries it. **A PreToolUse block is APPROVE-ONCE (ADR 0062, supersedes 0061's `/guardrail-allow` prompt directive — both deleted):** `blockOutcome` returns `{Block, AskApproval}` (the new `governance.HookOutcome.AskApproval` bit), and `engine/agent`'s `preHook`→`askHookApproval` surfaces it to a human as an ORDINARY permission ask (PauseForApproval→EvPermissionAsk→Approve) when `Deps.Interactive`, else DEGRADES to a terminal block headless (the degrade lives INSIDE `preHook`, so every caller inherits it). Allow/AllowAlways execute the call DIRECTLY (no re-run of preHook). `session.PendingAsk.HookOriginated` (SERIALIZED, `json:"hook_originated,omitempty"`) makes the awaiting-resume path (`resolvePendingCall`) SKIP preHook re-run on Allow (else a resumed guardrail ask re-blocks). AllowAlways arms a session "Allow & don't ask again" waiver (`modelhook.WaiverHolder`) via the new OPTIONAL `port.HookApprovalLearner` (type-asserted on `Deps.Hooks`, NEVER a `HookRunner` method — that'd break the API; all three engine additions are Added/minor); the waiver is in-memory, session-keyed (child-isolated), consulted in `Runner.check` BEFORE the LLM call, and is NOT plumbed to the Service (arming is in-loop from a human verdict, never a prompt scan). Posture-coupling is composition-only (`demoteForPosture`, the single posture→mode point): yolo demotes guardrails to advisory; strict/trusted/AUTO keep enforcing (under auto the interactive approve-once ask IS the auto-mode behaviour, gated on `Deps.Interactive` not posture). `AskApproval` is PreToolUse-only (ignored on Post; `mergeOutcomes` propagates it). The guardrail `Runner` is wired ONLY into the MAIN engine's hooks (`buildEngine` mainHooks + per-session factory), NEVER into `buildCatalog`'s child hooks = the no-recursion guard; the checker engine is built via `childEngineDepsForProvider` (inert Hooks + nil `ChildAskReviewer` + `Interactive` false + tool-less catalog), so a check fires no hooks. Guardrails config is **OPERATOR-TIER ONLY** — read from user-global `settings.yaml` `guardrails:` + CLI, NEVER the project-tier file (a project weakening/disabling a checker is a security DOWNGRADE — the tighten-only project gate REVERSES here); `permconfig.Resolver.OperatorGuardrails()` enforces it, project blocks ignored with a WARN, the subtree parsed STRICTLY. The verdict parse is the #31 whole-output-single-object discipline (`modelhook.ParseVerdict`), NOT `session.ValidateJSON` (fail-open/prose-extracting — wrong for attacker-adjacent content). The fence helpers `agent.UntrustedFence`/`NeutraliseFraming`/`WriteUntrustedBlock` + `agent.StripLoneCodeFence` live in `engine/agent/fence.go` (EXPORTED, single source of truth — the ask-reviewer AND the guardrail verdict parse share `StripLoneCodeFence`; don't re-duplicate or re-unexport them). The engine-driving half is `agent.RunGuardrailCheck` (a free func, NOT an exported struct — matches the `engineAskReviewer`/`engineJudge` siblings; composition noise stays out of the public API). Checker token spend is NOT folded into `MaxRunTokens` (the checker runs per call; cost control lives in the operator's provider/billing layer). **A configured model with NO rules is ON with the DEFAULT BLOCK set** (WebSearch/WebFetch/mcp__\*/Bash, ENFORCING — ADR 0060/0053; the model IS the opt-in-to-spend; downgrade to observe-only via `defaultMode: advisory`). The build-once `guardrails: ON …` posture line reports the resolved `mode=` from the ACTUAL specs (`guardrailsPostureLine`), so the default set honestly reads `mode=block` — never a hardcoded "advisory". Advisory findings now emit a client-visible `EvHook` (`HookAdvisory`, warning-coloured) in addition to the operator diag log — ADR 0051; the call/result is byte-unchanged (model-invisible). **Sanitize is bounded** (the sanitize-laundering defense): a nil/oversized/invalid-Pre-JSON `sanitized_content` falls back to a BLOCK (never run the original unsafe args), a Post-sanitize carries a redaction marker, and oversized CONTENT in an enforce mode routes through fail-open/closed (never a silent pass). A sustained checker outage escalates to a one-time "checker DOWN" sticky WARN. See `docs/adr/0021-guardrails.md`. -- **Diagnostics flow through the injected `port.Diagnostics`, NEVER `slog.Default()`/package-level `slog.Info|Warn|Debug|Error` in `engine/` or `internal/`** (banned by `forbidigo` in `.golangci.yml`, `cmd/` mains exempt). The `slogdiag` adapter is the only slog bridge; composition picks the sink (mecated→stderr/journald via `slog.SetDefault`; mecatui→file `$XDG_STATE_HOME/mecatl/mecatui.log` AND a redirected slog default so ambient/third-party slog can't corrupt the alt-screen; `--quiet`→discard). Build-once composition facts log in `app.Build` ONLY — never in the per-engine deps builders (`engineDepsForProvider`/`childEngineDepsForProvider`) (re-emitting per derivation caused N× duplication). Per-RUN diagnostics are session-correlated: the loop binds `deps.Diagnostics.With("session", id)` (+`"agent", role` for children) ONCE per run inside `Engine.Run` — NOT at construction (the engine predates the session id and is shared). Child engines (Subagent/member/fork) DO emit correlated diagnostics (real `cfg.diag()` + a `Deps.Role`); their `Deps.Sink`/`Deps.ToolCallRecorder` are role-TAGGED metrics views when `Config.MetricsRoleScoper` is wired (issue #47: keyed on the CLOSED `roleFamily` set `main|subagent|member|parallel|usermodel|child` — the raw role, which can embed a def name/model id, never reaches a label, so no cardinality leak; the conversation event stream is still `Run.Events()` only), and stay nil without a scoper (the no-perf path, byte-identical to the old OFF posture). The loop emits exactly THREE lines (compaction-failure WARN, policy-deny INFO, and — consciously amended by the background-subagents drain — the run-end background drain-abandon WARN, ids only); cancellation/tool-error/compaction-success/permission-ask are NOT emitted (the `session.Event` taxonomy owns them). `port.ToolCallRecorder` is the per-tool AUDIT seam, DISTINCT from diagnostics. See `docs/adr/0020-diagnostics.md`. +- **Diagnostics flow through the injected `port.Diagnostics`, NEVER `slog.Default()`/package-level `slog.Info|Warn|Debug|Error` in `engine/` or `internal/`** (banned by `forbidigo` in `.golangci.yml`, `cmd/` mains exempt). The `slogdiag` adapter is the only slog bridge; composition picks the sink (mecated→stderr/journald via `slog.SetDefault`; mecatui→file `$XDG_STATE_HOME/mecatl/mecatui.log` AND a redirected slog default so ambient/third-party slog can't corrupt the alt-screen; `--quiet`→discard). Build-once composition facts log in `app.Build` ONLY — never in the per-engine deps builders (`engineDepsForProvider`/`childEngineDepsForProvider`) (re-emitting per derivation caused N× duplication). Per-RUN diagnostics are session-correlated: the loop binds `deps.Diagnostics.With("session", id)` (+`"agent", role` for children) ONCE per run inside `Engine.RunContent` — NOT at construction (the engine predates the session id and is shared). Child engines (Subagent/member/fork) DO emit correlated diagnostics (real `cfg.diag()` + a `Deps.Role`); their `Deps.Sink`/`Deps.ToolCallRecorder` are role-TAGGED metrics views when `Config.MetricsRoleScoper` is wired (issue #47: keyed on the CLOSED `roleFamily` set `main|subagent|member|parallel|usermodel|child` — the raw role, which can embed a def name/model id, never reaches a label, so no cardinality leak; the conversation event stream is still `Run.Events()` only), and stay nil without a scoper (the no-perf path, byte-identical to the old OFF posture). The loop emits exactly THREE lines (compaction-failure WARN, policy-deny INFO, and — consciously amended by the background-subagents drain — the run-end background drain-abandon WARN, ids only); cancellation/tool-error/compaction-success/permission-ask are NOT emitted (the `session.Event` taxonomy owns them). `port.ToolCallRecorder` is the per-tool AUDIT seam, DISTINCT from diagnostics. See `docs/adr/0020-diagnostics.md`. - **Session leasing (`port.SessionLease`, cloud-native Phase 4) is OPTIONAL + composition/Service-owned — the loop NEVER imports it.** The renewer goroutine + the `Service.heldLeases` registry live on `internal/adapter/server.Service` (the same storage-agnostic discipline as `port.EventLog`); `engine/agent` must never import `port.SessionLease`. Acquire is at the run-entry funnel (`acquireLease`, called by `StartRunContent`/`resumeFromAwaiting`) AFTER `s.runEntryMu.lock(id)` (so same-process exclusion stays cheap and the `resumeMu→runEntryMu` lock order holds); a competing live owner → `ErrSessionLeasedElsewhere` (gRPC `FAILED_PRECONDITION` / HTTP 409). Release uses a cancel-detached short-timeout ctx (the `appendEvent` precedent). The DEFAULT path is BYTE-IDENTICAL: no flag → `buildSessionLease` returns nil → no acquire/renewer/release; `memstore` implements the seam but must NOT auto-wire (only a `--session-lease-*` flag selects a backend). The sticky-disable INFO (`ErrLeaseUnsupported`) + renew-loss WARN + release-failure WARN ride the injected `port.Diagnostics`, never `slog`. The token is plumbed but NOT consulted (CAS-Save deferred). New backends are siblings under `engine/adapter/memlease` / `internal/adapter/{flocklease,k8slease,grpcdriver}`, all validated by `engine/adapter/leaseconformance`. - **Added an outlives-a-call resource? Inventory it in `docs/adr/0027-cloud-native.md`.** Any goroutine, LRU, in-memory map on `Service`/`Run`/`Build`, cache, lease, breaker, or `http.Client`+semaphore whose lifetime outlives one tool call gets a row in CLOUD-NATIVE.md **List 1** (resource inventory: owner/scope/cleanup/re-attach); if it ALSO holds session/run state a restart would lose, add a row to **List 2** (rehydrate-fidelity ledger) with an explicit decision (persist-in-snapshot / derive / reset-by-design / fix-via-event-log). The three that already drifted in unnoticed and had to be backfilled: the modelhook guardrail breakers, the WebSearch provider, the `askReviewBreaker` — don't be the fourth. diff --git a/README.md b/README.md index 7848ad77fb..daaf72175f 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ ships as a client of the same API. **Interfaces & operations** - **Three API surfaces, one event model** — a bidi gRPC `Converse` stream, an HTTP/SSE mirror, and ACP over stdio for editors (`mecated acp`), all over the same domain `Event`. - **Single-shot CI runner & a GitHub Action that implements issues** — `mecatequi` is a headless, forge-agnostic binary: one prompt against the same engine → a git-diff patch + a machine-readable summary + an exit code. A reusable `workflow_call` workflow (a ~15-line caller) — backed by composite actions, with a hand-rolled split-privilege workflow as the escape hatch — turns an issue (label `mecatequi` / comment `@mecatequi`) into a pull request; the agent job holds only the rotatable LLM key and **no** write token, while a separate, agent-code-free job applies the patch as data and opens the PR. See [`docs/adr/0028-mecatequi.md`](docs/adr/0028-mecatequi.md). -- **Auth & limits** — bearer token + optional TLS/mTLS, per-client + global rate limiting, `/healthz`+`/readyz` + gRPC health, graceful shutdown, session auto-resume from a store. +- **Auth & limits** — bearer token + optional TLS/mTLS, per-client + global rate limiting, `/healthz`+`/readyz` + gRPC health, graceful shutdown, session auto-resume from a store. Reusable OIDC caller verification is available as the opt-in `github.com/stacklok/mecatl/authn/oidc` module; the engine itself accepts only an already-verified `session.Principal`. - **Observability** — Prometheus metrics (`/metrics`), OpenTelemetry spans with an OTLP exporter, per-tool-call logging, and an append-only JSONL replay store. - **Deployment** — `ko`-built static distroless image, PSS-restricted manifests, and a signed release (cosign + SBOM + SLSA provenance). - **Strict hexagonal/DDD** — the domain and the loop depend only on ports; the OpenAI client, the servers, the filesystem, and the tools are adapters wired only at the composition root. @@ -175,16 +175,18 @@ exported surface fails the `api-compat` gate until the baseline + changelog are `internal/` holds the heavy adapters and the composition layer. `engine/` is its **own Go module** (`github.com/stacklok/mecatl/engine`), kept in this -repo as a monorepo via a committed `go.work` (`use ./` + `use ./engine`). There are two -`go.mod` files: the root (`github.com/stacklok/mecatl`, with its full require cone) and -`engine/go.mod` (a tiny closure — `doublestar` + `x/sync` + test-only `goleak`). An +repo as a monorepo via a committed `go.work`. The reusable OIDC adapter is another +opt-in module, `github.com/stacklok/mecatl/authn/oidc`; it carries the token-validation +dependencies so engine-only consumers do not. The root and submodule manifests are +maintained independently. An external project imports the core directly, e.g. `import "github.com/stacklok/mecatl/engine/agent"`, and pulls in only that small closure, not mecatl's heavy dependency cone. See [ADR 0036](docs/adr/0036-engine-module.md). | Path | Contents | |---|---| -| `go.work`, `go.mod`, `engine/go.mod` | the committed Go workspace + the two module manifests (root + the importable-core engine module) | +| `go.work`, `go.mod`, `engine/go.mod`, `authn/oidc/go.mod` | the committed Go workspace and the root, importable-engine, and opt-in OIDC module manifests | +| `authn/oidc` | reusable OIDC bearer validation that projects verified claims into `session.Principal` without exposing ToolHive types ([ADR 0103](docs/adr/0103-oidc-authn-module.md)) | | `engine/COMPATIBILITY.md`, `engine/CHANGELOG.md`, `engine/api/*.txt` | the engine public-API stability contract: policy, change record, and committed surface snapshots (the `api-compat` gate, [ADR 0037](docs/adr/0037-engine-stability-contract.md)) | | `engine/session`, `engine/governance`, `engine/tool`, `engine/prompt` | the domain (aggregate, permission/hook types, tool catalog + FS interfaces, prompt assembly) | | `engine/port` | the port interfaces the loop consumes | diff --git a/Taskfile.yml b/Taskfile.yml index 6aa6422ced..92c0affe4a 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -45,6 +45,9 @@ tasks: # engine/ is its own Go module (consumed via the committed go.work). Building # it here keeps the importable-core module compiling alongside the binaries. - cd engine && go build ./... + # authn/oidc is the opt-in caller-identity adapter module (ADR 0103), + # separate from both the dependency-free engine and provider modules. + - cd authn/oidc && go build ./... # provider/ holds the opt-in LLM-provider Go submodules (ADR 0093), each its # own module under the workspace. Building them here keeps the importable # adapters compiling alongside the binaries. @@ -178,12 +181,14 @@ tasks: ./cmd/mecatui test: - desc: Run unit tests with the race detector (root module + engine module + provider modules + the standalone hygiene proofs) + desc: Run unit tests with the race detector (root + engine + authn/oidc + provider modules + standalone hygiene proofs) cmds: - go test -race ./... # engine/ is a separate module under the workspace — `./...` from the root # does NOT cross the module boundary, so its tests are a second invocation. - cd engine && go test -race ./... + # The opt-in OIDC adapter is a separate non-provider module. + - cd authn/oidc && go test -race ./... # provider/ submodules (ADR 0093) — each its own module under the workspace; # the per-module `./...` invocation runs their tests through the workspace. - cd provider/ssefilter && go test -race ./... @@ -191,8 +196,15 @@ tasks: - cd provider/openai && go test -race ./... - cd provider/openaichat && go test -race ./... - task: test:engine-standalone + - task: test:authn-standalone - task: test:provider-standalone + test:authn-standalone: + desc: Prove the opt-in OIDC module builds and tests with GOWORK=off. + cmds: + - cd authn/oidc && GOWORK=off go build ./... + - cd authn/oidc && GOWORK=off go test ./... + test:engine-standalone: desc: | Prove the engine module builds + tests with NO workspace and NO host-repo @@ -271,10 +283,11 @@ tasks: Run the kind-based k8s e2e suite (e2e/k8s/, build tag kind_e2e, ADR 0048). Spins a real kind cluster with a Redis StatefulSet + two storage-free mecak8s agent replicas and asserts lease exclusion, graceful failover, - and session persistence. Export OPENROUTER_API_KEY to ALSO run the LIVE - variant (real LLM turns through the pods proving the plumbing under load; - the live specs Skip without the key). Needs Docker + kind + ko + kubectl. - NOT part of `task test` (slow ~3-5 min mock-only, ~10-15 min with live). + session persistence, and OIDC caller identity against an in-cluster Dex. + Export OPENROUTER_API_KEY to ALSO run the LIVE variant (real LLM turns + through the pods proving the plumbing under load; the live specs Skip + without the key). Needs Docker + kind + ko + kubectl. NOT part of + `task test` (slow ~5-8 min mock-only, ~10-15 min with live). deps: [build] preconditions: - sh: command -v kind >/dev/null 2>&1 @@ -288,8 +301,119 @@ tasks: # real haiku turn takes 10-30s, the live lease/persistence specs each drive # 2-3 turns with FlakeAttempts(2), and the provider patch + rollout adds # ~1-2 min. Without the key the live specs Skip and the suite fits in 15m; - # the outer bound only matters when the live variant runs. - - go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/... + # the outer bound only matters when the live variant runs. GOWORK=off proves + # the image uses tagged external dependencies rather than workspace overlays. + - GOWORK=off go test -tags kind_e2e -count=1 -timeout 30m ./e2e/k8s/... + + deploy:check: + desc: | + Validate every deploy/ kustomize root WITHOUT a cluster: schema-check the + rendered manifests and assert the caller-identity boundaries (ADR 0100). + Needs kustomize + kubeconform; needs NO cluster and NO KO_DOCKER_REPO, so + it runs in CI and on a laptop. + preconditions: + - sh: command -v kustomize >/dev/null 2>&1 + msg: "kustomize is not installed (https://kubectl.docs.kubernetes.io/installation/kustomize/)" + - sh: command -v kubeconform >/dev/null 2>&1 + msg: "kubeconform is not installed (go install github.com/yannh/kubeconform/cmd/kubeconform@latest)" + cmds: + # Schema validation is kubeconform, NOT `kubectl apply --dry-run=client`: + # kubectl maps kinds against the API server even with --validate=false, so + # it needs a reachable cluster and cannot run here. + - for root in deploy/mecak8s deploy/mecak8s-oidc; do echo "== $root"; kustomize build "$root" | kubeconform -strict -summary -; done + # The base must stay identity-OFF: caller identity is opt-in, and the + # published example must keep deploying what operators already expect. + - cmd: | + if kustomize build deploy/mecak8s | grep -qi 'oidc'; then + echo "deploy/mecak8s (the BASE) mentions oidc — caller identity must stay opt-in"; exit 1 + fi + silent: true + # A published example must never ship SSRF relaxation: the flag that lets + # the validator reach a private/in-cluster or http:// issuer exists for the + # e2e fixtures ONLY. (--oidc-jwks-uri is a URL, not a relaxation.) + - cmd: | + if kustomize build deploy/mecak8s-oidc | grep -qiE 'insecure|allow-private'; then + echo "deploy/mecak8s-oidc ships an SSRF relaxation flag — that belongs to the e2e fixtures only"; exit 1 + fi + silent: true + # The overlay APPENDS its flags (JSON6902 add) — a strategic-merge patch + # mentioning `args` would REPLACE the atomic list and silently drop the + # storage + lease flags while every schema check still passed. This is the + # regression guard for that. + - cmd: | + missing="" + rendered=$(kustomize build deploy/mecak8s-oidc) + for arg in --redis-url --session-lease-k8s-namespace --headless --posture --grpc-addr --http-addr --oidc-issuer --oidc-audience --oidc-jwks-uri --oidc-max-jwks-staleness=1h; do + echo "$rendered" | grep -q -- "$arg" || missing="$missing $arg" + done + if [ -n "$missing" ]; then + echo "deploy/mecak8s-oidc DROPPED base args:$missing — the patch must be a JSON6902 append, not a strategic merge"; exit 1 + fi + silent: true + + deploy:render: + desc: | + Render a deploy/ kustomize root with the ko-built image ref, on stdout. + ROOT defaults to deploy/mecak8s (set ROOT=deploy/mecak8s-oidc for the + caller-identity overlay). Honours KO_DOCKER_REPO. NOTE: KO_DOCKER_REPO=ko.local + renders a ref no cluster can PULL (ko.local is not a registry) — fine for + inspecting the output, not for deploying; see deploy:apply. + This is the composition to use for a kustomize root: + `ko resolve -f ` does NOT run kustomize (it globs the directory as + plain YAML and even emits kustomization.yaml as a resource), so the + kustomize build must come first and ko must read it on stdin. + vars: + ROOT: '{{.ROOT | default "deploy/mecak8s"}}' + preconditions: + - sh: command -v kustomize >/dev/null 2>&1 + msg: "kustomize is not installed" + - sh: command -v ko >/dev/null 2>&1 + msg: "ko is not installed (https://ko.build/install/)" + - sh: '[ -n "${KO_DOCKER_REPO:-}" ]' + msg: "KO_DOCKER_REPO is required (e.g. export KO_DOCKER_REPO=ko.local for a local image)" + cmds: + - kustomize build {{.ROOT}} | ko resolve -f - + + deploy:apply: + desc: | + Render a deploy/ kustomize root and apply it, namespace FIRST. ROOT defaults + to deploy/mecak8s. Honours KO_DOCKER_REPO and the CURRENT kubectl context — + it deploys to whatever `kubectl config current-context` points at, so check + that first. + REQUIRES A REGISTRY THE CLUSTER CAN PULL FROM. This task does not distribute + images: with KO_DOCKER_REPO=ko.local the pods get ErrImagePull, because + ko.local lives in the local Docker daemon and is not a registry the node can + resolve. For kind, either push to a real registry, or build+load first (the + way e2e/k8s does it: save the ref to a tarball and `kind load + image-archive`, which survives daemons where `kind load docker-image` + fails). + vars: + ROOT: '{{.ROOT | default "deploy/mecak8s"}}' + preconditions: + - sh: command -v kubectl >/dev/null 2>&1 + msg: "kubectl is not installed" + - sh: command -v kustomize >/dev/null 2>&1 + msg: "kustomize is not installed" + - sh: '[ -n "${KO_DOCKER_REPO:-}" ]' + msg: "KO_DOCKER_REPO is required (a registry the CLUSTER can pull from; ko.local is not one — see the task description)" + # Refuse the footgun rather than deploying pods that can only ErrImagePull. + - sh: '[ "${KO_DOCKER_REPO:-}" != "ko.local" ]' + msg: "KO_DOCKER_REPO=ko.local cannot be pulled by a cluster node (it is the local Docker daemon, not a registry). Push to a real registry, or build+load the image into the node first (see e2e/k8s saveAndLoadImage)." + cmds: + # Two-phase apply. kubectl processes documents in order, but the namespace + # controller marks a new namespace Active ASYNCHRONOUSLY, so namespaced + # resources in the SAME invocation fail with "namespaces not found". + # e2e/k8s/helpers_test.go splits the same way for the same reason. + - cmd: | + set -eu + rendered=$(kustomize build {{.ROOT}} | ko resolve -f -) + nsdoc=$(printf '%s\n' "$rendered" | awk 'BEGIN{RS="\n---\n"} /^kind: Namespace$|\nkind: Namespace$/ {print; exit}') + if [ -n "$nsdoc" ]; then + printf '%s\n' "$nsdoc" | kubectl apply -f - + ns=$(printf '%s\n' "$nsdoc" | awk '/^ name:/ {print $2; exit}') + kubectl wait --for=jsonpath='{.status.phase}'=Active "namespace/$ns" --timeout=60s + fi + printf '%s\n' "$rendered" | kubectl apply -f - fuzz: desc: | @@ -450,6 +574,9 @@ tasks: - go tool cover -func=coverage/engine.out - go tool cover -html=coverage/engine.out -o coverage/engine.html - 'echo "HTML engine coverage report: coverage/engine.html"' + - cd authn/oidc && go test -race -coverprofile=../../coverage/authn-oidc.out -covermode=atomic ./... + - go tool cover -func=coverage/authn-oidc.out + - go tool cover -html=coverage/authn-oidc.out -o coverage/authn-oidc.html # provider/ submodules (ADR 0093) — sibling profiles per module. - cd provider/ssefilter && go test -race -coverprofile=../../coverage/provider-ssefilter.out -covermode=atomic ./... - cd provider/anthropic && go test -race -coverprofile=../../coverage/provider-anthropic.out -covermode=atomic ./... @@ -457,7 +584,7 @@ tasks: - cd provider/openaichat && go test -race -coverprofile=../../coverage/provider-openaichat.out -covermode=atomic ./... lint: - desc: Run golangci-lint (parallel-safe) and go vet over the root module + the engine module + the provider modules + desc: Run golangci-lint (parallel-safe) and go vet over the root, engine, authn/oidc, and provider modules cmds: - golangci-lint run --allow-parallel-runners ./... - go vet ./... @@ -466,6 +593,9 @@ tasks: # single source of truth across the module boundary. - cd engine && golangci-lint run --config ../.golangci.yml --allow-parallel-runners ./... - cd engine && go vet ./... + # authn/oidc is a separate opt-in adapter module, sharing the root config. + - cd authn/oidc && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners ./... + - cd authn/oidc && go vet ./... # provider/ submodules (ADR 0093) — each its own module, sharing the ROOT # golangci config so the depguard allowlists stay the single source of truth. - cd provider/ssefilter && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners ./... @@ -504,6 +634,8 @@ tasks: # module boundary, so its scan is a second invocation against engine/go.mod. # No allowlist: the engine library's closure is clean and must stay clean. - cmd: set -o pipefail; cd engine && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... | go run ../.github/scripts/govulncheck-gate.go # v1.1.4 + # Opt-in OIDC module: independently scan its security-sensitive closure. + - cmd: set -o pipefail; cd authn/oidc && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... | go run ../../.github/scripts/govulncheck-gate.go # v1.1.4 # provider/ submodules (ADR 0093) — each its own module; scan against its # own go.mod so the provider library's closure is checked independently. - cmd: set -o pipefail; cd provider/ssefilter && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... | go run ../../.github/scripts/govulncheck-gate.go # v1.1.4 @@ -512,10 +644,11 @@ tasks: - cmd: set -o pipefail; cd provider/openaichat && go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 -format json ./... | go run ../../.github/scripts/govulncheck-gate.go # v1.1.4 lint:fix: - desc: Run golangci-lint with autofix (parallel-safe) over the root module + the engine module + the provider modules + desc: Run golangci-lint with autofix (parallel-safe) over the root, engine, authn/oidc, and provider modules cmds: - golangci-lint run --allow-parallel-runners --fix ./... - cd engine && golangci-lint run --config ../.golangci.yml --allow-parallel-runners --fix ./... + - cd authn/oidc && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners --fix ./... - cd provider/ssefilter && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners --fix ./... - cd provider/anthropic && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners --fix ./... - cd provider/openai && golangci-lint run --config ../../.golangci.yml --allow-parallel-runners --fix ./... @@ -567,21 +700,23 @@ tasks: - cmd: test -z "$(gofmt -l .)" || { echo "gofmt needs to run on:"; gofmt -l .; exit 1; } tidy: - desc: Tidy go.mod / go.sum for the root module + the engine module, then sync the workspace - cmds: - # INVARIANT — do NOT reorder these three steps. The order - # (1) root `go mod tidy` → (2) `go work sync` → (3) engine `GOWORK=off go mod tidy` - # is load-bearing. engine/ is a separate module: it must be tidied with the - # workspace OFF (step 3) so its go.sum reflects its OWN tiny closure, not the - # host repo's heavy cone. `go work sync` (step 2) aligns the shared transitive - # versions across both modules but can DROP `/go.mod` hash lines from - # engine/go.sum; the standalone tidy MUST run AFTER the sync to restore them. - # Reordering (running the sync last, or the engine tidy before it) leaves - # engine/go.sum missing those `/go.mod` lines, which breaks the GOWORK=off - # engine-standalone CI job on a fresh checkout. Keep this exact order. + desc: Tidy root, engine, authn/oidc, and standalone-ready provider module manifests, then sync the workspace + cmds: + # INVARIANT — do NOT reorder these steps. The order + # (1) root `go mod tidy` → (2) `go work sync` → (3) each standalone + # module's `GOWORK=off go mod tidy` + # is load-bearing. Separate modules must be tidied with the workspace OFF + # so each go.sum reflects its OWN closure, not the host repo's heavy cone. + # `go work sync` can drop `/go.mod` hash lines, so standalone tidy MUST run + # after sync. Running sync last leaves standalone sums incomplete. - go mod tidy - go work sync - cd engine && GOWORK=off go mod tidy + # The OIDC adapter's own sum must cover its standalone closure. Its go.mod + # deliberately has no replace directive. Until an engine minor containing + # PrincipalFromClaims/GrantTypeFromClaims is published, this command is an + # intentional release-sequencing gate and may fail against the older tag. + - cd authn/oidc && GOWORK=off go mod tidy # provider/ submodules (ADR 0093) — same GOWORK=off discipline as engine: # each module's go.sum must reflect its OWN closure, not the host repo's. # ssefilter (stdlib + openai-go) and anthropic (engine is a published dep) diff --git a/authn/oidc/go.mod b/authn/oidc/go.mod new file mode 100644 index 0000000000..fcdf5095c1 --- /dev/null +++ b/authn/oidc/go.mod @@ -0,0 +1,30 @@ +module github.com/stacklok/mecatl/authn/oidc + +go 1.26.5 + +require ( + github.com/stacklok/mecatl/engine v0.10.0 + github.com/stacklok/toolhive-core v0.0.39 +) + +require ( + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect + github.com/ebitengine/purego v0.10.2 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect + github.com/goccy/go-json v0.10.6 // indirect + github.com/golang-jwt/jwt/v5 v5.3.1 // indirect + github.com/lestrrat-go/blackmagic v1.0.4 // indirect + github.com/lestrrat-go/httpcc v1.0.1 // indirect + github.com/lestrrat-go/httprc/v3 v3.0.6 // indirect + github.com/lestrrat-go/jwx/v3 v3.2.0 // indirect + github.com/lestrrat-go/option/v2 v2.0.0 // indirect + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/segmentio/asm v1.2.1 // indirect + github.com/shirou/gopsutil/v4 v4.26.7 // indirect + github.com/valyala/fastjson v1.6.10 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + golang.org/x/net v0.57.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.40.0 // indirect +) diff --git a/authn/oidc/go.sum b/authn/oidc/go.sum new file mode 100644 index 0000000000..a192a52e71 --- /dev/null +++ b/authn/oidc/go.sum @@ -0,0 +1,68 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 h1:5RVFMOWjMyRy8cARdy79nAmgYw3hK/4HUq48LQ6Wwqo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= +github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE= +github.com/ebitengine/purego v0.10.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= +github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU= +github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= +github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/lestrrat-go/blackmagic v1.0.4 h1:IwQibdnf8l2KoO+qC3uT4OaTWsW7tuRQXy9TRN9QanA= +github.com/lestrrat-go/blackmagic v1.0.4/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw= +github.com/lestrrat-go/dsig v1.3.0 h1:phjMOCXvYzhuIgn7Voe2rex8z166vGfxRxmqM25P9/Q= +github.com/lestrrat-go/dsig v1.3.0/go.mod h1:RD2eOaidyPvpc7IJQoO3Qq52RWdy8ZcJs8lrOnoa1Kc= +github.com/lestrrat-go/dsig-secp256k1 v1.0.0 h1:JpDe4Aybfl0soBvoVwjqDbp+9S1Y2OM7gcrVVMFPOzY= +github.com/lestrrat-go/dsig-secp256k1 v1.0.0/go.mod h1:CxUgAhssb8FToqbL8NjSPoGQlnO4w3LG1P0qPWQm/NU= +github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= +github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= +github.com/lestrrat-go/httprc/v3 v3.0.6 h1:4FpLQ18KK/ypPbVU3NLWJNRvH3kcYiqKqWfKGqNWxxI= +github.com/lestrrat-go/httprc/v3 v3.0.6/go.mod h1:mSMtkZW92Z98M5YoNNztbRGxbXHql7tSitCvaxvo9l0= +github.com/lestrrat-go/jwx/v3 v3.2.0 h1:Jb3zBASTSZXz7gzzSAfYqxXF8KejvKC4xWoePLQqXCA= +github.com/lestrrat-go/jwx/v3 v3.2.0/go.mod h1:38vQ8iWKq3qRSbilbzvzdQPuywhowwuR03lhkYskyrw= +github.com/lestrrat-go/option/v2 v2.0.0 h1:XxrcaJESE1fokHy3FpaQ/cXW8ZsIdWcdFzzLOcID3Ss= +github.com/lestrrat-go/option/v2 v2.0.0/go.mod h1:oSySsmzMoR0iRzCDCaUfsCzxQHUEuhOViQObyy7S6Vg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0= +github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= +github.com/shirou/gopsutil/v4 v4.26.7 h1:IXzpHz/dkMRYAhKkOXr1HB6SuzWU3eoyyeWe7g3bNZc= +github.com/shirou/gopsutil/v4 v4.26.7/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM= +github.com/stacklok/mecatl/engine v0.10.0 h1:eOZDY5UdkGHlhbz/+za/kLe/G1KpS5HR4+wx9cIuc5Q= +github.com/stacklok/mecatl/engine v0.10.0/go.mod h1:ffOAMujPONE7iCOcu22nKy1NTJesdSScIa0DOmADo/w= +github.com/stacklok/toolhive-core v0.0.39 h1:l9XV1LoWL33CYQyjj2xhbNZpYLnobV5hOVaspNO27DA= +github.com/stacklok/toolhive-core v0.0.39/go.mod h1:8L/EIQWziQeVLOOZXT7VGRhaKFyS2Hb3IyFRJocm5Hg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/valyala/fastjson v1.6.10 h1:/yjJg8jaVQdYR3arGxPE2X5z89xrlhS0eGXdv+ADTh4= +github.com/valyala/fastjson v1.6.10/go.mod h1:e6FubmQouUNP73jtMLmcbxS6ydWIpOfhz34TSfO3JaE= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= +golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/authn/oidc/oidc.go b/authn/oidc/oidc.go new file mode 100644 index 0000000000..54ab3efbea --- /dev/null +++ b/authn/oidc/oidc.go @@ -0,0 +1,122 @@ +// Package oidc verifies OIDC bearer tokens and projects their already-verified +// claims into the engine's narrow caller identity. +package oidc + +import ( + "context" + "errors" + "fmt" + "net/http" + "time" + + "github.com/stacklok/toolhive-core/authn" + + "github.com/stacklok/mecatl/engine/session" +) + +// Config is the trusted issuer, audience, and key-fetch policy for a Validator. +type Config struct { + // Issuer is the exact OIDC issuer accepted in the token's iss claim. + Issuer string + // JWKSURI pins the signing-key endpoint; empty uses OIDC discovery. + JWKSURI string + // Audience is the single service audience accepted in the token's aud claim. + Audience string + // MaxJWKSStaleness bounds cached-key use during an identity-provider outage; + // zero disables the upper bound. + MaxJWKSStaleness time.Duration + // InsecureAllowPrivateIssuer permits HTTP and private issuer/JWKS addresses. + // It is intended only for isolated tests and disables SSRF protections. + InsecureAllowPrivateIssuer bool + // HTTPClient optionally supplies trusted roots and transport policy. Nil uses + // the validator's hardened client. When set, the caller is responsible for + // preserving equivalent redirect and private-address protections. + HTTPClient *http.Client +} + +// ErrInvalidToken identifies a malformed, invalid, or otherwise inadmissible +// bearer credential. +var ErrInvalidToken = errors.New("oidc: invalid token") + +// ErrInvalidConfig identifies configuration that cannot construct a validator. +// The wrapped error deliberately does not expose ToolHive error types. +var ErrInvalidConfig = errors.New("oidc: invalid configuration") + +// ErrIdentityUnavailable identifies a transient inability to obtain trusted key +// material from the identity provider. +var ErrIdentityUnavailable = errors.New("oidc: identity unavailable") + +// Validator owns token verification and its background JWKS refresh. Call Close +// when it is no longer needed. +type Validator struct { + validator *authn.Validator +} + +// NewValidator constructs a fail-closed OIDC validator. Issuer and Audience +// must both be non-empty. Secure issuer/JWKS transport and audience validation +// remain enabled unless Config explicitly opts out where documented. +func NewValidator(ctx context.Context, cfg Config) (*Validator, error) { + if cfg.Issuer == "" { + return nil, fmt.Errorf("%w: issuer is empty", ErrInvalidConfig) + } + if cfg.Audience == "" { + return nil, fmt.Errorf("%w: audience is empty", ErrInvalidConfig) + } + toolhiveConfig := authnConfig(cfg) + toolhiveConfig.HTTPClient = cfg.HTTPClient + validator, err := authn.NewValidator(ctx, toolhiveConfig) + if err != nil { + return nil, fmt.Errorf("%w: %v", ErrInvalidConfig, err) + } + return &Validator{validator: validator}, nil +} + +func authnConfig(cfg Config) authn.Config { + return authn.Config{ + Issuer: cfg.Issuer, + Audiences: []string{cfg.Audience}, + JWKSURL: cfg.JWKSURI, + MaxJWKSStaleness: cfg.MaxJWKSStaleness, + AllowAnyAudience: false, + InsecureAllowHTTP: cfg.InsecureAllowPrivateIssuer, + AllowPrivateIP: cfg.InsecureAllowPrivateIssuer, + } +} + +// Validate verifies bearer and returns its caller identity. A successfully +// verified claim set without a usable issuer and subject is rejected. +func (v *Validator) Validate(ctx context.Context, bearer string) (*session.Principal, error) { + principal, err := v.validator.Validate(ctx, bearer) + if err != nil { + return nil, mapError(err) + } + out := session.PrincipalFromClaims(principal.Claims) + if out == nil { + return nil, fmt.Errorf("%w: verified claims have no issuer or subject", ErrInvalidToken) + } + return out, nil +} + +// Close stops background JWKS refresh. +func (v *Validator) Close() error { + if v != nil && v.validator != nil { + v.validator.Close() + } + return nil +} + +func mapError(err error) error { + if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { + return err + } + var authnErr *authn.Error + if errors.As(err, &authnErr) { + switch authnErr.Code { + case authn.CodeUnavailable: + return fmt.Errorf("%w: %s", ErrIdentityUnavailable, authnErr.Reason) + case authn.CodeInvalidToken, authn.CodeInvalidRequest: + return fmt.Errorf("%w: %s", ErrInvalidToken, authnErr.Reason) + } + } + return fmt.Errorf("%w: unrecognised validator failure", ErrInvalidToken) +} diff --git a/authn/oidc/oidc_test.go b/authn/oidc/oidc_test.go new file mode 100644 index 0000000000..08610e1f39 --- /dev/null +++ b/authn/oidc/oidc_test.go @@ -0,0 +1,157 @@ +package oidc + +import ( + "context" + "crypto/rand" + "crypto/rsa" + "encoding/base64" + "encoding/json" + "errors" + "math/big" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/stacklok/toolhive-core/authn" +) + +func TestAuthnConfigPreservesSecurityPolicy(t *testing.T) { + t.Parallel() + got := authnConfig(Config{ + Issuer: "https://idp.example", JWKSURI: "https://idp.example/keys", + Audience: "mecatl", MaxJWKSStaleness: 23 * time.Minute, + }) + if got.MaxJWKSStaleness != 23*time.Minute || len(got.Audiences) != 1 || got.Audiences[0] != "mecatl" { + t.Fatalf("authn config did not preserve audience/staleness: %#v", got) + } + if got.AllowAnyAudience || got.InsecureAllowHTTP || got.AllowPrivateIP { + t.Fatalf("secure defaults changed: %#v", got) + } +} + +func TestNewValidatorRejectsEmptyTrustInputs(t *testing.T) { + t.Parallel() + for _, tc := range []struct { + name string + cfg Config + want string + }{ + {name: "issuer", cfg: Config{Audience: testAudience}, want: "issuer is empty"}, + {name: "audience", cfg: Config{Issuer: "https://idp.example"}, want: "audience is empty"}, + } { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + validator, err := NewValidator(context.Background(), tc.cfg) + if validator != nil || !errors.Is(err, ErrInvalidConfig) || !strings.Contains(err.Error(), tc.want) { + t.Fatalf("NewValidator(%#v) = (%#v, %v), want nil %q ErrInvalidConfig", tc.cfg, validator, err, tc.want) + } + }) + } +} + +func TestNewValidatorContainsConstructorErrors(t *testing.T) { + t.Parallel() + validator, err := NewValidator(context.Background(), Config{Issuer: "://bad", Audience: testAudience}) + if validator != nil || !errors.Is(err, ErrInvalidConfig) { + t.Fatalf("NewValidator malformed issuer = (%#v, %v), want nil ErrInvalidConfig", validator, err) + } + var authnErr *authn.Error + if errors.As(err, &authnErr) { + t.Fatalf("constructor error exposes ToolHive type: %T", authnErr) + } +} + +func TestMapError(t *testing.T) { + t.Parallel() + for _, tc := range []struct { + name string + err error + want error + }{ + {name: "invalid token", err: &authn.Error{Code: authn.CodeInvalidToken}, want: ErrInvalidToken}, + {name: "invalid request", err: &authn.Error{Code: authn.CodeInvalidRequest}, want: ErrInvalidToken}, + {name: "unavailable", err: &authn.Error{Code: authn.CodeUnavailable}, want: ErrIdentityUnavailable}, + {name: "unknown authn code", err: &authn.Error{Code: authn.Code("future_code")}, want: ErrInvalidToken}, + {name: "unknown error", err: errors.New("unknown"), want: ErrInvalidToken}, + } { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + got := mapError(tc.err) + if !errors.Is(got, tc.want) { + t.Fatalf("mapError(%v) = %v, want %v", tc.err, got, tc.want) + } + opposite := ErrIdentityUnavailable + if tc.want == ErrIdentityUnavailable { + opposite = ErrInvalidToken + } + if errors.Is(got, opposite) { + t.Fatalf("mapError(%v) = %v, unexpectedly wraps %v", tc.err, got, opposite) + } + }) + } + for _, want := range []error{context.Canceled, context.DeadlineExceeded} { + if got := mapError(want); !errors.Is(got, want) || errors.Is(got, ErrInvalidToken) || errors.Is(got, ErrIdentityUnavailable) { + t.Fatalf("mapError(%v) = %v, want original context error only", want, got) + } + } +} + +const ( + testKID = "test-key-1" + testAudience = "mecatl" +) + +type jwksFixture struct { + srv *httptest.Server +} + +func newJWKSFixture(t *testing.T) *jwksFixture { + t.Helper() + key, err := rsa.GenerateKey(rand.Reader, 2048) + if err != nil { + t.Fatalf("rsa.GenerateKey: %v", err) + } + fixture := &jwksFixture{} + mux := http.NewServeMux() + mux.HandleFunc("/keys", func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + _ = json.NewEncoder(w).Encode(map[string]any{"keys": []map[string]string{{ + "kty": "RSA", "use": "sig", "alg": "RS256", "kid": testKID, + "n": base64.RawURLEncoding.EncodeToString(key.N.Bytes()), + "e": base64.RawURLEncoding.EncodeToString(big.NewInt(int64(key.E)).Bytes()), + }}}) + }) + fixture.srv = httptest.NewTLSServer(mux) + t.Cleanup(fixture.srv.Close) + return fixture +} + +func (f *jwksFixture) validator(t *testing.T) *Validator { + t.Helper() + validator, err := NewValidator(context.Background(), Config{ + Issuer: f.srv.URL, Audience: testAudience, JWKSURI: f.srv.URL + "/keys", + HTTPClient: f.srv.Client(), + }) + if err != nil { + t.Fatalf("NewValidator: %v", err) + } + t.Cleanup(func() { _ = validator.Close() }) + return validator +} + +func TestValidatorCloseIsIdempotent(t *testing.T) { + fixture := newJWKSFixture(t) + validator := fixture.validator(t) + if err := validator.Close(); err != nil { + t.Fatalf("first Close: %v", err) + } + if err := validator.Close(); err != nil { + t.Fatalf("second Close: %v", err) + } + var nilValidator *Validator + if err := nilValidator.Close(); err != nil { + t.Fatalf("nil Close: %v", err) + } +} diff --git a/cmd/mecak8s/flags.go b/cmd/mecak8s/flags.go index 59c5651303..e3dedc9169 100644 --- a/cmd/mecak8s/flags.go +++ b/cmd/mecak8s/flags.go @@ -168,6 +168,9 @@ type config struct { tlsCert string tlsKey string clientCA string + // oidc carries the caller-identity flags (--oidc-issuer/--oidc-jwks-uri/ + // --oidc-audience), shared verbatim with mecated. Zero value = identity off. + oidc cliconfig.OIDCConfig // Child-session retention/GC over the Redis store (PrunableStore). Defaults // mirror mecated so a durable store does not grow without bound. @@ -329,6 +332,7 @@ func parseFlags(argv []string) (config, error) { fs.StringVar(&cfg.tlsCert, "tls-cert", "", "PEM server certificate; enables TLS on gRPC + HTTP when set with --tls-key") fs.StringVar(&cfg.tlsKey, "tls-key", "", "PEM server private key (paired with --tls-cert)") fs.StringVar(&cfg.clientCA, "client-ca", "", "PEM client CA bundle; enables mutual TLS (require+verify client certs)") + cliconfig.RegisterOIDCFlags(fs, &cfg.oidc) // Child/main retention over the (prunable) Redis store — mirrors mecated. fs.DurationVar(&cfg.childRetention, "child-retention", 168*time.Hour, "how long persisted CHILD session snapshots are retained before the GC sweep deletes them; 0 disables the age pass") diff --git a/cmd/mecak8s/serve.go b/cmd/mecak8s/serve.go index b15515064d..69eaae90db 100644 --- a/cmd/mecak8s/serve.go +++ b/cmd/mecak8s/serve.go @@ -50,12 +50,11 @@ func serve(ctx context.Context, cfg config, svc *server.Service, obs observabili return err } - auth := server.NewAuthenticator(server.SecurityConfig{ - AuthToken: cfg.authToken, - // No rate limiting on a pod: it is fronted by the Service/mesh, not a - // raw public port. RateBurst 0 leaves the authenticator's rate limiter - // disabled. - }) + auth, err := newAuthenticator(ctx, cfg) + if err != nil { + return err + } + defer auth.Close() // --- gRPC: auth interceptors, standard health service --- grpcOpts := []grpc.ServerOption{ @@ -113,7 +112,9 @@ func serve(ctx context.Context, cfg config, svc *server.Service, obs observabili TLSConfig: tlsCfg, } - authed := cfg.authToken != "" || tlsCfg != nil + // Caller identity counts as authentication: an OIDC deployment may carry no + // static token at all. + authed := cfg.authToken != "" || cfg.oidc.Enabled() || tlsCfg != nil warnIfNonLoopback("grpc-addr", cfg.grpcAddr, authed) warnIfNonLoopback("http-addr", cfg.httpAddr, authed) @@ -187,6 +188,29 @@ func serve(ctx context.Context, cfg config, svc *server.Service, obs observabili return nil } +// newAuthenticator constructs the caller-identity boundary with the server-root +// context so its JWKS refresh survives individual requests. A broken OIDC setup +// is fatal: the pod must not silently serve unauthenticated traffic. +func newAuthenticator(ctx context.Context, cfg config) (*server.Authenticator, error) { + // Log before construction so an insecure test-only relaxation is visible even + // when validator construction then fails. + warnInsecureIssuer(cfg.oidc) + if err := cliconfig.ValidateOIDCAuthToken(cfg.oidc, cfg.authToken); err != nil { + return nil, err + } + validator, err := cliconfig.OIDCValidator(ctx, cfg.oidc) + if err != nil { + return nil, err + } + return server.NewAuthenticator(server.SecurityConfig{ + AuthToken: cfg.authToken, + Validator: validator, + // No rate limiting on a pod: it is fronted by the Service/mesh, not a + // raw public port. RateBurst 0 leaves the authenticator's rate limiter + // disabled. + }), nil +} + // boundedShutdown is the ADR-0048-§4d shutdown sequence: // 1. arm the drain gate (new runs → 503); /readyz flips not-ready. // 2. log "draining: N active runs" (Service.ActiveRuns()). @@ -291,3 +315,13 @@ func warnIfNonLoopback(flagName, addr string, authed bool) { func signalCtx() (context.Context, context.CancelFunc) { return signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) } + +// warnInsecureIssuer logs the SSRF-relaxation warning when the operator enabled +// it, and is silent otherwise. It is a function rather than an inline branch so +// the caller does not grow another decision point (gocyclo), and so both server +// mains surface the warning identically. +func warnInsecureIssuer(c cliconfig.OIDCConfig) { + if w := c.InsecureIssuerWarning(); w != "" { + slog.Warn(w) + } +} diff --git a/cmd/mecated/caller_identity_test.go b/cmd/mecated/caller_identity_test.go new file mode 100644 index 0000000000..900679cc26 --- /dev/null +++ b/cmd/mecated/caller_identity_test.go @@ -0,0 +1,79 @@ +package main + +import ( + "context" + "errors" + "testing" + + "github.com/stacklok/mecatl/internal/adapter/server" + "github.com/stacklok/mecatl/internal/cliconfig" +) + +// TestCallerIdentity_Scenario1_MisconfiguredOIDCFailsToStart pins AC1.6: with +// the OIDC flags set but validator construction failing (an unreachable JWKS and +// no --oidc-jwks-uri static override), the server REFUSES TO START. It must +// never degrade silently to the unauthenticated path — that is the classic +// misconfigured-verifier fail-open (ADR 0100 decision 3). +func TestCallerIdentity_Scenario1_MisconfiguredOIDCFailsToStart(t *testing.T) { + t.Parallel() + + jwksDown := func(context.Context, cliconfig.OIDCConfig) (server.PrincipalValidator, error) { + return nil, errors.New("discovery: Get \"https://idp.example.com/.well-known/openid-configuration\": dial tcp: connection refused") + } + + cases := []struct { + name string + oidc cliconfig.OIDCConfig + wantErr bool + }{ + { + name: "unreachable JWKS, no static override", + oidc: cliconfig.OIDCConfig{Issuer: "https://idp.example.com", Audience: "mecatl", NewValidator: jwksDown}, + wantErr: true, + }, + { + name: "issuer set, audience missing", + oidc: cliconfig.OIDCConfig{Issuer: "https://idp.example.com", NewValidator: jwksDown}, + wantErr: true, + }, + { + name: "issuer set, no validator available", + oidc: cliconfig.OIDCConfig{Issuer: "https://idp.example.com", Audience: "mecatl"}, + wantErr: true, + }, + { + name: "negative maximum JWKS staleness", + oidc: cliconfig.OIDCConfig{MaxJWKSStaleness: -1}, + wantErr: true, + }, + { + // OIDC off: unchanged, the authenticator builds. + name: "oidc not configured", + oidc: cliconfig.OIDCConfig{}, + wantErr: false, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + cfg := config{oidc: tc.oidc} + _, auth, err := buildEdge(context.Background(), cfg) + if tc.wantErr { + if err == nil { + t.Fatal("buildEdge err = nil, want a startup failure (silent fail-open)") + } + if auth != nil { + t.Fatal("buildEdge returned an Authenticator despite a fatal OIDC misconfiguration") + } + return + } + if err != nil { + t.Fatalf("buildEdge err = %v, want nil", err) + } + if auth == nil { + t.Fatal("buildEdge returned no Authenticator") + } + }) + } +} diff --git a/cmd/mecated/helpmeta.go b/cmd/mecated/helpmeta.go index 6b9f5ff334..e24ecd0d9d 100644 --- a/cmd/mecated/helpmeta.go +++ b/cmd/mecated/helpmeta.go @@ -74,6 +74,15 @@ var flagMetaByFlag = map[string]flagMeta{ "client-ca": {group: groupSecurity, common: false, acp: acpExclude}, "rate-limit": {group: groupSecurity, common: false, acp: acpExclude}, "rate-burst": {group: groupSecurity, common: false, acp: acpExclude}, + // Caller identity (ADR 0100): advanced, server-boundary — an ACP client + // speaks over stdio and has no authenticated edge. + "oidc-issuer": {group: groupSecurity, common: false, acp: acpExclude}, + "oidc-jwks-uri": {group: groupSecurity, common: false, acp: acpExclude}, + "oidc-audience": {group: groupSecurity, common: false, acp: acpExclude}, + "oidc-max-jwks-staleness": {group: groupSecurity, common: false, acp: acpExclude}, + // TEST-ONLY SSRF relaxation (see cliconfig.OIDCConfig): not common, and + // acpExclude like its siblings — an ACP client has no business setting it. + "oidc-insecure-allow-private-issuer": {group: groupSecurity, common: false, acp: acpExclude}, // ── Observability (serve-only) ──────────────────────────────────────── "otlp-endpoint": {group: groupObservability, common: false, acp: acpExclude}, diff --git a/cmd/mecated/main.go b/cmd/mecated/main.go index 55cb6dd07f..1952483d75 100644 --- a/cmd/mecated/main.go +++ b/cmd/mecated/main.go @@ -121,6 +121,9 @@ type config struct { clientCA string // PEM client CA bundle; enables mutual TLS (require+verify client certs) rateLimit float64 // sustained per-client request rate (req/s); 0 disables rate limiting rateBurst int // token-bucket burst size; 0 -> derived from rateLimit + // oidc carries the caller-identity flags (--oidc-issuer/--oidc-jwks-uri/ + // --oidc-audience). Zero value = identity off, the unchanged path. + oidc cliconfig.OIDCConfig // LLM resilience knobs (see package internal/adapter/llmresilience). llmMaxAttempts int @@ -1511,6 +1514,7 @@ func parseFlagsModeOut(mode commandMode, argv []string, out io.Writer) (*flag.Fl fs.StringVar(&cfg.tlsCert, "tls-cert", "", "PEM server certificate; with --tls-key enables TLS on the gRPC + HTTP servers") fs.StringVar(&cfg.tlsKey, "tls-key", "", "PEM server private key (paired with --tls-cert)") fs.StringVar(&cfg.clientCA, "client-ca", "", "PEM client-CA bundle; enables mutual TLS (require + verify client certs)") + cliconfig.RegisterOIDCFlags(fs, &cfg.oidc) fs.Float64Var(&cfg.rateLimit, "rate-limit", 0, "sustained per-client request rate in req/s (0 disables rate limiting)") fs.IntVar(&cfg.rateBurst, "rate-burst", 0, "rate-limit token-bucket burst size (0 derives a sane default from --rate-limit)") @@ -1708,21 +1712,18 @@ func readAskReviewerPolicy(path string) (string, error) { // /debug/flightrecorder is not mounted. // // The harness API is protected by the server.Authenticator (bearer auth + rate -// limiting, both off by default) and optionally by TLS / mutual TLS. The -// liveness/readiness probes and the standard gRPC health service are mounted -// OUTSIDE the auth/rate-limit layer so orchestrators can probe without -// credentials. +// limiting, both off by default) and optionally by TLS / mutual TLS. HTTP +// liveness/readiness probes are mounted OUTSIDE the auth/rate-limit layer so +// orchestrators can probe without credentials. The gRPC health service shares +// the server-wide interceptors and therefore requires credentials when auth is on. func serve(ctx context.Context, cfg config, svc *server.Service, reg *prometheus.Registry, recorder *telemetry.FlightRecorder, slowTurns *telemetry.SlowTurnBuffer) error { - tlsCfg, err := buildTLSConfig(cfg) + tlsCfg, auth, err := buildEdge(ctx, cfg) if err != nil { return err } - - auth := server.NewAuthenticator(server.SecurityConfig{ - AuthToken: cfg.authToken, - RateLimit: cfg.rateLimit, - RateBurst: cfg.rateBurst, - }) + // The caller-identity validator owns a background JWKS refresh that only its + // own Close() stops — cancelling ctx does not. No-op when identity is off. + defer auth.Close() logSecurityPosture(cfg, tlsCfg) // --- gRPC: auth+rate interceptors, standard health service --- @@ -1793,7 +1794,9 @@ func serve(ctx context.Context, cfg config, svc *server.Service, reg *prometheus } } - authed := auth != nil && (cfg.authToken != "" || tlsCfg != nil) + // Caller identity counts as authentication: an OIDC deployment may carry no + // static token at all, and warning "NO authentication" there would be false. + authed := auth != nil && (cfg.authToken != "" || cfg.oidc.Enabled() || tlsCfg != nil) warnIfNonLoopback("grpc-addr", cfg.grpcAddr, authed) warnIfNonLoopback("http-addr", cfg.httpAddr, authed) @@ -1854,6 +1857,37 @@ func serve(ctx context.Context, cfg config, svc *server.Service, reg *prometheus return nil } +// buildEdge assembles everything guarding the listeners: the TLS config plus the +// edge policy (static bearer token, rate limiter, and — when --oidc-issuer is +// set — the caller-identity validator). +// +// ctx is the SERVER-ROOT context: the validator owns background JWKS refresh, so +// it must outlive any request. EVERY failure here is fatal and the daemon +// refuses to start — silently falling back to the unauthenticated path would +// turn an authenticated deployment into an open one (ADR 0100). +func buildEdge(ctx context.Context, cfg config) (*tls.Config, *server.Authenticator, error) { + tlsCfg, err := buildTLSConfig(cfg) + if err != nil { + return nil, nil, err + } + // Logged BEFORE construction so it appears even if the validator then fails + // to build. + warnInsecureIssuer(cfg.oidc) + if err := cliconfig.ValidateOIDCAuthToken(cfg.oidc, cfg.authToken); err != nil { + return nil, nil, err + } + validator, err := cliconfig.OIDCValidator(ctx, cfg.oidc) + if err != nil { + return nil, nil, err + } + return tlsCfg, server.NewAuthenticator(server.SecurityConfig{ + AuthToken: cfg.authToken, + RateLimit: cfg.rateLimit, + RateBurst: cfg.rateBurst, + Validator: validator, + }), nil +} + // warnIfNonLoopback logs the API trust assumption for the given bind address. // Loopback binds are logged at info. A non-loopback bind WITH authentication // (bearer token and/or TLS, indicated by authed) is logged at info; a @@ -1959,6 +1993,7 @@ func logSecurityPosture(cfg config, tlsCfg *tls.Config) { mtls := tlsCfg != nil && tlsCfg.ClientAuth == tls.RequireAndVerifyClientCert slog.Info("API security posture", "bearer_auth", cfg.authToken != "", + "caller_identity", cfg.oidc.Enabled(), "tls", tlsCfg != nil, "mutual_tls", mtls, "rate_limit_rps", cfg.rateLimit, @@ -1990,3 +2025,13 @@ func shutdown(grpcSrv *grpc.Server, httpSrv, metricsSrv *http.Server) { } grpcSrv.GracefulStop() } + +// warnInsecureIssuer logs the SSRF-relaxation warning when the operator enabled +// it, and is silent otherwise. It is a function rather than an inline branch so +// the caller does not grow another decision point (gocyclo), and so both server +// mains surface the warning identically. +func warnInsecureIssuer(c cliconfig.OIDCConfig) { + if w := c.InsecureIssuerWarning(); w != "" { + slog.Warn(w) + } +} diff --git a/cmd/mecated/main_test.go b/cmd/mecated/main_test.go index 2d0706cddb..82d6145406 100644 --- a/cmd/mecated/main_test.go +++ b/cmd/mecated/main_test.go @@ -116,6 +116,23 @@ func TestParseFlagsSchedulerMinIntervalDefault(t *testing.T) { } } +func TestParseFlagsOIDCMaxJWKSStaleness(t *testing.T) { + def, err := parseFlags(nil) + if err != nil { + t.Fatalf("parseFlags(nil): %v", err) + } + if def.oidc.MaxJWKSStaleness != time.Hour { + t.Fatalf("default --oidc-max-jwks-staleness = %v, want 1h", def.oidc.MaxJWKSStaleness) + } + override, err := parseFlags([]string{"--oidc-max-jwks-staleness=0"}) + if err != nil { + t.Fatalf("parseFlags override: %v", err) + } + if override.oidc.MaxJWKSStaleness != 0 { + t.Fatalf("--oidc-max-jwks-staleness=0 = %v, want disabled", override.oidc.MaxJWKSStaleness) + } +} + // TestParseFlagsSubagentModelRouter asserts the ADR 0042 kill-switch parses: // unset → not set (router governed by taxonomy); a bare flag / =true still PARSES and is // a harmless no-op (router stays governed by taxonomy); =false maps to RouterDisabled via diff --git a/contracts/gen/go/mecatl/v1/harness.pb.go b/contracts/gen/go/mecatl/v1/harness.pb.go index d748659b04..67e92526e4 100644 --- a/contracts/gen/go/mecatl/v1/harness.pb.go +++ b/contracts/gen/go/mecatl/v1/harness.pb.go @@ -404,7 +404,7 @@ func (x Content_Kind) Number() protoreflect.EnumNumber { // Deprecated: Use Content_Kind.Descriptor instead. func (Content_Kind) EnumDescriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{22, 0} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{23, 0} } // Kind discriminates the block kind. @@ -473,7 +473,7 @@ func (x ContentBlock_Kind) Number() protoreflect.EnumNumber { // Deprecated: Use ContentBlock_Kind.Descriptor instead. func (ContentBlock_Kind) EnumDescriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{23, 0} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{24, 0} } // Limits are the configured stop conditions for a session. A zero value in @@ -1382,6 +1382,87 @@ func (*ListSessionsRequest) Descriptor() ([]byte, []int) { return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{10} } +// Principal is the verified caller an object is attributed to (ADR 0100 — caller +// identity, threaded). Identity is the (issuer, subject) PAIR, never subject alone: +// two IdPs or realms collide on `sub`. It carries NO scopes, NO credentials and NO +// claims map — attribution only; enforcement is the isolation track's. +// +// An ABSENT principal is an ABSENT message (a nil owner), never a present-but-empty +// one — "nobody" must never be renderable as an anonymous somebody. +type Principal struct { + state protoimpl.MessageState `protogen:"open.v1"` + // issuer is the IdP that minted the token (the canonical `iss` claim). + Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` + // subject is the caller id within that issuer (the `sub` claim). + Subject string `protobuf:"bytes,2,opt,name=subject,proto3" json:"subject,omitempty"` + // grant_type is how the caller authenticated: "user", "client_credentials" or + // "system". A bare string passthrough (no enum) — the domain owns the closed set. + GrantType string `protobuf:"bytes,3,opt,name=grant_type,json=grantType,proto3" json:"grant_type,omitempty"` + // name is an optional human-readable display label. It is NEVER part of + // identity — display only. + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Principal) Reset() { + *x = Principal{} + mi := &file_mecatl_v1_harness_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Principal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Principal) ProtoMessage() {} + +func (x *Principal) ProtoReflect() protoreflect.Message { + mi := &file_mecatl_v1_harness_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Principal.ProtoReflect.Descriptor instead. +func (*Principal) Descriptor() ([]byte, []int) { + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{11} +} + +func (x *Principal) GetIssuer() string { + if x != nil { + return x.Issuer + } + return "" +} + +func (x *Principal) GetSubject() string { + if x != nil { + return x.Subject + } + return "" +} + +func (x *Principal) GetGrantType() string { + if x != nil { + return x.GrantType + } + return "" +} + +func (x *Principal) GetName() string { + if x != nil { + return x.Name + } + return "" +} + // SessionSummary is one stored session's picker metadata — id, timestamps, state, // turn count, and the resolved model id. It carries NO conversation content: it is // the cheap row a client renders in an "open existing session" picker (issue #245 @@ -1413,14 +1494,21 @@ type SessionSummary struct { // prompt (clamped to 120 runes). Empty for a session with no label (a client // may derive a fallback). Populated from the snapshot Title (or the lazy // fallback) by ListSessions. - Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` + Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` + // owner is the verified caller the session is attributed to (ADR 0100), stamped + // write-once at CreateSession from the validated token — never from the request + // body. UNSET for an ownerless session (a no-auth deployment, or a session + // persisted before the owner label existed; nothing backfills it). It is DISPLAY + // metadata: ListSessions applies NO owner filtering — scoping is the isolation + // track's (#368), not this one's. + Owner *Principal `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SessionSummary) Reset() { *x = SessionSummary{} - mi := &file_mecatl_v1_harness_proto_msgTypes[11] + mi := &file_mecatl_v1_harness_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1432,7 +1520,7 @@ func (x *SessionSummary) String() string { func (*SessionSummary) ProtoMessage() {} func (x *SessionSummary) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[11] + mi := &file_mecatl_v1_harness_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1445,7 +1533,7 @@ func (x *SessionSummary) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionSummary.ProtoReflect.Descriptor instead. func (*SessionSummary) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{11} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{12} } func (x *SessionSummary) GetSessionId() string { @@ -1497,6 +1585,13 @@ func (x *SessionSummary) GetTitle() string { return "" } +func (x *SessionSummary) GetOwner() *Principal { + if x != nil { + return x.Owner + } + return nil +} + // ListSessionsResponse carries the stored-session inventory, sorted by // modified_at descending (most-recently-active first). type ListSessionsResponse struct { @@ -1509,7 +1604,7 @@ type ListSessionsResponse struct { func (x *ListSessionsResponse) Reset() { *x = ListSessionsResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[12] + mi := &file_mecatl_v1_harness_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1521,7 +1616,7 @@ func (x *ListSessionsResponse) String() string { func (*ListSessionsResponse) ProtoMessage() {} func (x *ListSessionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[12] + mi := &file_mecatl_v1_harness_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1534,7 +1629,7 @@ func (x *ListSessionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSessionsResponse.ProtoReflect.Descriptor instead. func (*ListSessionsResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{12} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{13} } func (x *ListSessionsResponse) GetSessions() []*SessionSummary { @@ -1557,7 +1652,7 @@ type SetModeRequest struct { func (x *SetModeRequest) Reset() { *x = SetModeRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[13] + mi := &file_mecatl_v1_harness_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1569,7 +1664,7 @@ func (x *SetModeRequest) String() string { func (*SetModeRequest) ProtoMessage() {} func (x *SetModeRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[13] + mi := &file_mecatl_v1_harness_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1582,7 +1677,7 @@ func (x *SetModeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetModeRequest.ProtoReflect.Descriptor instead. func (*SetModeRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{13} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{14} } func (x *SetModeRequest) GetSessionId() string { @@ -1610,7 +1705,7 @@ type SetModeResponse struct { func (x *SetModeResponse) Reset() { *x = SetModeResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[14] + mi := &file_mecatl_v1_harness_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1622,7 +1717,7 @@ func (x *SetModeResponse) String() string { func (*SetModeResponse) ProtoMessage() {} func (x *SetModeResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[14] + mi := &file_mecatl_v1_harness_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1635,7 +1730,7 @@ func (x *SetModeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetModeResponse.ProtoReflect.Descriptor instead. func (*SetModeResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{14} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{15} } func (x *SetModeResponse) GetSession() *Session { @@ -1656,7 +1751,7 @@ type CloseSessionRequest struct { func (x *CloseSessionRequest) Reset() { *x = CloseSessionRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[15] + mi := &file_mecatl_v1_harness_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1668,7 +1763,7 @@ func (x *CloseSessionRequest) String() string { func (*CloseSessionRequest) ProtoMessage() {} func (x *CloseSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[15] + mi := &file_mecatl_v1_harness_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1681,7 +1776,7 @@ func (x *CloseSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CloseSessionRequest.ProtoReflect.Descriptor instead. func (*CloseSessionRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{15} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{16} } func (x *CloseSessionRequest) GetSessionId() string { @@ -1700,7 +1795,7 @@ type CloseSessionResponse struct { func (x *CloseSessionResponse) Reset() { *x = CloseSessionResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[16] + mi := &file_mecatl_v1_harness_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1712,7 +1807,7 @@ func (x *CloseSessionResponse) String() string { func (*CloseSessionResponse) ProtoMessage() {} func (x *CloseSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[16] + mi := &file_mecatl_v1_harness_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1725,7 +1820,7 @@ func (x *CloseSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CloseSessionResponse.ProtoReflect.Descriptor instead. func (*CloseSessionResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{16} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{17} } // ForkSessionRequest names the source session to fork from. @@ -1750,7 +1845,7 @@ type ForkSessionRequest struct { func (x *ForkSessionRequest) Reset() { *x = ForkSessionRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[17] + mi := &file_mecatl_v1_harness_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1762,7 +1857,7 @@ func (x *ForkSessionRequest) String() string { func (*ForkSessionRequest) ProtoMessage() {} func (x *ForkSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[17] + mi := &file_mecatl_v1_harness_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1775,7 +1870,7 @@ func (x *ForkSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkSessionRequest.ProtoReflect.Descriptor instead. func (*ForkSessionRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{17} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{18} } func (x *ForkSessionRequest) GetSourceSessionId() string { @@ -1810,7 +1905,7 @@ type ForkSessionResponse struct { func (x *ForkSessionResponse) Reset() { *x = ForkSessionResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[18] + mi := &file_mecatl_v1_harness_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1822,7 +1917,7 @@ func (x *ForkSessionResponse) String() string { func (*ForkSessionResponse) ProtoMessage() {} func (x *ForkSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[18] + mi := &file_mecatl_v1_harness_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1835,7 +1930,7 @@ func (x *ForkSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ForkSessionResponse.ProtoReflect.Descriptor instead. func (*ForkSessionResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{18} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{19} } func (x *ForkSessionResponse) GetSessionId() string { @@ -1890,7 +1985,7 @@ type Session struct { func (x *Session) Reset() { *x = Session{} - mi := &file_mecatl_v1_harness_proto_msgTypes[19] + mi := &file_mecatl_v1_harness_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1902,7 +1997,7 @@ func (x *Session) String() string { func (*Session) ProtoMessage() {} func (x *Session) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[19] + mi := &file_mecatl_v1_harness_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1915,7 +2010,7 @@ func (x *Session) ProtoReflect() protoreflect.Message { // Deprecated: Use Session.ProtoReflect.Descriptor instead. func (*Session) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{19} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{20} } func (x *Session) GetSessionId() string { @@ -2013,7 +2108,7 @@ type ConverseRequest struct { func (x *ConverseRequest) Reset() { *x = ConverseRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[20] + mi := &file_mecatl_v1_harness_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2025,7 +2120,7 @@ func (x *ConverseRequest) String() string { func (*ConverseRequest) ProtoMessage() {} func (x *ConverseRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[20] + mi := &file_mecatl_v1_harness_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2038,7 +2133,7 @@ func (x *ConverseRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConverseRequest.ProtoReflect.Descriptor instead. func (*ConverseRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{20} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{21} } func (x *ConverseRequest) GetKind() isConverseRequest_Kind { @@ -2129,7 +2224,7 @@ type ConverseResponse struct { func (x *ConverseResponse) Reset() { *x = ConverseResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[21] + mi := &file_mecatl_v1_harness_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2141,7 +2236,7 @@ func (x *ConverseResponse) String() string { func (*ConverseResponse) ProtoMessage() {} func (x *ConverseResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[21] + mi := &file_mecatl_v1_harness_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2154,7 +2249,7 @@ func (x *ConverseResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ConverseResponse.ProtoReflect.Descriptor instead. func (*ConverseResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{21} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{22} } func (x *ConverseResponse) GetEvent() *Event { @@ -2185,7 +2280,7 @@ type Content struct { func (x *Content) Reset() { *x = Content{} - mi := &file_mecatl_v1_harness_proto_msgTypes[22] + mi := &file_mecatl_v1_harness_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2197,7 +2292,7 @@ func (x *Content) String() string { func (*Content) ProtoMessage() {} func (x *Content) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[22] + mi := &file_mecatl_v1_harness_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2210,7 +2305,7 @@ func (x *Content) ProtoReflect() protoreflect.Message { // Deprecated: Use Content.ProtoReflect.Descriptor instead. func (*Content) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{22} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{23} } func (x *Content) GetKind() Content_Kind { @@ -2276,7 +2371,7 @@ type ContentBlock struct { func (x *ContentBlock) Reset() { *x = ContentBlock{} - mi := &file_mecatl_v1_harness_proto_msgTypes[23] + mi := &file_mecatl_v1_harness_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2288,7 +2383,7 @@ func (x *ContentBlock) String() string { func (*ContentBlock) ProtoMessage() {} func (x *ContentBlock) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[23] + mi := &file_mecatl_v1_harness_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2301,7 +2396,7 @@ func (x *ContentBlock) ProtoReflect() protoreflect.Message { // Deprecated: Use ContentBlock.ProtoReflect.Descriptor instead. func (*ContentBlock) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{23} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{24} } func (x *ContentBlock) GetKind() ContentBlock_Kind { @@ -2408,7 +2503,7 @@ type Prompt struct { func (x *Prompt) Reset() { *x = Prompt{} - mi := &file_mecatl_v1_harness_proto_msgTypes[24] + mi := &file_mecatl_v1_harness_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2420,7 +2515,7 @@ func (x *Prompt) String() string { func (*Prompt) ProtoMessage() {} func (x *Prompt) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[24] + mi := &file_mecatl_v1_harness_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2433,7 +2528,7 @@ func (x *Prompt) ProtoReflect() protoreflect.Message { // Deprecated: Use Prompt.ProtoReflect.Descriptor instead. func (*Prompt) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{24} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{25} } func (x *Prompt) GetSessionId() string { @@ -2479,7 +2574,7 @@ type ResumeApproval struct { func (x *ResumeApproval) Reset() { *x = ResumeApproval{} - mi := &file_mecatl_v1_harness_proto_msgTypes[25] + mi := &file_mecatl_v1_harness_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2491,7 +2586,7 @@ func (x *ResumeApproval) String() string { func (*ResumeApproval) ProtoMessage() {} func (x *ResumeApproval) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[25] + mi := &file_mecatl_v1_harness_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2504,7 +2599,7 @@ func (x *ResumeApproval) ProtoReflect() protoreflect.Message { // Deprecated: Use ResumeApproval.ProtoReflect.Descriptor instead. func (*ResumeApproval) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{25} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{26} } func (x *ResumeApproval) GetAskId() string { @@ -2538,7 +2633,7 @@ type Cancel struct { func (x *Cancel) Reset() { *x = Cancel{} - mi := &file_mecatl_v1_harness_proto_msgTypes[26] + mi := &file_mecatl_v1_harness_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2550,7 +2645,7 @@ func (x *Cancel) String() string { func (*Cancel) ProtoMessage() {} func (x *Cancel) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[26] + mi := &file_mecatl_v1_harness_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2563,7 +2658,7 @@ func (x *Cancel) ProtoReflect() protoreflect.Message { // Deprecated: Use Cancel.ProtoReflect.Descriptor instead. func (*Cancel) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{26} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{27} } // CancelChild cancels ONE child of the in-flight run, addressed by its child @@ -2585,7 +2680,7 @@ type CancelChild struct { func (x *CancelChild) Reset() { *x = CancelChild{} - mi := &file_mecatl_v1_harness_proto_msgTypes[27] + mi := &file_mecatl_v1_harness_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2597,7 +2692,7 @@ func (x *CancelChild) String() string { func (*CancelChild) ProtoMessage() {} func (x *CancelChild) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[27] + mi := &file_mecatl_v1_harness_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2610,7 +2705,7 @@ func (x *CancelChild) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelChild.ProtoReflect.Descriptor instead. func (*CancelChild) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{27} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{28} } func (x *CancelChild) GetChildId() string { @@ -2701,7 +2796,7 @@ type Event struct { func (x *Event) Reset() { *x = Event{} - mi := &file_mecatl_v1_harness_proto_msgTypes[28] + mi := &file_mecatl_v1_harness_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2713,7 +2808,7 @@ func (x *Event) String() string { func (*Event) ProtoMessage() {} func (x *Event) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[28] + mi := &file_mecatl_v1_harness_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2726,7 +2821,7 @@ func (x *Event) ProtoReflect() protoreflect.Message { // Deprecated: Use Event.ProtoReflect.Descriptor instead. func (*Event) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{28} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{29} } func (x *Event) GetType() string { @@ -2883,7 +2978,7 @@ type Approval struct { func (x *Approval) Reset() { *x = Approval{} - mi := &file_mecatl_v1_harness_proto_msgTypes[29] + mi := &file_mecatl_v1_harness_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2895,7 +2990,7 @@ func (x *Approval) String() string { func (*Approval) ProtoMessage() {} func (x *Approval) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[29] + mi := &file_mecatl_v1_harness_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2908,7 +3003,7 @@ func (x *Approval) ProtoReflect() protoreflect.Message { // Deprecated: Use Approval.ProtoReflect.Descriptor instead. func (*Approval) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{29} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{30} } func (x *Approval) GetAskId() string { @@ -2964,7 +3059,7 @@ type UserPrompt struct { func (x *UserPrompt) Reset() { *x = UserPrompt{} - mi := &file_mecatl_v1_harness_proto_msgTypes[30] + mi := &file_mecatl_v1_harness_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2976,7 +3071,7 @@ func (x *UserPrompt) String() string { func (*UserPrompt) ProtoMessage() {} func (x *UserPrompt) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[30] + mi := &file_mecatl_v1_harness_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2989,7 +3084,7 @@ func (x *UserPrompt) ProtoReflect() protoreflect.Message { // Deprecated: Use UserPrompt.ProtoReflect.Descriptor instead. func (*UserPrompt) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{30} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{31} } func (x *UserPrompt) GetText() string { @@ -3023,7 +3118,7 @@ type CompactionArchive struct { func (x *CompactionArchive) Reset() { *x = CompactionArchive{} - mi := &file_mecatl_v1_harness_proto_msgTypes[31] + mi := &file_mecatl_v1_harness_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3035,7 +3130,7 @@ func (x *CompactionArchive) String() string { func (*CompactionArchive) ProtoMessage() {} func (x *CompactionArchive) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[31] + mi := &file_mecatl_v1_harness_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3048,7 +3143,7 @@ func (x *CompactionArchive) ProtoReflect() protoreflect.Message { // Deprecated: Use CompactionArchive.ProtoReflect.Descriptor instead. func (*CompactionArchive) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{31} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{32} } func (x *CompactionArchive) GetReplaced() []*ConversationMessage { @@ -3093,7 +3188,7 @@ type ConversationMessage struct { func (x *ConversationMessage) Reset() { *x = ConversationMessage{} - mi := &file_mecatl_v1_harness_proto_msgTypes[32] + mi := &file_mecatl_v1_harness_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3105,7 +3200,7 @@ func (x *ConversationMessage) String() string { func (*ConversationMessage) ProtoMessage() {} func (x *ConversationMessage) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[32] + mi := &file_mecatl_v1_harness_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3118,7 +3213,7 @@ func (x *ConversationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ConversationMessage.ProtoReflect.Descriptor instead. func (*ConversationMessage) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{32} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{33} } func (x *ConversationMessage) GetRole() string { @@ -3213,7 +3308,7 @@ type SchedulePayload struct { func (x *SchedulePayload) Reset() { *x = SchedulePayload{} - mi := &file_mecatl_v1_harness_proto_msgTypes[33] + mi := &file_mecatl_v1_harness_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3225,7 +3320,7 @@ func (x *SchedulePayload) String() string { func (*SchedulePayload) ProtoMessage() {} func (x *SchedulePayload) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[33] + mi := &file_mecatl_v1_harness_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3238,7 +3333,7 @@ func (x *SchedulePayload) ProtoReflect() protoreflect.Message { // Deprecated: Use SchedulePayload.ProtoReflect.Descriptor instead. func (*SchedulePayload) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{33} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{34} } func (x *SchedulePayload) GetScheduleName() string { @@ -3304,7 +3399,7 @@ type Hook struct { func (x *Hook) Reset() { *x = Hook{} - mi := &file_mecatl_v1_harness_proto_msgTypes[34] + mi := &file_mecatl_v1_harness_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3316,7 +3411,7 @@ func (x *Hook) String() string { func (*Hook) ProtoMessage() {} func (x *Hook) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[34] + mi := &file_mecatl_v1_harness_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3329,7 +3424,7 @@ func (x *Hook) ProtoReflect() protoreflect.Message { // Deprecated: Use Hook.ProtoReflect.Descriptor instead. func (*Hook) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{34} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{35} } func (x *Hook) GetPhase() string { @@ -3454,7 +3549,7 @@ type Subagent struct { func (x *Subagent) Reset() { *x = Subagent{} - mi := &file_mecatl_v1_harness_proto_msgTypes[35] + mi := &file_mecatl_v1_harness_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3466,7 +3561,7 @@ func (x *Subagent) String() string { func (*Subagent) ProtoMessage() {} func (x *Subagent) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[35] + mi := &file_mecatl_v1_harness_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3479,7 +3574,7 @@ func (x *Subagent) ProtoReflect() protoreflect.Message { // Deprecated: Use Subagent.ProtoReflect.Descriptor instead. func (*Subagent) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{35} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{36} } func (x *Subagent) GetParentCallId() string { @@ -3657,7 +3752,7 @@ type TeamMemberSpec struct { func (x *TeamMemberSpec) Reset() { *x = TeamMemberSpec{} - mi := &file_mecatl_v1_harness_proto_msgTypes[36] + mi := &file_mecatl_v1_harness_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3669,7 +3764,7 @@ func (x *TeamMemberSpec) String() string { func (*TeamMemberSpec) ProtoMessage() {} func (x *TeamMemberSpec) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[36] + mi := &file_mecatl_v1_harness_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3682,7 +3777,7 @@ func (x *TeamMemberSpec) ProtoReflect() protoreflect.Message { // Deprecated: Use TeamMemberSpec.ProtoReflect.Descriptor instead. func (*TeamMemberSpec) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{36} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{37} } func (x *TeamMemberSpec) GetName() string { @@ -3833,7 +3928,7 @@ type Team struct { func (x *Team) Reset() { *x = Team{} - mi := &file_mecatl_v1_harness_proto_msgTypes[37] + mi := &file_mecatl_v1_harness_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3845,7 +3940,7 @@ func (x *Team) String() string { func (*Team) ProtoMessage() {} func (x *Team) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[37] + mi := &file_mecatl_v1_harness_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3858,7 +3953,7 @@ func (x *Team) ProtoReflect() protoreflect.Message { // Deprecated: Use Team.ProtoReflect.Descriptor instead. func (*Team) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{37} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{38} } func (x *Team) GetParentCallId() string { @@ -4119,7 +4214,7 @@ type Parallel struct { func (x *Parallel) Reset() { *x = Parallel{} - mi := &file_mecatl_v1_harness_proto_msgTypes[38] + mi := &file_mecatl_v1_harness_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4131,7 +4226,7 @@ func (x *Parallel) String() string { func (*Parallel) ProtoMessage() {} func (x *Parallel) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[38] + mi := &file_mecatl_v1_harness_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4144,7 +4239,7 @@ func (x *Parallel) ProtoReflect() protoreflect.Message { // Deprecated: Use Parallel.ProtoReflect.Descriptor instead. func (*Parallel) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{38} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{39} } func (x *Parallel) GetParentCallId() string { @@ -4338,7 +4433,7 @@ type ToolCall struct { func (x *ToolCall) Reset() { *x = ToolCall{} - mi := &file_mecatl_v1_harness_proto_msgTypes[39] + mi := &file_mecatl_v1_harness_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4350,7 +4445,7 @@ func (x *ToolCall) String() string { func (*ToolCall) ProtoMessage() {} func (x *ToolCall) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[39] + mi := &file_mecatl_v1_harness_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4363,7 +4458,7 @@ func (x *ToolCall) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolCall.ProtoReflect.Descriptor instead. func (*ToolCall) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{39} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{40} } func (x *ToolCall) GetId() string { @@ -4412,7 +4507,7 @@ type ToolResult struct { func (x *ToolResult) Reset() { *x = ToolResult{} - mi := &file_mecatl_v1_harness_proto_msgTypes[40] + mi := &file_mecatl_v1_harness_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4424,7 +4519,7 @@ func (x *ToolResult) String() string { func (*ToolResult) ProtoMessage() {} func (x *ToolResult) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[40] + mi := &file_mecatl_v1_harness_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4437,7 +4532,7 @@ func (x *ToolResult) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolResult.ProtoReflect.Descriptor instead. func (*ToolResult) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{40} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{41} } func (x *ToolResult) GetCallId() string { @@ -4494,7 +4589,7 @@ type PermissionAsk struct { func (x *PermissionAsk) Reset() { *x = PermissionAsk{} - mi := &file_mecatl_v1_harness_proto_msgTypes[41] + mi := &file_mecatl_v1_harness_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4506,7 +4601,7 @@ func (x *PermissionAsk) String() string { func (*PermissionAsk) ProtoMessage() {} func (x *PermissionAsk) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[41] + mi := &file_mecatl_v1_harness_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4519,7 +4614,7 @@ func (x *PermissionAsk) ProtoReflect() protoreflect.Message { // Deprecated: Use PermissionAsk.ProtoReflect.Descriptor instead. func (*PermissionAsk) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{41} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{42} } func (x *PermissionAsk) GetAskId() string { @@ -4572,7 +4667,7 @@ type Result struct { func (x *Result) Reset() { *x = Result{} - mi := &file_mecatl_v1_harness_proto_msgTypes[42] + mi := &file_mecatl_v1_harness_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4584,7 +4679,7 @@ func (x *Result) String() string { func (*Result) ProtoMessage() {} func (x *Result) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[42] + mi := &file_mecatl_v1_harness_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4597,7 +4692,7 @@ func (x *Result) ProtoReflect() protoreflect.Message { // Deprecated: Use Result.ProtoReflect.Descriptor instead. func (*Result) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{42} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{43} } func (x *Result) GetStop() string { @@ -4652,7 +4747,7 @@ type TurnEnd struct { func (x *TurnEnd) Reset() { *x = TurnEnd{} - mi := &file_mecatl_v1_harness_proto_msgTypes[43] + mi := &file_mecatl_v1_harness_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4664,7 +4759,7 @@ func (x *TurnEnd) String() string { func (*TurnEnd) ProtoMessage() {} func (x *TurnEnd) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[43] + mi := &file_mecatl_v1_harness_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4677,7 +4772,7 @@ func (x *TurnEnd) ProtoReflect() protoreflect.Message { // Deprecated: Use TurnEnd.ProtoReflect.Descriptor instead. func (*TurnEnd) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{43} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{44} } func (x *TurnEnd) GetUsage() *Usage { @@ -4716,7 +4811,7 @@ type Usage struct { func (x *Usage) Reset() { *x = Usage{} - mi := &file_mecatl_v1_harness_proto_msgTypes[44] + mi := &file_mecatl_v1_harness_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4728,7 +4823,7 @@ func (x *Usage) String() string { func (*Usage) ProtoMessage() {} func (x *Usage) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[44] + mi := &file_mecatl_v1_harness_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4741,7 +4836,7 @@ func (x *Usage) ProtoReflect() protoreflect.Message { // Deprecated: Use Usage.ProtoReflect.Descriptor instead. func (*Usage) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{44} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{45} } func (x *Usage) GetInputTokens() int64 { @@ -4805,7 +4900,7 @@ type McpResource struct { func (x *McpResource) Reset() { *x = McpResource{} - mi := &file_mecatl_v1_harness_proto_msgTypes[45] + mi := &file_mecatl_v1_harness_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4817,7 +4912,7 @@ func (x *McpResource) String() string { func (*McpResource) ProtoMessage() {} func (x *McpResource) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[45] + mi := &file_mecatl_v1_harness_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4830,7 +4925,7 @@ func (x *McpResource) ProtoReflect() protoreflect.Message { // Deprecated: Use McpResource.ProtoReflect.Descriptor instead. func (*McpResource) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{45} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{46} } func (x *McpResource) GetServer() string { @@ -4901,7 +4996,7 @@ type ListMcpResourcesRequest struct { func (x *ListMcpResourcesRequest) Reset() { *x = ListMcpResourcesRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[46] + mi := &file_mecatl_v1_harness_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4913,7 +5008,7 @@ func (x *ListMcpResourcesRequest) String() string { func (*ListMcpResourcesRequest) ProtoMessage() {} func (x *ListMcpResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[46] + mi := &file_mecatl_v1_harness_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4926,7 +5021,7 @@ func (x *ListMcpResourcesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMcpResourcesRequest.ProtoReflect.Descriptor instead. func (*ListMcpResourcesRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{46} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{47} } func (x *ListMcpResourcesRequest) GetServer() string { @@ -4947,7 +5042,7 @@ type ListMcpResourcesResponse struct { func (x *ListMcpResourcesResponse) Reset() { *x = ListMcpResourcesResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[47] + mi := &file_mecatl_v1_harness_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4959,7 +5054,7 @@ func (x *ListMcpResourcesResponse) String() string { func (*ListMcpResourcesResponse) ProtoMessage() {} func (x *ListMcpResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[47] + mi := &file_mecatl_v1_harness_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4972,7 +5067,7 @@ func (x *ListMcpResourcesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMcpResourcesResponse.ProtoReflect.Descriptor instead. func (*ListMcpResourcesResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{47} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{48} } func (x *ListMcpResourcesResponse) GetResources() []*McpResource { @@ -5000,7 +5095,7 @@ type McpResourceContents struct { func (x *McpResourceContents) Reset() { *x = McpResourceContents{} - mi := &file_mecatl_v1_harness_proto_msgTypes[48] + mi := &file_mecatl_v1_harness_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5012,7 +5107,7 @@ func (x *McpResourceContents) String() string { func (*McpResourceContents) ProtoMessage() {} func (x *McpResourceContents) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[48] + mi := &file_mecatl_v1_harness_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5025,7 +5120,7 @@ func (x *McpResourceContents) ProtoReflect() protoreflect.Message { // Deprecated: Use McpResourceContents.ProtoReflect.Descriptor instead. func (*McpResourceContents) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{48} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{49} } func (x *McpResourceContents) GetUri() string { @@ -5069,7 +5164,7 @@ type ReadMcpResourceRequest struct { func (x *ReadMcpResourceRequest) Reset() { *x = ReadMcpResourceRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[49] + mi := &file_mecatl_v1_harness_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5081,7 +5176,7 @@ func (x *ReadMcpResourceRequest) String() string { func (*ReadMcpResourceRequest) ProtoMessage() {} func (x *ReadMcpResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[49] + mi := &file_mecatl_v1_harness_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5094,7 +5189,7 @@ func (x *ReadMcpResourceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadMcpResourceRequest.ProtoReflect.Descriptor instead. func (*ReadMcpResourceRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{49} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{50} } func (x *ReadMcpResourceRequest) GetServer() string { @@ -5122,7 +5217,7 @@ type ReadMcpResourceResponse struct { func (x *ReadMcpResourceResponse) Reset() { *x = ReadMcpResourceResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[50] + mi := &file_mecatl_v1_harness_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5134,7 +5229,7 @@ func (x *ReadMcpResourceResponse) String() string { func (*ReadMcpResourceResponse) ProtoMessage() {} func (x *ReadMcpResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[50] + mi := &file_mecatl_v1_harness_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5147,7 +5242,7 @@ func (x *ReadMcpResourceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadMcpResourceResponse.ProtoReflect.Descriptor instead. func (*ReadMcpResourceResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{50} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{51} } func (x *ReadMcpResourceResponse) GetContents() []*McpResourceContents { @@ -5175,7 +5270,7 @@ type McpPromptArgument struct { func (x *McpPromptArgument) Reset() { *x = McpPromptArgument{} - mi := &file_mecatl_v1_harness_proto_msgTypes[51] + mi := &file_mecatl_v1_harness_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5187,7 +5282,7 @@ func (x *McpPromptArgument) String() string { func (*McpPromptArgument) ProtoMessage() {} func (x *McpPromptArgument) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[51] + mi := &file_mecatl_v1_harness_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5200,7 +5295,7 @@ func (x *McpPromptArgument) ProtoReflect() protoreflect.Message { // Deprecated: Use McpPromptArgument.ProtoReflect.Descriptor instead. func (*McpPromptArgument) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{51} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{52} } func (x *McpPromptArgument) GetName() string { @@ -5251,7 +5346,7 @@ type McpPrompt struct { func (x *McpPrompt) Reset() { *x = McpPrompt{} - mi := &file_mecatl_v1_harness_proto_msgTypes[52] + mi := &file_mecatl_v1_harness_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5263,7 +5358,7 @@ func (x *McpPrompt) String() string { func (*McpPrompt) ProtoMessage() {} func (x *McpPrompt) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[52] + mi := &file_mecatl_v1_harness_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5276,7 +5371,7 @@ func (x *McpPrompt) ProtoReflect() protoreflect.Message { // Deprecated: Use McpPrompt.ProtoReflect.Descriptor instead. func (*McpPrompt) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{52} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{53} } func (x *McpPrompt) GetServer() string { @@ -5326,7 +5421,7 @@ type ListMcpPromptsRequest struct { func (x *ListMcpPromptsRequest) Reset() { *x = ListMcpPromptsRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[53] + mi := &file_mecatl_v1_harness_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5338,7 +5433,7 @@ func (x *ListMcpPromptsRequest) String() string { func (*ListMcpPromptsRequest) ProtoMessage() {} func (x *ListMcpPromptsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[53] + mi := &file_mecatl_v1_harness_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5351,7 +5446,7 @@ func (x *ListMcpPromptsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMcpPromptsRequest.ProtoReflect.Descriptor instead. func (*ListMcpPromptsRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{53} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{54} } func (x *ListMcpPromptsRequest) GetServer() string { @@ -5372,7 +5467,7 @@ type ListMcpPromptsResponse struct { func (x *ListMcpPromptsResponse) Reset() { *x = ListMcpPromptsResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[54] + mi := &file_mecatl_v1_harness_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5384,7 +5479,7 @@ func (x *ListMcpPromptsResponse) String() string { func (*ListMcpPromptsResponse) ProtoMessage() {} func (x *ListMcpPromptsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[54] + mi := &file_mecatl_v1_harness_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5397,7 +5492,7 @@ func (x *ListMcpPromptsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMcpPromptsResponse.ProtoReflect.Descriptor instead. func (*ListMcpPromptsResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{54} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{55} } func (x *ListMcpPromptsResponse) GetPrompts() []*McpPrompt { @@ -5422,7 +5517,7 @@ type GetMcpPromptRequest struct { func (x *GetMcpPromptRequest) Reset() { *x = GetMcpPromptRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[55] + mi := &file_mecatl_v1_harness_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5434,7 +5529,7 @@ func (x *GetMcpPromptRequest) String() string { func (*GetMcpPromptRequest) ProtoMessage() {} func (x *GetMcpPromptRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[55] + mi := &file_mecatl_v1_harness_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5447,7 +5542,7 @@ func (x *GetMcpPromptRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMcpPromptRequest.ProtoReflect.Descriptor instead. func (*GetMcpPromptRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{55} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{56} } func (x *GetMcpPromptRequest) GetServer() string { @@ -5485,7 +5580,7 @@ type McpPromptMessage struct { func (x *McpPromptMessage) Reset() { *x = McpPromptMessage{} - mi := &file_mecatl_v1_harness_proto_msgTypes[56] + mi := &file_mecatl_v1_harness_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5497,7 +5592,7 @@ func (x *McpPromptMessage) String() string { func (*McpPromptMessage) ProtoMessage() {} func (x *McpPromptMessage) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[56] + mi := &file_mecatl_v1_harness_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5510,7 +5605,7 @@ func (x *McpPromptMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use McpPromptMessage.ProtoReflect.Descriptor instead. func (*McpPromptMessage) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{56} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{57} } func (x *McpPromptMessage) GetRole() string { @@ -5540,7 +5635,7 @@ type GetMcpPromptResponse struct { func (x *GetMcpPromptResponse) Reset() { *x = GetMcpPromptResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[57] + mi := &file_mecatl_v1_harness_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5552,7 +5647,7 @@ func (x *GetMcpPromptResponse) String() string { func (*GetMcpPromptResponse) ProtoMessage() {} func (x *GetMcpPromptResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[57] + mi := &file_mecatl_v1_harness_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5565,7 +5660,7 @@ func (x *GetMcpPromptResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMcpPromptResponse.ProtoReflect.Descriptor instead. func (*GetMcpPromptResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{57} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{58} } func (x *GetMcpPromptResponse) GetDescription() string { @@ -5600,7 +5695,7 @@ type McpServerInfo struct { func (x *McpServerInfo) Reset() { *x = McpServerInfo{} - mi := &file_mecatl_v1_harness_proto_msgTypes[58] + mi := &file_mecatl_v1_harness_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5612,7 +5707,7 @@ func (x *McpServerInfo) String() string { func (*McpServerInfo) ProtoMessage() {} func (x *McpServerInfo) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[58] + mi := &file_mecatl_v1_harness_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5625,7 +5720,7 @@ func (x *McpServerInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use McpServerInfo.ProtoReflect.Descriptor instead. func (*McpServerInfo) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{58} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{59} } func (x *McpServerInfo) GetName() string { @@ -5678,7 +5773,7 @@ type McpSource struct { func (x *McpSource) Reset() { *x = McpSource{} - mi := &file_mecatl_v1_harness_proto_msgTypes[59] + mi := &file_mecatl_v1_harness_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5690,7 +5785,7 @@ func (x *McpSource) String() string { func (*McpSource) ProtoMessage() {} func (x *McpSource) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[59] + mi := &file_mecatl_v1_harness_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5703,7 +5798,7 @@ func (x *McpSource) ProtoReflect() protoreflect.Message { // Deprecated: Use McpSource.ProtoReflect.Descriptor instead. func (*McpSource) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{59} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{60} } func (x *McpSource) GetName() string { @@ -5757,7 +5852,7 @@ type ListMcpSourcesRequest struct { func (x *ListMcpSourcesRequest) Reset() { *x = ListMcpSourcesRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[60] + mi := &file_mecatl_v1_harness_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5769,7 +5864,7 @@ func (x *ListMcpSourcesRequest) String() string { func (*ListMcpSourcesRequest) ProtoMessage() {} func (x *ListMcpSourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[60] + mi := &file_mecatl_v1_harness_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5782,7 +5877,7 @@ func (x *ListMcpSourcesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMcpSourcesRequest.ProtoReflect.Descriptor instead. func (*ListMcpSourcesRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{60} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{61} } // ListMcpSourcesResponse carries the resolved source inventory. @@ -5796,7 +5891,7 @@ type ListMcpSourcesResponse struct { func (x *ListMcpSourcesResponse) Reset() { *x = ListMcpSourcesResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[61] + mi := &file_mecatl_v1_harness_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5808,7 +5903,7 @@ func (x *ListMcpSourcesResponse) String() string { func (*ListMcpSourcesResponse) ProtoMessage() {} func (x *ListMcpSourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[61] + mi := &file_mecatl_v1_harness_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5821,7 +5916,7 @@ func (x *ListMcpSourcesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMcpSourcesResponse.ProtoReflect.Descriptor instead. func (*ListMcpSourcesResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{61} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{62} } func (x *ListMcpSourcesResponse) GetSources() []*McpSource { @@ -5841,7 +5936,7 @@ type ListToolHiveGroupsRequest struct { func (x *ListToolHiveGroupsRequest) Reset() { *x = ListToolHiveGroupsRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[62] + mi := &file_mecatl_v1_harness_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5853,7 +5948,7 @@ func (x *ListToolHiveGroupsRequest) String() string { func (*ListToolHiveGroupsRequest) ProtoMessage() {} func (x *ListToolHiveGroupsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[62] + mi := &file_mecatl_v1_harness_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5866,7 +5961,7 @@ func (x *ListToolHiveGroupsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListToolHiveGroupsRequest.ProtoReflect.Descriptor instead. func (*ListToolHiveGroupsRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{62} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{63} } // ListToolHiveGroupsResponse carries the distinct, non-empty ToolHive groups. @@ -5880,7 +5975,7 @@ type ListToolHiveGroupsResponse struct { func (x *ListToolHiveGroupsResponse) Reset() { *x = ListToolHiveGroupsResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[63] + mi := &file_mecatl_v1_harness_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5892,7 +5987,7 @@ func (x *ListToolHiveGroupsResponse) String() string { func (*ListToolHiveGroupsResponse) ProtoMessage() {} func (x *ListToolHiveGroupsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[63] + mi := &file_mecatl_v1_harness_proto_msgTypes[64] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5905,7 +6000,7 @@ func (x *ListToolHiveGroupsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListToolHiveGroupsResponse.ProtoReflect.Descriptor instead. func (*ListToolHiveGroupsResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{63} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{64} } func (x *ListToolHiveGroupsResponse) GetGroups() []string { @@ -5941,7 +6036,7 @@ type AgentInfo struct { func (x *AgentInfo) Reset() { *x = AgentInfo{} - mi := &file_mecatl_v1_harness_proto_msgTypes[64] + mi := &file_mecatl_v1_harness_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5953,7 +6048,7 @@ func (x *AgentInfo) String() string { func (*AgentInfo) ProtoMessage() {} func (x *AgentInfo) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[64] + mi := &file_mecatl_v1_harness_proto_msgTypes[65] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5966,7 +6061,7 @@ func (x *AgentInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use AgentInfo.ProtoReflect.Descriptor instead. func (*AgentInfo) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{64} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{65} } func (x *AgentInfo) GetName() string { @@ -6020,7 +6115,7 @@ type ListAgentsRequest struct { func (x *ListAgentsRequest) Reset() { *x = ListAgentsRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[65] + mi := &file_mecatl_v1_harness_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6032,7 +6127,7 @@ func (x *ListAgentsRequest) String() string { func (*ListAgentsRequest) ProtoMessage() {} func (x *ListAgentsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[65] + mi := &file_mecatl_v1_harness_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6045,7 +6140,7 @@ func (x *ListAgentsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAgentsRequest.ProtoReflect.Descriptor instead. func (*ListAgentsRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{65} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{66} } // ListAgentsResponse carries the resolved agent definitions. @@ -6059,7 +6154,7 @@ type ListAgentsResponse struct { func (x *ListAgentsResponse) Reset() { *x = ListAgentsResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[66] + mi := &file_mecatl_v1_harness_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6071,7 +6166,7 @@ func (x *ListAgentsResponse) String() string { func (*ListAgentsResponse) ProtoMessage() {} func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[66] + mi := &file_mecatl_v1_harness_proto_msgTypes[67] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6084,7 +6179,7 @@ func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAgentsResponse.ProtoReflect.Descriptor instead. func (*ListAgentsResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{66} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{67} } func (x *ListAgentsResponse) GetAgents() []*AgentInfo { @@ -6111,7 +6206,7 @@ type Command struct { func (x *Command) Reset() { *x = Command{} - mi := &file_mecatl_v1_harness_proto_msgTypes[67] + mi := &file_mecatl_v1_harness_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6123,7 +6218,7 @@ func (x *Command) String() string { func (*Command) ProtoMessage() {} func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[67] + mi := &file_mecatl_v1_harness_proto_msgTypes[68] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6136,7 +6231,7 @@ func (x *Command) ProtoReflect() protoreflect.Message { // Deprecated: Use Command.ProtoReflect.Descriptor instead. func (*Command) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{67} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{68} } func (x *Command) GetName() string { @@ -6165,7 +6260,7 @@ type ListCommandsRequest struct { func (x *ListCommandsRequest) Reset() { *x = ListCommandsRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[68] + mi := &file_mecatl_v1_harness_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6177,7 +6272,7 @@ func (x *ListCommandsRequest) String() string { func (*ListCommandsRequest) ProtoMessage() {} func (x *ListCommandsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[68] + mi := &file_mecatl_v1_harness_proto_msgTypes[69] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6190,7 +6285,7 @@ func (x *ListCommandsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCommandsRequest.ProtoReflect.Descriptor instead. func (*ListCommandsRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{68} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{69} } func (x *ListCommandsRequest) GetWorkspace() string { @@ -6211,7 +6306,7 @@ type ListCommandsResponse struct { func (x *ListCommandsResponse) Reset() { *x = ListCommandsResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[69] + mi := &file_mecatl_v1_harness_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6223,7 +6318,7 @@ func (x *ListCommandsResponse) String() string { func (*ListCommandsResponse) ProtoMessage() {} func (x *ListCommandsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[69] + mi := &file_mecatl_v1_harness_proto_msgTypes[70] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6236,7 +6331,7 @@ func (x *ListCommandsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListCommandsResponse.ProtoReflect.Descriptor instead. func (*ListCommandsResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{69} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{70} } func (x *ListCommandsResponse) GetCommands() []*Command { @@ -6266,7 +6361,7 @@ type Worktree struct { func (x *Worktree) Reset() { *x = Worktree{} - mi := &file_mecatl_v1_harness_proto_msgTypes[70] + mi := &file_mecatl_v1_harness_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6278,7 +6373,7 @@ func (x *Worktree) String() string { func (*Worktree) ProtoMessage() {} func (x *Worktree) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[70] + mi := &file_mecatl_v1_harness_proto_msgTypes[71] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6291,7 +6386,7 @@ func (x *Worktree) ProtoReflect() protoreflect.Message { // Deprecated: Use Worktree.ProtoReflect.Descriptor instead. func (*Worktree) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{70} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{71} } func (x *Worktree) GetPath() string { @@ -6334,7 +6429,7 @@ type ListWorktreesRequest struct { func (x *ListWorktreesRequest) Reset() { *x = ListWorktreesRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[71] + mi := &file_mecatl_v1_harness_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6346,7 +6441,7 @@ func (x *ListWorktreesRequest) String() string { func (*ListWorktreesRequest) ProtoMessage() {} func (x *ListWorktreesRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[71] + mi := &file_mecatl_v1_harness_proto_msgTypes[72] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6359,7 +6454,7 @@ func (x *ListWorktreesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorktreesRequest.ProtoReflect.Descriptor instead. func (*ListWorktreesRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{71} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{72} } func (x *ListWorktreesRequest) GetWorkspace() string { @@ -6381,7 +6476,7 @@ type ListWorktreesResponse struct { func (x *ListWorktreesResponse) Reset() { *x = ListWorktreesResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[72] + mi := &file_mecatl_v1_harness_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6393,7 +6488,7 @@ func (x *ListWorktreesResponse) String() string { func (*ListWorktreesResponse) ProtoMessage() {} func (x *ListWorktreesResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[72] + mi := &file_mecatl_v1_harness_proto_msgTypes[73] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6406,7 +6501,7 @@ func (x *ListWorktreesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListWorktreesResponse.ProtoReflect.Descriptor instead. func (*ListWorktreesResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{72} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{73} } func (x *ListWorktreesResponse) GetWorktrees() []*Worktree { @@ -6433,7 +6528,7 @@ type SkillInfo struct { func (x *SkillInfo) Reset() { *x = SkillInfo{} - mi := &file_mecatl_v1_harness_proto_msgTypes[73] + mi := &file_mecatl_v1_harness_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6445,7 +6540,7 @@ func (x *SkillInfo) String() string { func (*SkillInfo) ProtoMessage() {} func (x *SkillInfo) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[73] + mi := &file_mecatl_v1_harness_proto_msgTypes[74] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6458,7 +6553,7 @@ func (x *SkillInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SkillInfo.ProtoReflect.Descriptor instead. func (*SkillInfo) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{73} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{74} } func (x *SkillInfo) GetName() string { @@ -6484,7 +6579,7 @@ type ListSkillsRequest struct { func (x *ListSkillsRequest) Reset() { *x = ListSkillsRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[74] + mi := &file_mecatl_v1_harness_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6496,7 +6591,7 @@ func (x *ListSkillsRequest) String() string { func (*ListSkillsRequest) ProtoMessage() {} func (x *ListSkillsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[74] + mi := &file_mecatl_v1_harness_proto_msgTypes[75] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6509,7 +6604,7 @@ func (x *ListSkillsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSkillsRequest.ProtoReflect.Descriptor instead. func (*ListSkillsRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{74} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{75} } // ListSkillsResponse carries the resolved skills inventory. @@ -6523,7 +6618,7 @@ type ListSkillsResponse struct { func (x *ListSkillsResponse) Reset() { *x = ListSkillsResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[75] + mi := &file_mecatl_v1_harness_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6535,7 +6630,7 @@ func (x *ListSkillsResponse) String() string { func (*ListSkillsResponse) ProtoMessage() {} func (x *ListSkillsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[75] + mi := &file_mecatl_v1_harness_proto_msgTypes[76] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6548,7 +6643,7 @@ func (x *ListSkillsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListSkillsResponse.ProtoReflect.Descriptor instead. func (*ListSkillsResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{75} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{76} } func (x *ListSkillsResponse) GetSkills() []*SkillInfo { @@ -6589,7 +6684,7 @@ type SoulInfo struct { func (x *SoulInfo) Reset() { *x = SoulInfo{} - mi := &file_mecatl_v1_harness_proto_msgTypes[76] + mi := &file_mecatl_v1_harness_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6601,7 +6696,7 @@ func (x *SoulInfo) String() string { func (*SoulInfo) ProtoMessage() {} func (x *SoulInfo) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[76] + mi := &file_mecatl_v1_harness_proto_msgTypes[77] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6614,7 +6709,7 @@ func (x *SoulInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SoulInfo.ProtoReflect.Descriptor instead. func (*SoulInfo) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{76} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{77} } func (x *SoulInfo) GetContent() string { @@ -6675,7 +6770,7 @@ type GetSoulRequest struct { func (x *GetSoulRequest) Reset() { *x = GetSoulRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[77] + mi := &file_mecatl_v1_harness_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6687,7 +6782,7 @@ func (x *GetSoulRequest) String() string { func (*GetSoulRequest) ProtoMessage() {} func (x *GetSoulRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[77] + mi := &file_mecatl_v1_harness_proto_msgTypes[78] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6700,7 +6795,7 @@ func (x *GetSoulRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSoulRequest.ProtoReflect.Descriptor instead. func (*GetSoulRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{77} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{78} } // GetSoulResponse carries the resolved soul snapshot. @@ -6715,7 +6810,7 @@ type GetSoulResponse struct { func (x *GetSoulResponse) Reset() { *x = GetSoulResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[78] + mi := &file_mecatl_v1_harness_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6727,7 +6822,7 @@ func (x *GetSoulResponse) String() string { func (*GetSoulResponse) ProtoMessage() {} func (x *GetSoulResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[78] + mi := &file_mecatl_v1_harness_proto_msgTypes[79] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6740,7 +6835,7 @@ func (x *GetSoulResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSoulResponse.ProtoReflect.Descriptor instead. func (*GetSoulResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{78} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{79} } func (x *GetSoulResponse) GetSoul() *SoulInfo { @@ -6765,7 +6860,7 @@ type UserModelEntry struct { func (x *UserModelEntry) Reset() { *x = UserModelEntry{} - mi := &file_mecatl_v1_harness_proto_msgTypes[79] + mi := &file_mecatl_v1_harness_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6777,7 +6872,7 @@ func (x *UserModelEntry) String() string { func (*UserModelEntry) ProtoMessage() {} func (x *UserModelEntry) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[79] + mi := &file_mecatl_v1_harness_proto_msgTypes[80] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6790,7 +6885,7 @@ func (x *UserModelEntry) ProtoReflect() protoreflect.Message { // Deprecated: Use UserModelEntry.ProtoReflect.Descriptor instead. func (*UserModelEntry) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{79} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{80} } func (x *UserModelEntry) GetKey() string { @@ -6816,7 +6911,7 @@ type GetUserModelRequest struct { func (x *GetUserModelRequest) Reset() { *x = GetUserModelRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[80] + mi := &file_mecatl_v1_harness_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6828,7 +6923,7 @@ func (x *GetUserModelRequest) String() string { func (*GetUserModelRequest) ProtoMessage() {} func (x *GetUserModelRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[80] + mi := &file_mecatl_v1_harness_proto_msgTypes[81] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6841,7 +6936,7 @@ func (x *GetUserModelRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserModelRequest.ProtoReflect.Descriptor instead. func (*GetUserModelRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{80} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{81} } // GetUserModelResponse carries the current user-model entries plus aggregate @@ -6862,7 +6957,7 @@ type GetUserModelResponse struct { func (x *GetUserModelResponse) Reset() { *x = GetUserModelResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[81] + mi := &file_mecatl_v1_harness_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6874,7 +6969,7 @@ func (x *GetUserModelResponse) String() string { func (*GetUserModelResponse) ProtoMessage() {} func (x *GetUserModelResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[81] + mi := &file_mecatl_v1_harness_proto_msgTypes[82] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6887,7 +6982,7 @@ func (x *GetUserModelResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserModelResponse.ProtoReflect.Descriptor instead. func (*GetUserModelResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{81} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{82} } func (x *GetUserModelResponse) GetEntries() []*UserModelEntry { @@ -6937,7 +7032,7 @@ type ModelInfo struct { func (x *ModelInfo) Reset() { *x = ModelInfo{} - mi := &file_mecatl_v1_harness_proto_msgTypes[82] + mi := &file_mecatl_v1_harness_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6949,7 +7044,7 @@ func (x *ModelInfo) String() string { func (*ModelInfo) ProtoMessage() {} func (x *ModelInfo) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[82] + mi := &file_mecatl_v1_harness_proto_msgTypes[83] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6962,7 +7057,7 @@ func (x *ModelInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ModelInfo.ProtoReflect.Descriptor instead. func (*ModelInfo) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{82} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{83} } func (x *ModelInfo) GetId() string { @@ -7016,7 +7111,7 @@ type ListModelsRequest struct { func (x *ListModelsRequest) Reset() { *x = ListModelsRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[83] + mi := &file_mecatl_v1_harness_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7028,7 +7123,7 @@ func (x *ListModelsRequest) String() string { func (*ListModelsRequest) ProtoMessage() {} func (x *ListModelsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[83] + mi := &file_mecatl_v1_harness_proto_msgTypes[84] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7041,7 +7136,7 @@ func (x *ListModelsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListModelsRequest.ProtoReflect.Descriptor instead. func (*ListModelsRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{83} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{84} } // ProviderStatus is one provider's last live-listing outcome, for client @@ -7088,7 +7183,7 @@ type ProviderStatus struct { func (x *ProviderStatus) Reset() { *x = ProviderStatus{} - mi := &file_mecatl_v1_harness_proto_msgTypes[84] + mi := &file_mecatl_v1_harness_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7100,7 +7195,7 @@ func (x *ProviderStatus) String() string { func (*ProviderStatus) ProtoMessage() {} func (x *ProviderStatus) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[84] + mi := &file_mecatl_v1_harness_proto_msgTypes[85] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7113,7 +7208,7 @@ func (x *ProviderStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use ProviderStatus.ProtoReflect.Descriptor instead. func (*ProviderStatus) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{84} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{85} } func (x *ProviderStatus) GetProviderId() string { @@ -7177,7 +7272,7 @@ type ListModelsResponse struct { func (x *ListModelsResponse) Reset() { *x = ListModelsResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[85] + mi := &file_mecatl_v1_harness_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7189,7 +7284,7 @@ func (x *ListModelsResponse) String() string { func (*ListModelsResponse) ProtoMessage() {} func (x *ListModelsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[85] + mi := &file_mecatl_v1_harness_proto_msgTypes[86] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7202,7 +7297,7 @@ func (x *ListModelsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListModelsResponse.ProtoReflect.Descriptor instead. func (*ListModelsResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{85} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{86} } func (x *ListModelsResponse) GetModels() []*ModelInfo { @@ -7254,7 +7349,7 @@ type CreateTeamRequest struct { func (x *CreateTeamRequest) Reset() { *x = CreateTeamRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[86] + mi := &file_mecatl_v1_harness_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7266,7 +7361,7 @@ func (x *CreateTeamRequest) String() string { func (*CreateTeamRequest) ProtoMessage() {} func (x *CreateTeamRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[86] + mi := &file_mecatl_v1_harness_proto_msgTypes[87] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7279,7 +7374,7 @@ func (x *CreateTeamRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateTeamRequest.ProtoReflect.Descriptor instead. func (*CreateTeamRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{86} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{87} } func (x *CreateTeamRequest) GetWorkspace() string { @@ -7331,7 +7426,7 @@ type CreateTeamResponse struct { func (x *CreateTeamResponse) Reset() { *x = CreateTeamResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[87] + mi := &file_mecatl_v1_harness_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7343,7 +7438,7 @@ func (x *CreateTeamResponse) String() string { func (*CreateTeamResponse) ProtoMessage() {} func (x *CreateTeamResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[87] + mi := &file_mecatl_v1_harness_proto_msgTypes[88] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7356,7 +7451,7 @@ func (x *CreateTeamResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateTeamResponse.ProtoReflect.Descriptor instead. func (*CreateTeamResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{87} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{88} } func (x *CreateTeamResponse) GetTeamId() string { @@ -7393,7 +7488,7 @@ type TeammateSpec struct { func (x *TeammateSpec) Reset() { *x = TeammateSpec{} - mi := &file_mecatl_v1_harness_proto_msgTypes[88] + mi := &file_mecatl_v1_harness_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7405,7 +7500,7 @@ func (x *TeammateSpec) String() string { func (*TeammateSpec) ProtoMessage() {} func (x *TeammateSpec) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[88] + mi := &file_mecatl_v1_harness_proto_msgTypes[89] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7418,7 +7513,7 @@ func (x *TeammateSpec) ProtoReflect() protoreflect.Message { // Deprecated: Use TeammateSpec.ProtoReflect.Descriptor instead. func (*TeammateSpec) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{88} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{89} } func (x *TeammateSpec) GetName() string { @@ -7477,7 +7572,7 @@ type SpawnTeammateRequest struct { func (x *SpawnTeammateRequest) Reset() { *x = SpawnTeammateRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[89] + mi := &file_mecatl_v1_harness_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7489,7 +7584,7 @@ func (x *SpawnTeammateRequest) String() string { func (*SpawnTeammateRequest) ProtoMessage() {} func (x *SpawnTeammateRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[89] + mi := &file_mecatl_v1_harness_proto_msgTypes[90] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7502,7 +7597,7 @@ func (x *SpawnTeammateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SpawnTeammateRequest.ProtoReflect.Descriptor instead. func (*SpawnTeammateRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{89} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{90} } func (x *SpawnTeammateRequest) GetTeamId() string { @@ -7558,7 +7653,7 @@ type SpawnTeammateResponse struct { func (x *SpawnTeammateResponse) Reset() { *x = SpawnTeammateResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[90] + mi := &file_mecatl_v1_harness_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7570,7 +7665,7 @@ func (x *SpawnTeammateResponse) String() string { func (*SpawnTeammateResponse) ProtoMessage() {} func (x *SpawnTeammateResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[90] + mi := &file_mecatl_v1_harness_proto_msgTypes[91] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7583,7 +7678,7 @@ func (x *SpawnTeammateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SpawnTeammateResponse.ProtoReflect.Descriptor instead. func (*SpawnTeammateResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{90} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{91} } func (x *SpawnTeammateResponse) GetMember() *TeamMember { @@ -7610,7 +7705,7 @@ type SendTeammateMessageRequest struct { func (x *SendTeammateMessageRequest) Reset() { *x = SendTeammateMessageRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[91] + mi := &file_mecatl_v1_harness_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7622,7 +7717,7 @@ func (x *SendTeammateMessageRequest) String() string { func (*SendTeammateMessageRequest) ProtoMessage() {} func (x *SendTeammateMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[91] + mi := &file_mecatl_v1_harness_proto_msgTypes[92] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7635,7 +7730,7 @@ func (x *SendTeammateMessageRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SendTeammateMessageRequest.ProtoReflect.Descriptor instead. func (*SendTeammateMessageRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{91} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{92} } func (x *SendTeammateMessageRequest) GetTeamId() string { @@ -7675,7 +7770,7 @@ type SendTeammateMessageResponse struct { func (x *SendTeammateMessageResponse) Reset() { *x = SendTeammateMessageResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[92] + mi := &file_mecatl_v1_harness_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7687,7 +7782,7 @@ func (x *SendTeammateMessageResponse) String() string { func (*SendTeammateMessageResponse) ProtoMessage() {} func (x *SendTeammateMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[92] + mi := &file_mecatl_v1_harness_proto_msgTypes[93] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7700,7 +7795,7 @@ func (x *SendTeammateMessageResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SendTeammateMessageResponse.ProtoReflect.Descriptor instead. func (*SendTeammateMessageResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{92} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{93} } // CancelTeammateRequest cancels one member of a running team. @@ -7716,7 +7811,7 @@ type CancelTeammateRequest struct { func (x *CancelTeammateRequest) Reset() { *x = CancelTeammateRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[93] + mi := &file_mecatl_v1_harness_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7728,7 +7823,7 @@ func (x *CancelTeammateRequest) String() string { func (*CancelTeammateRequest) ProtoMessage() {} func (x *CancelTeammateRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[93] + mi := &file_mecatl_v1_harness_proto_msgTypes[94] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7741,7 +7836,7 @@ func (x *CancelTeammateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelTeammateRequest.ProtoReflect.Descriptor instead. func (*CancelTeammateRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{93} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{94} } func (x *CancelTeammateRequest) GetTeamId() string { @@ -7767,7 +7862,7 @@ type CancelTeammateResponse struct { func (x *CancelTeammateResponse) Reset() { *x = CancelTeammateResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[94] + mi := &file_mecatl_v1_harness_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7779,7 +7874,7 @@ func (x *CancelTeammateResponse) String() string { func (*CancelTeammateResponse) ProtoMessage() {} func (x *CancelTeammateResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[94] + mi := &file_mecatl_v1_harness_proto_msgTypes[95] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7792,7 +7887,7 @@ func (x *CancelTeammateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelTeammateResponse.ProtoReflect.Descriptor instead. func (*CancelTeammateResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{94} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{95} } // RunTeamRequest drives a team to quiescence, streaming member events. @@ -7806,7 +7901,7 @@ type RunTeamRequest struct { func (x *RunTeamRequest) Reset() { *x = RunTeamRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[95] + mi := &file_mecatl_v1_harness_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7818,7 +7913,7 @@ func (x *RunTeamRequest) String() string { func (*RunTeamRequest) ProtoMessage() {} func (x *RunTeamRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[95] + mi := &file_mecatl_v1_harness_proto_msgTypes[96] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7831,7 +7926,7 @@ func (x *RunTeamRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunTeamRequest.ProtoReflect.Descriptor instead. func (*RunTeamRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{95} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{96} } func (x *RunTeamRequest) GetTeamId() string { @@ -7859,7 +7954,7 @@ type TeamEvent struct { func (x *TeamEvent) Reset() { *x = TeamEvent{} - mi := &file_mecatl_v1_harness_proto_msgTypes[96] + mi := &file_mecatl_v1_harness_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7871,7 +7966,7 @@ func (x *TeamEvent) String() string { func (*TeamEvent) ProtoMessage() {} func (x *TeamEvent) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[96] + mi := &file_mecatl_v1_harness_proto_msgTypes[97] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7884,7 +7979,7 @@ func (x *TeamEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use TeamEvent.ProtoReflect.Descriptor instead. func (*TeamEvent) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{96} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{97} } func (x *TeamEvent) GetMember() string { @@ -7944,7 +8039,7 @@ type TeamOutcome struct { func (x *TeamOutcome) Reset() { *x = TeamOutcome{} - mi := &file_mecatl_v1_harness_proto_msgTypes[97] + mi := &file_mecatl_v1_harness_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7956,7 +8051,7 @@ func (x *TeamOutcome) String() string { func (*TeamOutcome) ProtoMessage() {} func (x *TeamOutcome) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[97] + mi := &file_mecatl_v1_harness_proto_msgTypes[98] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7969,7 +8064,7 @@ func (x *TeamOutcome) ProtoReflect() protoreflect.Message { // Deprecated: Use TeamOutcome.ProtoReflect.Descriptor instead. func (*TeamOutcome) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{97} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{98} } func (x *TeamOutcome) GetRounds() int32 { @@ -8032,7 +8127,7 @@ type ListTeamRequest struct { func (x *ListTeamRequest) Reset() { *x = ListTeamRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[98] + mi := &file_mecatl_v1_harness_proto_msgTypes[99] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8044,7 +8139,7 @@ func (x *ListTeamRequest) String() string { func (*ListTeamRequest) ProtoMessage() {} func (x *ListTeamRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[98] + mi := &file_mecatl_v1_harness_proto_msgTypes[99] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8057,7 +8152,7 @@ func (x *ListTeamRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListTeamRequest.ProtoReflect.Descriptor instead. func (*ListTeamRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{98} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{99} } func (x *ListTeamRequest) GetTeamId() string { @@ -8082,7 +8177,7 @@ type ListTeamResponse struct { func (x *ListTeamResponse) Reset() { *x = ListTeamResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[99] + mi := &file_mecatl_v1_harness_proto_msgTypes[100] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8094,7 +8189,7 @@ func (x *ListTeamResponse) String() string { func (*ListTeamResponse) ProtoMessage() {} func (x *ListTeamResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[99] + mi := &file_mecatl_v1_harness_proto_msgTypes[100] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8107,7 +8202,7 @@ func (x *ListTeamResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListTeamResponse.ProtoReflect.Descriptor instead. func (*ListTeamResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{99} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{100} } func (x *ListTeamResponse) GetMembers() []*TeamMember { @@ -8148,7 +8243,7 @@ type TeamMember struct { func (x *TeamMember) Reset() { *x = TeamMember{} - mi := &file_mecatl_v1_harness_proto_msgTypes[100] + mi := &file_mecatl_v1_harness_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8160,7 +8255,7 @@ func (x *TeamMember) String() string { func (*TeamMember) ProtoMessage() {} func (x *TeamMember) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[100] + mi := &file_mecatl_v1_harness_proto_msgTypes[101] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8173,7 +8268,7 @@ func (x *TeamMember) ProtoReflect() protoreflect.Message { // Deprecated: Use TeamMember.ProtoReflect.Descriptor instead. func (*TeamMember) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{100} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{101} } func (x *TeamMember) GetName() string { @@ -8223,7 +8318,7 @@ type TeamTask struct { func (x *TeamTask) Reset() { *x = TeamTask{} - mi := &file_mecatl_v1_harness_proto_msgTypes[101] + mi := &file_mecatl_v1_harness_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8235,7 +8330,7 @@ func (x *TeamTask) String() string { func (*TeamTask) ProtoMessage() {} func (x *TeamTask) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[101] + mi := &file_mecatl_v1_harness_proto_msgTypes[102] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8248,7 +8343,7 @@ func (x *TeamTask) ProtoReflect() protoreflect.Message { // Deprecated: Use TeamTask.ProtoReflect.Descriptor instead. func (*TeamTask) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{101} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{102} } func (x *TeamTask) GetId() string { @@ -8301,7 +8396,7 @@ type TeamFinding struct { func (x *TeamFinding) Reset() { *x = TeamFinding{} - mi := &file_mecatl_v1_harness_proto_msgTypes[102] + mi := &file_mecatl_v1_harness_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8313,7 +8408,7 @@ func (x *TeamFinding) String() string { func (*TeamFinding) ProtoMessage() {} func (x *TeamFinding) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[102] + mi := &file_mecatl_v1_harness_proto_msgTypes[103] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8326,7 +8421,7 @@ func (x *TeamFinding) ProtoReflect() protoreflect.Message { // Deprecated: Use TeamFinding.ProtoReflect.Descriptor instead. func (*TeamFinding) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{102} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{103} } func (x *TeamFinding) GetMember() string { @@ -8369,7 +8464,7 @@ type TeamMemberDisposition struct { func (x *TeamMemberDisposition) Reset() { *x = TeamMemberDisposition{} - mi := &file_mecatl_v1_harness_proto_msgTypes[103] + mi := &file_mecatl_v1_harness_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8381,7 +8476,7 @@ func (x *TeamMemberDisposition) String() string { func (*TeamMemberDisposition) ProtoMessage() {} func (x *TeamMemberDisposition) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[103] + mi := &file_mecatl_v1_harness_proto_msgTypes[104] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8394,7 +8489,7 @@ func (x *TeamMemberDisposition) ProtoReflect() protoreflect.Message { // Deprecated: Use TeamMemberDisposition.ProtoReflect.Descriptor instead. func (*TeamMemberDisposition) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{103} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{104} } func (x *TeamMemberDisposition) GetName() string { @@ -8436,7 +8531,7 @@ type CleanupTeamRequest struct { func (x *CleanupTeamRequest) Reset() { *x = CleanupTeamRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[104] + mi := &file_mecatl_v1_harness_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8448,7 +8543,7 @@ func (x *CleanupTeamRequest) String() string { func (*CleanupTeamRequest) ProtoMessage() {} func (x *CleanupTeamRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[104] + mi := &file_mecatl_v1_harness_proto_msgTypes[105] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8461,7 +8556,7 @@ func (x *CleanupTeamRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CleanupTeamRequest.ProtoReflect.Descriptor instead. func (*CleanupTeamRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{104} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{105} } func (x *CleanupTeamRequest) GetTeamId() string { @@ -8480,7 +8575,7 @@ type CleanupTeamResponse struct { func (x *CleanupTeamResponse) Reset() { *x = CleanupTeamResponse{} - mi := &file_mecatl_v1_harness_proto_msgTypes[105] + mi := &file_mecatl_v1_harness_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8492,7 +8587,7 @@ func (x *CleanupTeamResponse) String() string { func (*CleanupTeamResponse) ProtoMessage() {} func (x *CleanupTeamResponse) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[105] + mi := &file_mecatl_v1_harness_proto_msgTypes[106] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8505,7 +8600,7 @@ func (x *CleanupTeamResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CleanupTeamResponse.ProtoReflect.Descriptor instead. func (*CleanupTeamResponse) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{105} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{106} } // ApprovePlanRequest resolves a parked plan-approval ask (issue #206). See the @@ -8528,7 +8623,7 @@ type ApprovePlanRequest struct { func (x *ApprovePlanRequest) Reset() { *x = ApprovePlanRequest{} - mi := &file_mecatl_v1_harness_proto_msgTypes[106] + mi := &file_mecatl_v1_harness_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8540,7 +8635,7 @@ func (x *ApprovePlanRequest) String() string { func (*ApprovePlanRequest) ProtoMessage() {} func (x *ApprovePlanRequest) ProtoReflect() protoreflect.Message { - mi := &file_mecatl_v1_harness_proto_msgTypes[106] + mi := &file_mecatl_v1_harness_proto_msgTypes[107] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8553,7 +8648,7 @@ func (x *ApprovePlanRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApprovePlanRequest.ProtoReflect.Descriptor instead. func (*ApprovePlanRequest) Descriptor() ([]byte, []int) { - return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{106} + return file_mecatl_v1_harness_proto_rawDescGZIP(), []int{107} } func (x *ApprovePlanRequest) GetSessionId() string { @@ -8687,1058 +8782,1068 @@ var file_mecatl_v1_harness_proto_rawDesc = string([]byte{ 0x26, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xde, - 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x70, + 0x0a, 0x09, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x69, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x8a, 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6d, 0x6f, + 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x41, 0x74, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x4d, 0x0a, + 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x52, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x67, 0x0a, 0x0e, + 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, + 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, + 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x3f, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x0a, 0x13, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, + 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8a, 0x01, + 0x0a, 0x12, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x29, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x65, 0x66, 0x66, + 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x66, 0x66, 0x6f, 0x72, 0x74, 0x22, 0x34, 0x0a, 0x13, 0x46, 0x6f, + 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, - 0x75, 0x6e, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x6d, 0x6f, 0x64, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x41, 0x74, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, - 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x49, - 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, - 0x75, 0x6e, 0x69, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, - 0x4d, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x75, 0x6d, - 0x6d, 0x61, 0x72, 0x79, 0x52, 0x08, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x67, - 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x26, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, - 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x3f, 0x0a, 0x0f, 0x53, 0x65, 0x74, 0x4d, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x0a, 0x13, 0x43, 0x6c, 0x6f, 0x73, - 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x22, 0xad, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x29, + 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x75, 0x72, + 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x26, + 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x75, 0x6e, 0x69, + 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x3f, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, + 0x76, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x41, 0x0a, + 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x22, 0xf6, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x48, 0x00, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, + 0x74, 0x12, 0x44, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x5f, 0x61, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, + 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x2b, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x68, 0x69, + 0x6c, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x68, 0x69, 0x6c, + 0x64, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x3a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, + 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0xb7, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x17, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, + 0x6c, 0x22, 0x3c, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x49, 0x4e, + 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, + 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x02, 0x22, + 0xf3, 0x03, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x30, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x75, 0x64, + 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, 0x75, 0x64, + 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, + 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, + 0x14, 0x0a, 0x10, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x54, 0x45, + 0x58, 0x54, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4d, 0x41, + 0x47, 0x45, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x41, 0x55, 0x44, + 0x49, 0x4f, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x53, + 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, + 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x45, 0x4d, 0x42, 0x45, 0x44, 0x44, 0x45, 0x44, 0x5f, 0x52, 0x45, + 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x49, 0x4e, 0x44, + 0x5f, 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, 0x55, 0x52, 0x45, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x54, + 0x45, 0x4e, 0x54, 0x10, 0x06, 0x22, 0x6e, 0x0a, 0x06, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x6c, 0x6f, 0x73, 0x65, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x8a, 0x01, 0x0a, 0x12, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, - 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x65, - 0x66, 0x66, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x66, 0x66, 0x6f, 0x72, 0x74, 0x22, 0x34, 0x0a, 0x13, - 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x22, 0xad, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, - 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, - 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x73, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x75, 0x72, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x75, 0x72, 0x6e, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x5f, 0x75, - 0x6e, 0x69, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x55, 0x6e, 0x69, 0x78, 0x12, 0x3f, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, - 0x41, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x69, 0x65, 0x73, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, - 0x65, 0x73, 0x22, 0xf6, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x48, 0x00, 0x52, 0x06, 0x70, 0x72, 0x6f, - 0x6d, 0x70, 0x74, 0x12, 0x44, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x5f, 0x61, 0x70, - 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, - 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x75, 0x6d, - 0x65, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x2b, 0x0a, 0x06, 0x63, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x06, - 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x5f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, - 0x68, 0x69, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x68, - 0x69, 0x6c, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x22, 0x3a, 0x0a, 0x10, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x26, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0xb7, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, - 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x72, 0x6c, 0x22, 0x3c, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x10, 0x4b, - 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x10, - 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, - 0x02, 0x22, 0xf3, 0x03, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x30, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, - 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, - 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x61, - 0x75, 0x64, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, - 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x04, 0x4b, 0x69, 0x6e, - 0x64, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4b, 0x49, 0x4e, 0x44, 0x5f, - 0x54, 0x45, 0x58, 0x54, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x49, - 0x4d, 0x41, 0x47, 0x45, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x41, - 0x55, 0x44, 0x49, 0x4f, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x52, - 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4c, 0x49, 0x4e, 0x4b, 0x10, 0x04, 0x12, 0x1a, - 0x0a, 0x16, 0x4b, 0x49, 0x4e, 0x44, 0x5f, 0x45, 0x4d, 0x42, 0x45, 0x44, 0x44, 0x45, 0x44, 0x5f, - 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x49, - 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x52, 0x55, 0x43, 0x54, 0x55, 0x52, 0x45, 0x44, 0x5f, 0x43, 0x4f, - 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x10, 0x06, 0x22, 0x6e, 0x0a, 0x06, 0x50, 0x72, 0x6f, 0x6d, 0x70, - 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x28, 0x0a, - 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x52, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x22, 0x7c, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x75, 0x6d, - 0x65, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x06, 0x61, 0x73, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x05, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x12, - 0x34, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, - 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x64, 0x69, 0x63, 0x74, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x22, - 0x31, 0x0a, 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x22, - 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x63, 0x68, 0x69, 0x6c, 0x64, - 0x49, 0x64, 0x22, 0x87, 0x06, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73, - 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x74, 0x6f, - 0x6f, 0x6c, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, - 0x6c, 0x6c, 0x52, 0x08, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x36, 0x0a, 0x0b, - 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, - 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x03, 0x61, 0x73, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x52, 0x03, 0x61, 0x73, 0x6b, - 0x12, 0x29, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x75, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x75, 0x72, 0x6e, 0x45, 0x6e, 0x64, 0x52, 0x07, 0x74, 0x75, 0x72, 0x6e, 0x45, - 0x6e, 0x64, 0x12, 0x23, 0x0a, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x08, - 0x73, 0x75, 0x62, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x2f, 0x0a, - 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, - 0x6c, 0x6c, 0x65, 0x6c, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x36, - 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x08, 0x73, 0x63, - 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, - 0x61, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x52, 0x08, 0x61, - 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, - 0x6d, 0x70, 0x74, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, - 0x4b, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x72, - 0x63, 0x68, 0x69, 0x76, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x22, 0x8b, 0x01, 0x0a, - 0x08, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x73, 0x6b, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x6b, 0x49, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, - 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x12, 0x17, - 0x0a, 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x6f, 0x77, - 0x5f, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x22, 0x4a, 0x0a, 0x0a, 0x55, 0x73, - 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x28, 0x0a, 0x05, - 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, - 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x22, 0x4f, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x72, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x22, 0xc4, 0x02, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x76, - 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, - 0x6f, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x32, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, - 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x28, 0x0a, 0x05, 0x70, + 0x61, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x05, + 0x70, 0x61, 0x72, 0x74, 0x73, 0x22, 0x7c, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, + 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x1e, 0x0a, 0x06, 0x61, 0x73, 0x6b, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, + 0x52, 0x05, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x34, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, + 0x76, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x52, 0x07, 0x76, 0x65, 0x72, 0x64, + 0x69, 0x63, 0x74, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x22, 0x31, 0x0a, + 0x0b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x12, 0x22, 0x0a, 0x08, + 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x49, 0x64, + 0x22, 0x87, 0x06, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x73, 0x65, 0x71, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x74, 0x75, 0x72, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x74, 0x6f, 0x6f, 0x6c, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, - 0x52, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x36, 0x0a, 0x0b, 0x74, - 0x6f, 0x6f, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6f, - 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, - 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x68, - 0x61, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x50, 0x68, 0x61, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, - 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x70, 0x61, 0x72, - 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, - 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0xa8, - 0x01, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, - 0x61, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x72, 0x65, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x72, 0x65, 0x49, 0x64, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, - 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x7e, 0x0a, 0x04, 0x48, 0x6f, 0x6f, - 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x12, 0x33, 0x0a, 0x08, 0x64, - 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x44, 0x65, - 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x17, 0x0a, 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x22, 0x9d, 0x04, 0x0a, 0x08, 0x53, 0x75, - 0x62, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, - 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x68, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, - 0x6f, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x74, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, - 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, - 0x6f, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x1f, - 0x0a, 0x0b, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x73, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x12, - 0x1e, 0x0a, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, - 0x27, 0x0a, 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, - 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, - 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x65, 0x78, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x10, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, - 0x63, 0x61, 0x75, 0x73, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x61, 0x75, - 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xf1, 0x01, 0x0a, 0x0e, 0x54, 0x65, - 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, - 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, - 0x6c, 0x65, 0x61, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x63, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, - 0x6f, 0x75, 0x74, 0x65, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x0a, - 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, - 0x67, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x98, 0x05, - 0x0a, 0x04, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, - 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, - 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, - 0x52, 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x65, 0x78, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, - 0x74, 0x6f, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, - 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, - 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x73, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, - 0x77, 0x12, 0x29, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, - 0x6d, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x32, 0x0a, 0x08, - 0x66, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x46, - 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x44, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x44, 0x69, 0x73, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x22, 0xf1, 0x05, 0x0a, 0x08, 0x50, 0x61, 0x72, - 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, - 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6b, - 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6a, - 0x6f, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, - 0x67, 0x6f, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x67, 0x6f, 0x61, 0x6c, - 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, - 0x08, 0x69, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x69, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, - 0x6f, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, - 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, - 0x70, 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x69, - 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x6e, - 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x77, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x69, - 0x6e, 0x6e, 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x19, 0x0a, - 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x64, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, - 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x4d, - 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, - 0x6e, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, - 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, - 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, - 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x42, 0x0a, 0x08, - 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, - 0x22, 0xba, 0x01, 0x0a, 0x0a, 0x54, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x17, 0x0a, 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2f, 0x0a, - 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x2d, - 0x0a, 0x12, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x74, 0x72, 0x75, - 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x66, 0x0a, - 0x0d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x12, 0x15, - 0x0a, 0x06, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x8c, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x73, 0x74, 0x6f, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x65, 0x72, 0x6d, 0x61, 0x6e, - 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x70, 0x65, 0x72, 0x6d, 0x61, - 0x6e, 0x65, 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x07, 0x54, 0x75, 0x72, 0x6e, 0x45, 0x6e, 0x64, 0x12, - 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, + 0x52, 0x08, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x36, 0x0a, 0x0b, 0x74, 0x6f, + 0x6f, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x2a, 0x0a, 0x03, 0x61, 0x73, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x52, 0x03, 0x61, 0x73, 0x6b, 0x12, 0x29, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x2d, 0x0a, 0x08, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x75, 0x72, 0x6e, 0x45, 0x6e, 0x64, 0x52, 0x07, 0x74, 0x75, 0x72, 0x6e, 0x45, 0x6e, 0x64, + 0x12, 0x23, 0x0a, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, + 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x75, + 0x62, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x0d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x2f, 0x0a, 0x08, 0x70, + 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6c, 0x6c, + 0x65, 0x6c, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x36, 0x0a, 0x08, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x52, 0x08, 0x61, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x36, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72, + 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6d, 0x70, + 0x74, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x4b, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x11, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x08, 0x41, + 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x73, 0x6b, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x6f, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x07, + 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, + 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, + 0x6c, 0x77, 0x61, 0x79, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x22, 0x4a, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, + 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x61, + 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x70, + 0x61, 0x72, 0x74, 0x73, 0x22, 0x4f, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x72, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x72, 0x65, 0x70, + 0x6c, 0x61, 0x63, 0x65, 0x64, 0x22, 0xc4, 0x02, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x32, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, 0x61, + 0x6c, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x09, + 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x12, 0x36, 0x0a, 0x0b, 0x74, 0x6f, 0x6f, + 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, + 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x68, 0x61, 0x73, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x50, 0x68, 0x61, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x70, 0x61, 0x72, 0x74, 0x73, + 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x74, + 0x65, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0xa8, 0x01, 0x0a, + 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x72, 0x65, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x7e, 0x0a, 0x04, 0x48, 0x6f, 0x6f, 0x6b, 0x12, + 0x14, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x12, 0x33, 0x0a, 0x08, 0x64, 0x65, 0x63, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x44, 0x65, 0x63, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, + 0x0a, 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x22, 0x9d, 0x04, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, + 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6f, + 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, + 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x1f, 0x0a, 0x0b, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x43, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, + 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x61, + 0x75, 0x73, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xf1, 0x01, 0x0a, 0x0e, 0x54, 0x65, 0x61, 0x6d, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x12, + 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x65, + 0x61, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x6f, 0x75, + 0x74, 0x65, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x72, + 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x6f, + 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x98, 0x05, 0x0a, 0x04, + 0x54, 0x65, 0x61, 0x6d, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, + 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, + 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, + 0x6d, 0x49, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x52, 0x06, + 0x72, 0x6f, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, + 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x6f, + 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x26, 0x0a, + 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, + 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x55, 0x73, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, + 0x29, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x32, 0x0a, 0x08, 0x66, 0x69, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x46, 0x69, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x44, + 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x11, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x44, 0x69, 0x73, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x22, 0xf1, 0x05, 0x0a, 0x08, 0x50, 0x61, 0x72, 0x61, 0x6c, + 0x6c, 0x65, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x61, + 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6a, 0x6f, 0x69, + 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, + 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, + 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x12, 0x1b, + 0x0a, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, + 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x6f, 0x6c, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x74, 0x6f, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, + 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x22, 0xd4, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x61, - 0x63, 0x68, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x61, 0x64, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x10, 0x63, 0x61, 0x63, 0x68, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, - 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, - 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, - 0xd1, 0x01, 0x0a, 0x0b, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, - 0x6e, 0x6c, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, - 0x6e, 0x6c, 0x79, 0x22, 0x31, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, - 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x13, 0x4d, 0x63, 0x70, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, - 0x69, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, - 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x54, 0x0a, 0x16, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x63, - 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x69, 0x22, 0x55, 0x0a, 0x17, - 0x52, 0x65, 0x61, 0x64, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x73, 0x22, 0x7b, 0x0a, 0x11, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, - 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, - 0x22, 0xab, 0x01, 0x0a, 0x09, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x77, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, + 0x12, 0x29, 0x0a, 0x10, 0x77, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x68, 0x69, 0x6c, 0x64, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, + 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x64, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x6e, 0x65, + 0x72, 0x5f, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, + 0x6e, 0x65, 0x72, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, + 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x6f, 0x75, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x42, 0x0a, 0x08, 0x54, 0x6f, + 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, + 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0xba, + 0x01, 0x0a, 0x0a, 0x54, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, + 0x07, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x63, 0x61, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x06, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x2d, 0x0a, 0x12, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, + 0x75, 0x72, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x66, 0x0a, 0x0d, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x73, 0x6b, 0x12, 0x15, 0x0a, 0x06, + 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, + 0x6b, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x6f, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x22, 0x8c, 0x01, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, + 0x6f, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x70, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x65, + 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x07, 0x54, 0x75, 0x72, 0x6e, 0x45, 0x6e, 0x64, 0x12, 0x26, 0x0a, + 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, + 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x73, 0x22, 0xd4, 0x01, 0x0a, 0x05, 0x55, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x61, 0x63, 0x68, + 0x65, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x61, 0x64, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x10, 0x63, 0x61, 0x63, 0x68, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0xd1, 0x01, + 0x0a, 0x0b, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, + 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, + 0x79, 0x22, 0x31, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x22, 0x50, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x13, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, + 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x54, 0x0a, 0x16, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x63, 0x70, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, + 0x19, 0x0a, 0x03, 0x75, 0x72, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, + 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x03, 0x75, 0x72, 0x69, 0x22, 0x55, 0x0a, 0x17, 0x52, 0x65, + 0x61, 0x64, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0x7b, 0x0a, 0x11, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x41, 0x72, + 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x41, 0x72, 0x67, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2f, - 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, - 0x48, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x70, 0x72, 0x6f, - 0x6d, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, - 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x22, 0xde, 0x01, 0x0a, 0x13, 0x47, 0x65, - 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x4b, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x3c, 0x0a, 0x0e, - 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3a, 0x0a, 0x10, 0x4d, 0x63, - 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, - 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x71, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4d, 0x63, 0x70, - 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x22, 0xab, + 0x01, 0x0a, 0x09, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x37, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x69, 0x0a, 0x0d, 0x4d, 0x63, 0x70, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x22, 0xb9, 0x01, 0x0a, 0x09, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x32, 0x0a, 0x07, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, - 0x22, 0x17, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x16, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, - 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x34, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, 0x69, 0x76, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xac, 0x01, 0x0a, 0x09, 0x41, 0x67, 0x65, 0x6e, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x42, 0x0a, 0x12, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3f, - 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x12, 0x3a, 0x0a, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x52, 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2f, 0x0a, 0x15, + 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x48, 0x0a, + 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6d, 0x70, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x07, + 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x22, 0xde, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4d, + 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1f, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4b, 0x0a, + 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x41, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x09, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x3c, 0x0a, 0x0e, 0x41, 0x72, + 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3a, 0x0a, 0x10, 0x4d, 0x63, 0x70, 0x50, + 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x22, 0x71, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, + 0x6f, 0x6d, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, + 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x63, 0x70, + 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x69, 0x0a, 0x0d, 0x4d, 0x63, 0x70, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x22, 0xb9, 0x01, 0x0a, 0x09, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x32, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x63, 0x70, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x22, 0x17, + 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, 0x69, 0x76, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x34, + 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, 0x69, 0x76, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x22, 0xac, 0x01, 0x0a, 0x09, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, + 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, + 0x6c, 0x6f, 0x72, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x42, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, + 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x3f, 0x0a, 0x07, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x33, 0x0a, + 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x22, 0x46, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x5e, 0x0a, 0x08, 0x57, 0x6f, + 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, + 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, + 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x72, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x61, 0x72, 0x65, 0x22, 0x34, 0x0a, 0x14, 0x4c, 0x69, + 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x22, 0x4a, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x77, 0x6f, 0x72, + 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, + 0x65, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x22, 0x41, 0x0a, 0x09, + 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x33, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x22, 0x46, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x08, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x5e, 0x0a, 0x08, - 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, - 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x61, 0x72, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x61, 0x72, 0x65, 0x22, 0x34, 0x0a, 0x14, - 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x22, 0x4a, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, - 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x77, - 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x74, - 0x72, 0x65, 0x65, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x22, 0x41, - 0x0a, 0x09, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x42, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6b, - 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, - 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x6e, - 0x66, 0x6f, 0x52, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x08, 0x53, - 0x6f, 0x75, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x73, - 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x72, 0x65, 0x73, 0x65, - 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, - 0x65, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x74, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x72, 0x69, 0x66, 0x74, - 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x72, 0x69, 0x66, 0x74, 0x65, - 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x3a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x73, 0x6f, 0x75, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x6f, 0x75, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x73, 0x6f, 0x75, 0x6c, 0x22, - 0x44, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x82, 0x01, 0x0a, - 0x14, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, - 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x73, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x61, - 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, - 0x36, 0x22, 0xb8, 0x01, 0x0a, 0x09, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x13, 0x0a, 0x11, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x22, 0xef, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, - 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x12, - 0x3d, 0x0a, 0x1b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4d, 0x6f, 0x64, - 0x65, 0x6c, 0x41, 0x75, 0x74, 0x6f, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x32, 0x0a, 0x15, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x6f, 0x74, - 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, - 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, - 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xbd, 0x01, 0x0a, - 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x25, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, - 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, - 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x6d, - 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x67, 0x6f, 0x61, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x65, 0x61, 0x6d, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, - 0x61, 0x78, 0x54, 0x65, 0x61, 0x6d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x5e, 0x0a, 0x12, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x07, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0xa1, 0x01, 0x0a, - 0x0c, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1b, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x67, - 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x61, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x12, 0x1a, 0x0a, - 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, - 0x22, 0xcb, 0x01, 0x0a, 0x14, 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, - 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, + 0x13, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x42, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x6b, + 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x06, 0x73, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x22, 0xe4, 0x01, 0x0a, 0x08, 0x53, 0x6f, 0x75, + 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, + 0x12, 0x39, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x6f, 0x75, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x52, + 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x74, + 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x72, + 0x75, 0x73, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x72, 0x69, 0x66, 0x74, 0x65, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x72, 0x69, 0x66, 0x74, 0x65, 0x64, 0x22, + 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x3a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x04, 0x73, 0x6f, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x6f, 0x75, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x73, 0x6f, 0x75, 0x6c, 0x22, 0x44, 0x0a, + 0x0e, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, + 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x82, 0x01, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x69, + 0x7a, 0x65, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, + 0x36, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x22, + 0xb8, 0x01, 0x0a, 0x09, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x13, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0xef, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x69, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x69, 0x6e, 0x74, 0x12, 0x3d, 0x0a, + 0x1b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x61, + 0x75, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, + 0x41, 0x75, 0x74, 0x6f, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x32, 0x0a, + 0x15, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x22, 0x86, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x11, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x25, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x77, 0x6f, + 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x6d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x67, 0x6f, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x67, 0x6f, + 0x61, 0x6c, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, + 0x54, 0x65, 0x61, 0x6d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x5e, 0x0a, 0x12, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x17, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x0c, 0x54, + 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1b, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x67, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, - 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, + 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x22, 0x46, - 0x0a, 0x15, 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x06, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x53, 0x65, 0x6e, 0x64, 0x54, - 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, - 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x74, 0x6f, - 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x1b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x22, 0x1d, 0x0a, 0x1b, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, - 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x5a, 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, - 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, - 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x54, 0x65, 0x61, - 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, - 0x10, 0x01, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x7d, 0x0a, 0x09, 0x54, 0x65, - 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x26, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x63, 0x6f, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, - 0x52, 0x07, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x22, 0xa4, 0x02, 0x0a, 0x0b, 0x54, 0x65, - 0x61, 0x6d, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x74, 0x12, - 0x29, 0x0a, 0x10, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x65, 0x78, 0x68, 0x61, 0x75, 0x73, - 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x62, 0x75, 0x64, 0x67, 0x65, - 0x74, 0x45, 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, - 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x26, - 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, - 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, 0x08, - 0x66, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x46, - 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, - 0x22, 0x33, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, + 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x22, 0xcb, + 0x01, 0x0a, 0x14, 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, + 0x01, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x75, 0x74, + 0x61, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, + 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x22, 0x46, 0x0a, 0x15, + 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x06, 0x6d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, + 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, - 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, - 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x05, 0x74, - 0x61, 0x73, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, 0x63, - 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, - 0x63, 0x65, 0x6e, 0x74, 0x22, 0x74, 0x0a, 0x0a, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x54, - 0x65, 0x61, 0x6d, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x65, 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x70, 0x73, 0x22, - 0x39, 0x0a, 0x0b, 0x54, 0x65, 0x61, 0x6d, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x16, - 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xa1, 0x01, 0x0a, 0x15, 0x54, - 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x70, - 0x70, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x70, 0x70, - 0x65, 0x64, 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0x36, - 0x0a, 0x12, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, - 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, - 0x70, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, - 0x0a, 0x12, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x12, 0x1b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, + 0x1d, 0x0a, 0x1b, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, + 0x0a, 0x15, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x0b, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, - 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x2a, 0x8a, 0x01, 0x0a, - 0x0e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, - 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, - 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, - 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x18, 0x0a, - 0x14, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, - 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x52, 0x4d, 0x49, - 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, - 0x54, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x53, 0x10, 0x03, 0x2a, 0x92, 0x01, 0x0a, 0x0f, 0x41, 0x70, - 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x12, 0x20, 0x0a, - 0x1c, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x44, 0x49, 0x43, - 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x19, 0x0a, 0x15, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x44, - 0x49, 0x43, 0x54, 0x5f, 0x44, 0x45, 0x4e, 0x59, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x41, 0x50, - 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x44, 0x49, 0x43, 0x54, 0x5f, 0x41, - 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x41, + 0x01, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x06, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, + 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x7d, 0x0a, 0x09, 0x54, 0x65, 0x61, 0x6d, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x26, 0x0a, + 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x30, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x52, 0x07, + 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x22, 0xa4, 0x02, 0x0a, 0x0b, 0x54, 0x65, 0x61, 0x6d, + 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, + 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, + 0x10, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x5f, 0x65, 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x45, + 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x26, 0x0a, 0x05, + 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, 0x69, + 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, 0x08, 0x66, 0x69, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x46, 0x69, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x33, + 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x65, 0x61, + 0x6d, 0x49, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x05, 0x74, 0x61, 0x73, + 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x05, 0x74, + 0x61, 0x73, 0x6b, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, 0x63, 0x65, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x71, 0x75, 0x69, 0x65, 0x73, 0x63, 0x65, + 0x6e, 0x74, 0x22, 0x74, 0x0a, 0x0a, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x54, 0x65, 0x61, + 0x6d, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x70, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x70, 0x73, 0x22, 0x39, 0x0a, + 0x0b, 0x54, 0x65, 0x61, 0x6d, 0x46, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xa1, 0x01, 0x0a, 0x15, 0x54, 0x65, 0x61, + 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x70, 0x70, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, + 0x12, 0x37, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, + 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x22, 0x36, 0x0a, 0x12, + 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x65, + 0x61, 0x6d, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x12, + 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, + 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x0b, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, + 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x2a, 0x8a, 0x01, 0x0a, 0x0e, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, + 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, + 0x0a, 0x17, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, + 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x50, + 0x4c, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, + 0x49, 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x5f, + 0x45, 0x44, 0x49, 0x54, 0x53, 0x10, 0x03, 0x2a, 0x92, 0x01, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x64, 0x69, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x44, 0x49, 0x43, 0x54, 0x5f, - 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x41, 0x4c, 0x57, 0x41, 0x59, 0x53, 0x10, 0x03, 0x2a, 0x98, - 0x01, 0x0a, 0x0c, 0x48, 0x6f, 0x6f, 0x6b, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x1d, 0x0a, 0x19, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, - 0x0a, 0x12, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, - 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, - 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, - 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, - 0x4f, 0x4e, 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1a, 0x0a, - 0x16, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x41, - 0x44, 0x56, 0x49, 0x53, 0x4f, 0x52, 0x59, 0x10, 0x04, 0x2a, 0x84, 0x01, 0x0a, 0x0e, 0x53, 0x6f, - 0x75, 0x6c, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x1b, - 0x53, 0x4f, 0x55, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, - 0x14, 0x53, 0x4f, 0x55, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, - 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x4f, 0x55, 0x4c, 0x5f, - 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, - 0x43, 0x54, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x4f, 0x55, 0x4c, 0x5f, 0x50, 0x52, 0x4f, - 0x56, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x10, 0x03, - 0x2a, 0xad, 0x01, 0x0a, 0x14, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, - 0x74, 0x6f, 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x45, 0x41, - 0x4d, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x54, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, - 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x54, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x45, - 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, - 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, - 0x54, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, - 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x10, 0x03, - 0x32, 0xeb, 0x12, 0x0a, 0x0e, 0x48, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x12, - 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x5b, 0x0a, 0x10, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x52, 0x65, 0x61, - 0x64, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x63, 0x70, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x22, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, - 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, - 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, + 0x15, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x44, 0x49, 0x43, + 0x54, 0x5f, 0x44, 0x45, 0x4e, 0x59, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x41, 0x50, 0x50, 0x52, + 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x44, 0x49, 0x43, 0x54, 0x5f, 0x41, 0x4c, 0x4c, + 0x4f, 0x57, 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x41, 0x50, 0x50, + 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f, 0x56, 0x45, 0x52, 0x44, 0x49, 0x43, 0x54, 0x5f, 0x41, 0x4c, + 0x4c, 0x4f, 0x57, 0x5f, 0x41, 0x4c, 0x57, 0x41, 0x59, 0x53, 0x10, 0x03, 0x2a, 0x98, 0x01, 0x0a, + 0x0c, 0x48, 0x6f, 0x6f, 0x6b, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, + 0x19, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, + 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, + 0x46, 0x4f, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, + 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x12, + 0x1a, 0x0a, 0x16, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x48, + 0x4f, 0x4f, 0x4b, 0x5f, 0x44, 0x45, 0x43, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x44, 0x56, + 0x49, 0x53, 0x4f, 0x52, 0x59, 0x10, 0x04, 0x2a, 0x84, 0x01, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x6c, + 0x50, 0x72, 0x6f, 0x76, 0x65, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x4f, + 0x55, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x53, + 0x4f, 0x55, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x55, + 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x4f, 0x55, 0x4c, 0x5f, 0x50, 0x52, + 0x4f, 0x56, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, + 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x53, 0x4f, 0x55, 0x4c, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x45, + 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x10, 0x03, 0x2a, 0xad, + 0x01, 0x0a, 0x14, 0x54, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x74, 0x6f, + 0x70, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x45, 0x41, 0x4d, 0x5f, + 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x21, 0x0a, 0x1d, 0x54, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, + 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x54, 0x45, 0x41, 0x4d, 0x5f, 0x4d, 0x45, 0x4d, 0x42, + 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x43, + 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x45, + 0x41, 0x4d, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x52, + 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x10, 0x03, 0x32, 0xeb, + 0x12, 0x0a, 0x0e, 0x48, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x40, 0x0a, 0x07, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6c, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, + 0x6f, 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6f, + 0x72, 0x6b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x47, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x12, 0x1a, 0x2e, + 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, + 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x5b, 0x0a, 0x10, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x22, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x52, 0x65, 0x61, 0x64, 0x4d, + 0x63, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x63, 0x70, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, + 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4d, 0x63, + 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, + 0x70, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x47, 0x65, - 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, - 0x6d, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, - 0x6d, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x20, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4d, + 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x63, 0x70, 0x50, 0x72, 0x6f, 0x6d, 0x70, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, 0x70, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x63, - 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x4d, 0x63, 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x61, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, 0x69, - 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, 0x69, 0x76, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, - 0x6f, 0x6f, 0x6c, 0x48, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, - 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, - 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x4c, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x76, 0x65, 0x12, 0x23, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x70, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x61, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, 0x69, 0x76, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, 0x6c, 0x48, 0x69, 0x76, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6f, + 0x6c, 0x48, 0x69, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, + 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x1e, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x52, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, + 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x74, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x4f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6b, - 0x69, 0x6c, 0x6c, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x12, 0x19, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x4c, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x76, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x30, 0x01, 0x12, 0x4f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x69, 0x73, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x49, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1c, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, + 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x4f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, + 0x6c, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, + 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, + 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x53, 0x70, - 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, - 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, - 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, - 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, - 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, - 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, + 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x61, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x53, 0x70, 0x61, 0x77, + 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x6d, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x77, 0x6e, 0x54, 0x65, 0x61, 0x6d, + 0x6d, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x13, + 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x65, 0x61, 0x6d, 0x6d, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, + 0x6d, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, 0x6d, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x54, 0x65, 0x61, 0x6d, 0x6d, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x52, - 0x75, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, - 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x08, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, - 0x0a, 0x0b, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, - 0x70, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, - 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, - 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, - 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x42, 0xa2, - 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x42, 0x0c, 0x48, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x61, - 0x63, 0x6b, 0x6c, 0x6f, 0x6b, 0x2f, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x09, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x15, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x52, 0x75, 0x6e, + 0x54, 0x65, 0x61, 0x6d, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x75, 0x6e, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x14, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x54, + 0x65, 0x61, 0x6d, 0x12, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1b, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x54, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0b, + 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x6e, 0x75, 0x70, 0x54, 0x65, + 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x41, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x61, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x42, 0xa2, 0x01, 0x0a, + 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0c, + 0x48, 0x61, 0x72, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, + 0x6c, 0x6f, 0x6b, 0x2f, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x09, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -9754,7 +9859,7 @@ func file_mecatl_v1_harness_proto_rawDescGZIP() []byte { } var file_mecatl_v1_harness_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_mecatl_v1_harness_proto_msgTypes = make([]protoimpl.MessageInfo, 108) +var file_mecatl_v1_harness_proto_msgTypes = make([]protoimpl.MessageInfo, 109) var file_mecatl_v1_harness_proto_goTypes = []any{ (PermissionMode)(0), // 0: mecatl.v1.PermissionMode (ApprovalVerdict)(0), // 1: mecatl.v1.ApprovalVerdict @@ -9774,103 +9879,104 @@ var file_mecatl_v1_harness_proto_goTypes = []any{ (*StreamSessionEventsRequest)(nil), // 15: mecatl.v1.StreamSessionEventsRequest (*StreamSessionLiveRequest)(nil), // 16: mecatl.v1.StreamSessionLiveRequest (*ListSessionsRequest)(nil), // 17: mecatl.v1.ListSessionsRequest - (*SessionSummary)(nil), // 18: mecatl.v1.SessionSummary - (*ListSessionsResponse)(nil), // 19: mecatl.v1.ListSessionsResponse - (*SetModeRequest)(nil), // 20: mecatl.v1.SetModeRequest - (*SetModeResponse)(nil), // 21: mecatl.v1.SetModeResponse - (*CloseSessionRequest)(nil), // 22: mecatl.v1.CloseSessionRequest - (*CloseSessionResponse)(nil), // 23: mecatl.v1.CloseSessionResponse - (*ForkSessionRequest)(nil), // 24: mecatl.v1.ForkSessionRequest - (*ForkSessionResponse)(nil), // 25: mecatl.v1.ForkSessionResponse - (*Session)(nil), // 26: mecatl.v1.Session - (*ConverseRequest)(nil), // 27: mecatl.v1.ConverseRequest - (*ConverseResponse)(nil), // 28: mecatl.v1.ConverseResponse - (*Content)(nil), // 29: mecatl.v1.Content - (*ContentBlock)(nil), // 30: mecatl.v1.ContentBlock - (*Prompt)(nil), // 31: mecatl.v1.Prompt - (*ResumeApproval)(nil), // 32: mecatl.v1.ResumeApproval - (*Cancel)(nil), // 33: mecatl.v1.Cancel - (*CancelChild)(nil), // 34: mecatl.v1.CancelChild - (*Event)(nil), // 35: mecatl.v1.Event - (*Approval)(nil), // 36: mecatl.v1.Approval - (*UserPrompt)(nil), // 37: mecatl.v1.UserPrompt - (*CompactionArchive)(nil), // 38: mecatl.v1.CompactionArchive - (*ConversationMessage)(nil), // 39: mecatl.v1.ConversationMessage - (*SchedulePayload)(nil), // 40: mecatl.v1.SchedulePayload - (*Hook)(nil), // 41: mecatl.v1.Hook - (*Subagent)(nil), // 42: mecatl.v1.Subagent - (*TeamMemberSpec)(nil), // 43: mecatl.v1.TeamMemberSpec - (*Team)(nil), // 44: mecatl.v1.Team - (*Parallel)(nil), // 45: mecatl.v1.Parallel - (*ToolCall)(nil), // 46: mecatl.v1.ToolCall - (*ToolResult)(nil), // 47: mecatl.v1.ToolResult - (*PermissionAsk)(nil), // 48: mecatl.v1.PermissionAsk - (*Result)(nil), // 49: mecatl.v1.Result - (*TurnEnd)(nil), // 50: mecatl.v1.TurnEnd - (*Usage)(nil), // 51: mecatl.v1.Usage - (*McpResource)(nil), // 52: mecatl.v1.McpResource - (*ListMcpResourcesRequest)(nil), // 53: mecatl.v1.ListMcpResourcesRequest - (*ListMcpResourcesResponse)(nil), // 54: mecatl.v1.ListMcpResourcesResponse - (*McpResourceContents)(nil), // 55: mecatl.v1.McpResourceContents - (*ReadMcpResourceRequest)(nil), // 56: mecatl.v1.ReadMcpResourceRequest - (*ReadMcpResourceResponse)(nil), // 57: mecatl.v1.ReadMcpResourceResponse - (*McpPromptArgument)(nil), // 58: mecatl.v1.McpPromptArgument - (*McpPrompt)(nil), // 59: mecatl.v1.McpPrompt - (*ListMcpPromptsRequest)(nil), // 60: mecatl.v1.ListMcpPromptsRequest - (*ListMcpPromptsResponse)(nil), // 61: mecatl.v1.ListMcpPromptsResponse - (*GetMcpPromptRequest)(nil), // 62: mecatl.v1.GetMcpPromptRequest - (*McpPromptMessage)(nil), // 63: mecatl.v1.McpPromptMessage - (*GetMcpPromptResponse)(nil), // 64: mecatl.v1.GetMcpPromptResponse - (*McpServerInfo)(nil), // 65: mecatl.v1.McpServerInfo - (*McpSource)(nil), // 66: mecatl.v1.McpSource - (*ListMcpSourcesRequest)(nil), // 67: mecatl.v1.ListMcpSourcesRequest - (*ListMcpSourcesResponse)(nil), // 68: mecatl.v1.ListMcpSourcesResponse - (*ListToolHiveGroupsRequest)(nil), // 69: mecatl.v1.ListToolHiveGroupsRequest - (*ListToolHiveGroupsResponse)(nil), // 70: mecatl.v1.ListToolHiveGroupsResponse - (*AgentInfo)(nil), // 71: mecatl.v1.AgentInfo - (*ListAgentsRequest)(nil), // 72: mecatl.v1.ListAgentsRequest - (*ListAgentsResponse)(nil), // 73: mecatl.v1.ListAgentsResponse - (*Command)(nil), // 74: mecatl.v1.Command - (*ListCommandsRequest)(nil), // 75: mecatl.v1.ListCommandsRequest - (*ListCommandsResponse)(nil), // 76: mecatl.v1.ListCommandsResponse - (*Worktree)(nil), // 77: mecatl.v1.Worktree - (*ListWorktreesRequest)(nil), // 78: mecatl.v1.ListWorktreesRequest - (*ListWorktreesResponse)(nil), // 79: mecatl.v1.ListWorktreesResponse - (*SkillInfo)(nil), // 80: mecatl.v1.SkillInfo - (*ListSkillsRequest)(nil), // 81: mecatl.v1.ListSkillsRequest - (*ListSkillsResponse)(nil), // 82: mecatl.v1.ListSkillsResponse - (*SoulInfo)(nil), // 83: mecatl.v1.SoulInfo - (*GetSoulRequest)(nil), // 84: mecatl.v1.GetSoulRequest - (*GetSoulResponse)(nil), // 85: mecatl.v1.GetSoulResponse - (*UserModelEntry)(nil), // 86: mecatl.v1.UserModelEntry - (*GetUserModelRequest)(nil), // 87: mecatl.v1.GetUserModelRequest - (*GetUserModelResponse)(nil), // 88: mecatl.v1.GetUserModelResponse - (*ModelInfo)(nil), // 89: mecatl.v1.ModelInfo - (*ListModelsRequest)(nil), // 90: mecatl.v1.ListModelsRequest - (*ProviderStatus)(nil), // 91: mecatl.v1.ProviderStatus - (*ListModelsResponse)(nil), // 92: mecatl.v1.ListModelsResponse - (*CreateTeamRequest)(nil), // 93: mecatl.v1.CreateTeamRequest - (*CreateTeamResponse)(nil), // 94: mecatl.v1.CreateTeamResponse - (*TeammateSpec)(nil), // 95: mecatl.v1.TeammateSpec - (*SpawnTeammateRequest)(nil), // 96: mecatl.v1.SpawnTeammateRequest - (*SpawnTeammateResponse)(nil), // 97: mecatl.v1.SpawnTeammateResponse - (*SendTeammateMessageRequest)(nil), // 98: mecatl.v1.SendTeammateMessageRequest - (*SendTeammateMessageResponse)(nil), // 99: mecatl.v1.SendTeammateMessageResponse - (*CancelTeammateRequest)(nil), // 100: mecatl.v1.CancelTeammateRequest - (*CancelTeammateResponse)(nil), // 101: mecatl.v1.CancelTeammateResponse - (*RunTeamRequest)(nil), // 102: mecatl.v1.RunTeamRequest - (*TeamEvent)(nil), // 103: mecatl.v1.TeamEvent - (*TeamOutcome)(nil), // 104: mecatl.v1.TeamOutcome - (*ListTeamRequest)(nil), // 105: mecatl.v1.ListTeamRequest - (*ListTeamResponse)(nil), // 106: mecatl.v1.ListTeamResponse - (*TeamMember)(nil), // 107: mecatl.v1.TeamMember - (*TeamTask)(nil), // 108: mecatl.v1.TeamTask - (*TeamFinding)(nil), // 109: mecatl.v1.TeamFinding - (*TeamMemberDisposition)(nil), // 110: mecatl.v1.TeamMemberDisposition - (*CleanupTeamRequest)(nil), // 111: mecatl.v1.CleanupTeamRequest - (*CleanupTeamResponse)(nil), // 112: mecatl.v1.CleanupTeamResponse - (*ApprovePlanRequest)(nil), // 113: mecatl.v1.ApprovePlanRequest - nil, // 114: mecatl.v1.GetMcpPromptRequest.ArgumentsEntry + (*Principal)(nil), // 18: mecatl.v1.Principal + (*SessionSummary)(nil), // 19: mecatl.v1.SessionSummary + (*ListSessionsResponse)(nil), // 20: mecatl.v1.ListSessionsResponse + (*SetModeRequest)(nil), // 21: mecatl.v1.SetModeRequest + (*SetModeResponse)(nil), // 22: mecatl.v1.SetModeResponse + (*CloseSessionRequest)(nil), // 23: mecatl.v1.CloseSessionRequest + (*CloseSessionResponse)(nil), // 24: mecatl.v1.CloseSessionResponse + (*ForkSessionRequest)(nil), // 25: mecatl.v1.ForkSessionRequest + (*ForkSessionResponse)(nil), // 26: mecatl.v1.ForkSessionResponse + (*Session)(nil), // 27: mecatl.v1.Session + (*ConverseRequest)(nil), // 28: mecatl.v1.ConverseRequest + (*ConverseResponse)(nil), // 29: mecatl.v1.ConverseResponse + (*Content)(nil), // 30: mecatl.v1.Content + (*ContentBlock)(nil), // 31: mecatl.v1.ContentBlock + (*Prompt)(nil), // 32: mecatl.v1.Prompt + (*ResumeApproval)(nil), // 33: mecatl.v1.ResumeApproval + (*Cancel)(nil), // 34: mecatl.v1.Cancel + (*CancelChild)(nil), // 35: mecatl.v1.CancelChild + (*Event)(nil), // 36: mecatl.v1.Event + (*Approval)(nil), // 37: mecatl.v1.Approval + (*UserPrompt)(nil), // 38: mecatl.v1.UserPrompt + (*CompactionArchive)(nil), // 39: mecatl.v1.CompactionArchive + (*ConversationMessage)(nil), // 40: mecatl.v1.ConversationMessage + (*SchedulePayload)(nil), // 41: mecatl.v1.SchedulePayload + (*Hook)(nil), // 42: mecatl.v1.Hook + (*Subagent)(nil), // 43: mecatl.v1.Subagent + (*TeamMemberSpec)(nil), // 44: mecatl.v1.TeamMemberSpec + (*Team)(nil), // 45: mecatl.v1.Team + (*Parallel)(nil), // 46: mecatl.v1.Parallel + (*ToolCall)(nil), // 47: mecatl.v1.ToolCall + (*ToolResult)(nil), // 48: mecatl.v1.ToolResult + (*PermissionAsk)(nil), // 49: mecatl.v1.PermissionAsk + (*Result)(nil), // 50: mecatl.v1.Result + (*TurnEnd)(nil), // 51: mecatl.v1.TurnEnd + (*Usage)(nil), // 52: mecatl.v1.Usage + (*McpResource)(nil), // 53: mecatl.v1.McpResource + (*ListMcpResourcesRequest)(nil), // 54: mecatl.v1.ListMcpResourcesRequest + (*ListMcpResourcesResponse)(nil), // 55: mecatl.v1.ListMcpResourcesResponse + (*McpResourceContents)(nil), // 56: mecatl.v1.McpResourceContents + (*ReadMcpResourceRequest)(nil), // 57: mecatl.v1.ReadMcpResourceRequest + (*ReadMcpResourceResponse)(nil), // 58: mecatl.v1.ReadMcpResourceResponse + (*McpPromptArgument)(nil), // 59: mecatl.v1.McpPromptArgument + (*McpPrompt)(nil), // 60: mecatl.v1.McpPrompt + (*ListMcpPromptsRequest)(nil), // 61: mecatl.v1.ListMcpPromptsRequest + (*ListMcpPromptsResponse)(nil), // 62: mecatl.v1.ListMcpPromptsResponse + (*GetMcpPromptRequest)(nil), // 63: mecatl.v1.GetMcpPromptRequest + (*McpPromptMessage)(nil), // 64: mecatl.v1.McpPromptMessage + (*GetMcpPromptResponse)(nil), // 65: mecatl.v1.GetMcpPromptResponse + (*McpServerInfo)(nil), // 66: mecatl.v1.McpServerInfo + (*McpSource)(nil), // 67: mecatl.v1.McpSource + (*ListMcpSourcesRequest)(nil), // 68: mecatl.v1.ListMcpSourcesRequest + (*ListMcpSourcesResponse)(nil), // 69: mecatl.v1.ListMcpSourcesResponse + (*ListToolHiveGroupsRequest)(nil), // 70: mecatl.v1.ListToolHiveGroupsRequest + (*ListToolHiveGroupsResponse)(nil), // 71: mecatl.v1.ListToolHiveGroupsResponse + (*AgentInfo)(nil), // 72: mecatl.v1.AgentInfo + (*ListAgentsRequest)(nil), // 73: mecatl.v1.ListAgentsRequest + (*ListAgentsResponse)(nil), // 74: mecatl.v1.ListAgentsResponse + (*Command)(nil), // 75: mecatl.v1.Command + (*ListCommandsRequest)(nil), // 76: mecatl.v1.ListCommandsRequest + (*ListCommandsResponse)(nil), // 77: mecatl.v1.ListCommandsResponse + (*Worktree)(nil), // 78: mecatl.v1.Worktree + (*ListWorktreesRequest)(nil), // 79: mecatl.v1.ListWorktreesRequest + (*ListWorktreesResponse)(nil), // 80: mecatl.v1.ListWorktreesResponse + (*SkillInfo)(nil), // 81: mecatl.v1.SkillInfo + (*ListSkillsRequest)(nil), // 82: mecatl.v1.ListSkillsRequest + (*ListSkillsResponse)(nil), // 83: mecatl.v1.ListSkillsResponse + (*SoulInfo)(nil), // 84: mecatl.v1.SoulInfo + (*GetSoulRequest)(nil), // 85: mecatl.v1.GetSoulRequest + (*GetSoulResponse)(nil), // 86: mecatl.v1.GetSoulResponse + (*UserModelEntry)(nil), // 87: mecatl.v1.UserModelEntry + (*GetUserModelRequest)(nil), // 88: mecatl.v1.GetUserModelRequest + (*GetUserModelResponse)(nil), // 89: mecatl.v1.GetUserModelResponse + (*ModelInfo)(nil), // 90: mecatl.v1.ModelInfo + (*ListModelsRequest)(nil), // 91: mecatl.v1.ListModelsRequest + (*ProviderStatus)(nil), // 92: mecatl.v1.ProviderStatus + (*ListModelsResponse)(nil), // 93: mecatl.v1.ListModelsResponse + (*CreateTeamRequest)(nil), // 94: mecatl.v1.CreateTeamRequest + (*CreateTeamResponse)(nil), // 95: mecatl.v1.CreateTeamResponse + (*TeammateSpec)(nil), // 96: mecatl.v1.TeammateSpec + (*SpawnTeammateRequest)(nil), // 97: mecatl.v1.SpawnTeammateRequest + (*SpawnTeammateResponse)(nil), // 98: mecatl.v1.SpawnTeammateResponse + (*SendTeammateMessageRequest)(nil), // 99: mecatl.v1.SendTeammateMessageRequest + (*SendTeammateMessageResponse)(nil), // 100: mecatl.v1.SendTeammateMessageResponse + (*CancelTeammateRequest)(nil), // 101: mecatl.v1.CancelTeammateRequest + (*CancelTeammateResponse)(nil), // 102: mecatl.v1.CancelTeammateResponse + (*RunTeamRequest)(nil), // 103: mecatl.v1.RunTeamRequest + (*TeamEvent)(nil), // 104: mecatl.v1.TeamEvent + (*TeamOutcome)(nil), // 105: mecatl.v1.TeamOutcome + (*ListTeamRequest)(nil), // 106: mecatl.v1.ListTeamRequest + (*ListTeamResponse)(nil), // 107: mecatl.v1.ListTeamResponse + (*TeamMember)(nil), // 108: mecatl.v1.TeamMember + (*TeamTask)(nil), // 109: mecatl.v1.TeamTask + (*TeamFinding)(nil), // 110: mecatl.v1.TeamFinding + (*TeamMemberDisposition)(nil), // 111: mecatl.v1.TeamMemberDisposition + (*CleanupTeamRequest)(nil), // 112: mecatl.v1.CleanupTeamRequest + (*CleanupTeamResponse)(nil), // 113: mecatl.v1.CleanupTeamResponse + (*ApprovePlanRequest)(nil), // 114: mecatl.v1.ApprovePlanRequest + nil, // 115: mecatl.v1.GetMcpPromptRequest.ArgumentsEntry } var file_mecatl_v1_harness_proto_depIdxs = []int32{ 0, // 0: mecatl.v1.CreateSessionRequest.mode:type_name -> mecatl.v1.PermissionMode @@ -9878,147 +9984,148 @@ var file_mecatl_v1_harness_proto_depIdxs = []int32{ 9, // 2: mecatl.v1.CreateSessionResponse.capabilities:type_name -> mecatl.v1.ServerCapabilities 12, // 3: mecatl.v1.CreateSessionResponse.session_capabilities:type_name -> mecatl.v1.SessionCapabilities 11, // 4: mecatl.v1.CreateSessionResponse.resolved_model:type_name -> mecatl.v1.ResolvedModel - 26, // 5: mecatl.v1.GetSessionResponse.session:type_name -> mecatl.v1.Session - 18, // 6: mecatl.v1.ListSessionsResponse.sessions:type_name -> mecatl.v1.SessionSummary - 0, // 7: mecatl.v1.SetModeRequest.mode:type_name -> mecatl.v1.PermissionMode - 26, // 8: mecatl.v1.SetModeResponse.session:type_name -> mecatl.v1.Session - 0, // 9: mecatl.v1.Session.mode:type_name -> mecatl.v1.PermissionMode - 7, // 10: mecatl.v1.Session.limits:type_name -> mecatl.v1.Limits - 11, // 11: mecatl.v1.Session.resolved_model:type_name -> mecatl.v1.ResolvedModel - 9, // 12: mecatl.v1.Session.capabilities:type_name -> mecatl.v1.ServerCapabilities - 31, // 13: mecatl.v1.ConverseRequest.prompt:type_name -> mecatl.v1.Prompt - 32, // 14: mecatl.v1.ConverseRequest.resume_approval:type_name -> mecatl.v1.ResumeApproval - 33, // 15: mecatl.v1.ConverseRequest.cancel:type_name -> mecatl.v1.Cancel - 34, // 16: mecatl.v1.ConverseRequest.cancel_child:type_name -> mecatl.v1.CancelChild - 35, // 17: mecatl.v1.ConverseResponse.event:type_name -> mecatl.v1.Event - 5, // 18: mecatl.v1.Content.kind:type_name -> mecatl.v1.Content.Kind - 6, // 19: mecatl.v1.ContentBlock.kind:type_name -> mecatl.v1.ContentBlock.Kind - 29, // 20: mecatl.v1.Prompt.parts:type_name -> mecatl.v1.Content - 1, // 21: mecatl.v1.ResumeApproval.verdict:type_name -> mecatl.v1.ApprovalVerdict - 46, // 22: mecatl.v1.Event.tool_call:type_name -> mecatl.v1.ToolCall - 47, // 23: mecatl.v1.Event.tool_result:type_name -> mecatl.v1.ToolResult - 48, // 24: mecatl.v1.Event.ask:type_name -> mecatl.v1.PermissionAsk - 49, // 25: mecatl.v1.Event.result:type_name -> mecatl.v1.Result - 51, // 26: mecatl.v1.Event.usage:type_name -> mecatl.v1.Usage - 50, // 27: mecatl.v1.Event.turn_end:type_name -> mecatl.v1.TurnEnd - 41, // 28: mecatl.v1.Event.hook:type_name -> mecatl.v1.Hook - 42, // 29: mecatl.v1.Event.subagent:type_name -> mecatl.v1.Subagent - 44, // 30: mecatl.v1.Event.team:type_name -> mecatl.v1.Team - 45, // 31: mecatl.v1.Event.parallel:type_name -> mecatl.v1.Parallel - 40, // 32: mecatl.v1.Event.schedule:type_name -> mecatl.v1.SchedulePayload - 36, // 33: mecatl.v1.Event.approval:type_name -> mecatl.v1.Approval - 37, // 34: mecatl.v1.Event.user_prompt:type_name -> mecatl.v1.UserPrompt - 38, // 35: mecatl.v1.Event.compaction_archive:type_name -> mecatl.v1.CompactionArchive - 29, // 36: mecatl.v1.UserPrompt.parts:type_name -> mecatl.v1.Content - 39, // 37: mecatl.v1.CompactionArchive.replaced:type_name -> mecatl.v1.ConversationMessage - 46, // 38: mecatl.v1.ConversationMessage.tool_calls:type_name -> mecatl.v1.ToolCall - 47, // 39: mecatl.v1.ConversationMessage.tool_result:type_name -> mecatl.v1.ToolResult - 29, // 40: mecatl.v1.ConversationMessage.parts:type_name -> mecatl.v1.Content - 2, // 41: mecatl.v1.Hook.decision:type_name -> mecatl.v1.HookDecision - 51, // 42: mecatl.v1.Subagent.usage:type_name -> mecatl.v1.Usage - 43, // 43: mecatl.v1.Team.roster:type_name -> mecatl.v1.TeamMemberSpec - 51, // 44: mecatl.v1.Team.usage:type_name -> mecatl.v1.Usage - 108, // 45: mecatl.v1.Team.tasks:type_name -> mecatl.v1.TeamTask - 109, // 46: mecatl.v1.Team.findings:type_name -> mecatl.v1.TeamFinding - 110, // 47: mecatl.v1.Team.dispositions:type_name -> mecatl.v1.TeamMemberDisposition - 51, // 48: mecatl.v1.Parallel.usage:type_name -> mecatl.v1.Usage - 30, // 49: mecatl.v1.ToolResult.blocks:type_name -> mecatl.v1.ContentBlock - 51, // 50: mecatl.v1.Result.usage:type_name -> mecatl.v1.Usage - 51, // 51: mecatl.v1.TurnEnd.usage:type_name -> mecatl.v1.Usage - 52, // 52: mecatl.v1.ListMcpResourcesResponse.resources:type_name -> mecatl.v1.McpResource - 55, // 53: mecatl.v1.ReadMcpResourceResponse.contents:type_name -> mecatl.v1.McpResourceContents - 58, // 54: mecatl.v1.McpPrompt.arguments:type_name -> mecatl.v1.McpPromptArgument - 59, // 55: mecatl.v1.ListMcpPromptsResponse.prompts:type_name -> mecatl.v1.McpPrompt - 114, // 56: mecatl.v1.GetMcpPromptRequest.arguments:type_name -> mecatl.v1.GetMcpPromptRequest.ArgumentsEntry - 63, // 57: mecatl.v1.GetMcpPromptResponse.messages:type_name -> mecatl.v1.McpPromptMessage - 65, // 58: mecatl.v1.McpSource.servers:type_name -> mecatl.v1.McpServerInfo - 66, // 59: mecatl.v1.ListMcpSourcesResponse.sources:type_name -> mecatl.v1.McpSource - 71, // 60: mecatl.v1.ListAgentsResponse.agents:type_name -> mecatl.v1.AgentInfo - 74, // 61: mecatl.v1.ListCommandsResponse.commands:type_name -> mecatl.v1.Command - 77, // 62: mecatl.v1.ListWorktreesResponse.worktrees:type_name -> mecatl.v1.Worktree - 80, // 63: mecatl.v1.ListSkillsResponse.skills:type_name -> mecatl.v1.SkillInfo - 3, // 64: mecatl.v1.SoulInfo.provenance:type_name -> mecatl.v1.SoulProvenance - 83, // 65: mecatl.v1.GetSoulResponse.soul:type_name -> mecatl.v1.SoulInfo - 86, // 66: mecatl.v1.GetUserModelResponse.entries:type_name -> mecatl.v1.UserModelEntry - 89, // 67: mecatl.v1.ListModelsResponse.models:type_name -> mecatl.v1.ModelInfo - 91, // 68: mecatl.v1.ListModelsResponse.provider_status:type_name -> mecatl.v1.ProviderStatus - 95, // 69: mecatl.v1.CreateTeamRequest.members:type_name -> mecatl.v1.TeammateSpec - 107, // 70: mecatl.v1.CreateTeamResponse.members:type_name -> mecatl.v1.TeamMember - 107, // 71: mecatl.v1.SpawnTeammateResponse.member:type_name -> mecatl.v1.TeamMember - 35, // 72: mecatl.v1.TeamEvent.event:type_name -> mecatl.v1.Event - 104, // 73: mecatl.v1.TeamEvent.outcome:type_name -> mecatl.v1.TeamOutcome - 51, // 74: mecatl.v1.TeamOutcome.usage:type_name -> mecatl.v1.Usage - 110, // 75: mecatl.v1.TeamOutcome.dispositions:type_name -> mecatl.v1.TeamMemberDisposition - 109, // 76: mecatl.v1.TeamOutcome.findings:type_name -> mecatl.v1.TeamFinding - 107, // 77: mecatl.v1.ListTeamResponse.members:type_name -> mecatl.v1.TeamMember - 108, // 78: mecatl.v1.ListTeamResponse.tasks:type_name -> mecatl.v1.TeamTask - 4, // 79: mecatl.v1.TeamMemberDisposition.reason:type_name -> mecatl.v1.TeamMemberStopReason - 0, // 80: mecatl.v1.ApprovePlanRequest.target_mode:type_name -> mecatl.v1.PermissionMode - 8, // 81: mecatl.v1.HarnessService.CreateSession:input_type -> mecatl.v1.CreateSessionRequest - 13, // 82: mecatl.v1.HarnessService.GetSession:input_type -> mecatl.v1.GetSessionRequest - 20, // 83: mecatl.v1.HarnessService.SetMode:input_type -> mecatl.v1.SetModeRequest - 22, // 84: mecatl.v1.HarnessService.CloseSession:input_type -> mecatl.v1.CloseSessionRequest - 24, // 85: mecatl.v1.HarnessService.ForkSession:input_type -> mecatl.v1.ForkSessionRequest - 27, // 86: mecatl.v1.HarnessService.Converse:input_type -> mecatl.v1.ConverseRequest - 53, // 87: mecatl.v1.HarnessService.ListMcpResources:input_type -> mecatl.v1.ListMcpResourcesRequest - 56, // 88: mecatl.v1.HarnessService.ReadMcpResource:input_type -> mecatl.v1.ReadMcpResourceRequest - 60, // 89: mecatl.v1.HarnessService.ListMcpPrompts:input_type -> mecatl.v1.ListMcpPromptsRequest - 62, // 90: mecatl.v1.HarnessService.GetMcpPrompt:input_type -> mecatl.v1.GetMcpPromptRequest - 67, // 91: mecatl.v1.HarnessService.ListMcpSources:input_type -> mecatl.v1.ListMcpSourcesRequest - 69, // 92: mecatl.v1.HarnessService.ListToolHiveGroups:input_type -> mecatl.v1.ListToolHiveGroupsRequest - 72, // 93: mecatl.v1.HarnessService.ListAgents:input_type -> mecatl.v1.ListAgentsRequest - 75, // 94: mecatl.v1.HarnessService.ListCommands:input_type -> mecatl.v1.ListCommandsRequest - 78, // 95: mecatl.v1.HarnessService.ListWorktrees:input_type -> mecatl.v1.ListWorktreesRequest - 15, // 96: mecatl.v1.HarnessService.StreamSessionEvents:input_type -> mecatl.v1.StreamSessionEventsRequest - 16, // 97: mecatl.v1.HarnessService.StreamSessionLive:input_type -> mecatl.v1.StreamSessionLiveRequest - 17, // 98: mecatl.v1.HarnessService.ListSessions:input_type -> mecatl.v1.ListSessionsRequest - 81, // 99: mecatl.v1.HarnessService.ListSkills:input_type -> mecatl.v1.ListSkillsRequest - 84, // 100: mecatl.v1.HarnessService.GetSoul:input_type -> mecatl.v1.GetSoulRequest - 87, // 101: mecatl.v1.HarnessService.GetUserModel:input_type -> mecatl.v1.GetUserModelRequest - 90, // 102: mecatl.v1.HarnessService.ListModels:input_type -> mecatl.v1.ListModelsRequest - 93, // 103: mecatl.v1.HarnessService.CreateTeam:input_type -> mecatl.v1.CreateTeamRequest - 96, // 104: mecatl.v1.HarnessService.SpawnTeammate:input_type -> mecatl.v1.SpawnTeammateRequest - 98, // 105: mecatl.v1.HarnessService.SendTeammateMessage:input_type -> mecatl.v1.SendTeammateMessageRequest - 100, // 106: mecatl.v1.HarnessService.CancelTeammate:input_type -> mecatl.v1.CancelTeammateRequest - 102, // 107: mecatl.v1.HarnessService.RunTeam:input_type -> mecatl.v1.RunTeamRequest - 105, // 108: mecatl.v1.HarnessService.ListTeam:input_type -> mecatl.v1.ListTeamRequest - 111, // 109: mecatl.v1.HarnessService.CleanupTeam:input_type -> mecatl.v1.CleanupTeamRequest - 113, // 110: mecatl.v1.HarnessService.ApprovePlan:input_type -> mecatl.v1.ApprovePlanRequest - 10, // 111: mecatl.v1.HarnessService.CreateSession:output_type -> mecatl.v1.CreateSessionResponse - 14, // 112: mecatl.v1.HarnessService.GetSession:output_type -> mecatl.v1.GetSessionResponse - 21, // 113: mecatl.v1.HarnessService.SetMode:output_type -> mecatl.v1.SetModeResponse - 23, // 114: mecatl.v1.HarnessService.CloseSession:output_type -> mecatl.v1.CloseSessionResponse - 25, // 115: mecatl.v1.HarnessService.ForkSession:output_type -> mecatl.v1.ForkSessionResponse - 28, // 116: mecatl.v1.HarnessService.Converse:output_type -> mecatl.v1.ConverseResponse - 54, // 117: mecatl.v1.HarnessService.ListMcpResources:output_type -> mecatl.v1.ListMcpResourcesResponse - 57, // 118: mecatl.v1.HarnessService.ReadMcpResource:output_type -> mecatl.v1.ReadMcpResourceResponse - 61, // 119: mecatl.v1.HarnessService.ListMcpPrompts:output_type -> mecatl.v1.ListMcpPromptsResponse - 64, // 120: mecatl.v1.HarnessService.GetMcpPrompt:output_type -> mecatl.v1.GetMcpPromptResponse - 68, // 121: mecatl.v1.HarnessService.ListMcpSources:output_type -> mecatl.v1.ListMcpSourcesResponse - 70, // 122: mecatl.v1.HarnessService.ListToolHiveGroups:output_type -> mecatl.v1.ListToolHiveGroupsResponse - 73, // 123: mecatl.v1.HarnessService.ListAgents:output_type -> mecatl.v1.ListAgentsResponse - 76, // 124: mecatl.v1.HarnessService.ListCommands:output_type -> mecatl.v1.ListCommandsResponse - 79, // 125: mecatl.v1.HarnessService.ListWorktrees:output_type -> mecatl.v1.ListWorktreesResponse - 35, // 126: mecatl.v1.HarnessService.StreamSessionEvents:output_type -> mecatl.v1.Event - 35, // 127: mecatl.v1.HarnessService.StreamSessionLive:output_type -> mecatl.v1.Event - 19, // 128: mecatl.v1.HarnessService.ListSessions:output_type -> mecatl.v1.ListSessionsResponse - 82, // 129: mecatl.v1.HarnessService.ListSkills:output_type -> mecatl.v1.ListSkillsResponse - 85, // 130: mecatl.v1.HarnessService.GetSoul:output_type -> mecatl.v1.GetSoulResponse - 88, // 131: mecatl.v1.HarnessService.GetUserModel:output_type -> mecatl.v1.GetUserModelResponse - 92, // 132: mecatl.v1.HarnessService.ListModels:output_type -> mecatl.v1.ListModelsResponse - 94, // 133: mecatl.v1.HarnessService.CreateTeam:output_type -> mecatl.v1.CreateTeamResponse - 97, // 134: mecatl.v1.HarnessService.SpawnTeammate:output_type -> mecatl.v1.SpawnTeammateResponse - 99, // 135: mecatl.v1.HarnessService.SendTeammateMessage:output_type -> mecatl.v1.SendTeammateMessageResponse - 101, // 136: mecatl.v1.HarnessService.CancelTeammate:output_type -> mecatl.v1.CancelTeammateResponse - 103, // 137: mecatl.v1.HarnessService.RunTeam:output_type -> mecatl.v1.TeamEvent - 106, // 138: mecatl.v1.HarnessService.ListTeam:output_type -> mecatl.v1.ListTeamResponse - 112, // 139: mecatl.v1.HarnessService.CleanupTeam:output_type -> mecatl.v1.CleanupTeamResponse - 35, // 140: mecatl.v1.HarnessService.ApprovePlan:output_type -> mecatl.v1.Event - 111, // [111:141] is the sub-list for method output_type - 81, // [81:111] is the sub-list for method input_type - 81, // [81:81] is the sub-list for extension type_name - 81, // [81:81] is the sub-list for extension extendee - 0, // [0:81] is the sub-list for field type_name + 27, // 5: mecatl.v1.GetSessionResponse.session:type_name -> mecatl.v1.Session + 18, // 6: mecatl.v1.SessionSummary.owner:type_name -> mecatl.v1.Principal + 19, // 7: mecatl.v1.ListSessionsResponse.sessions:type_name -> mecatl.v1.SessionSummary + 0, // 8: mecatl.v1.SetModeRequest.mode:type_name -> mecatl.v1.PermissionMode + 27, // 9: mecatl.v1.SetModeResponse.session:type_name -> mecatl.v1.Session + 0, // 10: mecatl.v1.Session.mode:type_name -> mecatl.v1.PermissionMode + 7, // 11: mecatl.v1.Session.limits:type_name -> mecatl.v1.Limits + 11, // 12: mecatl.v1.Session.resolved_model:type_name -> mecatl.v1.ResolvedModel + 9, // 13: mecatl.v1.Session.capabilities:type_name -> mecatl.v1.ServerCapabilities + 32, // 14: mecatl.v1.ConverseRequest.prompt:type_name -> mecatl.v1.Prompt + 33, // 15: mecatl.v1.ConverseRequest.resume_approval:type_name -> mecatl.v1.ResumeApproval + 34, // 16: mecatl.v1.ConverseRequest.cancel:type_name -> mecatl.v1.Cancel + 35, // 17: mecatl.v1.ConverseRequest.cancel_child:type_name -> mecatl.v1.CancelChild + 36, // 18: mecatl.v1.ConverseResponse.event:type_name -> mecatl.v1.Event + 5, // 19: mecatl.v1.Content.kind:type_name -> mecatl.v1.Content.Kind + 6, // 20: mecatl.v1.ContentBlock.kind:type_name -> mecatl.v1.ContentBlock.Kind + 30, // 21: mecatl.v1.Prompt.parts:type_name -> mecatl.v1.Content + 1, // 22: mecatl.v1.ResumeApproval.verdict:type_name -> mecatl.v1.ApprovalVerdict + 47, // 23: mecatl.v1.Event.tool_call:type_name -> mecatl.v1.ToolCall + 48, // 24: mecatl.v1.Event.tool_result:type_name -> mecatl.v1.ToolResult + 49, // 25: mecatl.v1.Event.ask:type_name -> mecatl.v1.PermissionAsk + 50, // 26: mecatl.v1.Event.result:type_name -> mecatl.v1.Result + 52, // 27: mecatl.v1.Event.usage:type_name -> mecatl.v1.Usage + 51, // 28: mecatl.v1.Event.turn_end:type_name -> mecatl.v1.TurnEnd + 42, // 29: mecatl.v1.Event.hook:type_name -> mecatl.v1.Hook + 43, // 30: mecatl.v1.Event.subagent:type_name -> mecatl.v1.Subagent + 45, // 31: mecatl.v1.Event.team:type_name -> mecatl.v1.Team + 46, // 32: mecatl.v1.Event.parallel:type_name -> mecatl.v1.Parallel + 41, // 33: mecatl.v1.Event.schedule:type_name -> mecatl.v1.SchedulePayload + 37, // 34: mecatl.v1.Event.approval:type_name -> mecatl.v1.Approval + 38, // 35: mecatl.v1.Event.user_prompt:type_name -> mecatl.v1.UserPrompt + 39, // 36: mecatl.v1.Event.compaction_archive:type_name -> mecatl.v1.CompactionArchive + 30, // 37: mecatl.v1.UserPrompt.parts:type_name -> mecatl.v1.Content + 40, // 38: mecatl.v1.CompactionArchive.replaced:type_name -> mecatl.v1.ConversationMessage + 47, // 39: mecatl.v1.ConversationMessage.tool_calls:type_name -> mecatl.v1.ToolCall + 48, // 40: mecatl.v1.ConversationMessage.tool_result:type_name -> mecatl.v1.ToolResult + 30, // 41: mecatl.v1.ConversationMessage.parts:type_name -> mecatl.v1.Content + 2, // 42: mecatl.v1.Hook.decision:type_name -> mecatl.v1.HookDecision + 52, // 43: mecatl.v1.Subagent.usage:type_name -> mecatl.v1.Usage + 44, // 44: mecatl.v1.Team.roster:type_name -> mecatl.v1.TeamMemberSpec + 52, // 45: mecatl.v1.Team.usage:type_name -> mecatl.v1.Usage + 109, // 46: mecatl.v1.Team.tasks:type_name -> mecatl.v1.TeamTask + 110, // 47: mecatl.v1.Team.findings:type_name -> mecatl.v1.TeamFinding + 111, // 48: mecatl.v1.Team.dispositions:type_name -> mecatl.v1.TeamMemberDisposition + 52, // 49: mecatl.v1.Parallel.usage:type_name -> mecatl.v1.Usage + 31, // 50: mecatl.v1.ToolResult.blocks:type_name -> mecatl.v1.ContentBlock + 52, // 51: mecatl.v1.Result.usage:type_name -> mecatl.v1.Usage + 52, // 52: mecatl.v1.TurnEnd.usage:type_name -> mecatl.v1.Usage + 53, // 53: mecatl.v1.ListMcpResourcesResponse.resources:type_name -> mecatl.v1.McpResource + 56, // 54: mecatl.v1.ReadMcpResourceResponse.contents:type_name -> mecatl.v1.McpResourceContents + 59, // 55: mecatl.v1.McpPrompt.arguments:type_name -> mecatl.v1.McpPromptArgument + 60, // 56: mecatl.v1.ListMcpPromptsResponse.prompts:type_name -> mecatl.v1.McpPrompt + 115, // 57: mecatl.v1.GetMcpPromptRequest.arguments:type_name -> mecatl.v1.GetMcpPromptRequest.ArgumentsEntry + 64, // 58: mecatl.v1.GetMcpPromptResponse.messages:type_name -> mecatl.v1.McpPromptMessage + 66, // 59: mecatl.v1.McpSource.servers:type_name -> mecatl.v1.McpServerInfo + 67, // 60: mecatl.v1.ListMcpSourcesResponse.sources:type_name -> mecatl.v1.McpSource + 72, // 61: mecatl.v1.ListAgentsResponse.agents:type_name -> mecatl.v1.AgentInfo + 75, // 62: mecatl.v1.ListCommandsResponse.commands:type_name -> mecatl.v1.Command + 78, // 63: mecatl.v1.ListWorktreesResponse.worktrees:type_name -> mecatl.v1.Worktree + 81, // 64: mecatl.v1.ListSkillsResponse.skills:type_name -> mecatl.v1.SkillInfo + 3, // 65: mecatl.v1.SoulInfo.provenance:type_name -> mecatl.v1.SoulProvenance + 84, // 66: mecatl.v1.GetSoulResponse.soul:type_name -> mecatl.v1.SoulInfo + 87, // 67: mecatl.v1.GetUserModelResponse.entries:type_name -> mecatl.v1.UserModelEntry + 90, // 68: mecatl.v1.ListModelsResponse.models:type_name -> mecatl.v1.ModelInfo + 92, // 69: mecatl.v1.ListModelsResponse.provider_status:type_name -> mecatl.v1.ProviderStatus + 96, // 70: mecatl.v1.CreateTeamRequest.members:type_name -> mecatl.v1.TeammateSpec + 108, // 71: mecatl.v1.CreateTeamResponse.members:type_name -> mecatl.v1.TeamMember + 108, // 72: mecatl.v1.SpawnTeammateResponse.member:type_name -> mecatl.v1.TeamMember + 36, // 73: mecatl.v1.TeamEvent.event:type_name -> mecatl.v1.Event + 105, // 74: mecatl.v1.TeamEvent.outcome:type_name -> mecatl.v1.TeamOutcome + 52, // 75: mecatl.v1.TeamOutcome.usage:type_name -> mecatl.v1.Usage + 111, // 76: mecatl.v1.TeamOutcome.dispositions:type_name -> mecatl.v1.TeamMemberDisposition + 110, // 77: mecatl.v1.TeamOutcome.findings:type_name -> mecatl.v1.TeamFinding + 108, // 78: mecatl.v1.ListTeamResponse.members:type_name -> mecatl.v1.TeamMember + 109, // 79: mecatl.v1.ListTeamResponse.tasks:type_name -> mecatl.v1.TeamTask + 4, // 80: mecatl.v1.TeamMemberDisposition.reason:type_name -> mecatl.v1.TeamMemberStopReason + 0, // 81: mecatl.v1.ApprovePlanRequest.target_mode:type_name -> mecatl.v1.PermissionMode + 8, // 82: mecatl.v1.HarnessService.CreateSession:input_type -> mecatl.v1.CreateSessionRequest + 13, // 83: mecatl.v1.HarnessService.GetSession:input_type -> mecatl.v1.GetSessionRequest + 21, // 84: mecatl.v1.HarnessService.SetMode:input_type -> mecatl.v1.SetModeRequest + 23, // 85: mecatl.v1.HarnessService.CloseSession:input_type -> mecatl.v1.CloseSessionRequest + 25, // 86: mecatl.v1.HarnessService.ForkSession:input_type -> mecatl.v1.ForkSessionRequest + 28, // 87: mecatl.v1.HarnessService.Converse:input_type -> mecatl.v1.ConverseRequest + 54, // 88: mecatl.v1.HarnessService.ListMcpResources:input_type -> mecatl.v1.ListMcpResourcesRequest + 57, // 89: mecatl.v1.HarnessService.ReadMcpResource:input_type -> mecatl.v1.ReadMcpResourceRequest + 61, // 90: mecatl.v1.HarnessService.ListMcpPrompts:input_type -> mecatl.v1.ListMcpPromptsRequest + 63, // 91: mecatl.v1.HarnessService.GetMcpPrompt:input_type -> mecatl.v1.GetMcpPromptRequest + 68, // 92: mecatl.v1.HarnessService.ListMcpSources:input_type -> mecatl.v1.ListMcpSourcesRequest + 70, // 93: mecatl.v1.HarnessService.ListToolHiveGroups:input_type -> mecatl.v1.ListToolHiveGroupsRequest + 73, // 94: mecatl.v1.HarnessService.ListAgents:input_type -> mecatl.v1.ListAgentsRequest + 76, // 95: mecatl.v1.HarnessService.ListCommands:input_type -> mecatl.v1.ListCommandsRequest + 79, // 96: mecatl.v1.HarnessService.ListWorktrees:input_type -> mecatl.v1.ListWorktreesRequest + 15, // 97: mecatl.v1.HarnessService.StreamSessionEvents:input_type -> mecatl.v1.StreamSessionEventsRequest + 16, // 98: mecatl.v1.HarnessService.StreamSessionLive:input_type -> mecatl.v1.StreamSessionLiveRequest + 17, // 99: mecatl.v1.HarnessService.ListSessions:input_type -> mecatl.v1.ListSessionsRequest + 82, // 100: mecatl.v1.HarnessService.ListSkills:input_type -> mecatl.v1.ListSkillsRequest + 85, // 101: mecatl.v1.HarnessService.GetSoul:input_type -> mecatl.v1.GetSoulRequest + 88, // 102: mecatl.v1.HarnessService.GetUserModel:input_type -> mecatl.v1.GetUserModelRequest + 91, // 103: mecatl.v1.HarnessService.ListModels:input_type -> mecatl.v1.ListModelsRequest + 94, // 104: mecatl.v1.HarnessService.CreateTeam:input_type -> mecatl.v1.CreateTeamRequest + 97, // 105: mecatl.v1.HarnessService.SpawnTeammate:input_type -> mecatl.v1.SpawnTeammateRequest + 99, // 106: mecatl.v1.HarnessService.SendTeammateMessage:input_type -> mecatl.v1.SendTeammateMessageRequest + 101, // 107: mecatl.v1.HarnessService.CancelTeammate:input_type -> mecatl.v1.CancelTeammateRequest + 103, // 108: mecatl.v1.HarnessService.RunTeam:input_type -> mecatl.v1.RunTeamRequest + 106, // 109: mecatl.v1.HarnessService.ListTeam:input_type -> mecatl.v1.ListTeamRequest + 112, // 110: mecatl.v1.HarnessService.CleanupTeam:input_type -> mecatl.v1.CleanupTeamRequest + 114, // 111: mecatl.v1.HarnessService.ApprovePlan:input_type -> mecatl.v1.ApprovePlanRequest + 10, // 112: mecatl.v1.HarnessService.CreateSession:output_type -> mecatl.v1.CreateSessionResponse + 14, // 113: mecatl.v1.HarnessService.GetSession:output_type -> mecatl.v1.GetSessionResponse + 22, // 114: mecatl.v1.HarnessService.SetMode:output_type -> mecatl.v1.SetModeResponse + 24, // 115: mecatl.v1.HarnessService.CloseSession:output_type -> mecatl.v1.CloseSessionResponse + 26, // 116: mecatl.v1.HarnessService.ForkSession:output_type -> mecatl.v1.ForkSessionResponse + 29, // 117: mecatl.v1.HarnessService.Converse:output_type -> mecatl.v1.ConverseResponse + 55, // 118: mecatl.v1.HarnessService.ListMcpResources:output_type -> mecatl.v1.ListMcpResourcesResponse + 58, // 119: mecatl.v1.HarnessService.ReadMcpResource:output_type -> mecatl.v1.ReadMcpResourceResponse + 62, // 120: mecatl.v1.HarnessService.ListMcpPrompts:output_type -> mecatl.v1.ListMcpPromptsResponse + 65, // 121: mecatl.v1.HarnessService.GetMcpPrompt:output_type -> mecatl.v1.GetMcpPromptResponse + 69, // 122: mecatl.v1.HarnessService.ListMcpSources:output_type -> mecatl.v1.ListMcpSourcesResponse + 71, // 123: mecatl.v1.HarnessService.ListToolHiveGroups:output_type -> mecatl.v1.ListToolHiveGroupsResponse + 74, // 124: mecatl.v1.HarnessService.ListAgents:output_type -> mecatl.v1.ListAgentsResponse + 77, // 125: mecatl.v1.HarnessService.ListCommands:output_type -> mecatl.v1.ListCommandsResponse + 80, // 126: mecatl.v1.HarnessService.ListWorktrees:output_type -> mecatl.v1.ListWorktreesResponse + 36, // 127: mecatl.v1.HarnessService.StreamSessionEvents:output_type -> mecatl.v1.Event + 36, // 128: mecatl.v1.HarnessService.StreamSessionLive:output_type -> mecatl.v1.Event + 20, // 129: mecatl.v1.HarnessService.ListSessions:output_type -> mecatl.v1.ListSessionsResponse + 83, // 130: mecatl.v1.HarnessService.ListSkills:output_type -> mecatl.v1.ListSkillsResponse + 86, // 131: mecatl.v1.HarnessService.GetSoul:output_type -> mecatl.v1.GetSoulResponse + 89, // 132: mecatl.v1.HarnessService.GetUserModel:output_type -> mecatl.v1.GetUserModelResponse + 93, // 133: mecatl.v1.HarnessService.ListModels:output_type -> mecatl.v1.ListModelsResponse + 95, // 134: mecatl.v1.HarnessService.CreateTeam:output_type -> mecatl.v1.CreateTeamResponse + 98, // 135: mecatl.v1.HarnessService.SpawnTeammate:output_type -> mecatl.v1.SpawnTeammateResponse + 100, // 136: mecatl.v1.HarnessService.SendTeammateMessage:output_type -> mecatl.v1.SendTeammateMessageResponse + 102, // 137: mecatl.v1.HarnessService.CancelTeammate:output_type -> mecatl.v1.CancelTeammateResponse + 104, // 138: mecatl.v1.HarnessService.RunTeam:output_type -> mecatl.v1.TeamEvent + 107, // 139: mecatl.v1.HarnessService.ListTeam:output_type -> mecatl.v1.ListTeamResponse + 113, // 140: mecatl.v1.HarnessService.CleanupTeam:output_type -> mecatl.v1.CleanupTeamResponse + 36, // 141: mecatl.v1.HarnessService.ApprovePlan:output_type -> mecatl.v1.Event + 112, // [112:142] is the sub-list for method output_type + 82, // [82:112] is the sub-list for method input_type + 82, // [82:82] is the sub-list for extension type_name + 82, // [82:82] is the sub-list for extension extendee + 0, // [0:82] is the sub-list for field type_name } func init() { file_mecatl_v1_harness_proto_init() } @@ -10026,7 +10133,7 @@ func file_mecatl_v1_harness_proto_init() { if File_mecatl_v1_harness_proto != nil { return } - file_mecatl_v1_harness_proto_msgTypes[20].OneofWrappers = []any{ + file_mecatl_v1_harness_proto_msgTypes[21].OneofWrappers = []any{ (*ConverseRequest_Prompt)(nil), (*ConverseRequest_ResumeApproval)(nil), (*ConverseRequest_Cancel)(nil), @@ -10038,7 +10145,7 @@ func file_mecatl_v1_harness_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_mecatl_v1_harness_proto_rawDesc), len(file_mecatl_v1_harness_proto_rawDesc)), NumEnums: 7, - NumMessages: 108, + NumMessages: 109, NumExtensions: 0, NumServices: 1, }, diff --git a/contracts/gen/go/mecatl/v1/schedule.pb.go b/contracts/gen/go/mecatl/v1/schedule.pb.go index 0a0e141016..4cf2fcb436 100644 --- a/contracts/gen/go/mecatl/v1/schedule.pb.go +++ b/contracts/gen/go/mecatl/v1/schedule.pb.go @@ -300,7 +300,16 @@ type ScheduleSpec struct { // start + fire_timeout, and a watchdog reads it to terminate the in-flight run // with StopTimeout when it lapses. Per-fire: each fire gets a fresh deadline // from its own start instant. The store stores it inertly. - FireTimeout *durationpb.Duration `protobuf:"bytes,19,opt,name=fire_timeout,json=fireTimeout,proto3" json:"fire_timeout,omitempty"` + FireTimeout *durationpb.Duration `protobuf:"bytes,19,opt,name=fire_timeout,json=fireTimeout,proto3" json:"fire_timeout,omitempty"` + // owner is the verified caller the schedule is attributed to (ADR 0100 + // decision 6), captured ONCE at create time from the create SURFACE — the + // executing session's owner on the Schedule-tool path, the context principal + // on an out-of-band REST/CLI create. It is READ-ONLY on the wire: a create or + // update REQUEST's owner is IGNORED (a caller can no more name a schedule's + // owner than it can name a session's — CreateSessionRequest has no owner field + // for the same reason), and the server projects the captured value on every + // read. Absent = an ownerless schedule, never a fabricated principal. + Owner *Principal `protobuf:"bytes,20,opt,name=owner,proto3" json:"owner,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -468,6 +477,13 @@ func (x *ScheduleSpec) GetFireTimeout() *durationpb.Duration { return nil } +func (x *ScheduleSpec) GetOwner() *Principal { + if x != nil { + return x.Owner + } + return nil +} + // ScheduleState is the durable FIRING state of a schedule — the mutable half // that advances as the schedule fires. Mirrors port.ScheduleState. Updated // atomically by Claim (the claim-before-fire advance) and RecordFire (the @@ -1718,7 +1734,7 @@ var file_mecatl_v1_schedule_proto_rawDesc = string([]byte{ 0x09, 0x52, 0x04, 0x63, 0x72, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x6f, 0x6e, 0x65, 0x5f, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x6f, 0x6e, 0x65, 0x53, 0x68, 0x6f, 0x74, 0x22, 0x8e, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x6f, 0x6e, 0x65, 0x53, 0x68, 0x6f, 0x74, 0x22, 0xba, 0x06, 0x0a, 0x0c, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, @@ -1767,209 +1783,211 @@ var file_mecatl_v1_schedule_proto_rawDesc = string([]byte{ 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0b, 0x66, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, - 0x83, 0x04, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x61, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x46, 0x69, 0x72, 0x65, 0x41, 0x74, 0x12, - 0x3c, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x61, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x41, 0x74, 0x12, 0x1d, 0x0a, - 0x0a, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x09, 0x66, 0x69, 0x72, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, - 0x69, 0x72, 0x65, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6f, 0x6e, 0x65, 0x5f, 0x73, - 0x68, 0x6f, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6f, 0x6e, 0x65, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, - 0x74, 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x4b, 0x0a, 0x14, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x4d, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, 0x69, - 0x72, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, - 0x73, 0x73, 0x41, 0x74, 0x12, 0x3f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x64, 0x65, 0x61, - 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x66, 0x69, 0x72, 0x65, 0x44, 0x65, 0x61, - 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x67, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x2e, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xef, - 0x02, 0x0a, 0x0c, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x72, 0x65, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x23, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x35, 0x0a, 0x08, 0x66, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x07, 0x66, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, - 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x10, - 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, - 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x70, + 0x6f, 0x6e, 0x52, 0x0b, 0x66, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, + 0x2a, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x63, + 0x69, 0x70, 0x61, 0x6c, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x83, 0x04, 0x0a, 0x0d, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, + 0x0c, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x46, 0x69, 0x72, 0x65, 0x41, 0x74, 0x12, 0x3c, 0x0a, 0x0c, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, + 0x61, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, + 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, + 0x69, 0x72, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x72, 0x65, 0x5f, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x14, 0x6f, 0x6e, 0x65, 0x5f, 0x73, 0x68, 0x6f, 0x74, 0x5f, + 0x72, 0x65, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x11, 0x6f, 0x6e, 0x65, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x74, 0x72, 0x79, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x4b, 0x0a, 0x14, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x72, + 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x11, + 0x6c, 0x61, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x4d, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x70, 0x72, - 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x41, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, - 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, - 0x22, 0x4c, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x04, 0x73, 0x70, 0x65, - 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, - 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x49, - 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, - 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x31, 0x0a, 0x12, 0x47, 0x65, 0x74, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x12, 0x6c, 0x61, + 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x41, 0x74, + 0x12, 0x3f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x66, 0x69, 0x72, 0x65, 0x44, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, + 0x65, 0x22, 0x67, 0x0a, 0x08, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x2b, 0x0a, + 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x12, 0x2e, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x63, 0x61, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xef, 0x02, 0x0a, 0x0c, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x35, 0x0a, 0x08, 0x66, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x07, 0x66, + 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, + 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x12, 0x39, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x41, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x4c, 0x0a, 0x15, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x42, 0x06, 0xba, 0x48, + 0x03, 0xc8, 0x01, 0x01, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x49, 0x0a, 0x16, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x08, 0x73, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x31, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x46, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2f, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x22, 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4a, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x31, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x22, 0x4c, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, + 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, 0x52, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x22, 0x49, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x34, 0x0a, + 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x0a, + 0x0e, 0x46, 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, + 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x0f, + 0x46, 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x17, 0x0a, 0x07, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x66, 0x69, 0x72, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x14, 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, - 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x46, 0x0a, 0x13, - 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4a, 0x0a, 0x15, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x09, 0x73, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x4c, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x33, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x17, 0x0a, 0x15, + 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, + 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x52, + 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x72, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x66, 0x69, 0x72, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, + 0x01, 0x52, 0x06, 0x66, 0x69, 0x72, 0x65, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x0f, 0x47, 0x65, 0x74, + 0x46, 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x04, + 0x66, 0x69, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x63, + 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x46, + 0x69, 0x72, 0x65, 0x52, 0x04, 0x66, 0x69, 0x72, 0x65, 0x22, 0x40, 0x0a, 0x10, 0x4c, 0x69, 0x73, + 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, + 0x0d, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0c, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x42, 0x0a, 0x11, 0x4c, + 0x69, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2d, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x42, 0x06, 0xba, 0x48, 0x03, 0xc8, 0x01, 0x01, - 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x49, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2f, 0x0a, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x08, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x22, 0x34, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x72, 0x65, 0x52, 0x05, 0x66, 0x69, 0x72, 0x65, 0x73, 0x2a, + 0x5c, 0x0a, 0x0d, 0x4d, 0x69, 0x73, 0x66, 0x69, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x1e, 0x0a, 0x1a, 0x4d, 0x49, 0x53, 0x46, 0x49, 0x52, 0x45, 0x5f, 0x50, 0x4f, 0x4c, 0x49, + 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x19, 0x0a, 0x15, 0x4d, 0x49, 0x53, 0x46, 0x49, 0x52, 0x45, 0x5f, 0x46, 0x49, 0x52, 0x45, + 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x57, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4d, + 0x49, 0x53, 0x46, 0x49, 0x52, 0x45, 0x5f, 0x53, 0x4b, 0x49, 0x50, 0x10, 0x02, 0x32, 0xaf, 0x06, + 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2d, 0x0a, 0x0e, 0x46, 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x49, 0x0a, 0x0f, 0x46, 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x72, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x72, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x14, 0x50, - 0x61, 0x75, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x17, 0x0a, 0x15, 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x0a, 0x15, 0x52, 0x65, 0x73, + 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x46, 0x69, 0x72, 0x65, + 0x4e, 0x6f, 0x77, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x46, 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, + 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x72, 0x65, 0x4e, + 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x50, 0x61, + 0x75, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x63, 0x68, + 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x63, + 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, + 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x18, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x46, 0x69, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x66, - 0x69, 0x72, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, - 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x66, 0x69, 0x72, 0x65, 0x49, 0x64, 0x22, 0x3e, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x46, 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2b, 0x0a, 0x04, 0x66, 0x69, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x46, 0x69, 0x72, 0x65, 0x52, 0x04, 0x66, 0x69, 0x72, 0x65, 0x22, 0x40, 0x0a, - 0x10, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2c, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, - 0x01, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, - 0x42, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x72, 0x65, 0x52, 0x05, 0x66, 0x69, - 0x72, 0x65, 0x73, 0x2a, 0x5c, 0x0a, 0x0d, 0x4d, 0x69, 0x73, 0x66, 0x69, 0x72, 0x65, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1e, 0x0a, 0x1a, 0x4d, 0x49, 0x53, 0x46, 0x49, 0x52, 0x45, 0x5f, - 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x4d, 0x49, 0x53, 0x46, 0x49, 0x52, 0x45, 0x5f, - 0x46, 0x49, 0x52, 0x45, 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x5f, 0x4e, 0x4f, 0x57, 0x10, 0x01, 0x12, - 0x10, 0x0a, 0x0c, 0x4d, 0x49, 0x53, 0x46, 0x49, 0x52, 0x45, 0x5f, 0x53, 0x4b, 0x49, 0x50, 0x10, - 0x02, 0x32, 0xaf, 0x06, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1d, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6d, 0x65, 0x63, - 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x63, 0x68, - 0x65, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, - 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, - 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, - 0x46, 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, - 0x69, 0x72, 0x65, 0x4e, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, - 0x0a, 0x0d, 0x50, 0x61, 0x75, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x12, - 0x1f, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x75, 0x73, - 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x75, - 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, - 0x46, 0x69, 0x72, 0x65, 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1a, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, - 0x69, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x4c, - 0x69, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0xa3, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x6c, 0x6f, 0x6b, 0x2f, 0x6d, 0x65, 0x63, 0x61, - 0x74, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x67, 0x6f, 0x2f, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, - 0x63, 0x61, 0x74, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4d, 0x65, 0x63, 0x61, 0x74, - 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x15, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, - 0x65, 0x63, 0x61, 0x74, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x73, 0x75, 0x6d, 0x65, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x46, 0x69, 0x72, 0x65, + 0x12, 0x19, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x46, 0x69, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x65, + 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x46, + 0x69, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1c, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x46, 0x69, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0xa3, 0x01, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2e, 0x76, + 0x31, 0x42, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, + 0x74, 0x61, 0x63, 0x6b, 0x6c, 0x6f, 0x6b, 0x2f, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, + 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x65, 0x63, 0x61, 0x74, 0x6c, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x09, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x15, 0x4d, 0x65, 0x63, 0x61, 0x74, 0x6c, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0a, 0x4d, 0x65, 0x63, 0x61, 0x74, + 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, }) var ( @@ -2019,6 +2037,7 @@ var file_mecatl_v1_schedule_proto_goTypes = []any{ (PermissionMode)(0), // 29: mecatl.v1.PermissionMode (*Limits)(nil), // 30: mecatl.v1.Limits (*durationpb.Duration)(nil), // 31: google.protobuf.Duration + (*Principal)(nil), // 32: mecatl.v1.Principal } var file_mecatl_v1_schedule_proto_depIdxs = []int32{ 27, // 0: mecatl.v1.TriggerSpec.one_shot:type_name -> google.protobuf.Timestamp @@ -2030,50 +2049,51 @@ var file_mecatl_v1_schedule_proto_depIdxs = []int32{ 0, // 6: mecatl.v1.ScheduleSpec.misfire:type_name -> mecatl.v1.MisfirePolicy 27, // 7: mecatl.v1.ScheduleSpec.created_at:type_name -> google.protobuf.Timestamp 31, // 8: mecatl.v1.ScheduleSpec.fire_timeout:type_name -> google.protobuf.Duration - 27, // 9: mecatl.v1.ScheduleState.next_fire_at:type_name -> google.protobuf.Timestamp - 27, // 10: mecatl.v1.ScheduleState.last_fire_at:type_name -> google.protobuf.Timestamp - 27, // 11: mecatl.v1.ScheduleState.last_fire_started_at:type_name -> google.protobuf.Timestamp - 27, // 12: mecatl.v1.ScheduleState.last_fire_progress_at:type_name -> google.protobuf.Timestamp - 27, // 13: mecatl.v1.ScheduleState.fire_deadline:type_name -> google.protobuf.Timestamp - 3, // 14: mecatl.v1.Schedule.spec:type_name -> mecatl.v1.ScheduleSpec - 4, // 15: mecatl.v1.Schedule.state:type_name -> mecatl.v1.ScheduleState - 27, // 16: mecatl.v1.ScheduleFire.fired_at:type_name -> google.protobuf.Timestamp - 27, // 17: mecatl.v1.ScheduleFire.started_at:type_name -> google.protobuf.Timestamp - 27, // 18: mecatl.v1.ScheduleFire.progress_at:type_name -> google.protobuf.Timestamp - 27, // 19: mecatl.v1.ScheduleFire.deadline:type_name -> google.protobuf.Timestamp - 3, // 20: mecatl.v1.CreateScheduleRequest.spec:type_name -> mecatl.v1.ScheduleSpec - 5, // 21: mecatl.v1.CreateScheduleResponse.schedule:type_name -> mecatl.v1.Schedule - 5, // 22: mecatl.v1.GetScheduleResponse.schedule:type_name -> mecatl.v1.Schedule - 5, // 23: mecatl.v1.ListSchedulesResponse.schedules:type_name -> mecatl.v1.Schedule - 3, // 24: mecatl.v1.UpdateScheduleRequest.spec:type_name -> mecatl.v1.ScheduleSpec - 5, // 25: mecatl.v1.UpdateScheduleResponse.schedule:type_name -> mecatl.v1.Schedule - 6, // 26: mecatl.v1.GetFireResponse.fire:type_name -> mecatl.v1.ScheduleFire - 6, // 27: mecatl.v1.ListFiresResponse.fires:type_name -> mecatl.v1.ScheduleFire - 7, // 28: mecatl.v1.ScheduleService.CreateSchedule:input_type -> mecatl.v1.CreateScheduleRequest - 9, // 29: mecatl.v1.ScheduleService.GetSchedule:input_type -> mecatl.v1.GetScheduleRequest - 11, // 30: mecatl.v1.ScheduleService.ListSchedules:input_type -> mecatl.v1.ListSchedulesRequest - 13, // 31: mecatl.v1.ScheduleService.UpdateSchedule:input_type -> mecatl.v1.UpdateScheduleRequest - 15, // 32: mecatl.v1.ScheduleService.DeleteSchedule:input_type -> mecatl.v1.DeleteScheduleRequest - 17, // 33: mecatl.v1.ScheduleService.FireNow:input_type -> mecatl.v1.FireNowRequest - 19, // 34: mecatl.v1.ScheduleService.PauseSchedule:input_type -> mecatl.v1.PauseScheduleRequest - 21, // 35: mecatl.v1.ScheduleService.ResumeSchedule:input_type -> mecatl.v1.ResumeScheduleRequest - 23, // 36: mecatl.v1.ScheduleService.GetFire:input_type -> mecatl.v1.GetFireRequest - 25, // 37: mecatl.v1.ScheduleService.ListFires:input_type -> mecatl.v1.ListFiresRequest - 8, // 38: mecatl.v1.ScheduleService.CreateSchedule:output_type -> mecatl.v1.CreateScheduleResponse - 10, // 39: mecatl.v1.ScheduleService.GetSchedule:output_type -> mecatl.v1.GetScheduleResponse - 12, // 40: mecatl.v1.ScheduleService.ListSchedules:output_type -> mecatl.v1.ListSchedulesResponse - 14, // 41: mecatl.v1.ScheduleService.UpdateSchedule:output_type -> mecatl.v1.UpdateScheduleResponse - 16, // 42: mecatl.v1.ScheduleService.DeleteSchedule:output_type -> mecatl.v1.DeleteScheduleResponse - 18, // 43: mecatl.v1.ScheduleService.FireNow:output_type -> mecatl.v1.FireNowResponse - 20, // 44: mecatl.v1.ScheduleService.PauseSchedule:output_type -> mecatl.v1.PauseScheduleResponse - 22, // 45: mecatl.v1.ScheduleService.ResumeSchedule:output_type -> mecatl.v1.ResumeScheduleResponse - 24, // 46: mecatl.v1.ScheduleService.GetFire:output_type -> mecatl.v1.GetFireResponse - 26, // 47: mecatl.v1.ScheduleService.ListFires:output_type -> mecatl.v1.ListFiresResponse - 38, // [38:48] is the sub-list for method output_type - 28, // [28:38] is the sub-list for method input_type - 28, // [28:28] is the sub-list for extension type_name - 28, // [28:28] is the sub-list for extension extendee - 0, // [0:28] is the sub-list for field type_name + 32, // 9: mecatl.v1.ScheduleSpec.owner:type_name -> mecatl.v1.Principal + 27, // 10: mecatl.v1.ScheduleState.next_fire_at:type_name -> google.protobuf.Timestamp + 27, // 11: mecatl.v1.ScheduleState.last_fire_at:type_name -> google.protobuf.Timestamp + 27, // 12: mecatl.v1.ScheduleState.last_fire_started_at:type_name -> google.protobuf.Timestamp + 27, // 13: mecatl.v1.ScheduleState.last_fire_progress_at:type_name -> google.protobuf.Timestamp + 27, // 14: mecatl.v1.ScheduleState.fire_deadline:type_name -> google.protobuf.Timestamp + 3, // 15: mecatl.v1.Schedule.spec:type_name -> mecatl.v1.ScheduleSpec + 4, // 16: mecatl.v1.Schedule.state:type_name -> mecatl.v1.ScheduleState + 27, // 17: mecatl.v1.ScheduleFire.fired_at:type_name -> google.protobuf.Timestamp + 27, // 18: mecatl.v1.ScheduleFire.started_at:type_name -> google.protobuf.Timestamp + 27, // 19: mecatl.v1.ScheduleFire.progress_at:type_name -> google.protobuf.Timestamp + 27, // 20: mecatl.v1.ScheduleFire.deadline:type_name -> google.protobuf.Timestamp + 3, // 21: mecatl.v1.CreateScheduleRequest.spec:type_name -> mecatl.v1.ScheduleSpec + 5, // 22: mecatl.v1.CreateScheduleResponse.schedule:type_name -> mecatl.v1.Schedule + 5, // 23: mecatl.v1.GetScheduleResponse.schedule:type_name -> mecatl.v1.Schedule + 5, // 24: mecatl.v1.ListSchedulesResponse.schedules:type_name -> mecatl.v1.Schedule + 3, // 25: mecatl.v1.UpdateScheduleRequest.spec:type_name -> mecatl.v1.ScheduleSpec + 5, // 26: mecatl.v1.UpdateScheduleResponse.schedule:type_name -> mecatl.v1.Schedule + 6, // 27: mecatl.v1.GetFireResponse.fire:type_name -> mecatl.v1.ScheduleFire + 6, // 28: mecatl.v1.ListFiresResponse.fires:type_name -> mecatl.v1.ScheduleFire + 7, // 29: mecatl.v1.ScheduleService.CreateSchedule:input_type -> mecatl.v1.CreateScheduleRequest + 9, // 30: mecatl.v1.ScheduleService.GetSchedule:input_type -> mecatl.v1.GetScheduleRequest + 11, // 31: mecatl.v1.ScheduleService.ListSchedules:input_type -> mecatl.v1.ListSchedulesRequest + 13, // 32: mecatl.v1.ScheduleService.UpdateSchedule:input_type -> mecatl.v1.UpdateScheduleRequest + 15, // 33: mecatl.v1.ScheduleService.DeleteSchedule:input_type -> mecatl.v1.DeleteScheduleRequest + 17, // 34: mecatl.v1.ScheduleService.FireNow:input_type -> mecatl.v1.FireNowRequest + 19, // 35: mecatl.v1.ScheduleService.PauseSchedule:input_type -> mecatl.v1.PauseScheduleRequest + 21, // 36: mecatl.v1.ScheduleService.ResumeSchedule:input_type -> mecatl.v1.ResumeScheduleRequest + 23, // 37: mecatl.v1.ScheduleService.GetFire:input_type -> mecatl.v1.GetFireRequest + 25, // 38: mecatl.v1.ScheduleService.ListFires:input_type -> mecatl.v1.ListFiresRequest + 8, // 39: mecatl.v1.ScheduleService.CreateSchedule:output_type -> mecatl.v1.CreateScheduleResponse + 10, // 40: mecatl.v1.ScheduleService.GetSchedule:output_type -> mecatl.v1.GetScheduleResponse + 12, // 41: mecatl.v1.ScheduleService.ListSchedules:output_type -> mecatl.v1.ListSchedulesResponse + 14, // 42: mecatl.v1.ScheduleService.UpdateSchedule:output_type -> mecatl.v1.UpdateScheduleResponse + 16, // 43: mecatl.v1.ScheduleService.DeleteSchedule:output_type -> mecatl.v1.DeleteScheduleResponse + 18, // 44: mecatl.v1.ScheduleService.FireNow:output_type -> mecatl.v1.FireNowResponse + 20, // 45: mecatl.v1.ScheduleService.PauseSchedule:output_type -> mecatl.v1.PauseScheduleResponse + 22, // 46: mecatl.v1.ScheduleService.ResumeSchedule:output_type -> mecatl.v1.ResumeScheduleResponse + 24, // 47: mecatl.v1.ScheduleService.GetFire:output_type -> mecatl.v1.GetFireResponse + 26, // 48: mecatl.v1.ScheduleService.ListFires:output_type -> mecatl.v1.ListFiresResponse + 39, // [39:49] is the sub-list for method output_type + 29, // [29:39] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_mecatl_v1_schedule_proto_init() } diff --git a/contracts/proto/mecatl/v1/harness.proto b/contracts/proto/mecatl/v1/harness.proto index 1e1a8418b8..7457dba2c1 100644 --- a/contracts/proto/mecatl/v1/harness.proto +++ b/contracts/proto/mecatl/v1/harness.proto @@ -573,6 +573,26 @@ message StreamSessionLiveRequest { // ListSessionsRequest is the empty unary request for the stored-session inventory. message ListSessionsRequest {} +// Principal is the verified caller an object is attributed to (ADR 0100 — caller +// identity, threaded). Identity is the (issuer, subject) PAIR, never subject alone: +// two IdPs or realms collide on `sub`. It carries NO scopes, NO credentials and NO +// claims map — attribution only; enforcement is the isolation track's. +// +// An ABSENT principal is an ABSENT message (a nil owner), never a present-but-empty +// one — "nobody" must never be renderable as an anonymous somebody. +message Principal { + // issuer is the IdP that minted the token (the canonical `iss` claim). + string issuer = 1; + // subject is the caller id within that issuer (the `sub` claim). + string subject = 2; + // grant_type is how the caller authenticated: "user", "client_credentials" or + // "system". A bare string passthrough (no enum) — the domain owns the closed set. + string grant_type = 3; + // name is an optional human-readable display label. It is NEVER part of + // identity — display only. + string name = 4; +} + // SessionSummary is one stored session's picker metadata — id, timestamps, state, // turn count, and the resolved model id. It carries NO conversation content: it is // the cheap row a client renders in an "open existing session" picker (issue #245 @@ -604,6 +624,13 @@ message SessionSummary { // may derive a fallback). Populated from the snapshot Title (or the lazy // fallback) by ListSessions. string title = 7; + // owner is the verified caller the session is attributed to (ADR 0100), stamped + // write-once at CreateSession from the validated token — never from the request + // body. UNSET for an ownerless session (a no-auth deployment, or a session + // persisted before the owner label existed; nothing backfills it). It is DISPLAY + // metadata: ListSessions applies NO owner filtering — scoping is the isolation + // track's (#368), not this one's. + Principal owner = 8; } // ListSessionsResponse carries the stored-session inventory, sorted by diff --git a/contracts/proto/mecatl/v1/schedule.proto b/contracts/proto/mecatl/v1/schedule.proto index 0042ce6100..4856c3ddc0 100644 --- a/contracts/proto/mecatl/v1/schedule.proto +++ b/contracts/proto/mecatl/v1/schedule.proto @@ -199,6 +199,15 @@ message ScheduleSpec { // with StopTimeout when it lapses. Per-fire: each fire gets a fresh deadline // from its own start instant. The store stores it inertly. google.protobuf.Duration fire_timeout = 19; + // owner is the verified caller the schedule is attributed to (ADR 0100 + // decision 6), captured ONCE at create time from the create SURFACE — the + // executing session's owner on the Schedule-tool path, the context principal + // on an out-of-band REST/CLI create. It is READ-ONLY on the wire: a create or + // update REQUEST's owner is IGNORED (a caller can no more name a schedule's + // owner than it can name a session's — CreateSessionRequest has no owner field + // for the same reason), and the server projects the captured value on every + // read. Absent = an ownerless schedule, never a fabricated principal. + Principal owner = 20; } // ScheduleState is the durable FIRING state of a schedule — the mutable half diff --git a/deploy/README.md b/deploy/README.md index 6c392cc640..572b4d86fe 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -17,8 +17,10 @@ boundary to Kubernetes networking. - **Recommended in-pod control: enable `--auth-token`.** mecated supports `--auth-token` (bearer-token auth) as well as TLS and mTLS. Turning on `--auth-token` gives you a caller-identity check that travels with the pod, - independent of network topology. The `/healthz` and `/readyz` endpoints are - mounted **outside** the auth boundary, so probes keep working when auth is on. + independent of network topology. The HTTP `/healthz` and `/readyz` endpoints + are mounted **outside** the auth boundary so probes keep working; the gRPC + health service shares the API's auth interceptors and needs credentials when + auth is enabled. - A default-deny ingress **`NetworkPolicy`** ships in `networkpolicy.yaml` (wired into `kustomization.yaml`). It selects the mecated pod and allows no ingress until you add an explicit allow for your clients — defense-in-depth on @@ -95,3 +97,74 @@ Both the pod- and container-level `securityContext` satisfy the PSS **restricted** profile: `runAsNonRoot` (UID/GID 65532, matching the chainguard static base), `allowPrivilegeEscalation: false`, `readOnlyRootFilesystem: true`, `seccompProfile: RuntimeDefault`, and `capabilities.drop: [ALL]`. + +## Caller identity (OIDC) — the opt-in overlay + +`deploy/mecak8s-oidc/` is a kustomize overlay over `deploy/mecak8s/` that turns +on **caller identity**: a real IdP authenticates each caller, and every session +and schedule records the verified `(issuer, subject)` that owns it. + +```sh +# Use a registry your target cluster can pull from; ko.local is not sufficient. +export KO_DOCKER_REPO=registry.example/mecatl +task deploy:apply ROOT=deploy/mecak8s-oidc # edit the three flag values first +``` + +It appends four flags to the agent — `--oidc-issuer`, `--oidc-audience` +(required whenever the issuer is set), the optional `--oidc-jwks-uri` (pin the +signing-key endpoint and skip discovery, for an air-gapped or pinned-key +deployment), and `--oidc-max-jwks-staleness=1h`. The base deploys with identity +**off**, byte-identically to a mecatl without it, so nothing changes for existing +users of these manifests. + +**This is attribution, not isolation.** It records who acted; it refuses nothing. +Any authenticated caller can still list and act on any session — per-caller +access control is separate, later work. Do not deploy it as a tenancy boundary. + +**Point it at a real external IdP over HTTPS.** That is the only shape that works +with the token validator's security defaults intact: it refuses an `http://` +issuer, and refuses a `jwks_uri` that resolves to a private, loopback or +link-local address — which is what stops a `jwks_uri` aimed at cloud instance +metadata (`169.254.169.254`). An **in-cluster** IdP needs a flag that relaxes +both checks; that flag exists for the end-to-end test fixtures only and is +deliberately absent from these manifests, because a published example must not +ship SSRF relaxation. No `NetworkPolicy` patch is needed either: the base egress +already allows DNS plus TCP 443 to any destination IP, exactly what an external +IdP requires. + +### Validator and signing-key availability + +The shipped validator is `toolhive-core/authn` **v0.0.39**. A bad OIDC +configuration — including an unreachable initial key fetch — is fatal at startup; +the deployment never silently becomes unauthenticated. + +After a successful fetch, a short IdP outage can use the last good JWKS. The +explicit overlay value `--oidc-max-jwks-staleness=1h` bounds that availability +fallback: after one hour the validator tries to refresh and returns **503 Service +Unavailable** when it cannot obtain current keys. That is distinct from a bad, +expired, wrong-issuer, or wrong-audience token, which is rejected as **401**. +The hour is the maximum additional exposure for a signing key revoked at the IdP +during an outage; it is **not** per-token revocation. A token that remains valid +under a still-trusted signing key is accepted until its normal expiry. Set the +flag to `0` only to deliberately restore unbounded cached-key availability and +its corresponding signing-key revocation exposure. + +The JWKS cache is process-local and is not persisted. Restarting fetches current +keys again; if the IdP is still unavailable, an identity-enabled process cannot +start. + +### Trying it locally by hand + +The same flags work on a plain `mecated` and are the quickest way to see +attribution end to end: + +```sh +bin/mecated --grpc-addr=127.0.0.1:8080 \ + --oidc-issuer=https://idp.example.com/realms/mecatl \ + --oidc-audience=mecatl \ + --oidc-jwks-uri=https://idp.example.com/realms/mecatl/protocol/openid-connect/certs \ + --oidc-max-jwks-staleness=1h +``` + +Then create a session with a bearer token from that issuer and list sessions: the +row names the caller. diff --git a/deploy/mecak8s-oidc/agent-oidc-args.yaml b/deploy/mecak8s-oidc/agent-oidc-args.yaml new file mode 100644 index 0000000000..64de0c05fc --- /dev/null +++ b/deploy/mecak8s-oidc/agent-oidc-args.yaml @@ -0,0 +1,28 @@ +# Appends the four caller-identity flags to the agent's args (ADR 0100 +# decision 3; ADR 0101). +# +# A JSON6902 `add` to `args/-`, NOT a strategic-merge patch: a container's `args` +# is an ATOMIC list, so a strategic merge that mentioned `args` would REPLACE the +# base list wholesale and silently drop --redis-url, --session-lease-k8s-namespace +# and --mock. Appending preserves them. +# +# Replace the three IdP values with your own. --oidc-audience is REQUIRED whenever +# --oidc-issuer is set: an audience-less verifier accepts tokens minted for a +# different service. --oidc-jwks-uri is optional — set it to pin the signing-key +# endpoint and skip OIDC discovery (an air-gapped or pinned-key deployment); +# leave it out to derive the endpoint from the issuer's discovery document. Cached +# keys are trusted for at most one hour when refresh is unavailable; this explicit +# value makes the deployment policy reviewable. Set 0 only when knowingly accepting +# unbounded signing-key revocation exposure during an IdP outage. +- op: add + path: /spec/template/spec/containers/0/args/- + value: --oidc-issuer=https://idp.example.com/realms/mecatl +- op: add + path: /spec/template/spec/containers/0/args/- + value: --oidc-audience=mecatl +- op: add + path: /spec/template/spec/containers/0/args/- + value: --oidc-jwks-uri=https://idp.example.com/realms/mecatl/protocol/openid-connect/certs +- op: add + path: /spec/template/spec/containers/0/args/- + value: --oidc-max-jwks-staleness=1h diff --git a/deploy/mecak8s-oidc/kustomization.yaml b/deploy/mecak8s-oidc/kustomization.yaml new file mode 100644 index 0000000000..16b73f650c --- /dev/null +++ b/deploy/mecak8s-oidc/kustomization.yaml @@ -0,0 +1,39 @@ +# Kustomize overlay: caller identity (OIDC) for the mecak8s agent (ADR 0100). +# +# OPT-IN. The base deploys with identity OFF, which is byte-identical to a mecatl +# without caller identity — this overlay is for a deployment that wants every +# session and schedule to record WHICH verified caller owns it. +# +# kubectl apply -k deploy/mecak8s-oidc +# +# It points at a REAL, EXTERNAL IdP over HTTPS. That is deliberate and it is the +# only configuration that works with the token validator's security defaults +# intact: the validator refuses an `http://` issuer, and refuses a jwks_uri that +# resolves to a private, loopback or link-local address (which is what stops a +# jwks_uri pointing at cloud instance metadata, 169.254.169.254). An in-cluster +# IdP therefore needs a flag that relaxes those checks; that flag exists for the +# e2e fixtures ONLY and is deliberately absent here — a published example must +# not ship SSRF relaxation. +# +# No NetworkPolicy patch is needed: the base egress already allows DNS plus TCP +# 443 to any destination IP, which is exactly what an external IdP requires. +# +# ATTRIBUTION, NOT ISOLATION: this records who acted. It refuses nothing. Any +# authenticated caller can still act on any session — per-caller access control +# is a later, separate piece of work. Do not deploy this as a tenancy boundary. +# +# The production validator is toolhive-core/authn v0.0.39. A bad OIDC +# configuration still fails closed at startup rather than serving unauthenticated. +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../mecak8s + +patches: + - path: agent-oidc-args.yaml + target: + group: apps + version: v1 + kind: Deployment + name: mecak8s-agent diff --git a/deploy/mecak8s/networkpolicy.yaml b/deploy/mecak8s/networkpolicy.yaml index 1caaae0d16..f02e12980c 100644 --- a/deploy/mecak8s/networkpolicy.yaml +++ b/deploy/mecak8s/networkpolicy.yaml @@ -11,7 +11,9 @@ # Ingress is default-deny: the agent is reached via the mecak8s-agent Service, # so only pods in this namespace (or an explicit client allow) may connect. # The health probes (/readyz, /healthz) and /drain are served by kubelet on the -# node, which is NOT subject to NetworkPolicy, so they keep working. +# node, which is NOT subject to NetworkPolicy, so they keep working. /drain is +# deliberately unauthenticated for the preStop hook; do not grant general +# clients ingress unless they are also allowed to put the pod into drain mode. apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: diff --git a/docs/acceptance/README.md b/docs/acceptance/README.md index 93faed71da..8eb2c34790 100644 --- a/docs/acceptance/README.md +++ b/docs/acceptance/README.md @@ -1,11 +1,11 @@ # Acceptance plans -Each document here is an acceptance plan: the smallest set of work that makes -one capability demonstrable on the running harness. Plans are organized -scenario-first — acceptance is about what the harness can show, not which -packages exist on disk. Each plan names its capability, cites the ADRs / -[architecture](../architecture.md) / [AGENTS.md](../../AGENTS.md) invariants -that pin its decisions, and carries the accumulator branch its work lands on. +Each document here is an acceptance plan or completed acceptance record: the +smallest set of work that makes one capability demonstrable on the running +harness. They are organized scenario-first — acceptance is about what the +harness can show, not which packages exist on disk. Each document names its +capability and cites the ADRs / [architecture](../architecture.md) / +[AGENTS.md](../../AGENTS.md) invariants that pin its decisions. Plans are authored by the `/to-acceptance-plan` skill and driven to completion by `/plan-orchestrate`. New plans must be linked from this README; the matlatl @@ -68,6 +68,9 @@ when the code that satisfies the plan has landed. - [Delegation observability convergence](delegation-observability-convergence.md) — bounded previews for Subagent/Parallel, converging the delegation observability surface on two tiers (Team-unique structures stay Team-only). Status: landed. +- [Caller identity](caller-identity.md) — completed acceptance record for optional + OIDC caller attribution: a verified principal, durable session/schedule ownership, + and log-only event actors; no authorization. Status: landed. ## See also diff --git a/docs/acceptance/caller-identity.md b/docs/acceptance/caller-identity.md new file mode 100644 index 0000000000..ae667c3b60 --- /dev/null +++ b/docs/acceptance/caller-identity.md @@ -0,0 +1,93 @@ +# Caller identity — completed acceptance record + +**Status:** landed, 2026-08-11 +**Issue:** [stacklok/mecatl#367](https://github.com/stacklok/mecatl/issues/367) +**Rationale:** [ADR 0100](../adr/0100-caller-identity-threading.md); cached-JWKS availability policy: [ADR 0101](../adr/0101-bounded-jwks-staleness.md). + +Caller identity is optional OIDC authentication and durable attribution. A verified +principal is carried in the request context, sessions and schedules retain their +owner, and durable events record the caller that acted. Current behavior and operator +configuration belong in the [architecture guide](../architecture.md) and +[`mecated` usage guide](../usage/mecated.md). + +## Acceptance criteria and verification mapping + +### Edge and context + +- **AC1.1:** When OIDC is configured, a valid token from the configured issuer and + audience yields its `(issuer, subject)` principal on the handler context. + - verify: `TestCallerIdentity_Scenario1_ValidTokenYieldsPrincipal` +- **AC1.2:** Invalid, malformed, or unusable principals are rejected before the + handler runs; an unavailable JWKS is distinguishable as a 503-class condition. + - verify: `TestCallerIdentity_Scenario1_BadTokensRejected`, + `TestCallerIdentityEdgeRejectsMalformedPrincipal`, + `TestCallerIdentity_Scenario1_JWKSDownIsTransientNotUnauthorized` +- **AC1.3:** Without OIDC configuration, requests remain unauthenticated with a nil + principal; no anonymous principal is fabricated. + - verify: `TestCallerIdentity_Scenario1_NoAuthByteIdentical`, + `TestInvariant_no_fabricated_principal` +- **AC1.4:** OIDC enablement is independent of static-token authentication, and rate + limiting under OIDC uses the validated `(issuer, subject)`, not the raw token. + - verify: `TestCallerIdentity_Scenario1_IdentityPredicateIndependent`, + `TestCallerIdentity_Scenario1_RateLimitKeyedOnPrincipal` +- **AC2.1:** The principal rides the context rather than widening port interfaces. + Internal work that crosses a port boundary runs with an explicit system principal. + - verify: `TestCallerIdentity_Scenario2_InternalGoroutinesRunAsSystem` + +### Durable ownership and attribution + +- **AC3.1:** `CreateSession` records the verified principal as the write-once session + owner. The owner round-trips snapshots, restart/rehydration, and list rows, + including both list implementation paths. + - verify: `TestCallerIdentity_Scenario0_OwnerSnapshotRoundTrip`, + `TestCallerIdentity_Scenario0_PreShipSnapshotRestores`, + `TestCallerIdentity_Scenario0_APICompatAdditive`, + `TestCallerIdentity_Scenario3_OwnerRecordedAndListed`, + `TestCallerIdentity_Scenario3_OwnerSurvivesReopenRestart` +- **AC3.2:** Child sessions and forks retain the source owner. Pre-identity sessions + remain ownerless and are never adopted on a later access. + - verify: `TestCallerIdentity_Scenario3_ForkInheritsSourceOwner`, + `TestCallerIdentity_Scenario3_PreShipSessionNeverBackfilled` +- **AC3.3:** Session ownership is display-only: it does not filter listings or deny + access. + - verify: `TestCallerIdentity_Scenario3_ListRowOwnerIsDisplayOnly` +- **AC4.1:** Durable events record the context principal that acted, not the session + owner. The annotation is log-only and does not reach client event relays or alter + event-sourced rehydration. + - verify: `TestCallerIdentity_Scenario4_EventActorStampedAtAppendOnly`, + `TestCallerIdentity_Scenario4_EventActorLogOnly`, + `TestCallerIdentity_Scenario4_OwnerlessEventActorAbsent` +- **AC4.2:** A schedule captures its owner at creation. Its fire session retains that + owner with `client_credentials`; the fire's events name the scheduler system + principal. + - verify: `TestCallerIdentity_Scenario4_ScheduleOwnerCapturedAtCreate`, + `TestCallerIdentity_Scenario4_OutOfBandScheduleOwnerFromContext`, + `TestCallerIdentity_Scenario4_FireRunsAsOwnerClientCredentials` + +### Deployment boundary + +- **AC5.1:** A configured validator fails closed at startup when initial key material + cannot be obtained. Cached JWKS behavior follows ADR 0101: after the configured + staleness bound, an unavailable refresh is 503-class rather than an authentication + success or 401. + - verify: `TestCallerIdentity_Scenario1_MisconfiguredOIDCFailsToStart`, + `TestCallerIdentityE2E_Scenario2_RealTokenYieldsPrincipal`, + `TestCallerIdentityE2E_Scenario2_WrongAudienceRejected`, + `TestCallerIdentityE2E_Scenario2_StaticJWKSSkipsDiscovery` +- **AC5.2:** The published deployment configuration leaves identity off unless OIDC + is explicitly configured and does not enable the private-issuer relaxation. + - verify: `TestCallerIdentityE2E_Scenario3_PrivateIssuerRefusedByDefault`, + `TestCallerIdentityE2E_Scenario3_InsecureIssuerFlagWarns` + +## Non-goals + +- Authorization, ownership enforcement, list filtering, and workspace isolation. +- Per-user keying of memory, soul, user-tier skills, agent definitions, commands, or + rules. +- Per-token revocation, multi-tenant quotas, or authentication audit metrics. +- Redis authentication/TLS/keyspace scoping, snapshot MACs, event-log integrity, + sensitivity labels, and deliberate sharing. + +Caller identity is attribution, not a tenancy boundary. A valid token under a +currently trusted signing key remains valid until normal expiry; the JWKS staleness +bound limits cached signing-key trust during an identity-provider outage only. diff --git a/docs/adr/0027-cloud-native.md b/docs/adr/0027-cloud-native.md index 95a7183154..6b18b89bca 100644 --- a/docs/adr/0027-cloud-native.md +++ b/docs/adr/0027-cloud-native.md @@ -517,6 +517,32 @@ each is derive, not persist. The `goleak` D-Bus ignores in `internal/app/leakmain_test.go` are the visible symptom of row 40 and are scoped to a top-of-stack pin, not a blanket suppression. The re-audit verdict is CLEAN. +**Caller-identity re-audit (List 1 / List 2 — issue #367, ADR 0100).** The +caller-identity track (attribution only — nothing is refused on identity grounds +yet) adds ONE new outlives-a-call resource (List 1 row 41): the token validator's +JWKS cache and its background refresh. Everything else it adds is a FIELD on an +already-inventoried artifact: + +- **`internal/syscaller` earns no row.** The registry is a package-level slice of + string constants (`internal/syscaller/syscaller.go` (`Roots`)) — compile-time + data, not an allocated resource, and it holds nothing per session or per run. + `syscaller.Context` stamps a value on the root context of goroutines that are + ALREADY inventoried (rows 1 childgc, 30 scheduler tick, 31 leader-lease renewer, + and the two consolidators); a context value on an existing root changes no + lifetime, no cleanup and no re-attach answer, so annotating those rows would be + the only honest alternative and it would say nothing new. +- **The session owner and `Event.Actor` are List 2 concerns, not List 1** (rows 26 + and 27): both are fields on the existing snapshot / existing durable event log, + adding no handle, goroutine, cache or map. +- **The schedule owner earns a List 2 row (28)** because it is state a restart + would otherwise lose: it is captured at CREATE, and a fire that happens after a + restart must still run as the caller who created the schedule. + +The re-audit verdict is CLEAN. The shipped `toolhive-core/authn` v0.0.39 validator +is wired by the shared OIDC config; its cached keys are bounded by default under +[ADR 0101](./0101-bounded-jwks-staleness.md), and remain reconstructible rather +than persisted. + ### Sequencing rationale 0→1→2 is a strict dependency chain (rehydrate needs faithful snapshots). 3 is @@ -583,6 +609,7 @@ durable artifact survives and is reloaded), or **lost** (gone, possibly leaking) | 38 | mecak8s `/metrics` loopback listener (ADR 0098) | `cmd/mecak8s` (`serve`) | process (OPT-IN: only when `--metrics-addr` is set; loopback-only, fail-closed at parse time) | the `metricsSrv *http.Server` joins the `errCh` set and the `boundedShutdown` sequence (its `Shutdown` runs alongside the API listener's); SIGTERM also flushes OTLP via the `defer flushTelemetry` (LIFO before `built.Close()`) | **reset-by-design**: the prometheus reader is process-local; the scraped metrics are the scraper's record. The admin mux (`/metrics` + pprof/expvar) is loopback-only and carries no durable state. Nothing here needs a List 2 row | `cmd/mecak8s/serve.go` (`serve`, `boundedShutdown`, `isLoopbackAddr`); `cmd/mecak8s/observability.go` (`buildObservability`, `flushTelemetry`); `internal/adapter/telemetry/adminmux.go` (`NewAdminMux`) | | 39 | ToolHive-LLM direct-mode OIDC token source (issue #265, ADR 0102) | `internal/app` — built ONCE per Build inside `newDirectGatewayEntry` and captured by the `bearerRoundTripper`; the underlying `*llm.TokenSource` is toolhive's `pkg/auth/tokensource.OAuthTokenSource` | process (OPT-IN: constructed ONLY when the resolved routing mode is `direct` — the proxy path allocates none of this and stays byte-identical to pre-#265) | none needed and none exists: it holds no goroutine, no fd and no timer — an in-memory access token + expiry behind its own mutex, refreshed lazily on the per-request `Token(ctx)` call and dying with the process. It is deliberately NOT re-minted per session: every per-session/heal engine re-mint appends the SAME `WithHTTPClient`, so one token source serves every session (`construct()` closes over `extra`). Note the mutex serializes `Token` across concurrent sessions, so a slow IdP refresh blocks other requests for its duration — bounded by each caller's request ctx | **reconstructible** (a restarted process rebuilds it at the next Build and re-derives an access token from the keyring-held refresh token; decision = derive). Nothing enters a snapshot: the access token is short-lived derived material, and the refresh token already survives outside mecatl in the OS keyring with only its REFERENCE (`CachedRefreshTokenRef`) in ToolHive's config — so no List 2 row | `internal/adapter/toolhivellm/tokensource.go` (`DirectTokenSource`, `buildTokenSource`); consumed by `internal/app/registry.go` (`newDirectGatewayEntry`, `bearerRoundTripper`) | | 40 | OS-keyring / D-Bus connection behind the direct-mode secrets provider (issue #265, ADR 0102) | toolhive's `pkg/auth/secrets` (`GetSystemSecretsProvider`), opened transitively by row 39's construction; mecatl never holds the handle | process (OPT-IN with row 39; on Linux this is a `godbus` connection with its own reader/writer goroutines) | NOT mecatl-owned — no `Close` seam is exposed and none is folded into Build's `closeAll`; the connection is process-scoped and released at exit. This is the accepted residual, and it is why `internal/app/leakmain_test.go` pins `godbus/dbus/v5.newConn.func1` + `(*Conn).inWorker` by top-of-stack (a narrow pin, NOT a blanket suppression — any other leak still fails the gate) | **reconstructible** (re-opened lazily by the next Build's token-source construction; it is a transport to the keyring, never state-of-record — the credential it fetches is the keyring's, decision = derive). No List 2 row | `internal/adapter/toolhivellm/tokensource.go` (`buildTokenSource`); the goleak pins live in `internal/app/leakmain_test.go` (`TestMain`) | +| 41 | OIDC token-validator JWKS cache + its background key-rotation refresh (caller identity, ADR 0100 decision 3/7 and ADR 0103; the `toolhive-core/authn` validator wrapped by the opt-in `authn/oidc` module and adapted to `server.PrincipalValidator`) | the `authn/oidc.Validator` instance, constructed once per process through `internal/cliconfig/oidc.go` (`OIDCValidator`) and handed to `server.SecurityConfig.Validator`; the module owns the reusable lifecycle seam, never the JWT/JWKS mechanics | process (OPT-IN: only when `--oidc-issuer` is set; the zero value is identity OFF and allocates nothing) | **explicit teardown at the edge**, NOT the root context's cancel: the validator's background refresh is stopped by its OWN `Close()`, and cancelling a context does not call it. `internal/adapter/server/authn.go` (`Authenticator.Close`) type-asserts an OPTIONAL `io.Closer` on the configured validator (the `port.HookApprovalLearner` idiom — `PrincipalValidator` stays single-method, so a fake without teardown needs none) and closes it once (`sync.Once`); both mains `defer auth.Close()` (`cmd/mecated/main.go`, `cmd/mecak8s/serve.go`). The SERVER-ROOT context is still what the constructor is handed — deliberately NOT a per-request one, which would tear key rotation down with the first request — but it bounds in-flight fetches, not the refresh loop's lifetime. The refresh goroutine has no caller and therefore runs under the explicit system principal `mecatl:internal / jwks-refresh` (`internal/syscaller/syscaller.go` (`RootJWKSRefresh`)) | **reconstructible** (a restarted process re-resolves the flags and re-fetches the key set on the next Build; nothing is persisted and nothing should be — a cached signing key is a derivation of the IdP's live JWKS). Cached-key trust is bounded by `--oidc-max-jwks-staleness` (1h default; 0 explicitly disables the bound; ADR 0101) | `authn/oidc/oidc.go` (`Validator`, `NewValidator`, `Close`); `internal/cliconfig/oidc.go` (`OIDCConfig`, `OIDCValidator`, `RegisterOIDCFlags`); `internal/adapter/server/authn.go` (`PrincipalValidator`); `internal/syscaller/syscaller.go` (`RootJWKSRefresh`) | **Issue #388 re-audit (bounded embedded-mecatui shutdown).** #388 added NO new outlives-a-call resource row. The work BOUNDS existing rows' cleanup, it does not add diff --git a/docs/adr/0100-caller-identity-threading.md b/docs/adr/0100-caller-identity-threading.md new file mode 100644 index 0000000000..426db199a3 --- /dev/null +++ b/docs/adr/0100-caller-identity-threading.md @@ -0,0 +1,164 @@ +# ADR 0100 — Caller identity: accept a principal, thread it everywhere, record the owner + +- Status: Accepted +- Date: 2026-08-07 +- Scope: the authentication edge, the `Session`/`Schedule` aggregates, the event log, and the internal goroutine principals +- Supersedes: — +- Superseded by: — + +## Context + +mecatl's authentication edge (`internal/adapter/server/authn.go`) is a single shared +static bearer token compared in constant time. There is no user concept: one +credential, zero subjects. Nothing downstream — the session aggregate, the snapshot, +the event log, the schedule registry, the list row — records *who* is acting, so an +audit question ("who ran this?", "whose schedule fired?") has no durable answer. + +The agent-identity model ([`docs/agent-identity-model.md`](../agent-identity-model.md)) +names this its phase 1, the "audit trail (unsigned)": before mecatl can enforce +isolation (issue #368), attach sensitivity labels (#369), share deliberately (#370), +or sign anything (Track B), it must first *accept* a verified principal and *thread* +it through every port so the data layer exists and is agreed upon. The original +handover bundled acceptance, the owner, the decision function, the demo, and Redis +transport into one track; scoping it down to accept-and-thread is the cut that makes +it landable without waiting on enforcement design. + +Several hazards were verified against the code and shape the decision: + +- `authEnabled()` means "a static token is configured" — wrong in both directions (a + shared-token deployment has zero subjects; an OIDC deployment may have no static + token). Reusing it as the identity gate is a latent fail-open. +- `sessnap.RestoreState` already carries eight parameters; adding the owner as a + trailing parameter is a *Changed*/breaking entry under + [`engine/COMPATIBILITY.md`](../../engine/COMPATIBILITY.md), whereas a + direct-assignment field (the `Profile`/`ProviderID` pattern) is *Added*/minor. +- The loop is storage-agnostic and must stay so: no adapter/proto/server type may + cross into `engine/agent` (the layering rule). +- ToolHive's anonymous middleware mints a `sub: "anonymous"` with forged exp/iat — a + fabricated principal that reaches audit records looking like a real user. That is + the anti-pattern to avoid. +- `childgc` sweeps an origin session on retention, so a cron schedule that derives + its owner from the origin session *at fire time* would derive it from a session + that no longer exists. +- Token validation is hard to get right (alg confusion, key rotation, issuer + canonicalization, clock skew) and is needed by both mecatl and ToolHive. + +## Decision + +**Accept a verified principal at the edge, thread it everywhere, record the owner — +and stop.** No enforcement, no per-user keying changes, no signing. + +1. **One `Principal` value object.** `{ Issuer, Subject, GrantType, Name? }` in + `engine/session`. Identity is the `(iss, sub)` pair, never `sub` alone (two IdPs / + realms collide on `sub`). `GrantType ∈ user | client_credentials | system`. It + carries no scopes, no authority, no credentials. Modeled on ToolHive's + `PrincipalInfo`, not imported. + +2. **Accept at the existing `authn.go` seam, behind its own predicate.** The OIDC + verifier extends the current interceptor/middleware; it is enabled by whether the + verifier is wired, NOT by `authEnabled()`. The verified caller is stashed on an + unexported context key (`WithPrincipal`/`PrincipalFromContext`). **Absent = nil, + never fabricated.** Off by default ⇒ byte-identical to today. + +3. **Delegate validation to `toolhive-core/authn`.** The shared module both repos + already depend on owns the JWT/JWKS/discovery logic (`Validate(ctx, bearer) → + Principal`), hardened on extraction (refresh-on-unknown-kid + negative cache, + RSA-PSS, byte-exact issuer, leeway + authored nbf/iat). JWT-only; no introspection + branch. The validator is constructed with the **server-root** context (it owns + background JWKS refresh). Config: `--oidc-issuer` / `--oidc-jwks-uri` (static, + short-circuits discovery) / `--oidc-audience` (required when on). The rate limiter + re-keys off the validated `(iss, sub)`, not the raw token. **OIDC-misconfigured is + fatal at startup:** with OIDC flags set but validator construction failing (an + unreachable JWKS and no static `--oidc-jwks-uri` override), the server refuses to + start rather than silently degrading to the unauthenticated path — the classic + misconfigured-verifier fail-open. (A mid-flight JWKS outage is different: it + surfaces as a transient 503-class signal, distinct from a 401 bad token.) + +4. **The owner is write-once at `CreateSession`, from the verified token, never the + request body.** It round-trips the snapshot by **direct assignment** (the + `Profile` pattern), never a `RestoreState` parameter. Children + (`subagent-`/`parallel-`/`team-`/`sched--`) inherit the parent's owner — an + ownerless parent yields an ownerless child, never a fabricated one (this preserves + the byte-identical no-auth path); a fork inherits the **source's** owner (stamping + the caller's own owner would make fork an ownership-laundering path); resume keeps + the persisted owner. **Never backfilled** — a pre-ship session stays ownerless and + renders unowned. The list row surfaces the owner: proto `SessionSummary` gains an + `owner` field (a deliberate proto change), the server struct mirrors it, and + `port.SessionMeta` gains `Owner` so the `MetaLister` fast path (which skips + `Load`) populates the row identically to the slow path. Display-only — no + filtering (that is the isolation track's). + +5. **The event annotation is log-only, stamped only at `appendEvent`, and names the + caller who ACTED — not the session's owner.** `session.Event.Actor` is nil at + every emit site; the relay's `appendEvent` reads the **context principal** (the + verified caller driving this request) and stamps it. `toProto` omits it (the + log-only sibling of `EvApproval`/`EvCompactionArchive`); the event-sourced `Fold` + ignores it (a Fold-rebuilt session keeps the snapshot-restored owner; the fold + neither requires nor re-derives `Event.Actor`). No proto change on the event path. + + The owner and the actor are **different questions and routinely different + values**: this phase deliberately ships no authorization, so any authenticated + caller may act on any session (see Consequences). Deriving `Actor` from the + session's owner would therefore stamp caller A onto every event of a run that + caller B drove — repudiation in both directions, and worst on `EvApproval`, where + the record *is* a human granting a tool permission. The session owner answers + "whose is this?" and stays the identity of record; `Actor` answers "who did + this?". A run with no verified caller stamps nil — absence is never fabricated. + + A scheduled fire follows the same rule and therefore names the **scheduler's + system principal** on its events, while the fire's session still carries the + schedule owner (decision 6). That is the honest reading: the owner is + accountable, the scheduler is what acted. Every durable append path stamps + through the one chokepoint — including the schedule lifecycle events + (`fired`/`failed`), which must not reach the log unstamped. + +6. **A schedule's owner is captured at create time,** never derived at fire time + (the origin may be swept). The capture rule depends on the create surface: the + Schedule-tool path reads the *executing session's* owner via the origin binder; an + out-of-band REST/CLI create (no origin session) reads the *context principal*; + ownerless/none stays empty (never fabricated). A fire's `sched--` session is + minted under the scheduler's system-principal context, so an explicit + owner-injection seam (a `WithOwner` CreateSessionOption sibling of + `WithSessionID`) overrides the stamp — the fire's session and events carry the + schedule's owner with `GrantType: client_credentials`, not the system principal. + +7. **Internal goroutines run under an explicit system principal, never an absent + one.** `childgc`, both memory/dream consolidators, and the scheduler + tick/fire/delivery/reconcile run as `Principal{GrantType: system}`. + +8. **Memory, soul, and user-tier skills/commands/rules/agent-defs are deferred.** + They are ambient per-project / per-OS-user configuration (filesystem stores or + gRPC drivers wired in `app.Build`, never Redis, never created through the + authenticated edge), so there is no caller to stamp until they become + multi-tenant. Their consolidators get the system principal. + +## Consequences + +**Easier.** The data layer every later track reads now exists and is agreed upon; the +isolation track's decision function reads a complete, durable owner instead of five +separately-unit-tested pieces. The schedule owner survives its origin session. The +audit trail names a real, verified actor. Token validation is shared with ToolHive +and hardened once for both. + +**Harder / costs.** The `Event.Actor` field is nil almost everywhere (stamped only at +one site) and denormalizes the acting principal onto every event — deliberate, so an +event read in isolation names who acted. The actor is duplicated per event, and a +reader must hold two identities in mind (the session's owner and the event's actor) +which agree in the single-caller deployment and diverge in the multi-caller one. `Authority` (Track +C) ships inert until that track lands — a dead additive field, accepted to kill a +recurring three-way conflict on generated files. Building against a sibling-developed +`toolhive-core/authn` risks doc/impl divergence; mitigated by a fake-verifier seam. +The cut means **nothing is refused yet** — a deployment gains attribution but no +isolation, which must be stated plainly so it is not oversold. + +## See also + +- The reasoning model: [`docs/agent-identity-model.md`](../agent-identity-model.md) + (phase 1, "audit trail (unsigned)"). +- The completed [acceptance record](../acceptance/caller-identity.md). +- The layering rule and the persistence/rehydration invariants: + [`AGENTS.md`](../../AGENTS.md). +- The lifecycle convention: [ADR 0002](./0002-documentation-lifecycle.md); the engine + stability contract: [ADR 0037](./0037-engine-stability-contract.md); event-sourced + rehydration: [ADR 0038](./0038-event-sourced-rehydration.md); the resource + inventory this adds rows to: [ADR 0027](./0027-cloud-native.md). diff --git a/docs/adr/0101-bounded-jwks-staleness.md b/docs/adr/0101-bounded-jwks-staleness.md new file mode 100644 index 0000000000..4d023060c5 --- /dev/null +++ b/docs/adr/0101-bounded-jwks-staleness.md @@ -0,0 +1,52 @@ +# ADR 0101 — Bound cached JWKS staleness + +- Status: Accepted +- Date: 2026-08-11 +- Scope: OIDC caller-identity validation and its cached JWKS availability policy +- Supersedes: — +- Superseded by: — + +## Context + +OIDC validation depends on signing keys fetched from the identity provider. Keeping the +last successful JWKS during a temporary outage improves availability, but trusting that +cache forever means a revoked signing key remains valid for the full outage. Rejecting +all tokens as soon as refresh fails has the opposite failure mode: a brief identity +provider or network interruption takes every authenticated mecatl request down. + +The shared `toolhive-core/authn` validator can bound cached-key staleness and attempts a +refresh before rejecting keys that cross the bound. mecatl must choose the deployment +policy explicitly rather than inherit an unbounded library zero value. + +## Decision + +Add `--oidc-max-jwks-staleness` to the shared OIDC configuration used by both server +mains and pass it to `authn.Config.MaxJWKSStaleness`. + +Default the flag to **1 hour**. An explicit **0** disables the upper bound for operators +who knowingly prefer availability during an extended identity-provider outage. Reject +negative durations as a startup/configuration error. + +Once cached keys are older than the configured bound, validation first attempts to +refresh them. If refresh cannot succeed, reject validation with the existing +unavailable classification, which the mecatl edge maps to **HTTP 503**, not 401. Keep +issuer equality, required audience, HTTPS/private-address protections, error mapping, +and optional validator teardown unchanged. + +Do not persist the JWKS cache. A restarted process reconstructs the validator and +fetches current key material from the identity provider; signing keys remain a +derivation of the IdP's live JWKS, not mecatl-owned durable state. + +## Consequences + +The default limits the revoked-key exposure window during an IdP outage to one hour, +while tolerating ordinary short outages. After that window, authenticated requests fail +closed with a retryable service-unavailable response until keys can refresh. Operators +can restore the previous unbounded-availability posture with an explicit zero, accepting +the corresponding revocation risk. Restarting while the IdP is unavailable cannot rely +on an old on-disk key cache because none exists. + +## See also + +- [ADR 0100](./0100-caller-identity-threading.md) — caller identity and the shared OIDC validator +- [ADR 0027](./0027-cloud-native.md) — process-owned JWKS cache lifecycle and restart policy diff --git a/docs/adr/0103-oidc-authn-module.md b/docs/adr/0103-oidc-authn-module.md new file mode 100644 index 0000000000..d98d3e2018 --- /dev/null +++ b/docs/adr/0103-oidc-authn-module.md @@ -0,0 +1,46 @@ +# ADR 0103 — Ship reusable OIDC caller identity as an opt-in module + +- Status: Accepted +- Date: 2026-08-12 +- Scope: Engine caller-identity projection, OIDC validation, module and release boundaries +- Supersedes: None +- Superseded by: None + +## Context + +The engine accepts a verified principal through context but deliberately has no JWT, +OIDC, HTTP, or ToolHive dependency. The server already validates OIDC tokens with +`toolhive-core/authn`; embedders need the same security behavior without importing the +root module's full adapter cone. Putting that validator in the engine would destroy the +engine's small, provider-neutral dependency closure. + +## Decision + +Keep claim projection in the stdlib-only `engine/session` package. It accepts only an +already-verified claims map, requires non-empty string `iss` and `sub`, and can never +mint a system or anonymous principal. + +Ship the ToolHive-backed verifier as the separate opt-in Go module +`github.com/stacklok/mecatl/authn/oidc`. Its public API exposes only its own narrow +configuration, validator, errors, and engine principal; ToolHive types do not cross the +boundary. The root CLI adapter delegates to this module and retains its existing flags, +server error contract, system context, and close lifecycle. Release it under +`authn/oidc/vX.Y.Z`; it is not an LLM provider module. + +## Consequences + +Engine-only consumers retain the dependency-free identity seam. OIDC embedders opt into +the validator's network and cryptographic closure explicitly. Engine and authn module +releases must be coordinated when the authn module begins using a newly added engine +API, and each module is tested, linted, tidied, and vulnerability-scanned separately. +The engine release must come first: `authn/oidc` cannot be released or pass its +`GOWORK=off` standalone gate until a published engine minor includes the exported +`PrincipalFromClaims` and `GrantTypeFromClaims` APIs it imports. The authn manifest must +not hide that ordering with a local `replace`; workspace builds remain the pre-release +integration proof, while the failing standalone check is the explicit release gate. + +## See also + +- [Architecture guide](../architecture.md) +- [ADR 0100 — Caller identity threading](./0100-caller-identity-threading.md) +- [ADR 0101 — Bounded JWKS staleness](./0101-bounded-jwks-staleness.md) diff --git a/docs/adr/README.md b/docs/adr/README.md index b7eb084407..4f202f8b16 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -120,6 +120,9 @@ Documentation/citation conventions are in [`docs/design/README.md`](../design/RE - [0094 — Opt-in project ingestion: two-axis positive grants](./0094-opt-in-project-ingestion.md) *(superseded by 0095)* - [0095 — Root-aware project trust](./0095-root-aware-project-trust.md) *(the authoritative #359 trust decision; supersedes 0092 + 0094)* - [0096 — Diagnostic-only posture reporting](./0096-diagnostic-only-posture-reporting.md) *(orthogonal reporting surface; relates to 0095)* +- [0100 — Caller identity: accept a principal, thread it everywhere, record the owner](./0100-caller-identity-threading.md) *(agent-identity Track A; audit-trail phase)* +- [0101 — Bound cached JWKS staleness](./0101-bounded-jwks-staleness.md) +- [0103 — Ship reusable OIDC caller identity as an opt-in module](./0103-oidc-authn-module.md) - [0024 — System-prompt research](./0024-system-prompt-research.md) *(research)* - [0041 — Output-economy default prompt](./0041-output-economy-default-prompt.md) - [0054 — Reasoning rebalance of the default-tone prompt](./0054-reasoning-rebalance-default-prompt.md) diff --git a/docs/architecture.md b/docs/architecture.md index 5b2243193b..500712f4e8 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -571,3 +571,94 @@ overlay. What remains here is the metrics surface: due→terminal — skipped fires record no duration). No role label (a fire's own run already carries `role="main"`). + +## Caller identity + +Caller identity ([ADR 0100](adr/0100-caller-identity-threading.md), issue #367) +threads *who asked* through the harness. It is **attribution, not isolation**: +every durable artifact learns its owner, and nothing is yet refused on identity +grounds. The thread has four segments. + +**It enters at the edge, and only there.** `internal/adapter/server/authn.go` +(`PrincipalValidator`) is the seam: the gRPC interceptor and the HTTP middleware +hand a bearer to a validator and get back a `session.Principal` +(`engine/session/principal.go`), whose identity is the `(Issuer, Subject)` pair. +Token mechanics — parse, signature, `iss`/`aud`/`exp`, JWKS rotation — are +delegated to the validator; mecatl hand-rolls none of it. The reusable implementation +is the opt-in `github.com/stacklok/mecatl/authn/oidc` module +([ADR 0103](adr/0103-oidc-authn-module.md)); it keeps ToolHive and JWT dependencies +outside the engine and exposes no ToolHive types. The operator wires one +through `--oidc-issuer` / `--oidc-jwks-uri` / `--oidc-audience` / +`--oidc-max-jwks-staleness` (`internal/cliconfig/oidc.go` (`OIDCConfig`, +`OIDCValidator`)), and a validator that cannot be constructed is a **fatal** +startup error, never a silent degrade to unauthenticated. The shipped +`toolhive-core/authn` **v0.0.39** validator caches the last good JWKS during a +brief IdP outage, but the 1h default bounds that cache: once stale, it refreshes +before deciding and an unavailable refresh maps to **503**, not 401. `0` is the +explicit unbounded-availability escape hatch; negative durations are rejected. +The JWKS cache is process-local and never persisted, so restart re-fetches current +keys. This bounds signing-key revocation exposure during an outage; it does not +provide per-token revocation before token expiry. When OIDC and `--rate-limit` +are both enabled, a separate pre-validation bucket limits rejected bearers by +**direct transport peer IP** before another validator call. Forwarding headers +are deliberately ignored. A successful validation does not consume that bucket; +the existing post-validation limiter still charges the verified `(Issuer, +Subject)` exactly once. With no validator wired the +whole path is byte-identical to a mecatl without identity. Caller identity is +deliberately independent of the static +`--auth-token`: `SecurityConfig.identityConfigured()` gates neither on nor off +`authEnabled()`, because a shared-token deployment has one credential and zero +subjects. + +**It rides a context key, and is never fabricated.** `session.WithPrincipal` / +`session.PrincipalFromContext` (`engine/session/principal_context.go`) carry the +verified caller inward. For direct embedding, verification stays outside the engine; +a generic verifier's exact wiring is: + +```go +claims, err := verifyCredential(ctx, bearer) // signature, issuer, audience, expiry +if err != nil { + return err +} +principal := session.PrincipalFromClaims(claims) // claims are already verified +if principal == nil { + return errUnauthenticated +} +ctx = session.WithPrincipal(ctx, principal) // context passed to Engine.Run +if err := sess.RestoreLabels(principal, ""); err != nil { + return err +} +run := eng.Run(ctx, sess, workspace, request) +``` + +`authn/oidc.Validator.Validate` can replace the first projection steps and returns the +same non-nil `*session.Principal`; embedders still apply `WithPrincipal` and, when they +seed the aggregate themselves, `RestoreLabels`. The restore call must happen before the +first run so durable ownership is set through the aggregate seam. Children, conversation +forks, and resumed sessions inherit the source session's owner; do not re-derive or +replace it at those boundaries. Absent identity is a **nil** principal — no anonymous +placeholder is ever minted (an `AGENTS.md` invariant, pinned by +`TestInvariant_no_fabricated_principal`). Internal goroutines have no caller at +all, so they run under an *explicit* system principal instead of an absent one: +`internal/syscaller/syscaller.go` (`Roots`) is the registry, and the childgc +sweeper, both dream consolidators, the scheduler's `Start` and the JWKS refresh +each stamp `mecatl:internal / `. `FireNow` is deliberately **not** wrapped — +a manual fire keeps its requester's identity. + +**Sessions and schedules record an owner.** `CreateSession` stamps the owner from +the context principal, **write-once and never from the request body** +(`internal/adapter/server/service.go` (`resolveOwner`)); children and forks +inherit it from the source. It persists as the additive `owner` snapshot field +(`engine/adapter/sessnap/sessnap.go` (`Snapshot`)) and surfaces display-only on +both listing paths (`SessionSummary.Owner`, `port.SessionMeta.Owner`) — no +filtering. `port.ScheduleSpec.Owner` (`engine/port/schedule.go`) is captured at +**create**, not at fire time, so a scheduled `sched--` session runs as the human +who asked for it rather than as the scheduler's system principal. + +**The event log's `Actor` is log-only.** `session.Event.Actor` +(`engine/session/event.go`) is stamped at the relay, in the one place the durable +log is written (`internal/adapter/server/service.go` (`appendEvent`), plus the +`AppendRunEvent` delegate the scheduler's fire loop uses because it ranges +`run.Events()` itself and is not a wire relay). The loop never sets it — it stays +storage- and identity-agnostic, exactly as it does for `port.EventLog`. `Actor` is +an annotation on log lines; the **session owner** is the identity of record. diff --git a/docs/architecture/deployment-and-hardening.md b/docs/architecture/deployment-and-hardening.md index ffa2236fb7..7ac1bf9697 100644 --- a/docs/architecture/deployment-and-hardening.md +++ b/docs/architecture/deployment-and-hardening.md @@ -17,7 +17,11 @@ and `cmd/mecated` wires the knobs: `--client-ca`). The server still **warns loudly** if it binds a non-loopback address with no auth configured. - **Rate limiting** — per-client + global token-bucket (`--rate-limit` / - `--rate-burst`), bounded and idle-evicting. + `--rate-burst`), bounded and idle-evicting. With OIDC enabled, a separate + pre-validation rejected-token bucket protects JWT/JWKS validation. It is keyed + only by the direct transport peer IP (`RemoteAddr` / gRPC peer), never by + `Forwarded` or `X-Forwarded-For`; valid tokens do not consume it and proceed to + the unchanged post-validation `(issuer, subject)` limiter. - **Health** — HTTP `/healthz` (liveness) + `/readyz` (readiness) mounted outside auth/rate-limit, plus standard `grpc_health_v1` `SERVING` (`internal/adapter/server/health.go`). - **Graceful shutdown** — gRPC `GracefulStop` + HTTP `Shutdown`. diff --git a/docs/design/IMPLEMENTATION-NOTES.md b/docs/design/IMPLEMENTATION-NOTES.md index 6e1a82dfc6..7d723f4e99 100644 --- a/docs/design/IMPLEMENTATION-NOTES.md +++ b/docs/design/IMPLEMENTATION-NOTES.md @@ -17,6 +17,26 @@ Prefer updating the relevant design doc + this file over re-growing CLAUDE.md. --- +## Caller identity embedding and OIDC module boundary + +The engine accepts identity only after verification. `session.PrincipalFromClaims` +projects an already-verified claim map into the narrow `(iss, sub)` identity, rejecting +missing, empty, or non-string identity claims and deriving only `user` or +`client_credentials`; it never verifies a token and never mints `system`. An embedder +puts that principal on the run context with `session.WithPrincipal`. If it constructs a +session aggregate itself, it also seeds durable ownership through +`Session.RestoreLabels(principal, "")`; children, forks, and resumed sessions inherit +that owner. + +OIDC/JWKS mechanics live in the opt-in `authn/oidc` module (ADR 0103), not engine and +not a provider module. Its `Validator` wraps `toolhive-core/authn`, maps validation and +IdP-availability failures onto module-owned sentinels, fails closed if verified claims +do not project to a principal, and owns an explicit `Close` for the background refresh. +`internal/cliconfig` adapts those errors to the unchanged server sentinels and retains +the server-root system context and all existing flag behavior. + +--- + ## Domain — `engine/session/` (lifecycle recovery) A turn always drives the `Session` aggregate to a terminal state within one @@ -5498,7 +5518,10 @@ on the byte-identical no-scheduling path). The pieces: schedule name (control/space/path-separator runes → `-`) so a name with a newline or slash cannot produce a multi-line fire id. The OPTIONAL `EmitScheduleEvent` callback (`Service.EmitScheduleEvent`) appends the `EvScheduleFired`/`Skipped`/`Failed` event to the fire session's durable - `EventLog`. + `EventLog` — through the Service's single `appendEvent` chokepoint, so the event is + `Event.Actor`-stamped like every other durable append (it takes the scheduler's + `ctx`, which carries the system principal, so a `fired` event names + `mecatl:internal`/`scheduler`). - **Wire API (Phase 2a, #232).** `ScheduleService` — 10 gRPC RPCs (`CreateSchedule`/`GetSchedule`/`ListSchedules`/`UpdateSchedule`/`DeleteSchedule`/ `FireNow`/`PauseSchedule`/`ResumeSchedule`/`GetFire`/`ListFires`) in @@ -5603,8 +5626,13 @@ type-asserted via the `scheduleStoreProvider` accessor — a now-func, the durab for `FireNow`, the model inventory for selector validation) as late-bound atomic FIELDS on the manager (`SetScheduler` / `setModelsPointer`), never a reach back into the Service. `*server.Service` DELEGATES its nine `port.ScheduleManager` -verbs + `EmitScheduleEvent` + `GetFire` to the embedded manager, so the RPC -surface is byte-identical. A store with no `ScheduleStore` (the in-memory +verbs + `GetFire` to the embedded manager, so the RPC surface is byte-identical. +`EmitScheduleEvent` is the ONE exception and lives on the **Service**, not the +manager (ADR 0100 decision 5): a schedule lifecycle event has to be stamped with +`Event.Actor` by the same single `appendEvent` chokepoint as every other durable +append, and that chokepoint is the Service's. It takes a `ctx` for exactly that +reason — the old manager-side body built a fresh `context.Background()`, which +carries no principal, so a `fired` event would record no actor at all. A store with no `ScheduleStore` (the in-memory memstore) yields a NIL manager — the honest no-scheduling path, matching `ServerCapabilities.Scheduling` — never a stub. diff --git a/docs/design/PRODUCTION-READINESS.md b/docs/design/PRODUCTION-READINESS.md index 311d8a2890..c60b52277e 100644 --- a/docs/design/PRODUCTION-READINESS.md +++ b/docs/design/PRODUCTION-READINESS.md @@ -56,6 +56,7 @@ record; current behaviour is in the linked [architecture](../architecture.md) do | Model-based layer-2 risk classifier | ✅ | `permclassify` (opt-in, monotonic, fail-safe) | | Hooks (full lifecycle fired, exit 0/2) | ✅ | all 6 phases fire | | **API authentication + rate limiting** | ✅ | bearer (`--auth-token`/`MECATL_AUTH_TOKEN`, constant-time) + optional TLS/mTLS (`--tls-cert`/`--tls-key`/`--client-ca`) gRPC interceptors + HTTP middleware; per-client + global token-bucket rate limit (`--rate-limit`/`--rate-burst`, bounded/idle-evicting); off-loopback-no-auth WARNING (`internal/adapter/server/authn.go`) | +| **OIDC caller identity** | ✅ attribution via shipped `toolhive-core/authn` v0.0.39; ✅ default 1h JWKS-staleness bound (503 after an unavailable refresh); ⛔ per-caller authorization/isolation (#368); ⛔ per-token revocation | `--oidc-max-jwks-staleness=0` deliberately restores unbounded cached-key availability; JWKS cache is process-local and reconstructible, never persisted. | | OS-level sandbox (process trust) | ⏸️ Deferred | Explicitly deferred (2026-05-29). The `CommandRunner` port is the seam; a Landlock(+seccomp) wrapper drops in later without touching the loop. Bash is also fully optional (shell-less deploys avoid the surface entirely), so this is not a blocker for those. | | Secrets handling (no key logging) | ✅ | key via env, never logged | | MCP transport restriction (no stdio) | ✅ | streaming-HTTP only; standalone SSE GET enabled for server-initiated notifications (ADR 0057) | diff --git a/docs/tui.md b/docs/tui.md index e2419173db..b64524ac8f 100644 --- a/docs/tui.md +++ b/docs/tui.md @@ -69,10 +69,12 @@ The transport is exactly what the invocation says — there is no implicit probe or fallback: - **Bare `mecatui [flags]`** — always host an embedded `mecated` in-process over - a private UNIX socket; **never probe** loopback, **never dial**. All - embedded-server flags (`--mock`, `--trust-project`, provider knobs, …) apply, - and the remote-only flags (`--auth-token`, `--tls`, `--tls-ca`, `--insecure`) - are **rejected** here. + a private UNIX socket; **never probe** loopback, **never dial**. The socket + lives in a same-local-user private directory; it is a local trust boundary, + not a bearer/OIDC authentication surface. Its sessions are therefore + intentionally ownerless. All embedded-server flags (`--mock`, + `--trust-project`, provider knobs, …) apply, and the remote-only flags + (`--auth-token`, `--tls`, `--tls-ca`, `--insecure`) are **rejected** here. - **`mecatui connect ADDRESS [flags]`** — always dial a running `mecated` at `ADDRESS` (host:port); **never probe** loopback and **never embed** — the @@ -83,9 +85,28 @@ or fallback: ```sh bin/mecated serve & # listens on 127.0.0.1:8080 bin/mecatui connect 127.0.0.1:8080 --workspace "$PWD" - bin/mecatui connect mecated.internal:443 --tls --auth-token $MECATL_AUTH_TOKEN + bin/mecatui connect mecated.internal:443 --tls --auth-token "$MECATL_AUTH_TOKEN" ``` +### OIDC-connected server + +For a `mecated` or `mecak8s` deployment with caller identity enabled, obtain an +OIDC token from your identity provider and pass it to the **external** transport. +`mecatui` sends it as per-RPC `authorization: Bearer …` metadata on every gRPC +request; it does not run an OIDC browser flow or refresh the token itself. + +```sh +# A local port-forward is loopback, so it is the one plaintext bearer exception. +kubectl port-forward -n mecatl service/mecak8s-agent 8080:8080 & +export MECATL_AUTH_TOKEN="$(your-oidc-cli print-access-token)" +bin/mecatui connect 127.0.0.1:8080 --auth-token "$MECATL_AUTH_TOKEN" --workspace /tmp +``` + +For a non-loopback endpoint, `mecatui` refuses to send a bearer without `--tls`. +Use `--tls-ca` when the deployment uses a private CA. The workspace is evaluated +by the **server**, not the TUI host: `/tmp` above is a path inside the selected +agent pod, not your local checkout. See [Security & transport](usage/mecated.md#security--transport-auth-tls-rate-limiting) for the attribution model and its non-tenancy limits. + `ADDRESS` must immediately follow `connect`; a missing or flag-first `ADDRESS` is a usage error, with one carve-out: `mecatui connect --help` renders the connect help instead of the missing-ADDRESS usage error. An unknown leading command fails diff --git a/docs/usage/mecak8s.md b/docs/usage/mecak8s.md index 20a3bf51da..1253082354 100644 --- a/docs/usage/mecak8s.md +++ b/docs/usage/mecak8s.md @@ -99,6 +99,11 @@ ADR 0048): drain → lease release) lets a survivor take over *immediately*, not after the 30s TTL. 3. **Session persistence across pod restart** — a session + run reaching terminal on pod-A survives pod-A's deletion; a follow-up on pod-B succeeds (Redis snapshot, `Recover`/reopen). +4. **OIDC caller identity against a real in-cluster Dex** — the agent discovers Dex's + signing keys, rejects no-token and forged-token requests on both HTTP and gRPC, + records Alice as a newly created session owner, and records Bob as the durable + actor when he prompts Alice's session. A separate journey proves bounded JWKS + staleness returns 503 during an IdP outage and recovers when Dex is reachable. ```sh task e2e:k8s # needs kind + ko + kubectl + Docker; NOT part of task test (~3-5 min) diff --git a/docs/usage/mecated.md b/docs/usage/mecated.md index 5d498d0ddc..a13c577f25 100644 --- a/docs/usage/mecated.md +++ b/docs/usage/mecated.md @@ -402,8 +402,35 @@ non-loopback bind — see the trust note below. | `--auth-token` | `""` | bearer token required on **every** gRPC/HTTP request (or `MECATL_AUTH_TOKEN`; empty disables auth). | | `--tls-cert` / `--tls-key` | `""` | PEM server certificate/key pair; together they enable TLS on the gRPC + HTTP servers. | | `--client-ca` | `""` | PEM client-CA bundle; enables **mutual TLS** (require + verify client certs). | -| `--rate-limit` | `0` | sustained per-client request rate in req/s (`0` disables rate limiting). | -| `--rate-burst` | `0` | rate-limit token-bucket burst size (`0` derives a sane default from `--rate-limit`). | +| `--rate-limit` | `0` | sustained per-client request rate in req/s (`0` disables rate limiting). With OIDC, this also bounds rejected bearer validation per direct transport peer IP. | +| `--rate-burst` | `0` | rate-limit token-bucket burst size (`0` derives a sane default from `--rate-limit`), including the separate OIDC rejected-token bucket. | +| `--oidc-issuer` | `""` | OIDC issuer URL (the `iss` claim, byte-exact) whose tokens identify callers. Setting it turns **caller identity** on: every request must present a bearer the IdP vouches for, and the verified `(iss, sub)` is recorded as the session owner. Empty processes requests unauthenticated exactly as before. | +| `--oidc-jwks-uri` | `""` | static JWKS endpoint for `--oidc-issuer`, short-circuiting OIDC discovery (the air-gapped / pinned-key deployment). Empty derives it from the issuer's discovery document. | +| `--oidc-audience` | `""` | audience (`aud`) this deployment accepts. **Required** with `--oidc-issuer` — an audience-less verifier would accept tokens minted for a different service. | +| `--oidc-max-jwks-staleness` | `1h` | maximum age of a last-good JWKS when refresh cannot reach the IdP. `0` deliberately disables the bound; a negative duration is rejected. Once stale, a failed refresh returns 503 rather than accepting with stale keys. | + +The four OIDC flags are identical on `mecak8s`. Two things to be clear about +([ADR 0100](../adr/0100-caller-identity-threading.md), +[ADR 0101](../adr/0101-bounded-jwks-staleness.md)): + +- **Attribution, not isolation.** Sessions, schedules and durable event-log + records gain an owner; **nothing is refused** on identity grounds. Any + authenticated caller can still act on any session. Per-caller access control is + separate, later work — do not deploy these as a tenancy boundary. +- **Validator and revocation boundary.** The production validator is a + delegated, actively-maintained OIDC/JWT library. Its last-good JWKS cache tolerates short IdP + outages, but the default one-hour staleness bound fails closed with **503** if + a refresh still cannot obtain current keys. A malformed, expired, wrong-issuer, + or wrong-audience token is **401**. When OIDC and rate limiting are both on, + repeated rejected bearers are limited before further validation by the direct + transport peer IP; `Forwarded` and `X-Forwarded-For` are never trusted. An + admitted valid token does not consume this rejected-token bucket and is charged + once by the existing verified-principal limiter. An exhausted rejected-token + bucket returns **429** (gRPC `RESOURCE_EXHAUSTED`). The bound limits + signing-key revocation exposure during an outage; it does **not** revoke an otherwise valid individual + token before its expiry. The cache is process-local and unpersisted, so a restart + fetches keys again. `--oidc-max-jwks-staleness=0` is the explicit, risk-accepting + unbounded-cache escape hatch. ### Observability (the loopback admin listener) diff --git a/e2e/k8s/caller_identity_test.go b/e2e/k8s/caller_identity_test.go new file mode 100644 index 0000000000..bd09cfb176 --- /dev/null +++ b/e2e/k8s/caller_identity_test.go @@ -0,0 +1,512 @@ +//go:build kind_e2e + +// These journeys exercise the production toolhive-core/authn validator through +// the canonical GOWORK=off kind build. +// +// Every assertion here encodes a fact OBSERVED by hand in a live cluster first +// (the probe transcript). The earlier drafts of this file asserted assumptions and +// each cost a five-minute suite run to disprove — the owner was assumed absent +// from the API, an IdP outage was assumed to 503, and the durable event was +// assumed to be a flat snake_cased record. All three were wrong. + +package k8s_e2e_test + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "time" + + "github.com/onsi/ginkgo/v2" + "github.com/onsi/gomega" + mecatlv1 "github.com/stacklok/mecatl/contracts/gen/go/mecatl/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// --- bearer-carrying HTTP helpers -------------------------------------------- +// +// The suite's existing helpers send no Authorization header, which is right for +// the unauthenticated base. Caller identity is inherently MULTI-caller, so these +// take the bearer per call rather than reading one shared credential. + +func createSessionAs(ctx context.Context, addr, bearer string) (int, string) { + ginkgo.GinkgoHelper() + body, _ := json.Marshal(map[string]any{"workspace": "/tmp", "mode": "default"}) + req, _ := http.NewRequestWithContext(ctx, http.MethodPost, + fmt.Sprintf("http://%s/v1/sessions", addr), bytes.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + if bearer != "" { + req.Header.Set("Authorization", "Bearer "+bearer) + } + resp, err := http.DefaultClient.Do(req) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "POST /v1/sessions") + defer func() { _ = resp.Body.Close() }() + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 8192)) + if resp.StatusCode != http.StatusCreated { + return resp.StatusCode, "" + } + var out struct { + SessionID string `json:"session_id"` + } + gomega.ExpectWithOffset(1, json.Unmarshal(raw, &out)).To(gomega.Succeed(), "unmarshal %s", raw) + return resp.StatusCode, out.SessionID +} + +// promptAs drives a prompt through the authenticated edge, draining the SSE body +// so the run reaches terminal and its events are appended before we assert. +func promptAs(ctx context.Context, addr, sessionID, bearer, text string) int { + ginkgo.GinkgoHelper() + body, _ := json.Marshal(map[string]any{"text": text}) + req, _ := http.NewRequestWithContext(ctx, http.MethodPost, + fmt.Sprintf("http://%s/v1/sessions/%s/prompt", addr, sessionID), bytes.NewReader(body)) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept", "text/event-stream") + if bearer != "" { + req.Header.Set("Authorization", "Bearer "+bearer) + } + resp, err := http.DefaultClient.Do(req) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "POST prompt") + defer func() { _ = resp.Body.Close() }() + _, _ = io.Copy(io.Discard, io.LimitReader(resp.Body, 1<<20)) + return resp.StatusCode +} + +// sessionOwner reads the owner off the LIST row over plain HTTP. +// +// `GET /v1/sessions` carries owner{issuer,subject,grant_type,name} — verified in +// the cluster. An earlier draft read Redis instead, on a mistaken belief that +// ownership was gRPC-only; asserting the API is both correct and closer to what +// an operator actually sees. Returns ("", "") when the session has no owner. +func sessionOwner(ctx context.Context, addr, bearer, sessionID string) (subject, name string) { + ginkgo.GinkgoHelper() + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, + fmt.Sprintf("http://%s/v1/sessions", addr), nil) + if bearer != "" { + req.Header.Set("Authorization", "Bearer "+bearer) + } + resp, err := http.DefaultClient.Do(req) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "GET /v1/sessions") + defer func() { _ = resp.Body.Close() }() + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + gomega.ExpectWithOffset(1, resp.StatusCode).To(gomega.Equal(http.StatusOK), + "list sessions: %d %s", resp.StatusCode, raw) + + var out struct { + Sessions []struct { + SessionID string `json:"session_id"` + Owner *struct { + Subject string `json:"subject"` + Name string `json:"name"` + } `json:"owner"` + } `json:"sessions"` + } + gomega.ExpectWithOffset(1, json.Unmarshal(raw, &out)).To(gomega.Succeed(), "unmarshal %s", raw) + for _, s := range out.Sessions { + if s.SessionID != sessionID { + continue + } + if s.Owner == nil { + return "", "" + } + return s.Owner.Subject, s.Owner.Name + } + return "", "" +} + +// eventActors returns the actor subjects on a session's DURABLE event log. +// +// Redis is the only observation point: Event.Actor is log-only by design (toProto +// omits it), so no API returns it. Two shapes must be handled and BOTH were got +// wrong by an earlier draft, which could therefore only ever time out: +// - the record is an ENVELOPE, {"v":"redisstore-eventlog/1","ev":} +// - session.Event carries NO json tags, so keys are GO-CASED ("Actor"/"Subject") +// +// Every parse failure is asserted rather than skipped. A fail-silent parser +// guarding a security property is worse than no test: the moment this assertion is +// weakened to a negative, a silent skip makes it pass forever on an empty list. +func eventActors(sessionID string) []string { + ginkgo.GinkgoHelper() + raw := runCmdQuiet("kubectl", "exec", "-n", k8sNamespace, "redis-0", "--", + "redis-cli", "LRANGE", "mecatl:events:"+sessionID, "0", "-1") + var subs []string + for _, line := range splitNonEmptyLines(raw) { + var rec struct { + V string `json:"v"` + Ev json.RawMessage `json:"ev"` + } + gomega.ExpectWithOffset(1, json.Unmarshal([]byte(line), &rec)).To(gomega.Succeed(), + "event-log record is not the expected envelope: %.200s", line) + gomega.ExpectWithOffset(1, rec.Ev).NotTo(gomega.BeEmpty(), + "envelope carried no `ev` payload: %.200s", line) + + var ev struct { + Type string `json:"Type"` + Actor *struct { + Subject string `json:"Subject"` + Name string `json:"Name"` + } `json:"Actor"` + } + gomega.ExpectWithOffset(1, json.Unmarshal(rec.Ev, &ev)).To(gomega.Succeed(), + "event payload did not parse: %.200s", rec.Ev) + if ev.Actor != nil { + subs = append(subs, ev.Actor.Subject) + } + } + return subs +} + +func splitNonEmptyLines(s string) []string { + var out []string + for _, l := range bytes.Split([]byte(s), []byte("\n")) { + if t := bytes.TrimSpace(l); len(t) > 0 { + out = append(out, string(t)) + } + } + return out +} + +// listSessionIDs returns every session id the given caller can see. +// +// Deliberately separate from sessionOwner: Expect() on a multi-value call treats +// the extra returns as "must be zero", which is how the first version of this +// spec failed with `Unexpected non-nil/non-zero argument at index 1: "bob"`. +func listSessionIDs(ctx context.Context, addr, bearer string) []string { + ginkgo.GinkgoHelper() + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, + fmt.Sprintf("http://%s/v1/sessions", addr), nil) + if bearer != "" { + req.Header.Set("Authorization", "Bearer "+bearer) + } + resp, err := http.DefaultClient.Do(req) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "GET /v1/sessions") + defer func() { _ = resp.Body.Close() }() + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + gomega.ExpectWithOffset(1, resp.StatusCode).To(gomega.Equal(http.StatusOK), + "list sessions: %d %s", resp.StatusCode, raw) + var out struct { + Sessions []struct { + SessionID string `json:"session_id"` + } `json:"sessions"` + } + gomega.ExpectWithOffset(1, json.Unmarshal(raw, &out)).To(gomega.Succeed(), "unmarshal %s", raw) + ids := make([]string, 0, len(out.Sessions)) + for _, s := range out.Sessions { + ids = append(ids, s.SessionID) + } + return ids +} + +// --- the stories ------------------------------------------------------------- + +var _ = ginkgo.Describe("caller identity, from the caller's and operator's view", ginkgo.Serial, ginkgo.Ordered, func() { + ginkgo.Context("bounded JWKS staleness", ginkgo.Ordered, func() { + const maxStaleness = 2 * time.Second + + var ( + dex *idp + alice string + proxyDeployed bool + ) + + ginkgo.BeforeAll(func() { + ctx := ginkgoSuiteCtx() + dex = deployDex(ctx) + deployJWKSProxy(ctx) + proxyDeployed = true + patchAgentToOIDCWithCachePolicy(ctx, jwksProxyURI, maxStaleness) + alice = dex.token(ctx, aliceEmail) + }) + + ginkgo.AfterAll(func() { + ctx := ginkgoSuiteCtx() + // Restore reachability before removing the OIDC fixture so no independent + // later journey inherits an infrastructure outage. + if proxyDeployed { + setJWKSProxyReplicas(ctx, 1) + } + restoreAgentFromOIDC(ctx) + if dex != nil { + dex.stop() + } + }) + + ginkgo.It("fails stale cached keys with 503 and recovers when the issuer returns", func() { + addr, stop := portForward(agentPods[0]) + defer stop() + + warmCtx, warmCancel := shortCtx(30 * time.Second) + status, _ := createSessionAs(warmCtx, addr, alice) + warmCancel() + gomega.Expect(status).To(gomega.Equal(http.StatusCreated), + "the Dex token did not validate while discovery and JWKS were available") + + setJWKSProxyReplicas(ginkgoSuiteCtx(), 0) + time.Sleep(maxStaleness) + + gomega.Eventually(func() int { + requestCtx, cancel := shortCtx(25 * time.Second) + defer cancel() + status, _ := createSessionAs(requestCtx, addr, alice) + return status + }, 60*time.Second, time.Second).Should(gomega.Equal(http.StatusServiceUnavailable), + "after cached JWKS exceeds %s the same token must yield 503, never 401 or success", + maxStaleness) + + setJWKSProxyReplicas(ginkgoSuiteCtx(), 1) + gomega.Eventually(func() int { + requestCtx, cancel := shortCtx(25 * time.Second) + defer cancel() + status, _ := createSessionAs(requestCtx, addr, alice) + return status + }, 60*time.Second, time.Second).Should(gomega.Equal(http.StatusCreated), + "the validator did not recover after Dex/JWKS became reachable again") + }) + }) + + ginkgo.Context("authenticated caller journey", ginkgo.Ordered, func() { + var ( + dex *idp + alice string + ) + + ginkgo.BeforeAll(func() { + ctx := ginkgoSuiteCtx() + dex = deployDex(ctx) + // Enabling identity is itself Story 1: a validator that cannot be built is + // a FATAL startup error, so a completed rollout IS the assertion that the + // composed binary — flags, discovery, validator, middleware — works. This + // is the layer that was green in every unit test while both mains shipped a + // nil validator and no real deployment could start. + patchAgentToOIDC(ctx) + alice = dex.token(ctx, aliceEmail) + }) + + ginkgo.AfterAll(func() { + restoreAgentFromOIDC(ginkgoSuiteCtx()) + if dex != nil { + dex.stop() + } + }) + + // Story 2 — "I authenticate, and the work I do is mine." + ginkgo.It("attributes an authenticated run to the caller who made it", func() { + ctx := ginkgoSuiteCtx() + addr, stop := portForward(agentPods[0]) + defer stop() + + st, sess := createSessionAs(ctx, addr, alice) + gomega.Expect(st).To(gomega.Equal(http.StatusCreated), + "a real IdP-issued token was refused — identity is not working in the cluster") + + // The RUN is the point. Session creation alone never exercises the prompt + // path through the authenticated edge, and three scenarios of coverage + // existed before any authenticated run had been driven. + gomega.Expect(promptAs(ctx, addr, sess, alice, "hello from alice")). + To(gomega.Equal(http.StatusOK), "an authenticated run was refused") + + sub, name := sessionOwner(ctx, addr, alice, sess) + gomega.Expect(sub).NotTo(gomega.BeEmpty(), "the session recorded no owner") + gomega.Expect(name).To(gomega.Equal("alice"), + "the owner's display name did not come from the token's name claim") + }) + + // Story 5 — "A caller without a valid token gets nothing." + ginkgo.It("refuses a forged signature and a missing credential", func() { + ctx := ginkgoSuiteCtx() + addr, stop := portForward(agentPods[0]) + defer stop() + + // A real `kid` signed with a key the IdP never published: the validator finds + // the named key and must reject on the SIGNATURE. Without this, an edge that + // parsed a JWT without verifying it would pass every other assertion here. + forged := dex.forgedToken(ctx, "alice-impostor") + st, _ := createSessionAs(ctx, addr, forged) + gomega.Expect(st).To(gomega.Equal(http.StatusUnauthorized), + "a token signed by an unpublished key was ACCEPTED — signature verification is not happening") + + st, _ = createSessionAs(ctx, addr, "") + gomega.Expect(st).To(gomega.Equal(http.StatusUnauthorized), + "an unauthenticated request was accepted while identity is on") + }) + + // Story 5a — the same real-Dex credentials work through the gRPC edge used by + // remote mecatui clients. The mock provider makes CreateSession sufficient: it + // proves metadata extraction, interceptor validation, and principal admission + // without requiring a live LLM turn. + ginkgo.It("authenticates gRPC requests with Dex bearer metadata", func() { + addr, stop := portForwardGRPC(agentPods[0]) + defer stop() + + conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials())) + gomega.Expect(err).NotTo(gomega.HaveOccurred(), "dial gRPC port-forward") + defer func() { _ = conn.Close() }() + client := mecatlv1.NewHarnessServiceClient(conn) + + request := func(ctx context.Context) error { + _, err := client.CreateSession(ctx, &mecatlv1.CreateSessionRequest{Workspace: "/tmp"}) + return err + } + ctx, cancel := shortCtx(30 * time.Second) + defer cancel() + authCtx := metadata.AppendToOutgoingContext(ctx, "authorization", "Bearer "+alice) + gomega.Expect(request(authCtx)).To(gomega.Succeed(), + "a real Dex token was refused by the gRPC interceptor") + + missingCtx, missingCancel := shortCtx(30 * time.Second) + defer missingCancel() + gomega.Expect(status.Code(request(missingCtx))).To(gomega.Equal(codes.Unauthenticated), + "gRPC accepted a request without a bearer while identity is on") + + forgedCtx, forgedCancel := shortCtx(30 * time.Second) + defer forgedCancel() + forgedCtx = metadata.AppendToOutgoingContext(forgedCtx, "authorization", "Bearer "+dex.forgedToken(forgedCtx, "alice-impostor")) + gomega.Expect(status.Code(request(forgedCtx))).To(gomega.Equal(codes.Unauthenticated), + "gRPC accepted a token signed by an unpublished key") + }) + }) + + ginkgo.Context("shared deployment attribution and durability journey", ginkgo.Ordered, func() { + var ( + dex *idp + alice, bob string + ) + + ginkgo.BeforeAll(func() { + ctx := ginkgoSuiteCtx() + dex = deployDex(ctx) + patchAgentToOIDC(ctx) + alice = dex.token(ctx, aliceEmail) + bob = dex.token(ctx, bobEmail) + }) + + ginkgo.AfterAll(func() { + restoreAgentFromOIDC(ginkgoSuiteCtx()) + if dex != nil { + dex.stop() + } + }) + + // Story 3 — "I can see who owns what." + ginkgo.It("shows the owner on the list row over plain HTTP", func() { + ctx := ginkgoSuiteCtx() + addr, stop := portForward(agentPods[0]) + defer stop() + + st, bobSess := createSessionAs(ctx, addr, bob) + gomega.Expect(st).To(gomega.Equal(http.StatusCreated)) + + bobSub, name := sessionOwner(ctx, addr, bob, bobSess) + gomega.Expect(name).To(gomega.Equal("bob")) + + // Bob's listing shows ALICE's session too: attribution, NOT isolation. + // Asserted so the absence of scoping cannot be mistaken for a bug. When #368 + // lands this becomes a scoping test — FLIP it, do not delete it. + _, aliceSess := createSessionAs(ctx, addr, alice) + aliceSub, aliceName := sessionOwner(ctx, addr, alice, aliceSess) + gomega.Expect(aliceName).To(gomega.Equal("alice")) + gomega.Expect(bobSub).NotTo(gomega.Equal(aliceSub), + "two different callers produced the same subject — identity is not per-caller") + gomega.Expect(listSessionIDs(ctx, addr, bob)).To(gomega.ContainElement(aliceSess), + "bob's session list omitted alice's session — this phase ships NO isolation, "+ + "so scoping here is a behaviour change, not a fix") + }) + + // Story 4 — "I can tell who did something, even when it wasn't the owner." + ginkgo.It("records the acting caller as the actor, not the session's owner", func() { + ctx := ginkgoSuiteCtx() + addr, stop := portForward(agentPods[0]) + defer stop() + + st, aliceSess := createSessionAs(ctx, addr, alice) + gomega.Expect(st).To(gomega.Equal(http.StatusCreated)) + aliceSubject, ownerName := sessionOwner(ctx, addr, alice, aliceSess) + gomega.Expect(ownerName).To(gomega.Equal("alice")) + gomega.Expect(aliceSubject).NotTo(gomega.BeEmpty()) + + // Permitted: this phase ships no isolation. When #368 lands, FLIP this to + // expect a refusal — do not delete the spec. + gomega.Expect(promptAs(ctx, addr, aliceSess, bob, "bob acting on alice's session")). + To(gomega.Equal(http.StatusOK), + "bob was refused on alice's session — this phase ships NO isolation, so a "+ + "refusal is a behaviour change, not a fix") + + ownerSub, ownerName := sessionOwner(ctx, addr, alice, aliceSess) + gomega.Expect(ownerName).To(gomega.Equal("alice"), + "acting on a session re-owned it — ownership laundering") + gomega.Expect(ownerSub).To(gomega.Equal(aliceSubject)) + + // The ship-blocker both reviews found: owner answers "whose is this", actor + // answers "who did this", and here they differ. + gomega.Eventually(func() []string { + return eventActors(aliceSess) + }, 90*time.Second, 3*time.Second).ShouldNot(gomega.BeEmpty(), + "no durable event recorded an actor at all") + actors := eventActors(aliceSess) + gomega.Expect(actors).NotTo(gomega.ContainElement(aliceSubject), + "an event on the run BOB drove was attributed to ALICE — the audit trail names the wrong caller") + }) + + // Story 6 — "My session is still mine after the pod that took it dies." + // + // This is the ONLY story here that genuinely needs a cluster. Every other + // assertion could in principle be made against one in-process server; this one + // asks whether ownership is DURABLE STATE (in Redis, readable by any replica) or + // merely in-process bookkeeping that happens to look right while one pod lives. + // It was written, passed, and then LOST when this file was reorganised around + // user stories — restored deliberately, and placed last because it destroys a + // pod and reshuffles the roster the earlier specs port-forward to. + // ponytail: no SpecTimeout — that decorator requires a SpecContext-taking body, + // and every slow step here is already bounded by its own shortCtx. + ginkgo.It("keeps the owner after the pod that recorded it is replaced", + func() { + refreshPods() + podA, podB := agentPods[0], agentPods[1] + + addrA, stopA := portForward(podA) + defer stopA() + addrB, stopB := portForward(podB) + defer stopB() + + cCtx, cCancel := shortCtx(30 * time.Second) + st, sess := createSessionAs(cCtx, addrA, alice) + cCancel() + gomega.Expect(st).To(gomega.Equal(http.StatusCreated)) + oCtx, oCancel := shortCtx(30 * time.Second) + aliceSubject, ownerName := sessionOwner(oCtx, addrA, alice, sess) + oCancel() + gomega.Expect(ownerName).To(gomega.Equal("alice")) + gomega.Expect(aliceSubject).NotTo(gomega.BeEmpty()) + + // Drive a run so the session has durable events, not just a create. + rCtx, rCancel := shortCtx(60 * time.Second) + gomega.Expect(promptAs(rCtx, addrA, sess, alice, "alice before failover")). + To(gomega.Equal(http.StatusOK)) + rCancel() + + // Snapshot the roster BEFORE deleting, so waitReplacementReady waits for + // the genuinely-new pod rather than being satisfied by survivor pod-B — + // the trap called out in failover_test.go. + preDelete := podNames() + kubectlDeletePod(podA, false) + waitReplacementReady(preDelete) + + // Read the owner from a replica that never served the create. If ownership + // lived in process memory this returns empty; the assertion is that a + // DIFFERENT pod answers the same question identically. + oCtx, oCancel = shortCtx(60 * time.Second) + defer oCancel() + sub, name := sessionOwner(oCtx, addrB, alice, sess) + gomega.Expect(name).To(gomega.Equal("alice"), + "the surviving replica lost the owner's name — ownership is not durable across pods") + gomega.Expect(sub).To(gomega.Equal(aliceSubject), + "the surviving replica reported a different subject for the same session") + }) + }) +}) diff --git a/e2e/k8s/helpers_test.go b/e2e/k8s/helpers_test.go index 7875dbf693..0765bbc05a 100644 --- a/e2e/k8s/helpers_test.go +++ b/e2e/k8s/helpers_test.go @@ -45,6 +45,7 @@ const ( k8sNamespace = "mecatl" agentComponent = "agent" // app.kubernetes.io/component label value partOfLabel = "mecak8s" + agentGRPCPort = 8080 // the gRPC listener (--grpc-addr default in the pod) agentPodPort = 8081 // the HTTP/SSE listener (--http-addr default in the pod) // liveProviderSecret is the k8s Secret holding OPENROUTER_API_KEY for the live @@ -391,20 +392,29 @@ func waitReplacementReady(preDelete []string) string { // --- port-forward ------------------------------------------------------------ -// portForward starts `kubectl port-forward` from a free local port to the -// agent pod's HTTP listener and returns the local "host:port" address plus a -// stop function that terminates the forward. The forward runs for the lifetime -// of the returned context-cancellation / stop call. The local port is chosen by -// binding a free loopback port first (the same race-free pattern as -// e2e/harness/local.go's freePorts) and handing it to port-forward. +// portForward starts a port-forward from a free local port to the agent pod's HTTP +// listener and returns the local "host:port" address plus a stop function. func portForward(podName string) (addr string, stop func()) { + return portForwardPort(podName, agentPodPort) +} + +// portForwardGRPC is the gRPC sibling of portForward. It shares the same +// lifecycle and readiness behavior while targeting mecak8s's gRPC listener. +func portForwardGRPC(podName string) (addr string, stop func()) { + return portForwardPort(podName, agentGRPCPort) +} + +// portForwardPort starts `kubectl port-forward` from a free local port to a pod +// listener and returns the local "host:port" address plus a stop function. The +// forward runs for the lifetime of the returned context-cancellation / stop call. +func portForwardPort(podName string, targetPort int) (addr string, stop func()) { ginkgo.GinkgoHelper() port := freeLocalPort() ctx, cancel := context.WithCancel(ginkgoSuiteCtx()) cmd := exec.CommandContext(ctx, "kubectl", "port-forward", "-n", k8sNamespace, fmt.Sprintf("pod/%s", podName), - fmt.Sprintf("%d:%d", port, agentPodPort)) + fmt.Sprintf("%d:%d", port, targetPort)) // port-forward writes progress to stderr; capture it for failure diagnosis. var buf ginkgoWriter cmd.Stderr = &buf diff --git a/e2e/k8s/oidc_helpers_test.go b/e2e/k8s/oidc_helpers_test.go new file mode 100644 index 0000000000..92724d7191 --- /dev/null +++ b/e2e/k8s/oidc_helpers_test.go @@ -0,0 +1,654 @@ +//go:build kind_e2e + +// The fixtures use the production toolhive-core/authn validator from the tagged +// module dependency. The canonical task runs with GOWORK=off so no local module +// overlay can affect the image under test. + +package k8s_e2e_test + +import ( + "context" + "crypto/rand" + "crypto/rsa" + "encoding/json" + "fmt" + "io" + "net" + "net/http" + "net/url" + "os/exec" + "strings" + "time" + + "github.com/golang-jwt/jwt/v5" + "github.com/onsi/ginkgo/v2" + "github.com/onsi/gomega" +) + +// A REAL OIDC provider, not a static JWKS file. Dex is a single Go binary with +// static config and in-memory storage, so it costs one ConfigMap + Deployment + +// Service — and unlike a hand-rolled JWKS it ISSUES tokens and serves DISCOVERY. +// +// That difference is the point. With a static JWKS the suite could only prove "a +// signature over a key we handed you verifies"; the `.well-known` fetch that every +// real deployment performs had ZERO executions anywhere in this repo. +const ( + dexName = "dex" + dexPort = 5556 + dexIssuer = "http://dex.mecatl.svc.cluster.local:5556" + dexClient = "mecatl" + dexSecret = "mecatl-secret" + dexPass = "password" + jwksProxyURI = "http://jwks-proxy.mecatl.svc.cluster.local:8080/keys" + aliceEmail = "alice@example.com" + bobEmail = "bob@example.com" +) + +// idp is the in-cluster identity provider plus a local tunnel to it, so the test +// can obtain REAL tokens the way a caller would. +type idp struct { + addr string + stop func() +} + +// deployDex brings up Dex and forwards its port. +// +// PSS `restricted` is ENFORCED on this namespace, so the pod must be runAsNonRoot +// with dropped capabilities and RuntimeDefault seccomp or the API server rejects +// it. Dex needs no writable path with in-memory storage. +func deployDex(ctx context.Context) *idp { + ginkgo.GinkgoHelper() + + ginkgo.By("deploying Dex (a real OIDC provider) + its NetworkPolicies") + kubectlApplyStdin(ctx, []byte(dexManifests)) + + waitOut, err := exec.CommandContext(ctx, "kubectl", "wait", "--for=condition=Ready", + "pod", "-l", "app.kubernetes.io/name="+dexName, "-n", k8sNamespace, + "--timeout=180s").CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "Dex never became Ready\n--- output ---\n%s", waitOut) + + pod := strings.TrimSpace(runCmdQuiet("kubectl", "get", "pods", + "-l", "app.kubernetes.io/name="+dexName, "-n", k8sNamespace, + "-o", "jsonpath={.items[0].metadata.name}")) + gomega.ExpectWithOffset(1, pod).NotTo(gomega.BeEmpty(), "no Dex pod found") + + port := freeLocalPort() + fwdCtx, cancel := context.WithCancel(ctx) + cmd := exec.CommandContext(fwdCtx, "kubectl", "port-forward", "-n", k8sNamespace, + "pod/"+pod, fmt.Sprintf("%d:%d", port, dexPort)) + gomega.ExpectWithOffset(1, cmd.Start()).To(gomega.Succeed(), "port-forward to Dex") + + addr := fmt.Sprintf("127.0.0.1:%d", port) + gomega.EventuallyWithOffset(1, func() bool { + c, derr := net.DialTimeout("tcp", addr, 500*time.Millisecond) + if derr != nil { + return false + } + _ = c.Close() + return true + }, 30*time.Second, 250*time.Millisecond).Should(gomega.BeTrue(), + "the Dex port-forward never accepted on %s", addr) + + return &idp{addr: addr, stop: func() { cancel(); _ = cmd.Wait() }} +} + +// deployJWKSProxy installs a disposable reverse proxy in front of Dex's key +// endpoint. Taking the proxy pod down closes existing keep-alive connections, +// while Dex itself remains alive with the same signing key. +func deployJWKSProxy(ctx context.Context) { + ginkgo.GinkgoHelper() + kubectlApplyStdin(ctx, []byte(jwksProxyManifests)) + setJWKSProxyReplicas(ctx, 1) +} + +func setJWKSProxyReplicas(ctx context.Context, replicas int) { + ginkgo.GinkgoHelper() + out, err := exec.CommandContext(ctx, "kubectl", "scale", "deployment/jwks-proxy", + "-n", k8sNamespace, fmt.Sprintf("--replicas=%d", replicas)).CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "scale JWKS proxy to %d replicas\n--- output ---\n%s", replicas, out) + if replicas == 0 { + gomega.EventuallyWithOffset(1, func() string { + return strings.TrimSpace(runCmdQuiet("kubectl", "get", "pods", "-n", k8sNamespace, + "-l", "app.kubernetes.io/name=jwks-proxy", "-o", "name")) + }, 60*time.Second, time.Second).Should(gomega.BeEmpty(), "JWKS proxy pod remained after scale-to-zero") + return + } + rollout, err := exec.CommandContext(ctx, "kubectl", "rollout", "status", + "deployment/jwks-proxy", "-n", k8sNamespace, "--timeout=180s").CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "JWKS proxy did not become ready\n--- output ---\n%s", rollout) +} + +// token obtains a REAL id_token via Dex's password grant. +// +// The password grant is deliberate: it yields a genuine IdP-signed token with one +// HTTP call, no browser and no redirect dance, which is what makes a real IdP +// usable in an automated suite at all. +func (d *idp) token(ctx context.Context, email string) string { + ginkgo.GinkgoHelper() + form := url.Values{ + "grant_type": {"password"}, + "username": {email}, + "password": {dexPass}, + "scope": {"openid email profile"}, + } + req, err := http.NewRequestWithContext(ctx, http.MethodPost, + "http://"+d.addr+"/token", strings.NewReader(form.Encode())) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred()) + req.SetBasicAuth(dexClient, dexSecret) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := http.DefaultClient.Do(req) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "POST Dex /token") + defer func() { _ = resp.Body.Close() }() + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<16)) + gomega.ExpectWithOffset(1, resp.StatusCode).To(gomega.Equal(http.StatusOK), + "Dex refused a token for %s: %s", email, raw) + + var out struct { + IDToken string `json:"id_token"` + } + gomega.ExpectWithOffset(1, json.Unmarshal(raw, &out)).To(gomega.Succeed(), "unmarshal %s", raw) + gomega.ExpectWithOffset(1, out.IDToken).NotTo(gomega.BeEmpty(), "empty id_token") + return out.IDToken +} + +// forgedToken mints a token carrying one of Dex's REAL key ids, signed with a key +// Dex never published. +// +// Reusing the real `kid` is what makes this a SIGNATURE test rather than an +// unknown-key test: the validator finds the named key, verifies against it, and +// must reject. A random kid would also 401, but for the weaker reason "no such +// key" — which an edge that skipped signature verification entirely would produce +// too. +func (d *idp) forgedToken(ctx context.Context, sub string) string { + ginkgo.GinkgoHelper() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://"+d.addr+"/keys", nil) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred()) + resp, err := http.DefaultClient.Do(req) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "GET Dex /keys") + defer func() { _ = resp.Body.Close() }() + raw, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<16)) + var jwks struct { + Keys []struct { + Kid string `json:"kid"` + } `json:"keys"` + } + gomega.ExpectWithOffset(1, json.Unmarshal(raw, &jwks)).To(gomega.Succeed(), "unmarshal JWKS %s", raw) + gomega.ExpectWithOffset(1, jwks.Keys).NotTo(gomega.BeEmpty(), "Dex published no keys") + + rogue, err := rsa.GenerateKey(rand.Reader, 2048) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "generate the rogue key") + + now := time.Now() + tok := jwt.NewWithClaims(jwt.SigningMethodRS256, jwt.MapClaims{ + "iss": dexIssuer, "aud": dexClient, "sub": sub, + "iat": now.Unix(), "exp": now.Add(10 * time.Minute).Unix(), + }) + tok.Header["kid"] = jwks.Keys[0].Kid + s, err := tok.SignedString(rogue) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "sign the forged token") + return s +} + +// baseAgentArgs is the Deployment's args WITHOUT caller identity — the single +// source both the OIDC patch and the restore build from, so they cannot drift. +// +// The list is replaced wholesale by a JSON6902 `replace`, so it must carry every +// flag the pod needs; dropping --redis-url would leave the pod with no session +// store while still looking like a successful patch. +func baseAgentArgs() []string { + return []string{ + "--grpc-addr=0.0.0.0:8080", + "--http-addr=0.0.0.0:8081", + "--redis-url=redis:6379", + "--session-lease-k8s-namespace=" + k8sNamespace, + "--headless=true", + "--posture=auto", + "--mock", + } +} + +// patchAgentToOIDC turns caller identity on and waits out the rollout. +// +// It passes `--oidc-issuer` and NO `--oidc-jwks-uri`, so the agent performs real +// OIDC DISCOVERY against Dex. That is the shape a real deployment uses; pinning +// the JWKS URI is the air-gap hook, and pinning it everywhere is what left +// discovery unexercised. +// +// `--oidc-insecure-allow-private-issuer` is required and is this flag's justified +// use: Dex is http:// at an in-cluster address, which the validator refuses by +// default (the same check that blocks a jwks_uri aimed at 169.254.169.254). +// `task deploy:check` fails if the flag ever appears under deploy/. +func patchAgentToOIDC(ctx context.Context) { + patchAgentToOIDCWithCachePolicy(ctx, "", 0) +} + +// patchAgentToOIDCWithCachePolicy enables caller identity with optional JWKS URI +// and cache-staleness overrides. Empty/zero leave production defaults in force. +func patchAgentToOIDCWithCachePolicy(ctx context.Context, jwksURI string, maxStaleness time.Duration) { + ginkgo.GinkgoHelper() + + args := append(baseAgentArgs(), + "--oidc-issuer="+dexIssuer, + "--oidc-audience="+dexClient, + "--oidc-insecure-allow-private-issuer", + ) + if jwksURI != "" { + args = append(args, "--oidc-jwks-uri="+jwksURI) + } + if maxStaleness > 0 { + args = append(args, "--oidc-max-jwks-staleness="+maxStaleness.String()) + } + argsJSON, err := json.Marshal(args) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "marshal the OIDC args") + + mode := "discovery, no pinned JWKS" + if jwksURI != "" { + mode = "pinned JWKS endpoint" + } + ginkgo.By("patching mecak8s-agent to enable caller identity (" + mode + ")") + patch := fmt.Sprintf( + `[{"op":"replace","path":"/spec/template/spec/containers/0/args","value":%s}]`, argsJSON) + patchOut, err := exec.CommandContext(ctx, "kubectl", "patch", + "deployment/mecak8s-agent", "-n", k8sNamespace, + "--type=json", "-p", patch).CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "kubectl patch deployment to OIDC failed\n--- output ---\n%s", patchOut) + + ginkgo.By("waiting for the OIDC rollout") + rolloutOut, err := exec.CommandContext(ctx, "kubectl", "rollout", "status", + "deployment/mecak8s-agent", "-n", k8sNamespace, "--timeout=240s").CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "the OIDC rollout never completed. A pod that cannot reach the IdP exits at "+ + "startup by design (fail-closed) — check the agent→Dex egress NetworkPolicy, "+ + "which IS enforced in kind\n--- output ---\n%s", rolloutOut) + + ginkgo.By("waiting for all mecak8s pods to be Ready (after the OIDC patch)") + waitPodsReady() + agentPods = podNames() +} + +// restoreAgentFromOIDC puts the Deployment back to the unauthenticated baseline +// and removes the IdP. +// +// NOT optional hygiene. The Deployment is shared state for the whole suite: +// leaving identity on makes every later spec's unauthenticated request 401, which +// is exactly how an earlier run of these specs turned three passing specs red. +func restoreAgentFromOIDC(ctx context.Context) { + ginkgo.GinkgoHelper() + argsJSON, err := json.Marshal(baseAgentArgs()) + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "marshal the base args") + + ginkgo.By("restoring mecak8s-agent to the unauthenticated baseline") + patch := fmt.Sprintf( + `[{"op":"replace","path":"/spec/template/spec/containers/0/args","value":%s}]`, argsJSON) + out, err := exec.CommandContext(ctx, "kubectl", "patch", + "deployment/mecak8s-agent", "-n", k8sNamespace, + "--type=json", "-p", patch).CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "restore patch failed\n--- output ---\n%s", out) + + rollout, err := exec.CommandContext(ctx, "kubectl", "rollout", "status", + "deployment/mecak8s-agent", "-n", k8sNamespace, "--timeout=240s").CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "restore rollout never completed\n--- output ---\n%s", rollout) + waitPodsReady() + agentPods = podNames() + + deleteOut, err := exec.CommandContext(ctx, "kubectl", "delete", "-n", k8sNamespace, + "deployment/dex", "service/dex", "configmap/dex-config", + "deployment/jwks-proxy", "service/jwks-proxy", "configmap/jwks-proxy-config", + "networkpolicy/dex-allow-agent-ingress", + "networkpolicy/mecak8s-agent-allow-dex-egress", + "networkpolicy/mecak8s-agent-allow-jwks-proxy-egress", + "networkpolicy/jwks-proxy-allow-agent-ingress", + "networkpolicy/jwks-proxy-allow-dex-egress", + "networkpolicy/dex-allow-jwks-proxy-ingress", + "--ignore-not-found").CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "remove Dex fixture resources\n--- output ---\n%s", deleteOut) + gomega.EventuallyWithOffset(1, func() bool { + out, getErr := exec.CommandContext(ctx, "kubectl", "get", "pods", "-n", k8sNamespace, + "-l", "app.kubernetes.io/name="+dexName, "-o", "name").Output() + return getErr == nil && strings.TrimSpace(string(out)) == "" + }, 60*time.Second, time.Second).Should(gomega.BeTrue(), + "Dex pods did not terminate before the next caller-identity journey") +} + +// kubectlApplyStdin applies a manifest from stdin. +func kubectlApplyStdin(ctx context.Context, manifest []byte) { + ginkgo.GinkgoHelper() + apply := exec.CommandContext(ctx, "kubectl", "apply", "-f", "-") + apply.Stdin = strings.NewReader(string(manifest)) + out, err := apply.CombinedOutput() + gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), + "kubectl apply (stdin) failed\n--- output ---\n%s", out) +} + +// jwksProxyManifests is a disposable transport fault boundary in front of Dex's +// JWKS endpoint. Scaling it to zero closes active connections without restarting +// Dex or changing the signing key used by the token under test. +const jwksProxyManifests = ` +apiVersion: v1 +kind: ConfigMap +metadata: + name: jwks-proxy-config + namespace: mecatl +data: + default.conf: | + server { + listen 8080; + location /keys { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://dex.mecatl.svc.cluster.local:5556/keys; + } + } +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: jwks-proxy + namespace: mecatl +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: jwks-proxy + template: + metadata: + labels: + app.kubernetes.io/name: jwks-proxy + spec: + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + containers: + - name: nginx + image: nginxinc/nginx-unprivileged:1.29-alpine + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /keys + port: 8080 + periodSeconds: 2 + volumeMounts: + - name: config + mountPath: /etc/nginx/conf.d + readOnly: true + - name: tmp + mountPath: /tmp + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: ["ALL"] + volumes: + - name: config + configMap: + name: jwks-proxy-config + - name: tmp + emptyDir: {} +--- +apiVersion: v1 +kind: Service +metadata: + name: jwks-proxy + namespace: mecatl +spec: + selector: + app.kubernetes.io/name: jwks-proxy + ports: + - port: 8080 + targetPort: 8080 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: mecak8s-agent-allow-jwks-proxy-egress + namespace: mecatl +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: mecatl + app.kubernetes.io/part-of: mecak8s + app.kubernetes.io/component: agent + policyTypes: ["Egress"] + egress: + - to: + - podSelector: + matchLabels: + app.kubernetes.io/name: jwks-proxy + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: jwks-proxy-allow-agent-ingress + namespace: mecatl +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: jwks-proxy + policyTypes: ["Ingress"] + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: mecatl + app.kubernetes.io/part-of: mecak8s + app.kubernetes.io/component: agent + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: jwks-proxy-allow-dex-egress + namespace: mecatl +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: jwks-proxy + policyTypes: ["Egress"] + egress: + - to: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: kube-system + podSelector: + matchLabels: + k8s-app: kube-dns + ports: + - protocol: UDP + port: 53 + - protocol: TCP + port: 53 + - to: + - podSelector: + matchLabels: + app.kubernetes.io/name: dex + ports: + - protocol: TCP + port: 5556 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: dex-allow-jwks-proxy-ingress + namespace: mecatl +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: dex + policyTypes: ["Ingress"] + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: jwks-proxy + ports: + - protocol: TCP + port: 5556 +` + +// dexManifests is the IdP: config, workload, Service, and the two NetworkPolicies +// its traffic needs. The bcrypt hash is of the literal "password" — throwaway +// credentials for an ephemeral in-cluster IdP with in-memory storage. +const dexManifests = ` +apiVersion: v1 +kind: ConfigMap +metadata: + name: dex-config + namespace: mecatl +data: + config.yaml: | + issuer: http://dex.mecatl.svc.cluster.local:5556 + storage: + type: memory + web: + http: 0.0.0.0:5556 + oauth2: + passwordConnector: local + skipApprovalScreen: true + staticClients: + - id: mecatl + name: mecatl + secret: mecatl-secret + public: false + redirectURIs: ["http://localhost:5555/callback"] + enablePasswordDB: true + staticPasswords: + - email: alice@example.com + hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" + username: alice + userID: alice-uid + - email: bob@example.com + hash: "$2a$10$2b2cU8CPhOTaGrs1HRQuAueS7JTT5ZHsHSzYiFPm1leZck7Mc8T4W" + username: bob + userID: bob-uid +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dex + namespace: mecatl + labels: + app.kubernetes.io/name: dex + app.kubernetes.io/part-of: mecak8s + app.kubernetes.io/component: idp +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: dex + template: + metadata: + labels: + app.kubernetes.io/name: dex + app.kubernetes.io/part-of: mecak8s + app.kubernetes.io/component: idp + spec: + securityContext: + runAsNonRoot: true + runAsUser: 65532 + runAsGroup: 65532 + seccompProfile: + type: RuntimeDefault + containers: + - name: dex + image: ghcr.io/dexidp/dex:v2.44.0 + imagePullPolicy: IfNotPresent + command: ["/usr/local/bin/dex", "serve", "/etc/dex/config.yaml"] + ports: + - containerPort: 5556 + volumeMounts: + - name: cfg + mountPath: /etc/dex + readOnly: true + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: ["ALL"] + readinessProbe: + httpGet: + path: /healthz + port: 5556 + initialDelaySeconds: 2 + periodSeconds: 2 + volumes: + - name: cfg + configMap: + name: dex-config +--- +apiVersion: v1 +kind: Service +metadata: + name: dex + namespace: mecatl + labels: + app.kubernetes.io/name: dex +spec: + selector: + app.kubernetes.io/name: dex + ports: + - name: http + port: 5556 + targetPort: 5556 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: dex-allow-agent-ingress + namespace: mecatl +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: dex + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: mecatl + podSelector: + matchLabels: + app.kubernetes.io/name: mecatl + app.kubernetes.io/part-of: mecak8s + app.kubernetes.io/component: agent + ports: + - protocol: TCP + port: 5556 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: mecak8s-agent-allow-dex-egress + namespace: mecatl +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: mecatl + app.kubernetes.io/part-of: mecak8s + app.kubernetes.io/component: agent + policyTypes: + - Egress + egress: + - to: + - podSelector: + matchLabels: + app.kubernetes.io/name: dex + ports: + - protocol: TCP + port: 5556 +` diff --git a/engine/CHANGELOG.md b/engine/CHANGELOG.md index feda32b628..78dadb9a70 100644 --- a/engine/CHANGELOG.md +++ b/engine/CHANGELOG.md @@ -13,6 +13,95 @@ The covered surface is the seven core packages (`session`, `governance`, `tool`, ### Added +- **`session.PrincipalFromClaims` and `session.GrantTypeFromClaims`** + ([ADR 0103](../docs/adr/0103-oidc-authn-module.md)) — stdlib-only projection + helpers for embedders that verify credentials outside the engine. Projection + requires non-empty string `iss` and `sub`, preserves strings byte-exactly, + never fabricates anonymous identity or derives the `system` grant, and keeps + JWT/OIDC dependencies out of the engine. New exported functions: Added (a + minor bump). + +- **Caller-identity labels on the session aggregate** (issue #367, + [ADR 0100](../docs/adr/0100-caller-identity-threading.md)) — the joint + field-prep addition for the caller-identity track (`Owner`) and Track C + (`Authority`), landed together so the generated-surface regeneration is paid + once: + - `session.Principal` — the verified-caller value object + (`{Issuer, Subject, GrantType, Name}`). Identity is the `(Issuer, Subject)` + PAIR, never `Subject` alone (two IdPs collide on `sub`). It carries no + scopes, no authority, no credentials, no claims map. Absent identity is a + nil `*Principal`, never a fabricated anonymous one. + - `session.GrantType` + `GrantTypeUser` / `GrantTypeClientCredentials` / + `GrantTypeSystem` + `GrantType.Valid` — the closed three-value enum; the + zero value is deliberately not a member. + - `session.Authority` — Track C's label, shipped INERT (nothing reads or + writes it beyond the snapshot round-trip). Zero value means unset. + - `session.Session.Owner` / `session.Session.Authority` — the additive labels, + stamped through the new WRITE-ONCE `Session.RestoreLabels(owner, authority)` + (a different owner over a set one returns the new + `session.ErrOwnerAlreadySet`; a nil owner is the ownerless no-auth path and + does not burn the slot). `sessnap.Snapshot` gains matching `owner` / + `authority` fields, both `omitempty`, restored through that aggregate method + — `sessnap.RestoreState`'s signature is deliberately UNCHANGED (a trailing + parameter would be Changed/breaking; a direct-assignment field is + Added/minor). A pre-ship snapshot with no `owner`/`authority` key restores + to a nil owner and a zero authority. + + All of the above are new exported identifiers and new struct fields — + classified Added per COMPATIBILITY.md (a minor bump). (issue #367) + +- **`session.(*Principal).Clone`** (issue #367) — the ONE place the "copy a + `*Principal` across a boundary, nil stays nil" rule lives. It is + nil-receiver-safe (a nil principal clones to nil), and every site that hands a + principal out of, or into, a structure it does not own routes through it + instead of hand-rolling the nil check and the deref. `Principal` is all-strings + today so a shallow copy IS a deep copy; the method exists so that the day it + gains a slice or map field, every site stays correct together rather than + silently becoming an aliasing bug. A new exported method: Added (a minor bump). + +- **`port.SessionMeta.Owner`** (issue #367, + [ADR 0100](../docs/adr/0100-caller-identity-threading.md) decision 4) — the + session owner on the cheap picker projection, so a `MetaLister` listing (which + skips `Load` entirely) renders the owner column IDENTICALLY to the + `Load`-per-row fallback instead of leaving it empty on the fast path. Nil for + an ownerless session — a store that cannot decode an owner renders it as + unowned, never as somebody else. A new struct field: Added (a minor bump). + +- **`session.Event.Actor`** (issue #367, + [ADR 0100](../docs/adr/0100-caller-identity-threading.md) decision 5) — the + verified caller a durable-log event is attributed to, so an event read in + isolation names its actor. It is LOG-ONLY and DERIVE-AT-APPEND: every emit + site — the agent loop included — leaves it nil (the loop is storage- and + identity-agnostic), and the server relay's single `appendEvent` chokepoint + stamps it from the LOADED SESSION'S OWNER just before the durable + `port.EventLog.Append`. It never reaches the client wire (no proto field maps + it) and it is NOT a reconstruction input: `eventsource.Fold` ignores it, so a + folded session keeps the owner its caller restored from the snapshot. The + session owner stays the identity of record; an ownerless (pre-ship) session + records a nil actor, never a fabricated one. A new struct field: Added (a + minor bump). + +- **`port.ScheduleSpec.Owner`** (issue #367, + [ADR 0100](../docs/adr/0100-caller-identity-threading.md) decision 6) — the + verified caller a schedule is attributed to, captured ONCE at create time and + never derived at fire time (retention sweeps the origin session while the + schedule lives on, so a fire-time lookup would read a session that no longer + exists). The store is identity-blind: it round-trips the value verbatim on + every transport, which the schedule conformance suite now pins along with + pointer isolation (a loaded spec must not alias the stored record). Nil means + an ownerless schedule — never a fabricated principal. A new struct field: + Added (a minor bump). + +- **`session.WithPrincipal` / `session.PrincipalFromContext`** (issue #367, + [ADR 0100](../docs/adr/0100-caller-identity-threading.md) decision 2) — the + context seam the verified caller rides on. No port interface gains a principal + parameter; the principal travels in the `context.Context` under an unexported + empty-struct key. Absent identity reads back as a nil `*Principal`, never a + fabricated anonymous one — and `WithPrincipal(ctx, nil)` returns `ctx` + unchanged, so "no identity" can never be laundered into a present-but-empty + principal. The stored principal is a copy, so a caller cannot mutate what the + context reports. Added (a minor bump). + - **`session.ToValidUTF8` and `session.RepairToolResult`** (issue #402) — the UTF-8 repair primitives that close the Converse-stream kill. A tool can hand back arbitrary bytes (a command's stdout, a file's contents, an MCP server's diff --git a/engine/COMPATIBILITY.md b/engine/COMPATIBILITY.md index 2390170277..acffb8887a 100644 --- a/engine/COMPATIBILITY.md +++ b/engine/COMPATIBILITY.md @@ -138,6 +138,7 @@ honour. | cumulative `Usage` | **MUST** | the **SUM** of every per-run `EvResult.Usage` (each `EvResult.Usage` is PER-RUN; the budget brake reads the cumulative aggregate) | | `Title` | **MUST** (best-effort) | seeded from the FIRST genuine `EvUserPrompt` (via `session.SetTitle`, set-once + clamped); a synthesised-summary `EvUserPrompt` does not seed. For a compacted session the opener's `EvUserPrompt` was emitted before the compaction, so the title survives compaction. | | creation metadata: id, mode, limits, workspace, profile, provider/model selector, reasoning-effort, createdAt | **MUST** (supplied out-of-band) | **NOT in any event** — provided by the caller via `eventsource.SessionMeta` | +| identity labels: `Owner` (the verified caller), `Authority` (Track C, inert) | **not event-carried** — safe to lose on a pure fold | the snapshot (`sessnap`, restored via the write-once `Session.RestoreLabels`). Per [ADR 0100](../docs/adr/0100-caller-identity-threading.md) the event annotation is log-only and the fold neither requires nor re-derives it, so a fold-rebuilt session keeps whatever owner the snapshot restored — and an ownerless one stays ownerless (**never** fabricated or backfilled). | | `Counters` (turns / tool calls / consecutive failures) | run-scoped — reflects the **latest run segment** (they reset on `Reopen`), derived from the latest run's events | `EvTurnStart` (turns), `EvToolResult` (tool calls / consecutive failures) | | run plumbing (diagnostics binding, askID serials, ctx) | safe to lose — rebuilt fresh | n/a | diff --git a/engine/adapter/eventsource/review_test.go b/engine/adapter/eventsource/review_test.go index ea6ecf6f48..adec8c15e6 100644 --- a/engine/adapter/eventsource/review_test.go +++ b/engine/adapter/eventsource/review_test.go @@ -238,11 +238,15 @@ func TestFoldContractDocMatchesSessionFields(t *testing.T) { // run-scoped (latest segment): Counters // supplied via SessionMeta (not event-carried): ID, Mode, Limits, Workspace, // Profile, ProviderID, ModelID, ReasoningEffort, CreatedAt + // not-event-carried identity labels (ADR 0100): Owner, Authority — the event + // annotation is log-only and the fold neither requires nor re-derives it, + // so a folded session keeps the snapshot-restored owner (ownerless stays + // ownerless, never fabricated) wantSessionFields := map[string]struct{}{ "ID": {}, "State": {}, "Mode": {}, "Conversation": {}, "Limits": {}, "Counters": {}, "Usage": {}, "Workspace": {}, "Profile": {}, "ProviderID": {}, "ModelID": {}, "ReasoningEffort": {}, "CreatedAt": {}, - "Title": {}, + "Title": {}, "Owner": {}, "Authority": {}, } assertExportedFields(t, reflect.TypeOf(session.Session{}), wantSessionFields, "session.Session — classify the new field in COMPATIBILITY.md's reconstruction contract") diff --git a/engine/adapter/memschedulestore/memschedulestore.go b/engine/adapter/memschedulestore/memschedulestore.go index 4b6ff677d8..70f20e134a 100644 --- a/engine/adapter/memschedulestore/memschedulestore.go +++ b/engine/adapter/memschedulestore/memschedulestore.go @@ -442,15 +442,16 @@ func (s *Store) ReArmOneShot(_ context.Context, name string, nextFire time.Time) return nil } -// cloneSpec returns a copy of spec whose Parts slice is independent of the -// stored one (so a caller cannot mutate the store's record through the -// returned Schedule). ScheduleSpec is otherwise a struct of values. +// cloneSpec returns a copy of spec whose Parts slice AND Owner pointer are +// independent of the stored one (so a caller cannot mutate the store's record +// through the returned Schedule). ScheduleSpec is otherwise a struct of values. func cloneSpec(spec port.ScheduleSpec) port.ScheduleSpec { out := spec if spec.Parts != nil { out.Parts = make([]session.Content, len(spec.Parts)) copy(out.Parts, spec.Parts) } + out.Owner = spec.Owner.Clone() return out } diff --git a/engine/adapter/scheduleconformance/scheduleconformance.go b/engine/adapter/scheduleconformance/scheduleconformance.go index a7c444d604..803fb65db0 100644 --- a/engine/adapter/scheduleconformance/scheduleconformance.go +++ b/engine/adapter/scheduleconformance/scheduleconformance.go @@ -75,6 +75,15 @@ func Run(t *testing.T, newStore func(t *testing.T) port.ScheduleStore) { MaxFires: 3, Mutating: true, CreatedAt: time.Unix(1_700_000_000, 0), + // The captured owner (ADR 0100 decision 6) must survive the + // round-trip on EVERY transport — a schedule outlives its origin + // session, so the store is the only place the attribution lives. + Owner: &session.Principal{ + Issuer: "https://idp.example", + Subject: "alice", + GrantType: session.GrantTypeUser, + Name: "Alice", + }, }, State: port.ScheduleState{ NextFireAt: time.Unix(1_700_000_060, 0), @@ -89,6 +98,16 @@ func Run(t *testing.T, newStore func(t *testing.T) port.ScheduleStore) { t.Fatalf("Load: %v", err) } assertScheduleEqual(t, "round-trip", got, in) + // Owner is the spec's only POINTER field: a returned Schedule must not + // alias the store's record, or a caller's edit rewrites stored history. + got.Spec.Owner.Subject = "mallory" + again, err := s.Load(ctx, in.Spec.Name) + if err != nil { + t.Fatalf("Load (isolation): %v", err) + } + if again.Spec.Owner == nil || again.Spec.Owner.Subject != "alice" { + t.Errorf("mutating a loaded Spec.Owner changed the stored record: %+v", again.Spec.Owner) + } }) t.Run("save preserves existing firing state on overwrite", func(t *testing.T) { @@ -1550,6 +1569,14 @@ func assertScheduleEqual(t *testing.T, label string, got, want port.Schedule) { if got.Spec.Mutating != want.Spec.Mutating { t.Errorf("%s: Spec.Mutating = %v, want %v", label, got.Spec.Mutating, want.Spec.Mutating) } + switch { + case got.Spec.Owner == nil && want.Spec.Owner != nil: + t.Errorf("%s: Spec.Owner = nil, want %+v", label, *want.Spec.Owner) + case got.Spec.Owner != nil && want.Spec.Owner == nil: + t.Errorf("%s: Spec.Owner = %+v, want nil (an ownerless schedule is never adopted)", label, *got.Spec.Owner) + case got.Spec.Owner != nil && *got.Spec.Owner != *want.Spec.Owner: + t.Errorf("%s: Spec.Owner = %+v, want %+v", label, *got.Spec.Owner, *want.Spec.Owner) + } if !got.Spec.CreatedAt.Equal(want.Spec.CreatedAt) { t.Errorf("%s: Spec.CreatedAt = %v, want %v", label, got.Spec.CreatedAt, want.Spec.CreatedAt) } diff --git a/engine/adapter/sessnap/owner_test.go b/engine/adapter/sessnap/owner_test.go new file mode 100644 index 0000000000..695450c7bb --- /dev/null +++ b/engine/adapter/sessnap/owner_test.go @@ -0,0 +1,143 @@ +package sessnap_test + +import ( + "encoding/json" + "testing" + "time" + + "github.com/stacklok/mecatl/engine/adapter/sessnap" + "github.com/stacklok/mecatl/engine/session" +) + +// TestCallerIdentity_Scenario0_OwnerSnapshotRoundTrip pins AC0.1 of +// docs/acceptance/caller-identity.md: Session.Owner and Session.Authority +// round-trip through Marshal/Unmarshal byte-identically, restored via the +// write-once aggregate method (RestoreLabels), with no RestoreState signature +// change. +func TestCallerIdentity_Scenario0_OwnerSnapshotRoundTrip(t *testing.T) { + t.Parallel() + + s := session.New("s1", session.ModeDefault, "/w", session.Limits{}, time.Unix(0, 0).UTC()) + owner := &session.Principal{ + Issuer: "https://idp.example.com", + Subject: "user-42", + GrantType: session.GrantTypeUser, + Name: "Alice", + } + if err := s.RestoreLabels(owner, session.Authority("team-lead")); err != nil { + t.Fatalf("RestoreLabels: %v", err) + } + + line, err := sessnap.Marshal(s) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + got, err := sessnap.Unmarshal(line) + if err != nil { + t.Fatalf("Unmarshal: %v", err) + } + + if got.Owner == nil { + t.Fatalf("restored owner is nil, want %+v", *owner) + } + if *got.Owner != *owner { + t.Errorf("owner round-trip: got %+v, want %+v", *got.Owner, *owner) + } + if got.Authority != session.Authority("team-lead") { + t.Errorf("authority round-trip: got %q, want %q", got.Authority, "team-lead") + } + + // Byte-identical: re-marshalling the restored session reproduces the line. + again, err := sessnap.Marshal(got) + if err != nil { + t.Fatalf("re-Marshal: %v", err) + } + if string(again) != string(line) { + t.Errorf("snapshot not byte-identical across round-trip:\n got %s\nwant %s", again, line) + } + + // The identity pair is (Issuer, Subject) — a same-subject different-issuer + // principal must not compare equal. + other := *owner + other.Issuer = "https://other.example.com" + if other == *got.Owner { + t.Error("principals from different issuers compared equal; identity must be the (iss, sub) pair") + } +} + +// TestCallerIdentity_Scenario0_PreShipSnapshotRestores pins AC0.2: a snapshot +// written before this plan (no "owner"/"authority" keys) restores to a nil +// owner and a zero authority — additive omitempty, never a parse failure. +func TestCallerIdentity_Scenario0_PreShipSnapshotRestores(t *testing.T) { + t.Parallel() + + const preShip = `{"id":"s1","state":"idle","mode":"default","limits":{},` + + `"counters":{},"workspace":"/w","created_at":"1970-01-01T00:00:00Z","messages":[]}` + + got, err := sessnap.Unmarshal([]byte(preShip)) + if err != nil { + t.Fatalf("Unmarshal pre-ship snapshot: %v", err) + } + if got.Owner != nil { + t.Errorf("pre-ship snapshot restored owner %+v, want nil", *got.Owner) + } + if got.Authority != (session.Authority("")) { + t.Errorf("pre-ship snapshot restored authority %q, want the zero value", got.Authority) + } + + // And the omitempty half: an ownerless session emits neither key, so a + // snapshot stays byte-identical to a pre-ship one. + line, err := sessnap.Marshal(got) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + var keys map[string]json.RawMessage + if err := json.Unmarshal(line, &keys); err != nil { + t.Fatalf("decode keys: %v", err) + } + if _, ok := keys["owner"]; ok { + t.Errorf("ownerless snapshot emitted an \"owner\" key: %s", line) + } + if _, ok := keys["authority"]; ok { + t.Errorf("authority-less snapshot emitted an \"authority\" key: %s", line) + } +} + +// TestCallerIdentity_Scenario0_APICompatAdditive pins AC0.3: a consumer +// compiled against the new engine/session reads Owner and Authority with NO +// RestoreState call-site change — the additive-field, not-widened-signature +// contract (a trailing RestoreState parameter would be a Changed/breaking entry +// under engine/COMPATIBILITY.md). +func TestCallerIdentity_Scenario0_APICompatAdditive(t *testing.T) { + t.Parallel() + + // The pre-existing eight-parameter call site, verbatim. If RestoreState's + // signature widened, this file stops compiling — that is the assertion. + s := session.New("s1", session.ModeDefault, "/w", session.Limits{}, time.Unix(0, 0).UTC()) + if err := sessnap.RestoreState( + s, + session.StateIdle, + session.StopNone, + nil, + session.Counters{}, + session.Usage{}, + false, + "", + ); err != nil { + t.Fatalf("RestoreState: %v", err) + } + // RestoreState touches neither label: they are restored by the aggregate + // method, not the state driver. + if s.Owner != nil || s.Authority != session.Authority("") { + t.Errorf("RestoreState set the labels: owner=%v authority=%q", s.Owner, s.Authority) + } + + // And the fields are readable off the aggregate by an external consumer. + owner := &session.Principal{Issuer: "iss", Subject: "sub", GrantType: session.GrantTypeSystem} + if err := s.RestoreLabels(owner, session.Authority("a")); err != nil { + t.Fatalf("RestoreLabels: %v", err) + } + if s.Owner == nil || *s.Owner != *owner || s.Authority != session.Authority("a") { + t.Errorf("labels not readable: owner=%v authority=%q", s.Owner, s.Authority) + } +} diff --git a/engine/adapter/sessnap/sessnap.go b/engine/adapter/sessnap/sessnap.go index 449162f687..4b51f8ae01 100644 --- a/engine/adapter/sessnap/sessnap.go +++ b/engine/adapter/sessnap/sessnap.go @@ -82,6 +82,19 @@ type Snapshot struct { // event-side subagentCausePayload so the snapshot and the subagent.end event // carry the same persisted cause. LastError string `json:"last_error,omitempty"` + // Owner is the verified caller the session is attributed to (ADR 0100). A + // POINTER for true omitempty: an ownerless session emits no "owner" key, so a + // pre-ship snapshot decodes to a nil owner and an ownerless snapshot stays + // byte-identical to a pre-ship one — purely additive, no format-tag bump. + // Restored via the write-once aggregate method Session.RestoreLabels, NOT a + // RestoreState parameter (widening that signature would be a Changed/breaking + // entry under engine/COMPATIBILITY.md; a direct-assignment field is + // Added/minor). + Owner *session.Principal `json:"owner,omitempty"` + // Authority is Track C's inert label, round-tripped here so the contended + // generated-file regeneration is paid once. omitempty keeps a pre-ship + // snapshot with no "authority" key decoding to the zero value. + Authority session.Authority `json:"authority,omitempty"` } // messageDTO mirrors session.Message with JSON tags. session.Message is @@ -140,7 +153,11 @@ func Of(s *session.Session) (Snapshot, error) { ModelID: s.ModelID, ReasoningEffort: s.ReasoningEffort, Title: s.Title, + Authority: s.Authority, CreatedAt: s.CreatedAt, + // Owner is a pointer for true omitempty; Clone so the snapshot cannot + // alias (and later mutate) the aggregate's own principal. + Owner: s.Owner.Clone(), } // Usage is a pointer for true omitempty: only emit the key when there is spend // to persist, so a zero-usage snapshot stays byte-identical to a pre-Usage one. @@ -186,6 +203,12 @@ func (snap Snapshot) Restore() (*session.Session, error) { s.ModelID = snap.ModelID s.ReasoningEffort = snap.ReasoningEffort s.Title = snap.Title + // The identity labels go through the WRITE-ONCE aggregate method rather than a + // field poke (Session is an aggregate) and rather than a RestoreState + // parameter (that widening is Changed/breaking; this stays Added/minor). + if err := s.RestoreLabels(snap.Owner, snap.Authority); err != nil { + return nil, fmt.Errorf("sessnap: restore labels: %w", err) + } // The cumulative usage to seed (a nil pointer => the zero Usage, the pre-Usage // default), passed to RestoreState alongside the counters so it seeds the budget diff --git a/engine/agent/caller_identity_owner_test.go b/engine/agent/caller_identity_owner_test.go new file mode 100644 index 0000000000..1e27a1c09d --- /dev/null +++ b/engine/agent/caller_identity_owner_test.go @@ -0,0 +1,191 @@ +package agent + +import ( + "context" + "encoding/json" + "testing" + "time" + + "github.com/stacklok/mecatl/engine/adapter/memfs" + "github.com/stacklok/mecatl/engine/adapter/memstore" + "github.com/stacklok/mecatl/engine/adapter/mockllm" + "github.com/stacklok/mecatl/engine/adapter/permpolicy" + "github.com/stacklok/mecatl/engine/port" + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/engine/team" + "github.com/stacklok/mecatl/engine/tool" +) + +// ownerAlice and ownerBob are the two principals the child-inheritance test +// uses. They differ in BOTH halves of the identity pair, so an assertion that +// compares only `sub` still distinguishes them. +var ( + ownerAlice = &session.Principal{Issuer: "https://idp.example/alice-realm", Subject: "alice", GrantType: session.GrantTypeUser, Name: "Alice"} + ownerBob = &session.Principal{Issuer: "https://idp.example/bob-realm", Subject: "bob", GrantType: session.GrantTypeUser, Name: "Bob"} +) + +// TestCallerIdentity_Scenario3_ForkInheritsSourceOwner pins the engine half of +// AC3.3: a `subagent-`/`parallel-`/`team-` child session inherits the PARENT +// session's owner — the source's, not the calling goroutine's. The context this +// run is driven under carries a DIFFERENT principal (Bob), so a child that +// picked its owner off the ambient context instead of the parent aggregate +// fails here: that is exactly the laundering path the AC forbids. An OWNERLESS +// parent yields an OWNERLESS child — never fabricated, never rejected (the +// no-auth path must keep working). +// +// All THREE delegation families are driven, because all three mint their child +// session through the same parentCaps.inheritOwner seam: Subagent, a Parallel +// branch, and a Team member. Asserting only one would leave the other two's +// attribution unproven. +// +// The service half (a forked session inheriting the source session's owner) is +// pinned by the same-named test in internal/adapter/server. +func TestCallerIdentity_Scenario3_ForkInheritsSourceOwner(t *testing.T) { + for _, path := range []struct { + name string + // childID is the persisted child session id the delegation path mints. + childID session.SessionID + // register wires the delegation tool onto the parent catalog, persisting + // its children into store. + register func(t *testing.T, cat *tool.Catalog, store port.SessionStore) + // call is the parent model's tool call that starts the delegation. + call session.ToolCall + }{ + { + name: "subagent", + childID: "subagent-p1", + register: func(t *testing.T, cat *tool.Catalog, store port.SessionStore) { + t.Helper() + cat.MustRegister(NewSubagentTool(childEngineForOwnerTest(t), WithSubagentStore(store))) + }, + call: session.NewToolCall("p1", "Subagent", json.RawMessage(`{"prompt":"investigate"}`)), + }, + { + name: "parallel branch", + childID: "parallel-p1-0", + register: func(t *testing.T, cat *tool.Catalog, store port.SessionStore) { + t.Helper() + cat.MustRegister(NewParallelTool(childEngineForOwnerTest(t), ownerTestForker{}, + WithParallelStore(store), WithParallelConcurrency(1))) + }, + call: session.NewToolCall("p1", "Parallel", json.RawMessage(`{"tasks":["one"]}`)), + }, + { + name: "team member", + childID: MemberSessionID("p1", "worker"), + register: func(t *testing.T, cat *tool.Catalog, store port.SessionStore) { + t.Helper() + cat.MustRegister(NewTeamTool(ownerTestMemberFactory(t), + WithTeamToolStore(store), WithTeamToolReadOnlyForker(ownerTestForker{}))) + }, + call: session.NewToolCall("p1", "Team", + json.RawMessage(`{"goal":"fix it","members":[{"name":"lead","role":"lead"},{"name":"worker","role":"work"}]}`)), + }, + } { + for _, tc := range []struct { + name string + parentOwner *session.Principal + }{ + {"owned parent", ownerAlice}, + {"ownerless parent", nil}, + } { + t.Run(path.name+"/"+tc.name, func(t *testing.T) { + store := memstore.New() + allow := permpolicy.NewPolicy(permpolicy.AllowAllFloorRules(), nil) + cat := tool.NewCatalog() + path.register(t, cat, store) + + parentLLM := mockllm.New( + mockllm.ToolCallTurn(path.call), + mockllm.TextTurn("parent done"), + ) + e := NewEngine(Deps{LLM: parentLLM, Catalog: cat, Policy: allow, Model: "parent-model"}) + + sess := session.New("owner-parent", session.ModeDefault, "/ws", session.Limits{}, time.Unix(0, 0)) + if err := sess.RestoreLabels(tc.parentOwner, ""); err != nil { + t.Fatalf("RestoreLabels: %v", err) + } + + // The run is driven under a context carrying BOB — a different + // principal from the parent session's owner. + ctx := session.WithPrincipal(context.Background(), ownerBob) + r := e.Run(ctx, sess, memfs.NewWorkspace("/ws"), RunRequest{Text: "go"}) + drainRunEvents(t, r) + + child, err := store.Load(context.Background(), path.childID) + if err != nil || child == nil { + t.Fatalf("child %q must be persisted: %v", path.childID, err) + } + switch { + case tc.parentOwner == nil: + if child.Owner != nil { + t.Fatalf("ownerless parent produced child owned by %+v, want nil (never fabricated, never the caller's)", *child.Owner) + } + case child.Owner == nil: + t.Fatalf("child owner = nil, want the PARENT's owner %+v", *tc.parentOwner) + case *child.Owner != *tc.parentOwner: + t.Fatalf("child owner = %+v, want the PARENT's owner %+v (a child must not be attributed to the calling goroutine)", *child.Owner, *tc.parentOwner) + } + }) + } + } +} + +// childEngineForOwnerTest is the one-turn child engine every delegation path in +// the AC3.3 test delegates to. Its content is irrelevant — what is under test is +// the OWNER stamped on the child session, not what the child says. +func childEngineForOwnerTest(t *testing.T) *Engine { + t.Helper() + return NewEngine(Deps{ + LLM: mockllm.New(mockllm.TextTurn("child done")), + Catalog: tool.NewCatalog(), + Policy: permpolicy.NewPolicy(permpolicy.AllowAllFloorRules(), nil), + Model: "child-model", + }) +} + +// ownerTestForker is the minimal tool.WorkspaceForker the Parallel and Team +// paths require: each fork is a fresh in-memory workspace, no git, no cleanup. +type ownerTestForker struct{} + +func (ownerTestForker) Fork(_ context.Context, _ tool.Workspace, label string) (tool.Workspace, func() error, string, error) { + return memfs.NewWorkspace("/fork-" + label), func() error { return nil }, "", nil +} + +// ownerTestMemberFactory builds each team member's engine over its own scripted +// one-turn provider plus the team coordination tools, mirroring the real +// composition factory's shape. +func ownerTestMemberFactory(t *testing.T) TeamMemberEngineFactory { + t.Helper() + allow := permpolicy.NewPolicy(permpolicy.AllowAllFloorRules(), nil) + return func(tm *team.Team, spec MemberSpec, _ string) MemberBuild { + cat := tool.NewCatalog() + for _, tl := range MemberTools(tm, spec.Name, nil) { + cat.MustRegister(tl) + } + return MemberBuild{Engine: NewEngine(Deps{ + LLM: mockllm.New(mockllm.TextTurn(spec.Name + " done")), + Catalog: cat, + Policy: allow, + Model: "member-model", + })} + } +} + +// drainRunEvents drains a run to completion with a deadline, so a wedge fails +// the test instead of hanging it. +func drainRunEvents(t *testing.T, r *Run) { + t.Helper() + deadline := time.After(15 * time.Second) + for { + select { + case _, ok := <-r.Events(): + if !ok { + return + } + case <-deadline: + r.Cancel() + t.Fatal("run did not terminate (possible wedge)") + } + } +} diff --git a/engine/agent/dispatch.go b/engine/agent/dispatch.go index be010d6b41..16bc970ba8 100644 --- a/engine/agent/dispatch.go +++ b/engine/agent/dispatch.go @@ -1167,6 +1167,10 @@ func (e *Engine) parentCaps(r *Run, sess *session.Session, turnIdx int) parentCa caps.forkHistory = func() []session.Message { return session.ForkSnapshot(sess.Conversation) } + // The parent session's owner (ADR 0100 decision 4) rides down so every + // child session it spawns is attributed to the SAME principal. Read off + // the aggregate, never off the ambient context — see parentCaps.owner. + caps.owner = sess.Owner } // The OPT-IN headless ask reviewer: bind the engine's reviewer + THIS run's // breaker + the timeout into a closure resolveChildAsk consults on the headless diff --git a/engine/agent/parallel.go b/engine/agent/parallel.go index 58e5bbbe65..8e7f0db75d 100644 --- a/engine/agent/parallel.go +++ b/engine/agent/parallel.go @@ -1047,6 +1047,8 @@ func (t *ParallelTool) runBranch(ctx context.Context, callID session.ToolCallID, t.limits, branchEngine.now(), ) + // The branch is attributed to the PARENT session's owner (ADR 0100 decision 4). + caps.inheritOwner(childSess) run := branchEngine.Run(ctx, childSess, child, RunRequest{Text: prompt}) // A Parallel branch always runs in its OWN isolated fork, so its Bash asks are eligible diff --git a/engine/agent/subagent.go b/engine/agent/subagent.go index 540fcd4bd2..38a45278f6 100644 --- a/engine/agent/subagent.go +++ b/engine/agent/subagent.go @@ -167,6 +167,32 @@ type parentCaps struct { // The ctx is the run's ctx so a Run.Cancel propagates into the classifier turn // (issue #94); see SubagentModelRouter. routeTask func(ctx context.Context, taskPrompt string) (category, model, reason string, ok bool) + // owner is the PARENT session's verified owner (ADR 0100 decision 4), handed + // down so every child session (subagent-/parallel-/team-) is attributed to the + // same principal as the session that spawned it. It is read off the parent + // AGGREGATE, deliberately NOT off the ambient context: a child must inherit + // the SOURCE's owner, never the identity of whichever caller happens to be + // driving the run — that would be an ownership-laundering path. nil for an + // OWNERLESS parent (the no-auth path), which yields an ownerless child: never + // a fabricated one, and never a rejection. + owner *session.Principal +} + +// inheritOwner stamps the parent session's owner onto a freshly-minted child +// session (ADR 0100 decision 4). It is the ONE point every child family goes +// through, so subagent/parallel/team children cannot drift apart. Write-once via +// the aggregate (Session is an aggregate — never poke the field); on a fresh +// child the slot is empty so this cannot collide, and a nil owner is a no-op — +// an ownerless parent yields an ownerless child. +func (c parentCaps) inheritOwner(child *session.Session) { + if c.owner == nil || child == nil { + return + } + // The only error RestoreLabels can return is ErrOwnerAlreadySet on a DIFFERENT + // owner; a fresh child has no owner, and a resumed child already carries this + // same one. Either way the persisted owner stands — the write is write-once by + // construction and must never overwrite. + _ = child.RestoreLabels(c.owner, "") } // registerChildRun is the nil-safe registration wrapper a spawning tool calls: a @@ -2341,6 +2367,8 @@ func (t *SubagentTool) run(ctx context.Context, call session.ToolCall, ws tool.W if !ok { return errResult, nil } + // The child is attributed to the PARENT session's owner (ADR 0100 decision 4). + caps.inheritOwner(child) // Tear down the run workspace after the child fully drains. For a writable // (direct-write) child this is a no-op — cleanupWS is the no-op returned by // forkChildWorkspace for a nil forker (the child ran against the parent ws, which @@ -2675,6 +2703,8 @@ func (t *SubagentTool) driveBackground(ctx context.Context, b backgroundChild) { endOnError(errResult) return } + // The child is attributed to the PARENT session's owner (ADR 0100 decision 4). + b.caps.inheritOwner(child) // RESUME-START persist, mirroring prepareChildSession: refresh the resumed // snapshot's last-modified time so the child-session GC's age pass never // deletes an in-flight resumed child (best-effort, failures swallowed). diff --git a/engine/agent/teamsupervisor.go b/engine/agent/teamsupervisor.go index a0cb677d2f..7c1cd74d52 100644 --- a/engine/agent/teamsupervisor.go +++ b/engine/agent/teamsupervisor.go @@ -795,6 +795,8 @@ func (s *Supervisor) AddMember(ctx context.Context, spec MemberSpec) error { // unchanged. limits := mergeLimits(s.limits, build.Limits) sess := session.New(s.sessionID(spec.Name), mode, ws.Root(), limits, build.Engine.now()) + // The member is attributed to the PARENT session's owner (ADR 0100 decision 4). + s.caps.inheritOwner(sess) _ = s.team.SetMemberSession(spec.Name, sess.ID) // Mint the per-member cancellation pair and register the member in the PARENT diff --git a/engine/api/port.txt b/engine/api/port.txt index 052eba75f1..ba23509296 100644 --- a/engine/api/port.txt +++ b/engine/api/port.txt @@ -103,11 +103,11 @@ type ScheduleFire struct{ID string; ScheduleName string; SessionID session.Sessi type ScheduleManager interface{CreateSchedule(ctx context.Context, spec ScheduleSpec) (Schedule, error); DeleteSchedule(ctx context.Context, name string) error; FireNow(ctx context.Context, name string) (ScheduleFire, error); GetSchedule(ctx context.Context, name string) (Schedule, error); ListFires(ctx context.Context, scheduleName string) ([]ScheduleFire, error); ListSchedules(ctx context.Context) ([]Schedule, error); PauseSchedule(ctx context.Context, name string) error; ResumeSchedule(ctx context.Context, name string) error; UpdateSchedule(ctx context.Context, spec ScheduleSpec) (Schedule, error)} type ScheduleOneShotReArmer interface{ReArmOneShot(ctx context.Context, name string, nextFire time.Time) error} type ScheduleProviderSelector struct{ProviderID string; ModelID string} -type ScheduleSpec struct{Name string; Prompt string; Parts []session.Content; Trigger TriggerSpec; Selector ScheduleProviderSelector; Profile string; Workspace string; Mode session.PermissionMode; Limits session.Limits; Mutating bool; MaxFires int; Misfire MisfirePolicy; Singleton bool; Timezone string; CreatedAt time.Time; OneShotRetry bool; OneShotMaxRetries int; CarryContext bool; OriginSessionID session.SessionID; FireTimeout time.Duration} +type ScheduleSpec struct{Name string; Prompt string; Parts []session.Content; Trigger TriggerSpec; Selector ScheduleProviderSelector; Profile string; Workspace string; Mode session.PermissionMode; Limits session.Limits; Mutating bool; MaxFires int; Misfire MisfirePolicy; Singleton bool; Timezone string; CreatedAt time.Time; OneShotRetry bool; OneShotMaxRetries int; CarryContext bool; OriginSessionID session.SessionID; Owner *session.Principal; FireTimeout time.Duration} type ScheduleState struct{NextFireAt time.Time; LastFireAt time.Time; FireCount int; Enabled bool; LastFireSessionID session.SessionID; OneShotRetryCount int; LastFireStartedAt time.Time; LastFireProgressAt time.Time; FireDeadline time.Time} type ScheduleStore interface{Claim(ctx context.Context, name string, now time.Time, nextFire time.Time) (Schedule, error); ClaimNow(ctx context.Context, name string, now time.Time, nextFire time.Time) (Schedule, error); Delete(ctx context.Context, name string) error; Due(ctx context.Context, now time.Time) ([]Schedule, error); List(ctx context.Context) ([]Schedule, error); ListFires(ctx context.Context, scheduleName string) ([]ScheduleFire, error); Load(ctx context.Context, name string) (Schedule, error); LoadFire(ctx context.Context, fireID string) (ScheduleFire, error); RecordFire(ctx context.Context, f ScheduleFire) error; RecordFireProgress(ctx context.Context, name string, fireID string, at time.Time) error; RecordFireStart(ctx context.Context, name string, fire ScheduleFire) error; Save(ctx context.Context, s Schedule) error; SetEnabled(ctx context.Context, name string, enabled bool) error} type SessionLease interface{Acquire(ctx context.Context, id session.SessionID, owner string) (Lease, error); Release(ctx context.Context, l Lease) error; Renew(ctx context.Context, l Lease) (Lease, error)} -type SessionMeta struct{ID session.SessionID; ModifiedAt time.Time; State session.State; Turns int; ModelID string; CreatedAt time.Time; Title string} +type SessionMeta struct{ID session.SessionID; ModifiedAt time.Time; State session.State; Turns int; ModelID string; CreatedAt time.Time; Title string; Owner *session.Principal} type SessionStore interface{Load(ctx context.Context, id session.SessionID) (*session.Session, error); Save(ctx context.Context, s *session.Session) error} type StoredSession struct{ID session.SessionID; ModifiedAt time.Time} type ToolCallRecorder interface{ToolCall(id session.SessionID, call session.ToolCall, result session.ToolResult, queued time.Duration, took time.Duration)} diff --git a/engine/api/session.txt b/engine/api/session.txt index 93240e8f2f..1fde4d5cf9 100644 --- a/engine/api/session.txt +++ b/engine/api/session.txt @@ -1,5 +1,6 @@ method func (*Conversation).Append(m Message) method func (*Conversation).Len() int + method func (*Principal).Clone() *Principal method func (*Session).BeginTurn() error method func (*Session).Cancel() error method func (*Session).Complete() error @@ -23,12 +24,14 @@ method func (*Session).Reopen() error method func (*Session).ReplaceHistory(messages []Message) error method func (*Session).ResetUsage() error + method func (*Session).RestoreLabels(owner *Principal, authority Authority) error method func (*Session).ResumeWith() (PendingAsk, error) method func (*Session).SeedHistory(messages []Message) error method func (*Session).SetMode(mode PermissionMode) error method func (*Session).SetTitle(text string) method func (*Session).Stop(reason StopReason) error method func (*Session).StopReason() (StopReason, bool) + method func (GrantType).Valid() bool method func (Limits).WithDefaults(d Limits) Limits method func (PendingAsk).Origin() AskOrigin method func (State).IsTerminal() bool @@ -77,6 +80,9 @@ const EvToolResult EventType = "tool.result" const EvTurnEnd EventType = "turn.end" const EvTurnStart EventType = "turn.start" const EvUserPrompt EventType = "user_prompt" +const GrantTypeClientCredentials GrantType = "client_credentials" +const GrantTypeSystem GrantType = "system" +const GrantTypeUser GrantType = "user" const HookAdvisory HookDecision = "advisory" const HookBlocked HookDecision = "blocked" const HookInfo HookDecision = "info" @@ -135,6 +141,7 @@ const VerdictStringDeny untyped string = "deny" func ClampTitle(s string) string func CloneMessages(msgs []Message) []Message func ForkSnapshot(c *Conversation) []Message +func GrantTypeFromClaims(claims map[string]any) GrantType func IsGenuineUserPrompt(m Message) bool func IsSynthesisedSummary(text string) bool func New(id SessionID, mode PermissionMode, workspace string, limits Limits, createdAt time.Time) *Session @@ -157,6 +164,8 @@ func NewToolResultWithParts(callID ToolCallID, content string, parts []Content) func NewUserMessage(text string) Message func NewUserMessageWithParts(text string, parts []Content) Message func ParseArgs(call ToolCall, dst any) (msg string, ok bool) +func PrincipalFromClaims(claims map[string]any) *Principal +func PrincipalFromContext(ctx context.Context) *Principal func RepairToolResult(r ToolResult) ToolResult func StripProviderState(messages []Message) []Message func ToValidUTF8(s string) string @@ -168,16 +177,19 @@ func ValidateResolvedIP(ip net.IP) error func ValidateToolPairing(msgs []Message) error func ValidateToolResultParts(parts []Content) error func VerdictString(v ApprovalVerdict) string +func WithPrincipal(ctx context.Context, p *Principal) context.Context type ApprovalPayload struct{AskID string; Verdict string; Tool string; Call ToolCallID; AllowAlways bool} type ApprovalVerdict int type AskOrigin int +type Authority string type BlockKind string type CompactionArchivePayload struct{Replaced []Message} type Content struct{BlockKind BlockKind "json:\"block_kind,omitempty\""; Kind MediaKind; MIMEType string; Data []byte; URL string; Text string "json:\"Text,omitempty\""; Name string "json:\"Name,omitempty\""; Title string "json:\"Title,omitempty\""; Description string "json:\"Description,omitempty\""; Size int64 "json:\"Size,omitempty\""; Audience []string "json:\"Audience,omitempty\""; Priority float64 "json:\"Priority,omitempty\""; LastModified string "json:\"LastModified,omitempty\""} type Conversation struct{Messages []Message} type Counters struct{Turns int; ToolCalls int; ConsecutiveFailures int} -type Event struct{Type EventType; Seq int64; Turn int; Text string; ToolCall *ToolCall; ToolResult *ToolResult; Ask *PendingAsk; Result *ResultPayload; TurnEnd *TurnEndPayload; Hook *HookPayload; Approval *ApprovalPayload; CompactionArchive *CompactionArchivePayload; UserPrompt *UserPromptPayload; Usage *Usage; Subagent *SubagentPayload; Team *TeamPayload; Parallel *ParallelPayload; Schedule *SchedulePayload} +type Event struct{Type EventType; Seq int64; Turn int; Text string; ToolCall *ToolCall; ToolResult *ToolResult; Ask *PendingAsk; Result *ResultPayload; TurnEnd *TurnEndPayload; Hook *HookPayload; Approval *ApprovalPayload; CompactionArchive *CompactionArchivePayload; UserPrompt *UserPromptPayload; Usage *Usage; Subagent *SubagentPayload; Team *TeamPayload; Parallel *ParallelPayload; Actor *Principal; Schedule *SchedulePayload} type EventType string +type GrantType string type HookDecision string type HookPayload struct{Phase string; Tool string; Decision HookDecision; CallID ToolCallID} type Limits struct{MaxTurns int; MaxToolCalls int; MaxConsecutiveFailures int} @@ -187,10 +199,11 @@ type ParallelEventKind string type ParallelPayload struct{ParentCallID string; Kind ParallelEventKind; Join string; BranchCount int; BranchIndex int; ChildID string; BranchLabel string; Goal string; RoutedCategory string; RoutedModel string; RoutingReason string; Model string; ToolName string; IsError bool; ToolCount int; Text string; Detail string; InnerKind EventType; Failed bool; Workspace string; Stop StopReason; Usage Usage; DurationMs int64; Winner int; WinnerWorkspace string} type PendingAsk struct{AskID string; Tool string; Args json.RawMessage; Reason string; Call ToolCallID "json:\"call,omitempty\""; ConfiguredAsk bool; FlooredConfiguredAllow bool; HookOriginated bool "json:\"hook_originated,omitempty\""; PlanOriginated bool "json:\"plan_originated,omitempty\""} type PermissionMode string +type Principal struct{Issuer string; Subject string; GrantType GrantType; Name string} type ResultPayload struct{Stop StopReason; Text string; Usage Usage; Error string; Permanent bool} type Role string type SchedulePayload struct{ScheduleName string; FireID string; SessionID SessionID; Kind string; Stop StopReason; Err string} -type Session struct{ID SessionID; State State; Mode PermissionMode; Conversation *Conversation; Limits Limits; Counters Counters; Usage Usage; Workspace string; Profile string; ProviderID string; ModelID string; ReasoningEffort string; Title string; CreatedAt time.Time} +type Session struct{ID SessionID; State State; Mode PermissionMode; Conversation *Conversation; Limits Limits; Counters Counters; Usage Usage; Workspace string; Profile string; ProviderID string; ModelID string; ReasoningEffort string; Title string; Owner *Principal; Authority Authority; CreatedAt time.Time} type SessionID string type State string type StopReason string @@ -211,3 +224,4 @@ var ErrIllegalTransition error var ErrInvalidContent error var ErrInvalidMediaURL error var ErrNoPendingAsk error +var ErrOwnerAlreadySet error diff --git a/engine/port/schedule.go b/engine/port/schedule.go index 938994ff8d..8cd906cd41 100644 --- a/engine/port/schedule.go +++ b/engine/port/schedule.go @@ -332,6 +332,21 @@ type ScheduleSpec struct { // class as the other spec rejections). An empty OriginSessionID is always // valid (delivery is OFF — the byte-identical pre-delivery posture). OriginSessionID session.SessionID + // Owner is the verified caller the schedule is attributed to (ADR 0100 + // decision 6). It is captured ONCE at create time — never derived at fire + // time, because the origin session may be swept by retention while the + // schedule lives on. The capture rule is the CREATE SEAM's business (the + // Schedule-tool path reads the executing session's owner via the origin + // binder; an out-of-band REST/CLI create reads the context principal); the + // store is identity-blind and round-trips the value verbatim. A nil Owner is + // an ownerless schedule (the unauthenticated path) — never a fabricated + // principal. + // + // A fire mints its "sched--" session under this owner with GrantType + // client_credentials (the fire is automated, not interactive), injected via + // the explicit owner seam so the scheduler's system principal does not become + // the fire's owner. + Owner *session.Principal // FireTimeout is the per-fire wall-clock deadline (issue #386, the in-flight // scheduled-fire state). Zero means "use the deployment default" (the operator- // tier default applied by composition; a zero here is NOT "no timeout" — it diff --git a/engine/port/store.go b/engine/port/store.go index 4225f4d531..d6d21c90f9 100644 --- a/engine/port/store.go +++ b/engine/port/store.go @@ -106,6 +106,13 @@ type SessionMeta struct { // multimodal-only first prompt) carries "" here; the caller may fall back to // the lazy deriveTitle walk via a full Load if it needs the derived value. Title string + // Owner is the verified caller the session is attributed to (ADR 0100), or + // nil when the session is ownerless (the no-auth path, or a session + // persisted before the owner label existed — nothing backfills it). It is + // carried here so the cheap MetaLister listing renders the owner IDENTICALLY + // to the Load-per-row fallback; a store that cannot decode it leaves it nil, + // which renders as unowned rather than as somebody else. + Owner *session.Principal } // MetaLister is the OPTIONAL cheap-listing seam a SessionStore adapter may diff --git a/engine/session/event.go b/engine/session/event.go index 4327652ca1..5df4d88c61 100644 --- a/engine/session/event.go +++ b/engine/session/event.go @@ -1158,6 +1158,25 @@ type Event struct { // metadata-only observability projection of a Parallel fork-join run (group-level // join/winner facts + per-branch metadata + fork paths, never branch content). Parallel *ParallelPayload + // Actor is the verified caller who ACTED — who drove the request this event + // belongs to (ADR 0100 decision 5). It is LOG-ONLY and DERIVE-AT-APPEND: every + // emit site — the loop included — leaves it nil (the loop is storage-agnostic + // and knows nothing about principals), and the server relay's single appendEvent + // chokepoint stamps it from the CONTEXT PRINCIPAL just before the durable + // Append. It never reaches the client wire (toProto has no field for it) and it + // is not a reconstruction input: eventsource.Fold ignores it, so a folded + // session keeps the owner its caller restored from the snapshot. + // + // Actor is NOT the session's Owner, and the two routinely differ: this phase + // ships no authorization, so any authenticated caller may act on any session. + // The owner answers "whose is this?" and remains the identity of record; the + // actor answers "who did this?". Deriving it from the owner would stamp the + // owner onto every event of a run somebody else drove — repudiation in both + // directions, worst on EvApproval, where the record IS a human granting a tool + // permission. The denormalization is deliberate: an event read in isolation + // names its actor. A request with no verified caller records a nil Actor; + // absence is never fabricated. + Actor *Principal // Schedule is set on the schedule.* events (fired / skipped / failed): the // scheduler lifecycle projection emitted from composition (the scheduler), NOT // the loop. Client-visible (unlike the log-only EvApproval / diff --git a/engine/session/principal.go b/engine/session/principal.go new file mode 100644 index 0000000000..11d7c0e9e6 --- /dev/null +++ b/engine/session/principal.go @@ -0,0 +1,169 @@ +package session + +import ( + "errors" + "strings" +) + +// GrantType names how a Principal was authenticated. It is a closed enum of +// exactly three values (ADR 0100 decision 1); the zero value is deliberately +// NOT a member, so an unset grant type is never mistaken for a valid one. +type GrantType string + +const ( + // GrantTypeUser is an interactive end user (an OIDC authorization-code flow). + GrantTypeUser GrantType = "user" + // GrantTypeClientCredentials is a machine caller (an OAuth2 + // client-credentials flow), e.g. a schedule firing under its captured owner. + GrantTypeClientCredentials GrantType = "client_credentials" + // GrantTypeSystem is an internal harness goroutine (childgc, the memory/dream + // consolidators, the scheduler tick/fire/delivery/reconcile). It is explicit + // so an internal caller is never an ABSENT principal. + GrantTypeSystem GrantType = "system" +) + +// Valid reports whether g is one of the three defined grant types. +func (g GrantType) Valid() bool { + switch g { + case GrantTypeUser, GrantTypeClientCredentials, GrantTypeSystem: + return true + default: + return false + } +} + +// Principal is the verified caller a session or schedule is attributed to +// (ADR 0100 decision 1). Identity is the (Issuer, Subject) PAIR, never Subject +// alone — two IdPs or realms collide on `sub`. +// +// It is a pure value object: comparable, stdlib-only, and deliberately narrow. +// It carries NO scopes, NO authority, NO credentials, and NO claims map — those +// belong to the enforcement tracks, not to attribution. It is modeled on +// ToolHive's PrincipalInfo; ToolHive is not imported. +// +// Absent identity is a nil *Principal, NEVER a fabricated anonymous one (the +// ToolHive anonymous-middleware anti-pattern ADR 0100 rejects). +type Principal struct { + // Issuer is the IdP that minted the token (the canonical `iss` claim). + Issuer string + // Subject is the caller id within that issuer (the `sub` claim). + Subject string + // GrantType is how the caller authenticated. + GrantType GrantType + // Name is an optional human-readable display label. It is never part of + // identity — display only. + Name string +} + +// Clone returns a copy of p, or nil when p is nil. It is the ONE place the +// "copy a *Principal across a boundary, nil stays nil" rule lives — every site +// that hands a principal out of, or into, a structure it does not own routes +// through it instead of hand-rolling the nil check and the deref. +// +// Principal is all-strings today, so a shallow copy IS a deep copy. The method +// exists so that the day it gains a slice or map field, every site stays correct +// together rather than silently becoming an aliasing bug. +func (p *Principal) Clone() *Principal { + if p == nil { + return nil + } + c := *p + return &c +} + +// PrincipalFromClaims projects an already-verified token claim set into the +// narrow caller identity used by the engine. It does not verify claims or +// credentials; callers must do that before calling it. Missing, empty, or +// non-string iss/sub claims yield nil. Claim strings are preserved byte-exactly. +func PrincipalFromClaims(claims map[string]any) *Principal { + issuer, issuerOK := claims["iss"].(string) + subject, subjectOK := claims["sub"].(string) + if !issuerOK || issuer == "" || !subjectOK || subject == "" { + return nil + } + name, _ := claims["name"].(string) + return &Principal{ + Issuer: issuer, + Subject: subject, + GrantType: GrantTypeFromClaims(claims), + Name: name, + } +} + +// GrantTypeFromClaims derives the conservative attribution grant from an +// already-verified token claim set. The first non-empty explicit claim wins +// (`grant_type` before `gty`): a recognised user or client grant is decisive. +// An unknown explicit value is not itself classification evidence, so the +// equal-client-identity fallback may still identify a machine. With no such +// fallback, unknown and malformed signals default to user. It never returns +// system. +func GrantTypeFromClaims(claims map[string]any) GrantType { + switch normalizeGrantClaim(claimString(claims, "grant_type"), claimString(claims, "gty")) { + case "client_credentials": + return GrantTypeClientCredentials + case "authorization_code", "implicit", "password", "refresh_token", "device_code": + return GrantTypeUser + } + if sub := claimString(claims, "sub"); sub != "" { + for _, key := range []string{"azp", "client_id", "cid"} { + if claimString(claims, key) == sub { + return GrantTypeClientCredentials + } + } + } + return GrantTypeUser +} + +func normalizeGrantClaim(candidates ...string) string { + for _, candidate := range candidates { + if candidate == "" { + continue + } + value := strings.ToLower(strings.TrimSpace(candidate)) + if i := strings.LastIndex(value, ":"); i >= 0 { + value = value[i+1:] + } + return strings.ReplaceAll(value, "-", "_") + } + return "" +} + +func claimString(claims map[string]any, key string) string { + value, _ := claims[key].(string) + return value +} + +// Authority is Track C's placeholder label on the Session aggregate. It is +// INERT in the caller-identity plan: nothing reads or writes it beyond the +// snapshot round-trip. It ships now so the contended engine/api/*.txt +// regeneration and CHANGELOG note are paid once (ADR 0100 consequences). +// The zero value ("") means "unset". +type Authority string + +// ErrOwnerAlreadySet is returned by RestoreLabels when the session already +// carries a DIFFERENT owner. The owner is write-once (ADR 0100 decision 4). +var ErrOwnerAlreadySet = errors.New("session: owner already set") + +// RestoreLabels stamps the write-once identity labels (Owner, Authority) on the +// aggregate. It is the restore seam sessnap uses — Session is an aggregate, so +// an adapter must not poke the exported fields. +// +// Write-once: a nil owner leaves the label unset (the ownerless / no-auth path, +// and it does NOT burn the slot); re-stamping the SAME owner value is +// idempotent; stamping a DIFFERENT owner over a set one returns +// ErrOwnerAlreadySet rather than silently re-owning the session. The owner is +// stored as a COPY, so the caller cannot mutate a stamped session's owner +// through its own pointer. A zero Authority leaves that label untouched (the +// same additive posture); it is otherwise inert in this plan. +func (s *Session) RestoreLabels(owner *Principal, authority Authority) error { + if owner != nil { + if s.Owner != nil && *s.Owner != *owner { + return ErrOwnerAlreadySet + } + s.Owner = owner.Clone() + } + if authority != "" { + s.Authority = authority + } + return nil +} diff --git a/engine/session/principal_claims_test.go b/engine/session/principal_claims_test.go new file mode 100644 index 0000000000..d5e856d92e --- /dev/null +++ b/engine/session/principal_claims_test.go @@ -0,0 +1,86 @@ +package session_test + +import ( + "reflect" + "testing" + + "github.com/stacklok/mecatl/engine/session" +) + +func TestPrincipalFromClaims(t *testing.T) { + t.Parallel() + + for _, tc := range []struct { + name string + claims map[string]any + want *session.Principal + }{ + {name: "nil claims"}, + {name: "missing issuer", claims: map[string]any{"sub": "alice"}}, + {name: "empty issuer", claims: map[string]any{"iss": "", "sub": "alice"}}, + {name: "non-string issuer", claims: map[string]any{"iss": 42, "sub": "alice"}}, + {name: "missing subject", claims: map[string]any{"iss": "https://idp.example"}}, + {name: "empty subject", claims: map[string]any{"iss": "https://idp.example", "sub": ""}}, + {name: "non-string subject", claims: map[string]any{"iss": "https://idp.example", "sub": 42}}, + { + name: "projects byte-exact user identity", + claims: map[string]any{"iss": " https://IDP.example/ ", "sub": " alice\n", "name": " Ada ", "azp": "client"}, + want: &session.Principal{ + Issuer: " https://IDP.example/ ", Subject: " alice\n", Name: " Ada ", GrantType: session.GrantTypeUser, + }, + }, + { + name: "ignores non-string name and derives machine grant", + claims: map[string]any{"iss": "issuer", "sub": "service", "name": 42, "client_id": "service"}, + want: &session.Principal{Issuer: "issuer", Subject: "service", GrantType: session.GrantTypeClientCredentials}, + }, + { + name: "cannot fabricate system", + claims: map[string]any{"iss": "issuer", "sub": "caller", "grant_type": "system"}, + want: &session.Principal{Issuer: "issuer", Subject: "caller", GrantType: session.GrantTypeUser}, + }, + } { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + if got := session.PrincipalFromClaims(tc.claims); !reflect.DeepEqual(got, tc.want) { + t.Fatalf("PrincipalFromClaims(%v) = %#v, want %#v", tc.claims, got, tc.want) + } + }) + } +} + +func TestGrantTypeFromClaims(t *testing.T) { + t.Parallel() + + for _, tc := range []struct { + name string + claims map[string]any + want session.GrantType + }{ + {name: "nil", want: session.GrantTypeUser}, + {name: "authorization code", claims: map[string]any{"grant_type": "authorization_code"}, want: session.GrantTypeUser}, + {name: "other user grant", claims: map[string]any{"grant_type": "urn:ietf:params:oauth:grant-type:device_code"}, want: session.GrantTypeUser}, + {name: "client credentials", claims: map[string]any{"grant_type": "CLIENT_CREDENTIALS"}, want: session.GrantTypeClientCredentials}, + {name: "auth0 spelling", claims: map[string]any{"gty": "client-credentials"}, want: session.GrantTypeClientCredentials}, + {name: "grant_type takes precedence over gty", claims: map[string]any{"grant_type": "authorization_code", "gty": "client_credentials"}, want: session.GrantTypeUser}, + {name: "explicit user grant beats equal client identity", claims: map[string]any{"sub": "svc", "grant_type": "authorization_code", "azp": "svc"}, want: session.GrantTypeUser}, + {name: "azp equals sub", claims: map[string]any{"sub": "svc", "azp": "svc"}, want: session.GrantTypeClientCredentials}, + {name: "client_id equals sub", claims: map[string]any{"sub": "svc", "client_id": "svc"}, want: session.GrantTypeClientCredentials}, + {name: "cid equals sub", claims: map[string]any{"sub": "svc", "cid": "svc"}, want: session.GrantTypeClientCredentials}, + {name: "empty values do not match", claims: map[string]any{"sub": "", "azp": ""}, want: session.GrantTypeUser}, + {name: "non-string ignored", claims: map[string]any{"grant_type": 42}, want: session.GrantTypeUser}, + {name: "hostile system defaults user", claims: map[string]any{"grant_type": "system"}, want: session.GrantTypeUser}, + {name: "unknown falls through", claims: map[string]any{"sub": "svc", "grant_type": "custom", "azp": "svc"}, want: session.GrantTypeClientCredentials}, + } { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + got := session.GrantTypeFromClaims(tc.claims) + if got != tc.want { + t.Fatalf("GrantTypeFromClaims(%v) = %q, want %q", tc.claims, got, tc.want) + } + if !got.Valid() || got == session.GrantTypeSystem { + t.Fatalf("GrantTypeFromClaims(%v) returned inadmissible grant %q", tc.claims, got) + } + }) + } +} diff --git a/engine/session/principal_context.go b/engine/session/principal_context.go new file mode 100644 index 0000000000..c0f231149b --- /dev/null +++ b/engine/session/principal_context.go @@ -0,0 +1,35 @@ +package session + +import "context" + +// principalKey is the unexported context key for the verified caller. An empty +// struct type (not a string) so no other package can collide with or forge it. +type principalKey struct{} + +// WithPrincipal returns a context carrying the verified caller p. +// +// A nil p returns ctx UNCHANGED — storing "no identity" must never produce a +// value that reads back as a present-but-empty principal. Absent identity is a +// nil *Principal, never a fabricated one (ADR 0100 decision 2). +// +// The principal is stored as a COPY, so a later mutation through the caller's +// pointer cannot change what the context reports. +func WithPrincipal(ctx context.Context, p *Principal) context.Context { + if p == nil { + return ctx + } + return context.WithValue(ctx, principalKey{}, p.Clone()) +} + +// PrincipalFromContext returns the verified caller carried by ctx, or nil when +// there is none. Callers MUST handle nil as "no verified identity" — this +// function never fabricates an anonymous principal. +// +// The returned principal is a COPY: a reader that mutates it cannot change what +// the context reports for every later reader (which would corrupt ownership and +// audit attribution downstream). This is the read half of WithPrincipal's +// copy-on-store promise. +func PrincipalFromContext(ctx context.Context) *Principal { + p, _ := ctx.Value(principalKey{}).(*Principal) + return p.Clone() +} diff --git a/engine/session/principal_context_test.go b/engine/session/principal_context_test.go new file mode 100644 index 0000000000..bd973987d1 --- /dev/null +++ b/engine/session/principal_context_test.go @@ -0,0 +1,92 @@ +package session_test + +import ( + "context" + "testing" + + "github.com/stacklok/mecatl/engine/session" +) + +// TestInvariant_no_fabricated_principal pins the AGENTS.md invariant +// "no fabricated principal" (ADR 0100 decision 2): the context seam round-trips +// a verified principal, and an ABSENT principal reads back as nil — never a +// fabricated anonymous value. A nil stored through WithPrincipal must read back +// as absent too, so a caller cannot launder "no identity" into a non-nil empty +// principal. +func TestInvariant_no_fabricated_principal(t *testing.T) { + t.Parallel() + + t.Run("round trip", func(t *testing.T) { + t.Parallel() + want := &session.Principal{ + Issuer: "https://idp.example", + Subject: "user-1", + GrantType: session.GrantTypeUser, + Name: "Ada", + } + got := session.PrincipalFromContext(session.WithPrincipal(context.Background(), want)) + if got == nil { + t.Fatal("PrincipalFromContext returned nil for a stored principal") + } + if *got != *want { + t.Fatalf("round trip mismatch: got %+v, want %+v", *got, *want) + } + }) + + t.Run("absent is nil", func(t *testing.T) { + t.Parallel() + if got := session.PrincipalFromContext(context.Background()); got != nil { + t.Fatalf("bare context: got %+v, want nil (no fabricated principal)", *got) + } + }) + + t.Run("nil stored reads back absent", func(t *testing.T) { + t.Parallel() + ctx := session.WithPrincipal(context.Background(), nil) + if got := session.PrincipalFromContext(ctx); got != nil { + t.Fatalf("WithPrincipal(nil): got %+v, want nil (no fabricated principal)", *got) + } + }) + + t.Run("nil stored does not erase an outer principal into a fabricated one", func(t *testing.T) { + t.Parallel() + outer := session.WithPrincipal(context.Background(), &session.Principal{ + Issuer: "https://idp.example", Subject: "user-1", GrantType: session.GrantTypeUser, + }) + if got := session.PrincipalFromContext(session.WithPrincipal(outer, nil)); got != nil && got.Subject == "" { + t.Fatalf("nil shadow produced an empty fabricated principal: %+v", *got) + } + }) + + t.Run("identity is the issuer/subject pair", func(t *testing.T) { + t.Parallel() + a := session.PrincipalFromContext(session.WithPrincipal(context.Background(), + &session.Principal{Issuer: "https://a.example", Subject: "same", GrantType: session.GrantTypeUser})) + b := session.PrincipalFromContext(session.WithPrincipal(context.Background(), + &session.Principal{Issuer: "https://b.example", Subject: "same", GrantType: session.GrantTypeUser})) + if *a == *b { + t.Fatal("principals from different issuers compared equal on subject alone") + } + }) + + t.Run("stored principal is copied, not aliased", func(t *testing.T) { + t.Parallel() + p := &session.Principal{Issuer: "https://idp.example", Subject: "user-1", GrantType: session.GrantTypeUser} + ctx := session.WithPrincipal(context.Background(), p) + p.Subject = "attacker" + if got := session.PrincipalFromContext(ctx); got.Subject != "user-1" { + t.Fatalf("context principal mutated through the caller's pointer: %+v", *got) + } + }) + + t.Run("read hands back a copy, not the stored pointer", func(t *testing.T) { + t.Parallel() + ctx := session.WithPrincipal(context.Background(), + &session.Principal{Issuer: "https://idp.example", Subject: "user-1", GrantType: session.GrantTypeUser}) + first := session.PrincipalFromContext(ctx) + first.Subject = "attacker" + if got := session.PrincipalFromContext(ctx); got.Subject != "user-1" { + t.Fatalf("a reader mutated what the context reports for every later reader: %+v", *got) + } + }) +} diff --git a/engine/session/principal_test.go b/engine/session/principal_test.go new file mode 100644 index 0000000000..468a0d7bed --- /dev/null +++ b/engine/session/principal_test.go @@ -0,0 +1,146 @@ +package session_test + +import ( + "errors" + "testing" + "time" + + "github.com/stacklok/mecatl/engine/session" +) + +func newLabelSession(t *testing.T) *session.Session { + t.Helper() + return session.New("s1", session.ModeDefault, "/w", session.Limits{}, time.Unix(0, 0).UTC()) +} + +// TestRestoreLabelsIsWriteOnce pins the write-once contract of the owner label +// (ADR 0100 decision 4): a second RestoreLabels with a DIFFERENT owner is +// refused, so a restore path can never silently re-own a session. +func TestRestoreLabelsIsWriteOnce(t *testing.T) { + t.Parallel() + + alice := &session.Principal{Issuer: "https://idp", Subject: "alice", GrantType: session.GrantTypeUser} + bob := &session.Principal{Issuer: "https://idp", Subject: "bob", GrantType: session.GrantTypeUser} + + s := newLabelSession(t) + if err := s.RestoreLabels(alice, session.Authority("a")); err != nil { + t.Fatalf("first RestoreLabels: %v", err) + } + err := s.RestoreLabels(bob, session.Authority("b")) + if !errors.Is(err, session.ErrOwnerAlreadySet) { + t.Fatalf("second RestoreLabels with a different owner: got %v, want ErrOwnerAlreadySet", err) + } + if s.Owner.Subject != "alice" { + t.Errorf("owner overwritten: got %q, want alice", s.Owner.Subject) + } + if s.Authority != session.Authority("a") { + t.Errorf("authority overwritten: got %q, want a", s.Authority) + } +} + +// TestRestoreLabelsIdempotentForSameOwner pins the other half: re-restoring the +// SAME owner (a re-read of the same snapshot) is not an error. +func TestRestoreLabelsIdempotentForSameOwner(t *testing.T) { + t.Parallel() + + s := newLabelSession(t) + p := session.Principal{Issuer: "https://idp", Subject: "alice", GrantType: session.GrantTypeUser} + if err := s.RestoreLabels(&p, session.Authority("a")); err != nil { + t.Fatalf("first RestoreLabels: %v", err) + } + same := p // a distinct pointer with an equal value + if err := s.RestoreLabels(&same, session.Authority("a")); err != nil { + t.Fatalf("idempotent RestoreLabels: %v", err) + } +} + +// TestRestoreLabelsNilOwnerLeavesOwnerUnset pins the ownerless path: restoring a +// nil owner (a pre-ship / no-auth session) leaves the label unset and is never +// an error — the byte-identical no-auth path of ADR 0100. +func TestRestoreLabelsNilOwnerLeavesOwnerUnset(t *testing.T) { + t.Parallel() + + s := newLabelSession(t) + if err := s.RestoreLabels(nil, ""); err != nil { + t.Fatalf("RestoreLabels(nil): %v", err) + } + if s.Owner != nil { + t.Errorf("owner set from a nil restore: %+v", *s.Owner) + } + // A nil restore does not burn the write-once slot. + if err := s.RestoreLabels(&session.Principal{Issuer: "i", Subject: "s", GrantType: session.GrantTypeSystem}, "a"); err != nil { + t.Fatalf("RestoreLabels after a nil restore: %v", err) + } + if s.Owner == nil || s.Owner.Subject != "s" { + t.Errorf("owner not set after a nil restore: %v", s.Owner) + } +} + +// TestPrincipalClone pins the shared "copy a *Principal across a boundary, nil +// stays nil" rule the ownership sites route through. Principal is all-strings +// today so a shallow copy is a deep copy; the method exists so the day it gains +// a slice or map field every site stays correct together instead of drifting +// into a silent aliasing bug. +func TestPrincipalClone(t *testing.T) { + t.Parallel() + + for _, tc := range []struct { + name string + in *session.Principal + }{ + {"nil stays nil", nil}, + {"zero value", &session.Principal{}}, + {"populated", &session.Principal{ + Issuer: "https://idp", Subject: "alice", GrantType: session.GrantTypeUser, Name: "Ada", + }}, + } { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + got := tc.in.Clone() + if tc.in == nil { + if got != nil { + t.Fatalf("Clone of nil: got %+v, want nil", *got) + } + return + } + if got == nil { + t.Fatal("Clone returned nil for a non-nil principal") + } + if got == tc.in { + t.Fatal("Clone returned the SAME pointer — not a copy") + } + if *got != *tc.in { + t.Fatalf("Clone value mismatch: got %+v, want %+v", *got, *tc.in) + } + got.Subject = "attacker" + if tc.in.Subject == "attacker" { + t.Fatal("mutating the clone changed the original") + } + }) + } +} + +// TestPrincipalGrantTypesAreTheThreeValues pins ADR 0100 decision 1: the grant +// type is a small closed enum of exactly user / client_credentials / system. +func TestPrincipalGrantTypesAreTheThreeValues(t *testing.T) { + t.Parallel() + + want := map[session.GrantType]string{ + session.GrantTypeUser: "user", + session.GrantTypeClientCredentials: "client_credentials", + session.GrantTypeSystem: "system", + } + for gt, s := range want { + if string(gt) != s { + t.Errorf("grant type %v: got %q, want %q", gt, string(gt), s) + } + if !gt.Valid() { + t.Errorf("grant type %q reported invalid", gt) + } + } + for _, bad := range []session.GrantType{"", "anonymous", "User"} { + if bad.Valid() { + t.Errorf("grant type %q reported valid; the enum is closed", bad) + } + } +} diff --git a/engine/session/session.go b/engine/session/session.go index 75a1e734ba..5cf53af9c8 100644 --- a/engine/session/session.go +++ b/engine/session/session.go @@ -388,6 +388,18 @@ type Session struct { // It is "" for a session with no genuine prompt yet (lazy display-time // fallback applies). The aggregate never interprets it. Title string + // Owner is the verified caller this session is attributed to, or nil when the + // session is ownerless (a pre-ship snapshot, or a deployment with no identity + // verifier wired). It is a WRITE-ONCE label stamped through RestoreLabels — + // never a public setter, and never fabricated when identity is absent + // (ADR 0100 decision 4). The aggregate STORES it and never interprets it: no + // enforcement, no filtering, display + audit only. + Owner *Principal + // Authority is Track C's label, shipped INERT here so the contended + // engine/api/*.txt + CHANGELOG regeneration is paid once (ADR 0100 + // consequences). Nothing in this plan reads or writes it beyond the snapshot + // round-trip; the zero value means "unset". Stamped through RestoreLabels. + Authority Authority // CreatedAt is the creation timestamp. CreatedAt time.Time diff --git a/go.mod b/go.mod index 3720f2a2d0..d4e84cb67b 100644 --- a/go.mod +++ b/go.mod @@ -15,18 +15,20 @@ require ( github.com/charmbracelet/x/ansi v0.11.7 github.com/charmbracelet/x/exp/teatest/v2 v2.0.0-20260527151214-009e6338d40d github.com/gofrs/flock v0.13.0 + github.com/golang-jwt/jwt/v5 v5.3.1 github.com/google/jsonschema-go v0.4.3 github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 github.com/itchyny/gojq v0.12.19 - github.com/modelcontextprotocol/go-sdk v1.6.1 + github.com/modelcontextprotocol/go-sdk v1.7.1-0.20260803115424-0d0cdbc943f3 github.com/onsi/ginkgo/v2 v2.30.0 github.com/onsi/gomega v1.41.0 github.com/openai/openai-go/v3 v3.37.0 github.com/prometheus/client_golang v1.24.1 github.com/prometheus/client_model v0.6.2 github.com/prometheus/procfs v0.21.1 - github.com/redis/go-redis/v9 v9.21.0 - github.com/stacklok/mecatl/engine v0.9.0 + github.com/redis/go-redis/v9 v9.22.0 + github.com/stacklok/mecatl/authn/oidc v0.0.0-00010101000000-000000000000 + github.com/stacklok/mecatl/engine v0.10.0 github.com/stacklok/mecatl/provider/anthropic v0.0.0-00010101000000-000000000000 github.com/stacklok/mecatl/provider/openai v0.0.0-00010101000000-000000000000 github.com/stacklok/mecatl/provider/openaichat v0.0.0-00010101000000-000000000000 @@ -46,8 +48,9 @@ require ( go.opentelemetry.io/otel/trace v1.45.0 go.opentelemetry.io/proto/otlp v1.11.0 go.uber.org/goleak v1.3.0 - go.yaml.in/yaml/v3 v3.0.4 + go.yaml.in/yaml/v3 v3.0.5 golang.org/x/net v0.57.0 + golang.org/x/oauth2 v0.36.0 golang.org/x/sync v0.22.0 golang.org/x/term v0.45.0 golang.org/x/time v0.15.0 @@ -71,20 +74,20 @@ require ( github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2 v1.43.3 // indirect - github.com/aws/aws-sdk-go-v2/config v1.32.34 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.19.33 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.34 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.34 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.34 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.35 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.15 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.34 // indirect - github.com/aws/aws-sdk-go-v2/service/signin v1.5.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.33.3 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.45.3 // indirect - github.com/aws/smithy-go v1.27.6 // indirect + github.com/aws/aws-sdk-go-v2 v1.43.5 // indirect + github.com/aws/aws-sdk-go-v2/config v1.32.36 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.19.35 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.36 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.36 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.36 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.37 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.16 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.36 // indirect + github.com/aws/aws-sdk-go-v2/service/signin v1.5.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.33.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.45.5 // indirect + github.com/aws/smithy-go v1.27.7 // indirect github.com/aymanbagabas/go-udiff v0.4.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect @@ -107,7 +110,7 @@ require ( github.com/cristalhq/jwt/v4 v4.0.2 // indirect github.com/danieljoos/wincred v1.2.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect github.com/dgraph-io/ristretto v1.0.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.0 // indirect @@ -118,7 +121,7 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dylibso/observe-sdk/go v0.0.0-20240819160327-2d926c5d788a // indirect - github.com/ebitengine/purego v0.10.0 // indirect + github.com/ebitengine/purego v0.10.2 // indirect github.com/emicklei/go-restful/v3 v3.13.0 // indirect github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/extism/go-sdk v1.7.0 // indirect @@ -152,15 +155,14 @@ require ( github.com/go-viper/mapstructure/v2 v2.5.0 // indirect github.com/gobuffalo/pop/v6 v6.1.1 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-json v0.10.5 // indirect + github.com/goccy/go-json v0.10.6 // indirect github.com/godbus/dbus/v5 v5.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/golang/mock v1.7.0-rc.1 // indirect - github.com/google/cel-go v0.30.0 // indirect + github.com/google/cel-go v0.31.0 // indirect github.com/google/gnostic-models v0.7.1 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/go-containerregistry v0.21.8 // indirect + github.com/google/go-containerregistry v0.21.9 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect @@ -178,7 +180,7 @@ require ( github.com/lestrrat-go/blackmagic v1.0.4 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/httprc/v3 v3.0.6 // indirect - github.com/lestrrat-go/jwx/v3 v3.0.13 // indirect + github.com/lestrrat-go/jwx/v3 v3.2.0 // indirect github.com/lestrrat-go/option/v2 v2.0.0 // indirect github.com/lucasb-eyer/go-colorful v1.4.0 // indirect github.com/lufia/plan9stats v0.0.0-20250317134145-8bc96cf8fc35 // indirect @@ -190,7 +192,7 @@ require ( github.com/moby/moby/api v1.55.0 // indirect github.com/moby/moby/client v0.5.1 // indirect github.com/moby/spdystream v0.5.1 // indirect - github.com/modelcontextprotocol/registry v1.8.0 // indirect + github.com/modelcontextprotocol/registry v1.8.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect @@ -220,7 +222,7 @@ require ( github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210414080842-5b05eb8ff761 // indirect github.com/segmentio/asm v1.2.1 // indirect github.com/segmentio/encoding v0.5.4 // indirect - github.com/shirou/gopsutil/v4 v4.26.5 // indirect + github.com/shirou/gopsutil/v4 v4.26.7 // indirect github.com/sirupsen/logrus v1.9.4 // indirect github.com/spf13/afero v1.15.0 // indirect github.com/spf13/cast v1.10.0 // indirect @@ -228,7 +230,7 @@ require ( github.com/spf13/pflag v1.0.10 // indirect github.com/spf13/viper v1.21.0 // indirect github.com/stacklok/mecatl/provider/ssefilter v0.0.0 // indirect - github.com/stacklok/toolhive-core v0.0.33 // indirect + github.com/stacklok/toolhive-core v0.0.39 // indirect github.com/standard-webhooks/standard-webhooks/libraries v0.0.1 // indirect github.com/stretchr/testify v1.11.1 // indirect github.com/subosito/gotenv v1.6.0 // indirect @@ -241,6 +243,7 @@ require ( github.com/tidwall/sjson v1.2.5 // indirect github.com/tklauser/go-sysconf v0.3.16 // indirect github.com/tklauser/numcpus v0.11.0 // indirect + github.com/valyala/fastjson v1.6.10 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect @@ -271,7 +274,6 @@ require ( golang.org/x/exp/event v0.0.0-20260611194520-c48552f49976 // indirect golang.org/x/exp/jsonrpc2 v0.0.0-20260709172345-9ea1abe57597 // indirect golang.org/x/mod v0.38.0 // indirect - golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sys v0.47.0 // indirect golang.org/x/text v0.40.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect @@ -295,6 +297,8 @@ require ( sigs.k8s.io/yaml v1.6.0 // indirect ) +replace github.com/stacklok/mecatl/authn/oidc => ./authn/oidc + replace github.com/stacklok/mecatl/engine => ./engine replace github.com/stacklok/mecatl/provider/anthropic => ./provider/anthropic diff --git a/go.sum b/go.sum index dec4a9cbed..202d56a05d 100644 --- a/go.sum +++ b/go.sum @@ -44,34 +44,34 @@ github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3d github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go-v2 v1.43.3 h1:XJIcfv8uDs2ukdQsoAC8/Ebu1ejxwzlayl2ZsiFns2A= -github.com/aws/aws-sdk-go-v2 v1.43.3/go.mod h1:70vwSy16txshwG+g55WkpgPKDIByzHI8ccBsOteo3bQ= -github.com/aws/aws-sdk-go-v2/config v1.32.34 h1:o+YAizrX562nEZXaB38uYTK8RvIsvW0uuRP+e5e0Pfk= -github.com/aws/aws-sdk-go-v2/config v1.32.34/go.mod h1:wc0zYRChOniiufvdWiRVf3jgXSgbkvaD683IHHHc2ZQ= -github.com/aws/aws-sdk-go-v2/credentials v1.19.33 h1:/e5V3EWfeDiW6cuRxHsC8gbwko4/vvVYPJR2afBKFFY= -github.com/aws/aws-sdk-go-v2/credentials v1.19.33/go.mod h1:ZxAmkcyOM9beY/WO9oxp2oVPXiP3rq5N1/p4NbenJdE= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.34 h1:1EsGke6rTD2CG3j2MMVB77n6Q+FlbQWYI/dFdLWBNtM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.34/go.mod h1:5B1Z/QbaWzqoWRzYxZfmCbDDRcvUHcfAIQw/S+KfDmc= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.34 h1:vuIfjzoeqhQMGJyOBU3t0ZEjn2jrN8Bbg1N4CgjzM5Q= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.34/go.mod h1:hP28cN4CPJLZHirdQPrZR50JcLN4ApRJP2tzG8cRlhY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.34 h1:9faHsnqxJ1vDvB4wMZy/ajIDyz5QhllQjjc72RJpXAw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.34/go.mod h1:Yp6nIyejpa23nzlB/LhT63KTla9Jdi06nv/HH/OkAH8= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.35 h1:Oe8gMKJLO5awqpa5EhAGKVnBv1s+brdWVuxM2mDa7zA= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.35/go.mod h1:FZevcG9cOST/FWAAUhHIchjR9fXFXFRCWodOhx+PDLA= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.15 h1:JJLBQxwY+AFwuPAi5ivGc1ChnTdUt4cXMv7e76m2c/Y= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.15/go.mod h1:lQknBIe78MVL0cQOQDlag8KGflMbMEVFx9mB6O8ENvk= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.34 h1:sYg4qHWLqsjp15PzX7XCOHSOgKEGoZ5vQY43VvZ1pas= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.34/go.mod h1:N58SSz3roKf1HzW5qRaOiyk6MbDLTKgLPvlTfJ90iyI= -github.com/aws/aws-sdk-go-v2/service/signin v1.5.3 h1:togAtAmgV5IGMnQDuBDJeM8z5Y5RN6G7xeOgphWz+Yc= -github.com/aws/aws-sdk-go-v2/service/signin v1.5.3/go.mod h1:T7xKUUUvN7W3RW8UmMvKnD12xqh+Ux2gCPHPhnt64Dg= -github.com/aws/aws-sdk-go-v2/service/sso v1.33.3 h1:YjH64OUytnWZBHUtM9GMyi4ZWBiSQdEJkZuPykOIe44= -github.com/aws/aws-sdk-go-v2/service/sso v1.33.3/go.mod h1:5qoHcDZDTSJotoKk1bvVRPv1MXaL/NhfY9ng8D1g/ig= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.3 h1:A4o1di/XGaqtw6r3toSBrFX2U7mVSLqg7jo9wL4I+cU= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.3/go.mod h1:sKuKz2kHtrGVtFu34vbM3LWSA9CKD9YZUmm6e5PPqRA= -github.com/aws/aws-sdk-go-v2/service/sts v1.45.3 h1:Fi7+DiKN1+QphlajvE6FqeZ8GRbnnRul7zTdUiRpbGc= -github.com/aws/aws-sdk-go-v2/service/sts v1.45.3/go.mod h1:KCc3e27fHZUGtzpek7wZcp6dyCpGkJJo/+3PBujh/yU= -github.com/aws/smithy-go v1.27.6 h1:0zjT8jgK3jbrTT7JJ3EE6JsMhX8JTrZ+f1sEndYDXrA= -github.com/aws/smithy-go v1.27.6/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/aws-sdk-go-v2 v1.43.5 h1:yKT5GYnFWhuDo+DqKvE5ZPwVn3RjC4MAeBtZGlh6AVM= +github.com/aws/aws-sdk-go-v2 v1.43.5/go.mod h1:wZjAJppCntyOGgVSmgVTfDyRJK5PHOasO6Wsy8U7Axk= +github.com/aws/aws-sdk-go-v2/config v1.32.36 h1:mX6ietU7UlB4w/2IUaexJdsyUDvhTd+jYPjVePiyi6s= +github.com/aws/aws-sdk-go-v2/config v1.32.36/go.mod h1:rMpV4xk7ZK59edraSaHP0jsWrztWTT5tbCwWY495hug= +github.com/aws/aws-sdk-go-v2/credentials v1.19.35 h1:Cxua2RVdRwL0sfjHM/SnQoOnQ7xKng9m5EQBO8BnZlg= +github.com/aws/aws-sdk-go-v2/credentials v1.19.35/go.mod h1:9XQ+RSIGPkycr+oCJYnB1uTv5kMVVR+rd2vYK0Hxj2w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.36 h1:gucL1KH/PAYbpTpBg09CiVpBdTu4qkCl8C7xOTBixUg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.36/go.mod h1:usTB+PHhNMhrx2dxUeHcM7OrT5pySvmjYI++IsefPN0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.36 h1:5CrzwxDqf4w3x1Vs3/NiZ0nsC34Hbm3pIDMWbsLebOE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.36/go.mod h1:A3gHdKZIvG/QXERzZwcxNS3RNDFcRCuhhTFBYp+V/nw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.36 h1:A4N2f4YPcST0v+dWtX+xrpPPCL9VTBhoIFFUWYqbacE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.36/go.mod h1:B/Qr859uxWUEfZeGotK5KAEoof4Q9YWgNtPSwV6jcyk= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.37 h1:oyd3ke4V9AhKcRR7rRgxk1VyI+DjK2CBQtbxh3OkdaA= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.37/go.mod h1:aA9D7SqfG9IC1b7FLD7Iyc8Q4JN0a8gHhNjN4zPlIaI= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.16 h1:iE4NGbvqUZnHDqddQAauZzCILYtFjOHwRM5MOOKLB5A= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.16/go.mod h1:VsjEgrP+ibcou8TlWA4tYaB+0OojuhirsmCe+U60hTA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.36 h1:fx2ujmozWn+C/GtfXfz5k6Ckzza40ElOpIW7d92fLWQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.36/go.mod h1:QT2ufGVJ+xTRxtXPHTQ1kHkAdWIKPCmD+BqYAXWv8/4= +github.com/aws/aws-sdk-go-v2/service/signin v1.5.5 h1:0VTFBfOgPJrUSpGMgzoi8qLcXF5dbmiBuxpo14eBWUw= +github.com/aws/aws-sdk-go-v2/service/signin v1.5.5/go.mod h1:sNZYlBxoohYMBYl47BO/bFtAM6I8HSsPa1qwwPPRGoQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.33.5 h1:jDQARFp1mJ2PEnllQf01nfFXGfWMJ59e0/HCHUTTZCk= +github.com/aws/aws-sdk-go-v2/service/sso v1.33.5/go.mod h1:OcT2AhgTuxGAwZk5hgxaNLGpS33W8s8dUQadGVDVY9I= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.5 h1:8xo1q9ttkYqMJ6vOXX67FPSpVEI7BWKVTKh77g82w+8= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.38.5/go.mod h1:hbBeEUrZg6VddXYZpbKPyF0tl4XEnM+Dbx92RW3vmZI= +github.com/aws/aws-sdk-go-v2/service/sts v1.45.5 h1:eQ5BtXDrPg2wK0AjtVPzeBhUpYPeqHE/ptiH7xJRGek= +github.com/aws/aws-sdk-go-v2/service/sts v1.45.5/go.mod h1:f9ImhnOISY7BuTZLM8qHepCYnglHBVLk5wVzatmP++w= +github.com/aws/smithy-go v1.27.7 h1:Zgj5z4LfcDYoQIVk+n/yGdTkP/2y6ZT5vYxe0fp7bqE= +github.com/aws/smithy-go v1.27.7/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o= github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= @@ -144,8 +144,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 h1:5RVFMOWjMyRy8cARdy79nAmgYw3hK/4HUq48LQ6Wwqo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/dgraph-io/ristretto v1.0.0 h1:SYG07bONKMlFDUYu5pEu3DGAh8c2OFNzKm6G9J4Si84= github.com/dgraph-io/ristretto v1.0.0/go.mod h1:jTi2FiYEhQ1NsMmA7DeBykizjOuY88NhKBkepyu1jPc= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= @@ -170,8 +170,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dylibso/observe-sdk/go v0.0.0-20240819160327-2d926c5d788a h1:UwSIFv5g5lIvbGgtf3tVwC7Ky9rmMFBp0RMs+6f6YqE= github.com/dylibso/observe-sdk/go v0.0.0-20240819160327-2d926c5d788a/go.mod h1:C8DzXehI4zAbrdlbtOByKX6pfivJTBiV9Jjqv56Yd9Q= -github.com/ebitengine/purego v0.10.0 h1:QIw4xfpWT6GWTzaW5XEKy3HXoqrJGx1ijYHzTF0/ISU= -github.com/ebitengine/purego v0.10.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= +github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE= +github.com/ebitengine/purego v0.10.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= @@ -282,8 +282,8 @@ github.com/gobuffalo/tags/v3 v3.1.4/go.mod h1:ArRNo3ErlHO8BtdA0REaZxijuWnWzF6PUX github.com/gobuffalo/validate/v3 v3.3.3/go.mod h1:YC7FsbJ/9hW/VjQdmXPvFqvRis4vrRYFxr69WiNZw6g= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= -github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= +github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU= +github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ= @@ -301,15 +301,15 @@ github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/ github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/cel-go v0.30.0 h1:ll54AkzKunWkBn9wSoiUXbFZXYZTkdJGNXTBXUoolGo= -github.com/google/cel-go v0.30.0/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= +github.com/google/cel-go v0.31.0 h1:H0bhpFTqOvmHrBGrWKp7ZlhBm5Hh8PYUEXnwxT1LL7A= +github.com/google/cel-go v0.31.0/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c= github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-containerregistry v0.21.8 h1:Ig/zIsnztdCUNaiNNczE+MoP5xcyUMfvpvfOr1xyMLE= -github.com/google/go-containerregistry v0.21.8/go.mod h1:dP5XNKcL7kMFF/TB3LfvWmVhAcv7iqkHb3oDK8aauTo= +github.com/google/go-containerregistry v0.21.9 h1:F+D4uZ3iA3DLMJLfhaqMdHJbzeqm/216WGQq2dokuLs= +github.com/google/go-containerregistry v0.21.9/go.mod h1:dP5XNKcL7kMFF/TB3LfvWmVhAcv7iqkHb3oDK8aauTo= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/jsonschema-go v0.4.3 h1:/DBOLZTfDow7pe2GmaJNhltueGTtDKICi8V8p+DQPd0= github.com/google/jsonschema-go v0.4.3/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= @@ -425,16 +425,16 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lestrrat-go/blackmagic v1.0.4 h1:IwQibdnf8l2KoO+qC3uT4OaTWsW7tuRQXy9TRN9QanA= github.com/lestrrat-go/blackmagic v1.0.4/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw= -github.com/lestrrat-go/dsig v1.0.0 h1:OE09s2r9Z81kxzJYRn07TFM9XA4akrUdoMwr0L8xj38= -github.com/lestrrat-go/dsig v1.0.0/go.mod h1:dEgoOYYEJvW6XGbLasr8TFcAxoWrKlbQvmJgCR0qkDo= +github.com/lestrrat-go/dsig v1.3.0 h1:phjMOCXvYzhuIgn7Voe2rex8z166vGfxRxmqM25P9/Q= +github.com/lestrrat-go/dsig v1.3.0/go.mod h1:RD2eOaidyPvpc7IJQoO3Qq52RWdy8ZcJs8lrOnoa1Kc= github.com/lestrrat-go/dsig-secp256k1 v1.0.0 h1:JpDe4Aybfl0soBvoVwjqDbp+9S1Y2OM7gcrVVMFPOzY= github.com/lestrrat-go/dsig-secp256k1 v1.0.0/go.mod h1:CxUgAhssb8FToqbL8NjSPoGQlnO4w3LG1P0qPWQm/NU= github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE= github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E= github.com/lestrrat-go/httprc/v3 v3.0.6 h1:4FpLQ18KK/ypPbVU3NLWJNRvH3kcYiqKqWfKGqNWxxI= github.com/lestrrat-go/httprc/v3 v3.0.6/go.mod h1:mSMtkZW92Z98M5YoNNztbRGxbXHql7tSitCvaxvo9l0= -github.com/lestrrat-go/jwx/v3 v3.0.13 h1:AdHKiPIYeCSnOJtvdpipPg/0SuFh9rdkN+HF3O0VdSk= -github.com/lestrrat-go/jwx/v3 v3.0.13/go.mod h1:2m0PV1A9tM4b/jVLMx8rh6rBl7F6WGb3EG2hufN9OQU= +github.com/lestrrat-go/jwx/v3 v3.2.0 h1:Jb3zBASTSZXz7gzzSAfYqxXF8KejvKC4xWoePLQqXCA= +github.com/lestrrat-go/jwx/v3 v3.2.0/go.mod h1:38vQ8iWKq3qRSbilbzvzdQPuywhowwuR03lhkYskyrw= github.com/lestrrat-go/option/v2 v2.0.0 h1:XxrcaJESE1fokHy3FpaQ/cXW8ZsIdWcdFzzLOcID3Ss= github.com/lestrrat-go/option/v2 v2.0.0/go.mod h1:oSySsmzMoR0iRzCDCaUfsCzxQHUEuhOViQObyy7S6Vg= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -500,10 +500,10 @@ github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= -github.com/modelcontextprotocol/go-sdk v1.6.1 h1:0zOSupjKUxPKSocPT1Wtago+mUHU2/uZ4xSOY0FGReU= -github.com/modelcontextprotocol/go-sdk v1.6.1/go.mod h1:kzm3kzFL1/+AziGOE0nUs3gvPoNxMCvkxokMkuFapXQ= -github.com/modelcontextprotocol/registry v1.8.0 h1:x/seX0ji4iqRUpSovmkBcGbxfRiZZ7dgPwBcpCJrSTM= -github.com/modelcontextprotocol/registry v1.8.0/go.mod h1:G6AUpTpZSekQvcLl5griUjijEE8vedARE/TyCaHEFdo= +github.com/modelcontextprotocol/go-sdk v1.7.1-0.20260803115424-0d0cdbc943f3 h1:zWKNIvh4WevULrd5FxTBmr0oin2wN/zFb9ENXig1g4g= +github.com/modelcontextprotocol/go-sdk v1.7.1-0.20260803115424-0d0cdbc943f3/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts= +github.com/modelcontextprotocol/registry v1.8.1 h1:baHVpbY9xc/lyCi/Wemcy7idVBNKROJZbSgzosCEuEo= +github.com/modelcontextprotocol/registry v1.8.1/go.mod h1:W26bRO/fiGMqCfDFNFz8DWZbFSpGj87JsqwrTbvLIWU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -577,8 +577,8 @@ github.com/prometheus/otlptranslator v1.0.0 h1:s0LJW/iN9dkIH+EnhiD3BlkkP5QVIUVEo github.com/prometheus/otlptranslator v1.0.0/go.mod h1:vRYWnXvI6aWGpsdY/mOT/cbeVRBlPWtBNDb7kGR3uKM= github.com/prometheus/procfs v0.21.1 h1:GljZCt+zSTS+NZq88cyQ1LjZ+RCHp3uVuabBWA5+OJI= github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIjmHKYgMKmtY= -github.com/redis/go-redis/v9 v9.21.0 h1:FPBE4hhbAke+TLmcY3WkpbDffJEomdqPn3HYiqAtL9E= -github.com/redis/go-redis/v9 v9.21.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA= +github.com/redis/go-redis/v9 v9.22.0 h1:laDvpYXTJtZLloinw1fA5Kqd6HAEH2XKxOkG/PDq2F0= +github.com/redis/go-redis/v9 v9.22.0/go.mod h1:y2g0Wj8rQvuK0ELM+oxSudcLtC09JScs98I/X9gRWY4= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= @@ -603,8 +603,8 @@ github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0= github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shirou/gopsutil/v4 v4.26.5 h1:RPcBXkpz7kOj9PqGFQOlBPZHsyaPvPVQc098y9RmCNM= -github.com/shirou/gopsutil/v4 v4.26.5/go.mod h1:LZ6ewCSkBqUpvSOf+LsTGnRinC6iaNUNMGBtDkJBaLQ= +github.com/shirou/gopsutil/v4 v4.26.7 h1:IXzpHz/dkMRYAhKkOXr1HB6SuzWU3eoyyeWe7g3bNZc= +github.com/shirou/gopsutil/v4 v4.26.7/go.mod h1:5O9FjBiXoTDFatIWjZZosqj4pV0DRtLx598xGbBehzM= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -629,8 +629,8 @@ github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU= github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY= github.com/stacklok/toolhive v0.40.0 h1:tHAMdyQpoFDGs1X7xHv1SW+K9wJmcnWrZ6m7cOgU9fQ= github.com/stacklok/toolhive v0.40.0/go.mod h1:i7hCgqyzaG8W8Rgbr2tMj7gb0vKiiSS0WAUyEighpu0= -github.com/stacklok/toolhive-core v0.0.33 h1:+ldYrAWko3FaIMTbGzPDojjglRo3IWR3eUaYhjLGqRg= -github.com/stacklok/toolhive-core v0.0.33/go.mod h1:WWt0RUWgA3r39Oej3SBmRswjkopYn9YK2b/mdR9j+WM= +github.com/stacklok/toolhive-core v0.0.39 h1:l9XV1LoWL33CYQyjj2xhbNZpYLnobV5hOVaspNO27DA= +github.com/stacklok/toolhive-core v0.0.39/go.mod h1:8L/EIQWziQeVLOOZXT7VGRhaKFyS2Hb3IyFRJocm5Hg= github.com/standard-webhooks/standard-webhooks/libraries v0.0.1 h1:uOfcYT+3QungH6tIGSVCR/Y3KJmgJiHcojJbMTPDZAI= github.com/standard-webhooks/standard-webhooks/libraries v0.0.1/go.mod h1:L1MQhA6x4dn9r007T033lsaZMv9EmBAdXyU/+EF40fo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -678,8 +678,8 @@ github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9R github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/valyala/fastjson v1.6.7 h1:ZE4tRy0CIkh+qDc5McjatheGX2czdn8slQjomexVpBM= -github.com/valyala/fastjson v1.6.7/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= +github.com/valyala/fastjson v1.6.10 h1:/yjJg8jaVQdYR3arGxPE2X5z89xrlhS0eGXdv+ADTh4= +github.com/valyala/fastjson v1.6.10/go.mod h1:e6FubmQouUNP73jtMLmcbxS6ydWIpOfhz34TSfO3JaE= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -778,8 +778,9 @@ go.uber.org/zap v1.28.0 h1:IZzaP1Fv73/T/pBMLk4VutPl36uNC+OSUh3JLG3FIjo= go.uber.org/zap v1.28.0/go.mod h1:rDLpOi171uODNm/mxFcuYWxDsqWSAVkFdX4XojSKg/Q= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= go.yaml.in/yaml/v4 v4.0.0-rc.2 h1:/FrI8D64VSr4HtGIlUtlFMGsm7H7pWTbj6vOLVZcA6s= go.yaml.in/yaml/v4 v4.0.0-rc.2/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.ngrok.com/muxado/v2 v2.0.1 h1:jM9i6Pom6GGmnPrHKNR6OJRrUoHFkSZlJ3/S0zqdVpY= diff --git a/go.work b/go.work index 8c5f6568f8..d3f9ba42f2 100644 --- a/go.work +++ b/go.work @@ -4,6 +4,8 @@ use ./ use ./engine +use ./authn/oidc + use ./provider/anthropic use ./provider/openai diff --git a/go.work.sum b/go.work.sum index 21fef87a67..e9e288dfa5 100644 --- a/go.work.sum +++ b/go.work.sum @@ -2,16 +2,20 @@ cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= cloud.google.com/go/auth v0.18.2 h1:+Nbt5Ev0xEqxlNjd6c+yYUeosQ5TtEUaNcN/3FozlaM= cloud.google.com/go/auth v0.18.2/go.mod h1:xD+oY7gcahcu7G2SG2DsBerfFxgPAJz17zz2joOFF3M= +cloud.google.com/go/auth v0.20.0/go.mod h1:942/yi/itH1SsmpyrbnTMDgGfdy2BUqIKyd0cyYLc5Q= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= cloud.google.com/go/iam v1.7.0 h1:JD3zh0C6LHl16aCn5Akff0+GELdp1+4hmh6ndoFLl8U= cloud.google.com/go/iam v1.7.0/go.mod h1:tetWZW1PD/m6vcuY2Zj/aU0eCHNPuxedbnbRTyKXvdY= +cloud.google.com/go/iam v1.11.0/go.mod h1:KP+nKGugNJW4LcLx1uEZcq1ok5sQHFaQehQNl4QDgV4= cloud.google.com/go/kms v1.31.0 h1:LS8N92OxFDgOLg5NCo3OmbvjtQAIVT5gUHVLKIDHaFE= cloud.google.com/go/kms v1.31.0/go.mod h1:YIyXZym11R5uovJJt4oN5eUL3oPmirF3yKeIh6QAf4U= +cloud.google.com/go/kms v1.33.0/go.mod h1:CSGvW6GnMQbY+1nOHcIzhMtHSbExXlOmCKjWtYVjcpA= cloud.google.com/go/longrunning v0.9.0 h1:0EzbDEGsAvOZNbqXopgniY0w0a1phvu5IdUFq8grmqY= cloud.google.com/go/longrunning v0.9.0/go.mod h1:pkTz846W7bF4o2SzdWJ40Hu0Re+UoNT6Q5t+igIcb8E= +cloud.google.com/go/longrunning v1.2.0/go.mod h1:5KMQALFGOCtFoi2xSOA1u3H7WKlhmckgiyFw7+LGQp0= code.dny.dev/ssrf v0.2.0 h1:wCBP990rQQ1CYfRpW+YK1+8xhwUjv189AQ3WMo1jQaI= code.dny.dev/ssrf v0.2.0/go.mod h1:B+91l25OnyaLIeCx0WRJN5qfJ/4/ZTZxRXgm0lj/2w8= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= @@ -66,6 +70,7 @@ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3/go.mod h1:UbnqO+zjq github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.6.29 h1:1Hbcvm9a/7hBCAM5y5SAvSKyFUsULrMgmS+XBx32u68= github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.6.29/go.mod h1:qIWWBwh4Wp7HU4E8AkMtu9pqHJ6DxmqLFX7zV8ZX4lM= github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.6.31/go.mod h1:e68nsSeAI5H2Yq3v4GiGxljrU+0gUfn1olY7W2Lu9jU= +github.com/aws/aws-sdk-go-v2/feature/rds/auth v1.6.36/go.mod h1:bgDHl7/zlHq1A4Uxqb782balW63IF1s8bpSe3QLDZYc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= @@ -129,6 +134,7 @@ github.com/cyphar/filepath-securejoin v0.6.1/go.mod h1:A8hd4EnAeyujCJRrICiOWqjS1 github.com/danielgtaylor/huma/v2 v2.37.3 h1:6Av0Vj45Vk5lDxRVfoO2iPlEdvCvwLc7pl5nbqGOkYM= github.com/danielgtaylor/huma/v2 v2.37.3/go.mod h1:OeHHtCEAaNiuVbAVdYu4IQ0UOmnb4x3yMUOShNlZ53g= github.com/danielgtaylor/huma/v2 v2.38.0/go.mod h1:k9hwjlgWFt1t2jsmQGlsgXAG2FBTZa4kkjV581qAtfo= +github.com/danielgtaylor/huma/v2 v2.39.1/go.mod h1:zcnQ38duIJ3VUHwFaBoZ6x8T+KN/mr33oyqxcj0HTug= github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 h1:ge14PCmCvPjpMQMIAH7uKg0lrtNSOdpYsRXlwk3QbaE= @@ -184,26 +190,32 @@ github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNV github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-openapi/analysis v0.25.2 h1:I0vy4n3alz+DHTiN1PRhCb7QZxkK6g5YmswZKv2TKuw= github.com/go-openapi/analysis v0.25.2/go.mod h1:Uhs1t/2XR10EnwONYILGEzw8gcfGIG5Xk5K2AxnhqDo= +github.com/go-openapi/analysis v0.25.5/go.mod h1:d3UGtQC5uq5Kqqqis2VH09Km/v3vwsWrYkbp4gdm+Rc= github.com/go-openapi/errors v0.22.7 h1:JLFBGC0Apwdzw3484MmBqspjPbwa2SHvpDm0u5aGhUA= github.com/go-openapi/errors v0.22.7/go.mod h1://QW6SD9OsWtH6gHllUCddOXDL0tk0ZGNYHwsw4sW3w= github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w= github.com/go-openapi/loads v0.23.3 h1:g5Xap1JfwKkUnZdn+S0L3SzBDpcTIYzZ5Qaag0YDkKQ= github.com/go-openapi/loads v0.23.3/go.mod h1:NOH07zLajXo8y55hom0omlHWDVVvCwBM/S+csCK8LqA= github.com/go-openapi/loads v0.24.0/go.mod h1:xQMgX+hw5xRAhGrcDXxeMw78IFqUpIzhleu3HqPhyF4= +github.com/go-openapi/loads v0.25.0/go.mod h1:JFBw4SIB9+PTIFHDfcXuSSy5h6aWzjtUCrPYyx3qWU8= github.com/go-openapi/runtime v0.32.3 h1:J7Ycy5DJmhhP1By3NifhRUjnkXTrk21qbeqSULjwX8U= github.com/go-openapi/runtime v0.32.3/go.mod h1:/WTQi0fa5DiGnnCXQKsTkSm15OzJp8Uz3H2t+67TBr4= github.com/go-openapi/runtime v0.32.4/go.mod h1:Bz6keOZw1NX4T6f+m42OoT1MBPDt6Re13dbccHyGH/4= +github.com/go-openapi/runtime v0.33.0/go.mod h1:+rsupH3+TFKqmFysqkmgBOTxpVJV8eV+j9myvvea2Xw= github.com/go-openapi/runtime/server-middleware v0.30.0 h1:8rPoJ/xv7JL8BsovaqboKETlpWBArVh8n+0L/GyePog= github.com/go-openapi/runtime/server-middleware v0.30.0/go.mod h1:OYNT/TxNvB/VK5oe4htM2jDTwlEXuejVJmu0DVZfAMs= github.com/go-openapi/spec v0.22.5 h1:KhO7RBlKQfonUWX2WzQCoLIXVA6AcNqDGZ3a1Dutdlo= github.com/go-openapi/spec v0.22.5/go.mod h1:vxpOtMya5TXtENXKE5bKqv5NjocVhyhxHrlZfvKnZ74= github.com/go-openapi/spec v0.22.6/go.mod h1:HZvTHat+iH0PALQRWhrqIHtU/PEqxqd89fu0MxGlMeM= +github.com/go-openapi/spec v0.22.9/go.mod h1:b/mNUYIOQOyIiUzUzXEE8xzyZqf93KvM9hQGP91yfl0= github.com/go-openapi/strfmt v0.26.3 h1:rzmslHarJgBbf2qfGge+X3htclQfmXqBZMm0Too0HhU= github.com/go-openapi/strfmt v0.26.3/go.mod h1:a5nsUw0oRpQzZeOwx8bi6cKbzFZslpbCKt1LEot+KnQ= github.com/go-openapi/strfmt v0.26.4/go.mod h1:hNJi6nb5ETD6i7A1yRo03M9S6ZoTPPoWff1iUexmfUc= +github.com/go-openapi/strfmt v0.27.0/go.mod h1:s/qhDqfY72irigXUGJmtgid2Rm+3tnz3k8hZaRmvWYc= github.com/go-openapi/validate v0.25.3 h1:4nzAIavcJ7WveHK2+V1UAkZK3kWcjzxZCzjfZAfavKs= github.com/go-openapi/validate v0.25.3/go.mod h1:GemfuGMyYpIaBoKpX3z8sLywrmxpzWVOoJ7R0VeAVuk= github.com/go-openapi/validate v0.26.0/go.mod h1:b4o00uq7fJeJA+wWhVFCJpKTctzeFwzZImGGmHsl2JA= +github.com/go-openapi/validate v0.26.1/go.mod h1:B8UMgXiQiwwQWIbmuROlwJZDPGlikPuh7iHV1vPX9Oo= github.com/go-pdf/fpdf v0.6.0 h1:MlgtGIfsdMEEQJr2le6b/HNr1ZlQwxyWr77r2aj2U/8= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= @@ -252,8 +264,10 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaU github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/googleapis/enterprise-certificate-proxy v0.3.14 h1:yh8ncqsbUY4shRD5dA6RlzjJaT4hi3kII+zYw8wmLb8= github.com/googleapis/enterprise-certificate-proxy v0.3.14/go.mod h1:vqVt9yG9480NtzREnTlmGSBmFrA+bzb0yl0TxoBQXOg= +github.com/googleapis/enterprise-certificate-proxy v0.3.17/go.mod h1:rSEsBUemEBZEexP2y6jPp16LUmUbjmSbcPMQizR0o4k= github.com/googleapis/gax-go/v2 v2.21.0 h1:h45NjjzEO3faG9Lg/cFrBh2PgegVVgzqKzuZl/wMbiI= github.com/googleapis/gax-go/v2 v2.21.0/go.mod h1:But/NJU6TnZsrLai/xBAQLLz+Hc7fHZJt/hsCz3Fih4= +github.com/googleapis/gax-go/v2 v2.23.0/go.mod h1:rBQKOVJCdb8IFEzg+FCwlt1LP/xMDGuqUXhUG+XMXEg= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= @@ -313,6 +327,7 @@ github.com/jcmturner/gokrb5/v8 v8.4.3 h1:iTonLeSJOn7MVUtyMT+arAn5AKAPrkilzhGw8wE github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b/go.mod h1:hQmNrgofl+IY/8L+n20H6E6PWBBTokdsv+q49j0QhsU= github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4= github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= @@ -431,6 +446,7 @@ github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA= github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= +github.com/sassoftware/relic v7.2.1+incompatible/go.mod h1:CWfAxv73/iLZ17rbyhIEq3K9hs5w6FpNMdUT//qR+zk= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/secure-systems-lab/go-securesystemslib v0.11.0 h1:iuCR9kcMFD4QurdKrGvPLoKZLv9YvwPYVr0473BdtFs= github.com/secure-systems-lab/go-securesystemslib v0.11.0/go.mod h1:+PMOTjUGwHj2vcZ+TFKlb1tXRbrdWE1LYDT5i9JC80Q= @@ -453,11 +469,14 @@ github.com/sigstore/rekor-tiles/v2 v2.2.2-0.20260601073857-5d098a2b6443/go.mod h github.com/sigstore/rekor-tiles/v2 v2.3.0/go.mod h1:DEFiKSyQ4nF75QRVNdOPaIH3cmvMkO2B6xDZjNYngPc= github.com/sigstore/sigstore v1.10.8 h1:1Mgkxvkw4AXMfIP1DOjc6kw0GkUgA8pGVpveN/EfOq4= github.com/sigstore/sigstore v1.10.8/go.mod h1:f9+B/4iaYimvUkySyb2mvc73n3RLqNn24grHZM/ET8M= +github.com/sigstore/sigstore v1.10.9/go.mod h1:LYW9+qH7bK8wZmLm6lPxIC5lkHtkJDCgkqjChzTAIBs= github.com/sigstore/sigstore-go v1.2.1 h1:YWP/rDbBaEBvtbkj6xtwsSj38ZCFEhTVVadNOXjVe3A= github.com/sigstore/sigstore-go v1.2.1/go.mod h1:I8BqVwAb/SaQJ5pBu5IDFY+ksq8O/1/kCag8XUgrsko= github.com/sigstore/sigstore-go v1.2.2/go.mod h1:MIFwBxAHJD+/lKgZzt9n/4Zhq/3T2+EuGX8iGrIsZgU= +github.com/sigstore/sigstore-go v1.3.0/go.mod h1:AyRQXfpH89py1twjE3kEZxlRersng90GSYqQV9zGJE8= github.com/sigstore/timestamp-authority/v2 v2.1.2 h1:7DDhnknLL4w8VwomyvW2W8qblOS9LDR8oihna+jc7Ls= github.com/sigstore/timestamp-authority/v2 v2.1.2/go.mod h1:o6rAVZceFyejClIj/uStRNIemP16bVMZtbMmhk6pr0U= +github.com/sigstore/timestamp-authority/v2 v2.1.3/go.mod h1:myoFOKJB/u5vNTFwvBBJVkG3NnOBeIJevbfjNeasLjo= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -481,6 +500,7 @@ github.com/sv-tools/openapi v0.4.0 h1:UhD9DVnGox1hfTePNclpUzUFgos57FvzT2jmcAuTOJ github.com/sv-tools/openapi v0.4.0/go.mod h1:kD/dG+KP0+Fom1r6nvcj/ORtLus8d8enXT6dyRZDirE= github.com/swaggo/swag/v2 v2.0.0-rc5 h1:fK7d6ET9rrEsdB8IyuwXREWMcyQN3N7gawGFbbrjgHk= github.com/swaggo/swag/v2 v2.0.0-rc5/go.mod h1:kCL8Fu4Zl8d5tB2Bgj96b8wRowwrwk175bZHXfuGVFI= +github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug= github.com/theupdateframework/go-tuf/v2 v2.4.2-0.20260407074541-7e8f69f906ef h1:jJac5InhEfD0Z46/d5RayZjoavf/se7bPZpOgg8GLrM= github.com/theupdateframework/go-tuf/v2 v2.4.2-0.20260407074541-7e8f69f906ef/go.mod h1:cLUSJ2cgR194lNWfp+TJT4P8PX7qGleCXdudqlCMtOE= github.com/theupdateframework/go-tuf/v2 v2.4.2/go.mod h1:JqBrIUnNLAaNq/8GmBcEMFWfAFBbqp/MkJEJseXKbks= @@ -526,6 +546,7 @@ go.opentelemetry.io/contrib/detectors/gcp v1.43.0/go.mod h1:RyaZMFY7yi1kAs45S6mb go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0/go.mod h1:NoUCKYWK+3ecatC4HjkRktREheMeEtrXoQxrqYFeHSc= go.starlark.net v0.0.0-20260522144826-ec58d4b459e2 h1:3cIeOhZXLdLHnBoLyKdJu4SEAEuM/av/VFzB5twLo8k= go.starlark.net v0.0.0-20260522144826-ec58d4b459e2/go.mod h1:Iue6g6iirlfLoVi/DYCi5/x0h/bAOuWF3dULTKpt2Vo= go.starlark.net v0.0.0-20260630144053-529d8e869a14/go.mod h1:Iue6g6iirlfLoVi/DYCi5/x0h/bAOuWF3dULTKpt2Vo= @@ -543,6 +564,7 @@ gonum.org/v1/plot v0.12.0 h1:y1ZNmfz/xHuHvtgFe8USZVyykQo5ERXPnspQNVK15Og= gonum.org/v1/plot v0.12.0/go.mod h1:PgiMf9+3A3PnZdJIciIXmyN1FwdAA6rXELSN761oQkw= google.golang.org/api v0.274.0 h1:aYhycS5QQCwxHLwfEHRRLf9yNsfvp1JadKKWBE54RFA= google.golang.org/api v0.274.0/go.mod h1:JbAt7mF+XVmWu6xNP8/+CTiGH30ofmCmk9nM8d8fHew= +google.golang.org/api v0.287.1/go.mod h1:lM2kYRzYUCBY91P9h6VF1PYmvhxii3O5hji37qRvIcY= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 h1:XzmzkmB14QhVhgnawEVsOn6OFsnpyxNPRY9QV01dNB0= diff --git a/internal/adapter/grpcdriver/doc.go b/internal/adapter/grpcdriver/doc.go index a2147be50f..6043746d53 100644 --- a/internal/adapter/grpcdriver/doc.go +++ b/internal/adapter/grpcdriver/doc.go @@ -18,7 +18,10 @@ // writes): it holds whatever the harness persists, and a corrupt or hostile // payload from it fails the harness-side decode loudly — it never reaches the // model silently. Sanitization of model-written memory values stays in the -// harness's memory tools; a driver is never trusted to sanitize. +// harness's memory tools; a driver is never trusted to sanitize. The server +// wrappers deliberately install no authentication or TLS: mount them only on +// a separately protected operator network, or provide those controls in the +// driver host. // // # Wire format and versioning // diff --git a/internal/adapter/mcp/content_test.go b/internal/adapter/mcp/content_test.go index 95c2a58f73..1e1c83b577 100644 --- a/internal/adapter/mcp/content_test.go +++ b/internal/adapter/mcp/content_test.go @@ -487,6 +487,11 @@ func TestMapContentEmbeddedResourceEmpty(t *testing.T) { func TestMapContentUnsupportedKind(t *testing.T) { result := &mcpsdk.CallToolResult{ Content: []mcpsdk.Content{ + // ToolUseContent is the SDK's only Content implementation that mapContent + // deliberately does not handle. It remains valid during the SDK's documented + // sampling deprecation window, which makes it the regression fixture for a + // legacy server returning an unsupported content kind. + //nolint:staticcheck // deliberately exercise the SDK's legacy content type. &mcpsdk.ToolUseContent{ID: "tu-1", Name: "some-tool"}, }, } diff --git a/internal/adapter/scheduler/scheduler.go b/internal/adapter/scheduler/scheduler.go index 64b4b2c718..f5ca2d6f58 100644 --- a/internal/adapter/scheduler/scheduler.go +++ b/internal/adapter/scheduler/scheduler.go @@ -36,6 +36,7 @@ import ( "github.com/stacklok/mecatl/engine/adapter/cronparse" "github.com/stacklok/mecatl/engine/port" "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/internal/syscaller" ) // FireFunc is the composition-supplied callback a scheduler invokes for each @@ -131,8 +132,11 @@ type Config struct { // engine/agent import): the payload is a plain session.SchedulePayload value // object, not an EventSink/port import. The scheduler invokes it from // fireClaimed (fired/failed) and fireOne/FireNow (skipped) — the caller - // decides the kind; the callback decides where it lands. - EmitScheduleEvent func(payload session.SchedulePayload) + // decides the kind; the callback decides where it lands. The ctx is the + // firing caller's, so the durable append can attribute the event to whoever + // acted (a tick fire descends from Start's system-principal root; a manual + // FireNow keeps its requester) — ADR 0100 decision 5. + EmitScheduleEvent func(ctx context.Context, payload session.SchedulePayload) // ScheduleMetrics is the OPTIONAL composition-injected metrics callback // (issue #233, Phase 2b). It is nil-safe (nil = no metrics recorded — the // byte-identical no-metrics path). The scheduler invokes it from @@ -381,7 +385,7 @@ func (s *Scheduler) SetFire(f FireFunc) { // the scheduler is fully functional, just silent on the schedule lifecycle). // Composition calls it after SetFire (so the FireFunc is bound) and before // Start (so the callback is in place when the first tick fires). -func (s *Scheduler) SetEmitScheduleEvent(cb func(payload session.SchedulePayload)) { +func (s *Scheduler) SetEmitScheduleEvent(cb func(ctx context.Context, payload session.SchedulePayload)) { s.mu.Lock() defer s.mu.Unlock() if s.started.Load() { @@ -501,6 +505,12 @@ func (s *Scheduler) Start(ctx context.Context) error { if !s.started.CompareAndSwap(false, true) { return nil } + // The lifecycle root has no caller: every context the tick, fire, delivery + // and reconcile paths use descends from here (context.WithoutCancel keeps + // values), so this ONE wrap runs them all as the explicit system principal + // (ADR 0100 decision 7). FireNow is deliberately NOT wrapped — a manual fire + // keeps its requester's identity. + ctx = syscaller.Context(ctx, syscaller.RootScheduler) if s.cfg.Fire == nil { s.started.Store(false) panic("scheduler: Start called before SetFire (Fire is nil)") @@ -962,7 +972,7 @@ func (s *Scheduler) fireOne(ctx context.Context, sched port.Schedule, now time.T defer rel() // release the trial lease when fireOne returns } if overlap { - s.emitSchedule(session.SchedulePayload{ + s.emitSchedule(ctx, session.SchedulePayload{ ScheduleName: sched.Spec.Name, Kind: scheduleKindSkipped, }) @@ -1007,7 +1017,7 @@ func (s *Scheduler) fireOne(ctx context.Context, sched port.Schedule, now time.T } if skipFire { - s.emitSchedule(session.SchedulePayload{ + s.emitSchedule(ctx, session.SchedulePayload{ ScheduleName: sched.Spec.Name, Kind: scheduleKindSkipped, }) @@ -1080,7 +1090,7 @@ func (s *Scheduler) fireClaimed(ctx context.Context, claimed port.Schedule, now Err: fire.Err, } } - s.emitSchedule(payload) + s.emitSchedule(ctx, payload) // Record the fire metrics (Claim→terminal duration). now is the Claim time // fireClaimed was called with; the run is now terminal, so time.Since(now) // is the end-to-end fire cost. Skipped fires (no run) record metrics with a @@ -1109,9 +1119,9 @@ func (s *Scheduler) fireClaimed(ctx context.Context, claimed port.Schedule, now // the single chokepoint for emitting an EvSchedule* payload — fireClaimed calls // it for fired/failed, fireOne/FireNow call it for skipped. A nil callback is the // byte-identical no-emit path. -func (s *Scheduler) emitSchedule(payload session.SchedulePayload) { +func (s *Scheduler) emitSchedule(ctx context.Context, payload session.SchedulePayload) { if s.cfg.EmitScheduleEvent != nil { - s.cfg.EmitScheduleEvent(payload) + s.cfg.EmitScheduleEvent(ctx, payload) } } @@ -1181,7 +1191,7 @@ func (s *Scheduler) FireNow(ctx context.Context, name string, now time.Time) (po defer rel() } if overlap { - s.emitSchedule(session.SchedulePayload{ + s.emitSchedule(ctx, session.SchedulePayload{ ScheduleName: sched.Spec.Name, Kind: scheduleKindSkipped, }) diff --git a/internal/adapter/scheduler/scheduler_test.go b/internal/adapter/scheduler/scheduler_test.go index 17734497d7..28264388ed 100644 --- a/internal/adapter/scheduler/scheduler_test.go +++ b/internal/adapter/scheduler/scheduler_test.go @@ -989,7 +989,7 @@ func TestFireNowEmitCallback(t *testing.T) { var gotMu sync.Mutex var got []session.SchedulePayload - emit := func(p session.SchedulePayload) { + emit := func(_ context.Context, p session.SchedulePayload) { gotMu.Lock() got = append(got, p) gotMu.Unlock() @@ -1056,7 +1056,7 @@ func TestFireNowStopErrorEmitsFailed(t *testing.T) { var gotMu sync.Mutex var got []session.SchedulePayload - emit := func(p session.SchedulePayload) { + emit := func(_ context.Context, p session.SchedulePayload) { gotMu.Lock() got = append(got, p) gotMu.Unlock() diff --git a/internal/adapter/server/authn.go b/internal/adapter/server/authn.go index 646b86d241..c327f3d44c 100644 --- a/internal/adapter/server/authn.go +++ b/internal/adapter/server/authn.go @@ -3,6 +3,8 @@ package server import ( "context" "crypto/subtle" + "errors" + "io" "net" "net/http" "strings" @@ -15,6 +17,38 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" + + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/internal/syscaller" +) + +// PrincipalValidator verifies a bearer credential and returns the caller it +// vouches for (ADR 0100 decision 3). Validation itself — JWT parse, signature, +// alg, issuer/audience/exp/nbf, JWKS fetch and rotation — is DELEGATED to the +// implementation (toolhive-core/authn); mecatl hand-rolls none of it. This +// narrow interface is the seam: the edge only decides what to do with the +// verdict. +// +// A nil returned principal with a nil error is treated as a rejection: the edge +// never fabricates an anonymous caller (absent identity is a nil principal, and +// that only happens when NO validator is wired at all). +type PrincipalValidator interface { + Validate(ctx context.Context, bearer string) (*session.Principal, error) +} + +var ( + // ErrInvalidToken is the 401-class verdict: the credential is malformed, + // unsigned, from the wrong issuer/audience, expired, not yet valid, or + // otherwise not vouched for. A validator should wrap it. + ErrInvalidToken = errors.New("invalid bearer token") + // ErrIdentityUnavailable is the TRANSIENT 503-class verdict: the identity + // provider (its JWKS endpoint / discovery document) could not be reached, so + // the token's validity is UNKNOWN. It is deliberately distinct from + // ErrInvalidToken — an IdP outage must not be reported as an authn failure. + ErrIdentityUnavailable = errors.New("identity provider unavailable") + // errRejectedRateLimit means the direct peer exhausted its separate + // pre-validation budget for rejected bearer credentials. + errRejectedRateLimit = errors.New("rejected bearer rate limit exceeded") ) // SecurityConfig configures the reusable authentication and rate-limiting @@ -37,11 +71,25 @@ type SecurityConfig struct { // RateBurst is the token-bucket burst size. It defaults to a small multiple // of RateLimit when left zero (see newLimiterSet). RateBurst int + // Validator, when non-nil, turns caller identity ON: every request must + // present a bearer the validator vouches for, and the verified principal is + // stashed on the handler context (session.WithPrincipal). Nil (the default) + // leaves the path byte-identical to a mecatl without identity: no + // validation, no principal, no new failure mode. + Validator PrincipalValidator } -// authEnabled reports whether a bearer token is configured. +// authEnabled reports whether a STATIC shared bearer token is configured. It +// says nothing about caller identity — see identityConfigured. func (c SecurityConfig) authEnabled() bool { return c.AuthToken != "" } +// identityConfigured reports whether caller identity is on, i.e. whether a +// verifier is wired. It is deliberately INDEPENDENT of authEnabled(): a +// shared-token deployment has one credential and zero subjects, and an OIDC +// deployment may have subjects and no static token (ADR 0100 decision 2). +// Neither predicate may gate the other's behaviour. +func (c SecurityConfig) identityConfigured() bool { return c.Validator != nil } + // rateEnabled reports whether rate limiting is configured. func (c SecurityConfig) rateEnabled() bool { return c.RateLimit > 0 } @@ -78,6 +126,10 @@ type limiterSet struct { mu sync.Mutex clients map[string]*clientLimiter + // overflow is used only by the rejected-token limiter after clients reaches + // maxTrackedClients and no idle entry can be evicted. New peers then share a + // bucket rather than growing the map without bound. + overflow *clientLimiter // idleTTL evicts a client limiter that has not been seen for this long, so // memory stays bounded under churning client identities (e.g. peer IPs). idleTTL time.Duration @@ -88,6 +140,10 @@ type limiterSet struct { type clientLimiter struct { lim *rate.Limiter seen time.Time + // validationGate serializes rejected-bearer validation for one direct peer. + // It is a context-aware gate: a waiting request may leave when its caller + // cancels, without waiting for an in-flight validator call to finish. + validationGate chan struct{} } // maxTrackedClients caps the per-client map; once exceeded a sweep evicts idle @@ -114,6 +170,18 @@ func newLimiterSet(rps float64, burst int) *limiterSet { } } +func newRejectedLimiterSet(rps float64, burst int) *limiterSet { + s := newLimiterSet(rps, burst) + s.overflow = newClientLimiter(s.r, s.burst) + return s +} + +func newClientLimiter(r rate.Limit, burst int) *clientLimiter { + gate := make(chan struct{}, 1) + gate <- struct{}{} + return &clientLimiter{lim: rate.NewLimiter(r, burst), validationGate: gate} +} + // allow reports whether a request from client key may proceed: it must satisfy // both the per-client and the global limiter. func (s *limiterSet) allow(key string) bool { @@ -125,22 +193,56 @@ func (s *limiterSet) allow(key string) bool { return s.global.Allow() } +// allowValidation runs validate only while key's rejected-token bucket has +// budget. Successful validation and operational errors are not charged; an +// invalid/admissibility rejection consumes one token. A peer is intentionally +// serialized to protect the validator, but waiting requests can leave promptly +// when ctx is canceled or reaches its deadline. +func (s *limiterSet) allowValidation(ctx context.Context, key string, validate func() (*session.Principal, error), charge func(error) bool) (*session.Principal, bool, error) { + cl := s.clientLimiterEntry(key) + select { + case <-cl.validationGate: + defer func() { cl.validationGate <- struct{}{} }() + case <-ctx.Done(): + return nil, true, ctx.Err() + } + + now := s.now() + if cl.lim.TokensAt(now) < 1 { + return nil, false, nil + } + p, err := validate() + if charge(err) { + cl.lim.AllowN(s.now(), 1) + } + return p, true, err +} + // clientLimiter returns (creating if needed) the limiter for key, refreshing its // last-seen stamp and opportunistically evicting idle entries. func (s *limiterSet) clientLimiter(key string) *rate.Limiter { + return s.clientLimiterEntry(key).lim +} + +func (s *limiterSet) clientLimiterEntry(key string) *clientLimiter { now := s.now() s.mu.Lock() defer s.mu.Unlock() if c, ok := s.clients[key]; ok { c.seen = now - return c.lim + return c } if len(s.clients) >= maxTrackedClients { s.evictIdleLocked(now) + if len(s.clients) >= maxTrackedClients && s.overflow != nil { + s.overflow.seen = now + return s.overflow + } } - c := &clientLimiter{lim: rate.NewLimiter(s.r, s.burst), seen: now} + c := newClientLimiter(s.r, s.burst) + c.seen = now s.clients[key] = c - return c.lim + return c } // evictIdleLocked removes clients not seen within idleTTL. The caller holds mu. @@ -163,6 +265,14 @@ func clientKeyFromToken(token string) string { return "tok:" + token } +// clientKeyFromPrincipal keys rate limiting by the VERIFIED (iss, sub) pair, so +// two tokens for the same subject share one bucket — rotating a credential is +// not a limit bypass. Identity is the pair, never sub alone (two issuers collide +// on sub), and the raw token never appears in the key. +func clientKeyFromPrincipal(p *session.Principal) string { + return "sub:" + p.Issuer + "\x00" + p.Subject +} + // clientKeyFromAddr keys rate limiting by the peer IP (host portion), so a // single host shares one bucket regardless of source port. func clientKeyFromAddr(addr string) string { @@ -184,6 +294,34 @@ func clientKeyFromAddr(addr string) string { type Authenticator struct { cfg SecurityConfig limiters *limiterSet + // rejectedLimiters protects the validator from repeated rejected bearers. + // It is separate from limiters so valid requests consume only their verified + // principal's post-validation bucket. + rejectedLimiters *limiterSet + // closeOnce guards the optional validator teardown so a defer plus an + // explicit shutdown call cannot double-close. + closeOnce sync.Once +} + +// Close releases the edge's own long-lived resources at shutdown. Today that is +// exactly one thing: the configured validator's teardown, when it has one. +// +// Teardown is an OPTIONAL CAPABILITY, type-asserted (the port.HookApprovalLearner +// idiom), never a method on PrincipalValidator — widening that single-method +// interface would break every fake and every test that scripts the seam. A +// validator without a Close needs none. +// +// It exists because the real validator (toolhive-core/authn) owns a BACKGROUND +// JWKS refresh that its Close() stops, and cancelling the root context does NOT +// call Close(). Both server mains defer Authenticator.Close. +// +// Safe to call more than once and on the identity-OFF zero value. +func (a *Authenticator) Close() { + a.closeOnce.Do(func() { + if c, ok := a.cfg.Validator.(io.Closer); ok { + _ = c.Close() + } + }) } // NewAuthenticator builds an Authenticator from cfg. When rate limiting is @@ -192,47 +330,158 @@ func NewAuthenticator(cfg SecurityConfig) *Authenticator { a := &Authenticator{cfg: cfg} if cfg.rateEnabled() { a.limiters = newLimiterSet(cfg.RateLimit, cfg.RateBurst) + if cfg.identityConfigured() { + a.rejectedLimiters = newRejectedLimiterSet(cfg.RateLimit, cfg.RateBurst) + } } return a } -// tokenFromMetadata extracts the bearer token from incoming gRPC metadata. -func tokenFromMetadata(ctx context.Context) (string, bool) { +// tokenFromMetadata extracts the bearer token from incoming gRPC metadata. gRPC +// permits repeated metadata keys, but authorization is singular: duplicates are +// rejected rather than choosing an attacker-controlled first or last value. +func tokenFromMetadata(ctx context.Context) (token string, present, duplicate bool) { md, ok := metadata.FromIncomingContext(ctx) if !ok { - return "", false + return "", false, false } vals := md.Get(authHeader) - if len(vals) == 0 { - return "", false + if len(vals) != 1 { + return "", false, len(vals) > 1 } - return bearerFromAuthValue(vals[0]) + token, present = bearerFromAuthValue(vals[0]) + return token, present, false } -// authGRPC verifies the bearer token (when configured) and returns the token -// presented (empty when auth is off). It returns a codes.Unauthenticated status -// error on failure. -func (a *Authenticator) authGRPC(ctx context.Context) (string, error) { - if !a.cfg.authEnabled() { - return "", nil +// identify runs the caller-identity step: when a verifier is wired the bearer is +// validated and the verified principal returned; when it is not, it returns +// (nil, nil) — absent identity, never a fabricated caller. A missing bearer, +// a rejected token, a nil-principal verdict and an UNUSABLE principal (see +// admissiblePrincipal) are all ErrInvalidToken; an unreachable IdP surfaces as +// ErrIdentityUnavailable. With OIDC rate limiting enabled, a presented bearer +// first passes the direct-peer rejected-token budget; invalid/admissibility +// rejections consume that separate budget, while successful validation and +// operational validator errors do not. +func (a *Authenticator) identify(ctx context.Context, bearer string, present bool, peerKey string) (*session.Principal, error) { + if !a.cfg.identityConfigured() { + return nil, nil + } + if !present { + return nil, ErrInvalidToken + } + validate := func() (*session.Principal, error) { + p, err := a.cfg.Validator.Validate(ctx, bearer) + if err != nil { + return nil, err + } + if !admissiblePrincipal(p) { + return nil, ErrInvalidToken + } + return p, nil } - tok, ok := tokenFromMetadata(ctx) - if !ok || !constantTimeTokenMatch(tok, a.cfg.AuthToken) { - return "", status.Error(codes.Unauthenticated, "missing or invalid bearer token") + if a.rejectedLimiters == nil { + return validate() } - return tok, nil + p, allowed, err := a.rejectedLimiters.allowValidation(ctx, peerKey, validate, func(err error) bool { + return errors.Is(err, ErrInvalidToken) + }) + if !allowed { + return nil, errRejectedRateLimit + } + return p, err +} + +// admissiblePrincipal reports whether a validator's verdict is a principal the +// edge may admit. A non-nil principal is not automatically trustworthy — the +// validator is an injected dependency, so the edge enforces the shape it +// promises rather than trusting it: +// +// - Identity is the (Issuer, Subject) PAIR; a principal missing either half +// cannot be attributed to anyone. A wholly empty one is exactly the +// fabricated-anonymous caller ADR 0100 decision 2 rejects, arriving through +// the front door. +// - GrantType must be inside the closed enum: an out-of-enum value would flow +// to every downstream consumer as an unrecognised, unhandled case. +// - The INTERNAL namespace is off limits to an external caller. A token +// presenting mecatl:internal as its issuer, or the system grant, is +// byte-identical to a syscaller-stamped harness goroutine at every consumer +// — including the isolation track (#368), which will read it to decide. +// Only internal/syscaller mints those, and it never goes through this edge. +func admissiblePrincipal(p *session.Principal) bool { + switch { + case p == nil, p.Issuer == "", p.Subject == "": + return false + case !p.GrantType.Valid(), p.GrantType == session.GrantTypeSystem: + return false + case p.Issuer == syscaller.Issuer: + return false + } + return true +} + +// identityStatus maps an identify error onto a gRPC status: context cancellation +// and deadlines retain their native statuses, rejected-token throttling is +// ResourceExhausted, a transient IdP outage is Unavailable (503-class), and +// every other rejection is Unauthenticated. +func identityStatus(err error) error { + if errors.Is(err, context.Canceled) { + return status.Error(codes.Canceled, context.Canceled.Error()) + } + if errors.Is(err, context.DeadlineExceeded) { + return status.Error(codes.DeadlineExceeded, context.DeadlineExceeded.Error()) + } + if errors.Is(err, errRejectedRateLimit) { + return status.Error(codes.ResourceExhausted, "rate limit exceeded") + } + if errors.Is(err, ErrIdentityUnavailable) { + return status.Error(codes.Unavailable, "identity provider unavailable") + } + return status.Error(codes.Unauthenticated, "missing or invalid bearer token") } -// rateGRPC enforces the rate limit for a gRPC call keyed by token (when auth is -// on) or by peer IP. It returns codes.ResourceExhausted when over the limit. -func (a *Authenticator) rateGRPC(ctx context.Context, token string) error { +// authGRPC verifies the static bearer token (when configured) and the caller +// identity (when a verifier is wired), returning the token presented (empty when +// static auth is off) and the verified principal (nil when identity is off). +func (a *Authenticator) authGRPC(ctx context.Context) (string, *session.Principal, error) { + bearer, present, duplicate := tokenFromMetadata(ctx) + if duplicate { + return "", nil, status.Error(codes.Unauthenticated, "duplicate authorization metadata") + } + staticTok := "" + if a.cfg.authEnabled() { + if !present || !constantTimeTokenMatch(bearer, a.cfg.AuthToken) { + return "", nil, status.Error(codes.Unauthenticated, "missing or invalid bearer token") + } + staticTok = bearer + } + peerKey := clientKeyFromAddr("") + if pr, ok := peer.FromContext(ctx); ok && pr.Addr != nil { + peerKey = clientKeyFromAddr(pr.Addr.String()) + } + p, err := a.identify(ctx, bearer, present, peerKey) + if err != nil { + return "", nil, identityStatus(err) + } + return staticTok, p, nil +} + +// rateGRPC enforces the rate limit for a gRPC call keyed by the verified +// (iss, sub) when identity is on, else by token (when static auth is on) or by +// peer IP. It returns codes.ResourceExhausted when over the limit. +func (a *Authenticator) rateGRPC(ctx context.Context, token string, p *session.Principal) error { if a.limiters == nil { return nil } - key := clientKeyFromToken(token) - if !a.cfg.authEnabled() { - if p, ok := peer.FromContext(ctx); ok && p.Addr != nil { - key = clientKeyFromAddr(p.Addr.String()) + var key string + switch { + case p != nil: + key = clientKeyFromPrincipal(p) + case a.cfg.authEnabled(): + key = clientKeyFromToken(token) + default: + key = clientKeyFromToken(token) + if pr, ok := peer.FromContext(ctx); ok && pr.Addr != nil { + key = clientKeyFromAddr(pr.Addr.String()) } } if !a.limiters.allow(key) { @@ -242,17 +491,18 @@ func (a *Authenticator) rateGRPC(ctx context.Context, token string) error { } // UnaryInterceptor returns a grpc.UnaryServerInterceptor enforcing auth then -// rate limiting before the handler runs. +// rate limiting before the handler runs. The verified principal (if any) rides +// the handler context. func (a *Authenticator) UnaryInterceptor() grpc.UnaryServerInterceptor { return func(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) { - tok, err := a.authGRPC(ctx) + tok, p, err := a.authGRPC(ctx) if err != nil { return nil, err } - if err := a.rateGRPC(ctx, tok); err != nil { + if err := a.rateGRPC(ctx, tok, p); err != nil { return nil, err } - return handler(ctx, req) + return handler(session.WithPrincipal(ctx, p), req) } } @@ -262,17 +512,30 @@ func (a *Authenticator) UnaryInterceptor() grpc.UnaryServerInterceptor { func (a *Authenticator) StreamInterceptor() grpc.StreamServerInterceptor { return func(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error { ctx := ss.Context() - tok, err := a.authGRPC(ctx) + tok, p, err := a.authGRPC(ctx) if err != nil { return err } - if err := a.rateGRPC(ctx, tok); err != nil { + if err := a.rateGRPC(ctx, tok, p); err != nil { return err } - return handler(srv, ss) + if p == nil { + return handler(srv, ss) + } + return handler(srv, principalStream{ServerStream: ss, ctx: session.WithPrincipal(ctx, p)}) } } +// principalStream overrides a ServerStream's Context so the stream handler sees +// the verified principal. It is only used when identity is on, so the no-auth +// path hands the handler the ORIGINAL stream, unchanged. +type principalStream struct { + grpc.ServerStream + ctx context.Context +} + +func (s principalStream) Context() context.Context { return s.ctx } + // --- HTTP middleware -------------------------------------------------------- // Middleware wraps next with bearer-auth and rate-limit enforcement. The health @@ -280,19 +543,50 @@ func (a *Authenticator) StreamInterceptor() grpc.StreamServerInterceptor { // remain reachable without credentials and are never rate limited. func (a *Authenticator) Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + bearer, present := bearerFromAuthValue(r.Header.Get("Authorization")) token := "" if a.cfg.authEnabled() { - tok, ok := bearerFromAuthValue(r.Header.Get("Authorization")) - if !ok || !constantTimeTokenMatch(tok, a.cfg.AuthToken) { + if !present || !constantTimeTokenMatch(bearer, a.cfg.AuthToken) { w.Header().Set("WWW-Authenticate", "Bearer") writeError(w, http.StatusUnauthorized, "missing or invalid bearer token") return } - token = tok + token = bearer + } + principal, err := a.identify(r.Context(), bearer, present, clientKeyFromAddr(r.RemoteAddr)) + if err != nil { + if errors.Is(err, context.Canceled) { + // HTTP has no standard cancellation status. Use 408 without an auth + // challenge: this is the caller ending its request, not bad credentials. + writeError(w, http.StatusRequestTimeout, "request canceled") + return + } + if errors.Is(err, context.DeadlineExceeded) { + writeError(w, http.StatusRequestTimeout, "request deadline exceeded") + return + } + if errors.Is(err, errRejectedRateLimit) { + writeError(w, http.StatusTooManyRequests, "rate limit exceeded") + return + } + if errors.Is(err, ErrIdentityUnavailable) { + // A transient IdP outage: the token's validity is UNKNOWN, so + // this is a 503 with no auth challenge — never a 401. + writeError(w, http.StatusServiceUnavailable, "identity provider unavailable") + return + } + w.Header().Set("WWW-Authenticate", "Bearer") + writeError(w, http.StatusUnauthorized, "missing or invalid bearer token") + return } if a.limiters != nil { - key := clientKeyFromToken(token) - if !a.cfg.authEnabled() { + var key string + switch { + case principal != nil: + key = clientKeyFromPrincipal(principal) + case a.cfg.authEnabled(): + key = clientKeyFromToken(token) + default: key = clientKeyFromAddr(r.RemoteAddr) } if !a.limiters.allow(key) { @@ -300,6 +594,9 @@ func (a *Authenticator) Middleware(next http.Handler) http.Handler { return } } + if principal != nil { + r = r.WithContext(session.WithPrincipal(r.Context(), principal)) + } next.ServeHTTP(w, r) }) } diff --git a/internal/adapter/server/authn_test.go b/internal/adapter/server/authn_test.go index ce73181ab5..de9749dc96 100644 --- a/internal/adapter/server/authn_test.go +++ b/internal/adapter/server/authn_test.go @@ -98,6 +98,85 @@ func TestGRPCAuthDisabledAllows(t *testing.T) { } } +func TestGRPCAuthRejectsDuplicateAuthorizationMetadata(t *testing.T) { + auth := server.NewAuthenticator(server.SecurityConfig{AuthToken: "secret"}) + for _, tc := range []struct { + name string + values []string + }{ + {name: "conflicting", values: []string{"Bearer secret", "Bearer wrong"}}, + {name: "both valid", values: []string{"Bearer secret", "Bearer secret"}}, + } { + t.Run(tc.name+" unary", func(t *testing.T) { + ctx := metadata.NewIncomingContext(context.Background(), metadata.Pairs( + "authorization", tc.values[0], "authorization", tc.values[1])) + called := false + _, err := auth.UnaryInterceptor()(ctx, nil, &grpc.UnaryServerInfo{}, func(context.Context, any) (any, error) { + called = true + return nil, nil + }) + if status.Code(err) != codes.Unauthenticated { + t.Fatalf("code = %v, want Unauthenticated", status.Code(err)) + } + if called { + t.Fatal("handler was called for duplicate authorization metadata") + } + }) + t.Run(tc.name+" stream", func(t *testing.T) { + ctx := metadata.NewIncomingContext(context.Background(), metadata.Pairs( + "authorization", tc.values[0], "authorization", tc.values[1])) + called := false + err := auth.StreamInterceptor()(nil, authTestStream{ctx: ctx}, &grpc.StreamServerInfo{}, func(any, grpc.ServerStream) error { + called = true + return nil + }) + if status.Code(err) != codes.Unauthenticated { + t.Fatalf("code = %v, want Unauthenticated", status.Code(err)) + } + if called { + t.Fatal("handler was called for duplicate authorization metadata") + } + }) + } +} + +func TestGRPCAuthRejectsDuplicateAuthorizationMetadataWithoutAuthConfig(t *testing.T) { + auth := server.NewAuthenticator(server.SecurityConfig{}) + ctx := metadata.NewIncomingContext(context.Background(), metadata.Pairs( + "authorization", "Bearer one", "authorization", "Bearer two")) + + called := false + _, err := auth.UnaryInterceptor()(ctx, nil, &grpc.UnaryServerInfo{}, func(context.Context, any) (any, error) { + called = true + return nil, nil + }) + if status.Code(err) != codes.Unauthenticated { + t.Fatalf("unary code = %v, want Unauthenticated", status.Code(err)) + } + if called { + t.Fatal("unary handler was called for duplicate authorization metadata without auth") + } + + called = false + err = auth.StreamInterceptor()(nil, authTestStream{ctx: ctx}, &grpc.StreamServerInfo{}, func(any, grpc.ServerStream) error { + called = true + return nil + }) + if status.Code(err) != codes.Unauthenticated { + t.Fatalf("stream code = %v, want Unauthenticated", status.Code(err)) + } + if called { + t.Fatal("stream handler was called for duplicate authorization metadata without auth") + } +} + +type authTestStream struct { + grpc.ServerStream + ctx context.Context +} + +func (s authTestStream) Context() context.Context { return s.ctx } + // --- gRPC rate limit --------------------------------------------------------- func TestGRPCRateLimit(t *testing.T) { diff --git a/internal/adapter/server/caller_identity_event_actor_test.go b/internal/adapter/server/caller_identity_event_actor_test.go new file mode 100644 index 0000000000..4f4eb56b15 --- /dev/null +++ b/internal/adapter/server/caller_identity_event_actor_test.go @@ -0,0 +1,372 @@ +package server_test + +import ( + "context" + "encoding/json" + "errors" + "io" + "iter" + "strings" + "testing" + "time" + + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/reflect/protoreflect" + + mecatlv1 "github.com/stacklok/mecatl/contracts/gen/go/mecatl/v1" + "github.com/stacklok/mecatl/engine/adapter/eventsource" + "github.com/stacklok/mecatl/engine/adapter/memfs" + "github.com/stacklok/mecatl/engine/adapter/memstore" + "github.com/stacklok/mecatl/engine/adapter/mockllm" + "github.com/stacklok/mecatl/engine/adapter/permpolicy" + "github.com/stacklok/mecatl/engine/agent" + "github.com/stacklok/mecatl/engine/port" + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/engine/tool" + "github.com/stacklok/mecatl/internal/adapter/server" +) + +// eventActorService builds a Service over the supplied EventLog whose engine runs +// ONE allowed read-only tool call and then answers — enough to produce a full +// lifecycle stream (session.init → turn.start → tool.call → tool.result → +// user_prompt → result) in the durable log without parking on an ask. The script +// carries FOUR such runs so one service can drive several sessions. +func eventActorService(t *testing.T, log port.EventLog) *server.Service { + t.Helper() + cat := tool.NewCatalog() + cat.MustRegister(&scriptTool{name: "Read", readOnly: true, content: "file body"}) + var turns []mockllm.Turn + for range 4 { + turns = append(turns, + mockllm.ToolCallTurn(call("c1", "Read", `{"path":"a.go"}`)), + mockllm.TextTurn("done"), + ) + } + llm := mockllm.New(turns...) + engine := agent.NewEngine(agent.Deps{ + LLM: llm, + Catalog: cat, + Policy: permpolicy.NewPolicy(allowRules(), nil), + Model: "test-model", + }) + svc, err := server.NewService(server.Config{ + Engine: engine, + Store: memstore.New(), + Workspaces: func(root string) tool.Workspace { return memfs.NewWorkspace(root) }, + Now: func() time.Time { return time.Unix(0, 0) }, + DefaultCapabilities: llm.Capabilities(), + EventLog: log, + }) + if err != nil { + t.Fatalf("new service: %v", err) + } + return svc +} + +// driveConverse runs one prompt over the gRPC Converse relay to EOF, returning the +// proto events the CLIENT saw (the wire projection). +func driveConverse(t *testing.T, svc *server.Service, id session.SessionID) []*mecatlv1.Event { + t.Helper() + client, cleanup := dialGRPC(t, svc) + defer cleanup() + return driveConverseOn(context.Background(), t, client, id) +} + +// driveConverseOn runs one prompt over an EXISTING Converse client on the given +// outgoing context (which may carry an Authorization bearer, so the server-side +// handler context carries the verified caller). It returns the proto events the +// client saw. +func driveConverseOn(callCtx context.Context, t *testing.T, client mecatlv1.HarnessServiceClient, id session.SessionID) []*mecatlv1.Event { + t.Helper() + ctx, cancel := context.WithTimeout(callCtx, 10*time.Second) + defer cancel() + stream, err := client.Converse(ctx) + if err != nil { + t.Fatalf("Converse: %v", err) + } + if err := stream.Send(&mecatlv1.ConverseRequest{ + Kind: &mecatlv1.ConverseRequest_Prompt{Prompt: &mecatlv1.Prompt{SessionId: string(id), Text: "go"}}, + }); err != nil { + t.Fatalf("Send prompt: %v", err) + } + _ = stream.CloseSend() + var out []*mecatlv1.Event + for { + resp, rerr := stream.Recv() + if errors.Is(rerr, io.EOF) { + break + } + if rerr != nil { + t.Fatalf("Recv: %v", rerr) + } + out = append(out, resp.GetEvent()) + } + return out +} + +// TestCallerIdentity_Scenario4_EventActorStampedAtAppendOnly pins AC4.1: an +// appended event is attributed to the caller who ACTED — read from the CONTEXT +// PRINCIPAL, never from the session's owner — and the STAMP HAPPENS ONLY AT +// appendEvent (the loop-side emit leaves Actor nil). +// +// Three halves, all over sessions OWNED BY ALICE: +// - Alice drives her own session: owner and actor coincide (the single-caller +// deployment, where the distinction is invisible); +// - BOB drives Alice's session — which this phase PERMITS, since it ships no +// authorization — and every logged event must name BOB while the session's +// owner stays Alice. Stamping from the loaded session's owner puts Alice on +// Bob's actions: repudiation in both directions, worst on the approval record; +// - a session driven through Service.StartRunContent and drained DIRECTLY +// (bypassing the relay, so appendEvent never runs) → every event the loop +// emitted carries a nil Actor. +// +// MUTATION-KILL: stamping in the loop (any e.emit site) makes the direct-drain half +// fail; dropping the appendEvent stamp makes the log halves fail; reading the +// session owner instead of the context principal makes the divergent half fail. +func TestCallerIdentity_Scenario4_EventActorStampedAtAppendOnly(t *testing.T) { + ctx := session.WithPrincipal(context.Background(), alice) + log := memstore.NewEventLog() + svc := eventActorService(t, log) + + // A wired verifier is what puts a caller on the handler context; the two + // bearers below are the two callers. + auth := server.NewAuthenticator(server.SecurityConfig{Validator: fakeValidator{ok: map[string]session.Principal{ + "alice-tok": *alice, + "bob-tok": *bob, + }}}) + client, cleanup := dialGRPCSecure(t, svc, auth) + defer cleanup() + + newAliceSession := func() *session.Session { + t.Helper() + s, err := svc.CreateSession(ctx, "/ws", session.ModeDefault, session.Limits{MaxTurns: 4}) + if err != nil { + t.Fatalf("CreateSession: %v", err) + } + if got := ownerOf(s.Owner); got != *alice { + t.Fatalf("fixture session owner = %+v, want %+v", got, *alice) + } + return s + } + + assertActor := func(id session.SessionID, want *session.Principal) { + t.Helper() + logged := readEventLog(t, log, id) + if len(logged) == 0 { + t.Fatalf("no events recorded in the durable log for %q", id) + } + for i, ev := range logged { + if ev.Actor == nil { + t.Fatalf("logged[%d] (%s): Actor is nil, want %q — appendEvent must stamp the acting caller", i, ev.Type, want.Subject) + } + if *ev.Actor != *want { + t.Fatalf("logged[%d] (%s): Actor = %+v, want %+v (the ACTING caller, not the session owner)", i, ev.Type, *ev.Actor, *want) + } + } + } + + // (a) Alice acts on her own session. + own := newAliceSession() + driveConverseOn(bearerCtx(context.Background(), "alice-tok"), t, client, own.ID) + assertActor(own.ID, alice) + + // (b) BOB acts on ALICE's session — the case the owner-derived stamp got wrong. + shared := newAliceSession() + driveConverseOn(bearerCtx(context.Background(), "bob-tok"), t, client, shared.ID) + assertActor(shared.ID, bob) + // The OWNER is untouched: the session is still Alice's ("whose is this?"), + // only the events name who acted ("who did this?"). + loaded, err := svc.GetSession(context.Background(), shared.ID) + if err != nil { + t.Fatalf("GetSession: %v", err) + } + if got := ownerOf(loaded.Owner); got != *alice { + t.Fatalf("session owner after Bob's run = %+v, want %+v (the actor must not rewrite ownership)", got, *alice) + } + + // (c) The loop half: a session drained straight off Run.Events() so no relay + // (and therefore no appendEvent) is involved. + direct, err := svc.CreateSession(ctx, "/ws", session.ModeDefault, session.Limits{MaxTurns: 4}) + if err != nil { + t.Fatalf("CreateSession (direct): %v", err) + } + if got := ownerOf(direct.Owner); got != *alice { + t.Fatalf("direct session owner = %+v, want %+v (the fixture must be owned, or the nil-Actor half is vacuous)", got, *alice) + } + run, err := svc.StartRunContent(context.Background(), direct.ID, "go", nil) + if err != nil { + t.Fatalf("StartRunContent: %v", err) + } + emitted := 0 + for ev := range run.Events() { + emitted++ + if ev.Actor != nil { + t.Fatalf("loop-emitted %s carries Actor=%+v: the loop is storage-agnostic and must never stamp it (only appendEvent does)", ev.Type, *ev.Actor) + } + } + svc.FinishRun(direct.ID, run) + if emitted == 0 { + t.Fatalf("the direct run emitted no events; the nil-Actor half is vacuous") + } +} + +// TestCallerIdentity_Scenario4_EventActorLogOnly pins AC4.2: the actor annotation +// is LOG-ONLY. It does not reach the client wire (the proto Event has no principal +// field, and no relayed event carries Alice's identity), and it does not perturb +// event-sourced rehydration (eventsource.Fold ignores Actor: a stream carrying +// Bob's actor folds to a session identical to the same stream without it, and the +// fold never derives an owner from it — the folded session keeps whatever owner its +// caller restored from the snapshot). +func TestCallerIdentity_Scenario4_EventActorLogOnly(t *testing.T) { + // --- half 1: not on the client wire ------------------------------------- + ctx := session.WithPrincipal(context.Background(), alice) + log := memstore.NewEventLog() + svc := eventActorService(t, log) + sess, err := svc.CreateSession(ctx, "/ws", session.ModeDefault, session.Limits{MaxTurns: 4}) + if err != nil { + t.Fatalf("CreateSession: %v", err) + } + auth := server.NewAuthenticator(server.SecurityConfig{Validator: fakeValidator{ok: map[string]session.Principal{"alice-tok": *alice}}}) + client, cleanup := dialGRPCSecure(t, svc, auth) + defer cleanup() + wire := driveConverseOn(bearerCtx(context.Background(), "alice-tok"), t, client, sess.ID) + if len(wire) == 0 { + t.Fatalf("no events on the client wire; the omission half is vacuous") + } + // The log DID stamp them (so this is an omission at the wire, not a missing stamp). + if logged := readEventLog(t, log, sess.ID); len(logged) == 0 || logged[0].Actor == nil { + t.Fatalf("durable log must carry the actor (otherwise the wire-omission assertion is vacuous)") + } + for i, ev := range wire { + blob, merr := protojson.Marshal(ev) + if merr != nil { + t.Fatalf("marshal wire event: %v", merr) + } + if strings.Contains(string(blob), alice.Subject) || strings.Contains(string(blob), alice.Issuer) { + t.Fatalf("wire[%d] (%s) leaks the actor identity: %s", i, ev.GetType(), blob) + } + } + // Structural: the proto Event message carries NO principal-bearing field at all, + // so toProto has nothing to map. This fails the moment someone adds one. + assertNoPrincipalField(t, (&mecatlv1.Event{}).ProtoReflect().Descriptor()) + + // --- half 2: the fold ignores it ---------------------------------------- + base := []session.Event{ + {Type: session.EvSessionInit}, + {Type: session.EvUserPrompt, Turn: 0, UserPrompt: &session.UserPromptPayload{Text: "go"}}, + {Type: session.EvTurnStart, Turn: 0}, + {Type: session.EvMessageDelta, Turn: 0, Text: "all done"}, + {Type: session.EvResult, Turn: 0, Result: &session.ResultPayload{Stop: session.StopEndTurn}}, + } + stamped := make([]session.Event, len(base)) + copy(stamped, base) + for i := range stamped { + stamped[i].Actor = bob // a DIFFERENT principal than the snapshot owner + } + meta := eventsource.SessionMeta{ + ID: "s-fold", Mode: session.ModeDefault, Workspace: "/ws", CreatedAt: time.Unix(0, 0), + } + plain, err := eventsource.Fold(meta, evSeq(base)) + if err != nil { + t.Fatalf("Fold (no actor): %v", err) + } + withActor, err := eventsource.Fold(meta, evSeq(stamped)) + if err != nil { + t.Fatalf("Fold (actor-stamped): %v", err) + } + if withActor.Owner != nil { + t.Fatalf("Fold derived an owner (%+v) from Event.Actor; the annotation is log-only and must never be a reconstruction input", *withActor.Owner) + } + if a, b := mustJSON(t, plain), mustJSON(t, withActor); a != b { + t.Fatalf("Event.Actor perturbed the fold:\n without = %s\n with = %s", a, b) + } + // The folded session keeps the owner its caller restores from the snapshot: the + // fold neither requires nor overwrites it. + if err := withActor.RestoreLabels(alice, ""); err != nil { + t.Fatalf("RestoreLabels on a folded session: %v", err) + } + if got := ownerOf(withActor.Owner); got != *alice { + t.Fatalf("folded session owner = %+v, want the snapshot-restored %+v", got, *alice) + } +} + +// TestCallerIdentity_Scenario4_OwnerlessEventActorAbsent pins AC4.5: with NO +// VERIFIED CALLER on the context, an appended event records a NIL actor — never a +// fabricated one. Both no-caller shapes are covered: +// +// - the unauthenticated path over a pre-ship, ownerless session; +// - an OWNED session driven with no caller on the context, which additionally +// proves the stamp reads the CONTEXT and not the owner: an owner-derived stamp +// would name Alice here even though nobody verified acted. +func TestCallerIdentity_Scenario4_OwnerlessEventActorAbsent(t *testing.T) { + log := memstore.NewEventLog() + svc := eventActorService(t, log) + // No principal in the context: the pre-ship / no-auth path. + sess, err := svc.CreateSession(context.Background(), "/ws", session.ModeDefault, session.Limits{MaxTurns: 4}) + if err != nil { + t.Fatalf("CreateSession: %v", err) + } + if sess.Owner != nil { + t.Fatalf("fixture session must be ownerless, got owner %+v", *sess.Owner) + } + driveConverse(t, svc, sess.ID) + + // An OWNED session driven with no verified caller on the context. + owned, err := svc.CreateSession(session.WithPrincipal(context.Background(), alice), "/ws", session.ModeDefault, session.Limits{MaxTurns: 4}) + if err != nil { + t.Fatalf("CreateSession (owned): %v", err) + } + if got := ownerOf(owned.Owner); got != *alice { + t.Fatalf("owned fixture session owner = %+v, want %+v", got, *alice) + } + driveConverse(t, svc, owned.ID) + + for _, id := range []session.SessionID{sess.ID, owned.ID} { + logged := readEventLog(t, log, id) + if len(logged) == 0 { + t.Fatalf("no events recorded for session %q", id) + } + for i, ev := range logged { + if ev.Actor != nil { + t.Fatalf("logged[%d] (%s) of %q: no verified caller acted, yet the actor is %+v; absence must stay absent", i, ev.Type, id, *ev.Actor) + } + } + } +} + +// assertNoPrincipalField fails if md carries any field named "actor"/"principal" +// or any field whose message type is mecatl.v1.Principal. +func assertNoPrincipalField(t *testing.T, md protoreflect.MessageDescriptor) { + t.Helper() + fields := md.Fields() + for i := 0; i < fields.Len(); i++ { + f := fields.Get(i) + if f.Name() == "actor" || f.Name() == "principal" { + t.Fatalf("%s.%s exists: the event actor is LOG-ONLY and must not reach the client wire", md.FullName(), f.Name()) + } + if f.Kind() == protoreflect.MessageKind && f.Message().FullName() == "mecatl.v1.Principal" { + t.Fatalf("%s.%s is a mecatl.v1.Principal: the event actor is LOG-ONLY and must not reach the client wire", md.FullName(), f.Name()) + } + } +} + +// evSeq adapts a slice of events to the iterator Fold consumes. +func evSeq(evs []session.Event) iter.Seq2[session.Event, error] { + return func(yield func(session.Event, error) bool) { + for _, ev := range evs { + if !yield(ev, nil) { + return + } + } + } +} + +// mustJSON serializes v for a structural equality comparison. +func mustJSON(t *testing.T, v any) string { + t.Helper() + b, err := json.Marshal(v) + if err != nil { + t.Fatalf("marshal: %v", err) + } + return string(b) +} diff --git a/internal/adapter/server/caller_identity_owner_test.go b/internal/adapter/server/caller_identity_owner_test.go new file mode 100644 index 0000000000..e3a6acf6cf --- /dev/null +++ b/internal/adapter/server/caller_identity_owner_test.go @@ -0,0 +1,550 @@ +package server_test + +import ( + "context" + "sync/atomic" + "testing" + "time" + + "github.com/stacklok/mecatl/engine/adapter/memfs" + "github.com/stacklok/mecatl/engine/adapter/memstore" + "github.com/stacklok/mecatl/engine/adapter/mockllm" + "github.com/stacklok/mecatl/engine/adapter/permpolicy" + "github.com/stacklok/mecatl/engine/agent" + "github.com/stacklok/mecatl/engine/port" + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/engine/tool" + "github.com/stacklok/mecatl/internal/adapter/server" + "github.com/stacklok/mecatl/internal/adapter/store/jsonlstore" +) + +// alice and bob are the two verified principals the Scenario 3 tests use. They +// differ in BOTH halves of the identity pair (issuer + subject), so a test that +// accidentally compares only `sub` still distinguishes them. +var ( + alice = &session.Principal{Issuer: "https://idp.example/alice-realm", Subject: "alice", GrantType: session.GrantTypeUser, Name: "Alice"} + bob = &session.Principal{Issuer: "https://idp.example/bob-realm", Subject: "bob", GrantType: session.GrantTypeUser, Name: "Bob"} +) + +// ownerOf is the assertion helper: it reports the session/row owner as a +// comparable value, treating nil as "unowned" without dereferencing. +func ownerOf(p *session.Principal) session.Principal { + if p == nil { + return session.Principal{} + } + return *p +} + +// rowFor returns the ListSessions row for id, or fails. +func rowFor(t *testing.T, rows []server.SessionSummary, id session.SessionID) server.SessionSummary { + t.Helper() + for _, r := range rows { + if r.SessionID == string(id) { + return r + } + } + t.Fatalf("no ListSessions row for %q (rows: %+v)", id, rows) + return server.SessionSummary{} +} + +// TestCallerIdentity_Scenario3_OwnerRecordedAndListed pins AC3.1: a session +// created under a verified principal records that principal as its owner — on +// the returned aggregate, on the persisted snapshot re-Loaded from the store, +// and on the ListSessions row. The row is asserted on BOTH listing paths in ONE +// test (jsonlstore implements port.MetaLister → the cheap fast path that skips +// Load; memstore does not → the Load-per-row slow path), because an +// empty-on-fast-path divergence is the recurring per-path bug class this AC +// names. +func TestCallerIdentity_Scenario3_OwnerRecordedAndListed(t *testing.T) { + ctx := session.WithPrincipal(context.Background(), alice) + + stores := map[string]func(t *testing.T) port.SessionStore{ + "MetaLister fast path (jsonlstore)": func(t *testing.T) port.SessionStore { + st, err := jsonlstore.New(t.TempDir()) + if err != nil { + t.Fatalf("jsonlstore: %v", err) + } + return st + }, + "Load-per-row slow path (memstore)": func(*testing.T) port.SessionStore { + return memstore.New() + }, + } + + for name, mk := range stores { + t.Run(name, func(t *testing.T) { + store := mk(t) + svc := newServiceWithStore(t, store) + + sess, err := svc.CreateSession(ctx, "/ws", session.ModeDefault, session.Limits{MaxTurns: 3}) + if err != nil { + t.Fatalf("CreateSession: %v", err) + } + if got := ownerOf(sess.Owner); got != *alice { + t.Fatalf("created session owner = %+v, want %+v", got, *alice) + } + + // The persisted snapshot names her: re-Load straight from the store + // (not the Service cache) so this is the durable record, not memory. + loaded, err := store.Load(ctx, sess.ID) + if err != nil { + t.Fatalf("store.Load: %v", err) + } + if got := ownerOf(loaded.Owner); got != *alice { + t.Errorf("persisted snapshot owner = %+v, want %+v", got, *alice) + } + + rows, err := svc.ListSessions(ctx) + if err != nil { + t.Fatalf("ListSessions: %v", err) + } + if got := ownerOf(rowFor(t, rows, sess.ID).Owner); got != *alice { + t.Errorf("ListSessions row owner = %+v, want %+v", got, *alice) + } + }) + } +} + +// TestCallerIdentity_Scenario3_OwnerSurvivesReopenRestart pins AC3.2: the owner +// survives reopen (a second prompt on a completed session), interrupt, recover, +// a process restart (two Services over the SAME store — the two-Build pattern), +// AND a rehydrateSession per-session engine rebuild (a persisted selector +// session whose engine died with the process). +func TestCallerIdentity_Scenario3_OwnerSurvivesReopenRestart(t *testing.T) { + ctx := session.WithPrincipal(context.Background(), alice) + store := memstore.New() + + sel := server.ProviderSelector{ProviderID: "openrouter", ModelID: "anthropic/claude-3.5-sonnet"} + var ( + gotSel atomic.Value + calls atomic.Int32 + ) + svc1 := selectorServiceOverStore(t, store, selectorRecordingFactory("PRE-RESTART", &gotSel, &calls), nil) + + sess, err := svc1.CreateSessionWithProvider(ctx, "/work/owned", session.ModeDefault, session.Limits{}, sel) + if err != nil { + t.Fatalf("CreateSessionWithProvider: %v", err) + } + + // Turn 1 completes the session; turn 2 goes through loadAndReopen (the + // completed → Reopen run-entry seam). + for _, prompt := range []string{"first turn", "second turn (reopen)"} { + run, rerr := svc1.StartRun(ctx, sess.ID, prompt) + if rerr != nil { + t.Fatalf("StartRun %q: %v", prompt, rerr) + } + drainServerRun(run) + } + after, err := store.Load(ctx, sess.ID) + if err != nil { + t.Fatalf("store.Load after reopen: %v", err) + } + if got := ownerOf(after.Owner); got != *alice { + t.Errorf("owner after reopen = %+v, want %+v", got, *alice) + } + + // Interrupt and Recover are the other two run-entry recovery seams; both + // preserve the owner (they are aggregate transitions, not re-labellings). + for _, tc := range []struct { + name string + to func(*session.Session) error + }{ + {"interrupt", func(s *session.Session) error { + if err := s.BeginTurn(); err != nil { + return err + } + if err := s.Cancel(); err != nil { + return err + } + return s.Interrupt() + }}, + {"recover", func(s *session.Session) error { + if err := s.BeginTurn(); err != nil { + return err + } + if err := s.Fail(); err != nil { + return err + } + return s.Recover() + }}, + } { + t.Run(tc.name, func(t *testing.T) { + s, lerr := store.Load(ctx, sess.ID) + if lerr != nil { + t.Fatalf("store.Load: %v", lerr) + } + if terr := tc.to(s); terr != nil { + t.Fatalf("%s transition: %v", tc.name, terr) + } + if got := ownerOf(s.Owner); got != *alice { + t.Errorf("owner after %s = %+v, want %+v", tc.name, got, *alice) + } + }) + } + + // Process restart: a NEW Service over the SAME store, empty registries. The + // run-entry seam rehydrates the per-session engine from the persisted + // selector; the owner comes back off the snapshot, unchanged. + var ( + gotSel2 atomic.Value + calls2 atomic.Int32 + ) + svc2 := selectorServiceOverStore(t, store, selectorRecordingFactory("REHYDRATED", &gotSel2, &calls2), nil) + run2, err := svc2.StartRunContent(ctx, sess.ID, "post-restart turn", nil) + if err != nil { + t.Fatalf("StartRunContent (post-restart): %v", err) + } + drainServerRun(run2) + if calls2.Load() == 0 { + t.Fatal("rehydrateSession never rebuilt the per-session engine; the AC's rehydrate arm is vacuous") + } + restored, err := svc2.GetSession(ctx, sess.ID) + if err != nil { + t.Fatalf("GetSession after restart: %v", err) + } + if got := ownerOf(restored.Owner); got != *alice { + t.Errorf("owner after restart+rehydrate = %+v, want %+v", got, *alice) + } +} + +// TestCallerIdentity_Scenario3_ForkInheritsSourceOwner pins AC3.3 at the +// service layer: a session forked from a source (WithSourceSession, the +// model-switch carryover fork) carries the SOURCE's owner, not the forking +// caller's — otherwise fork is an ownership-laundering path (Bob forks Alice's +// session and the copy becomes his). The engine-side child half (a subagent +// child inheriting the parent session's owner) is pinned by the same-named test +// in engine/agent. +func TestCallerIdentity_Scenario3_ForkInheritsSourceOwner(t *testing.T) { + store := memstore.New() + svc := newServiceWithStore(t, store) + + src, err := svc.CreateSession(session.WithPrincipal(context.Background(), alice), "/ws", session.ModeDefault, session.Limits{MaxTurns: 3}) + if err != nil { + t.Fatalf("CreateSession (source): %v", err) + } + + // Bob forks Alice's session. The fork must NOT be attributed to Bob. + forked, err := svc.CreateSessionWithProfile( + session.WithPrincipal(context.Background(), bob), + "/ws", session.ModeDefault, session.Limits{MaxTurns: 3}, + server.ProviderSelector{}, server.ProfileDefault, + server.WithSourceSession(src.ID), + ) + if err != nil { + t.Fatalf("CreateSessionWithProfile WithSourceSession: %v", err) + } + if got := ownerOf(forked.Owner); got != *alice { + t.Fatalf("forked session owner = %+v, want the SOURCE's owner %+v (fork must not launder ownership to its caller)", got, *alice) + } + loaded, err := store.Load(context.Background(), forked.ID) + if err != nil { + t.Fatalf("store.Load(fork): %v", err) + } + if got := ownerOf(loaded.Owner); got != *alice { + t.Errorf("persisted fork owner = %+v, want %+v", got, *alice) + } + + // The explicit ForkSession seam is the other fork path — same rule: Bob + // forking Alice's session produces one owned by ALICE. + forkID, err := svc.ForkSession(session.WithPrincipal(context.Background(), bob), src.ID, "", "") + if err != nil { + t.Fatalf("ForkSession: %v", err) + } + forkSess, err := store.Load(context.Background(), forkID) + if err != nil { + t.Fatalf("store.Load(ForkSession): %v", err) + } + if got := ownerOf(forkSess.Owner); got != *alice { + t.Errorf("ForkSession owner = %+v, want the SOURCE's owner %+v", got, *alice) + } + + // An OWNERLESS source yields an ownerless fork — never the caller's, never a + // fabricated one (the no-auth path must stay byte-identical). + plain, err := svc.CreateSession(context.Background(), "/ws", session.ModeDefault, session.Limits{MaxTurns: 3}) + if err != nil { + t.Fatalf("CreateSession (ownerless source): %v", err) + } + forkedPlain, err := svc.CreateSessionWithProfile( + session.WithPrincipal(context.Background(), bob), + "/ws", session.ModeDefault, session.Limits{MaxTurns: 3}, + server.ProviderSelector{}, server.ProfileDefault, + server.WithSourceSession(plain.ID), + ) + if err != nil { + t.Fatalf("CreateSessionWithProfile WithSourceSession (ownerless): %v", err) + } + if forkedPlain.Owner != nil { + t.Errorf("fork of an OWNERLESS source got owner %+v, want nil (never fabricated, never the caller's)", *forkedPlain.Owner) + } +} + +// TestCallerIdentity_Scenario3_WithOwnerBeatsContextPrincipal pins the +// scheduler's owner-injection seam (task 06's consumer): an explicit WithOwner +// option overrides the context principal, and no option keeps the context +// principal (the byte-identical default). +func TestCallerIdentity_Scenario3_WithOwnerBeatsContextPrincipal(t *testing.T) { + svc := newServiceWithStore(t, memstore.New()) + ctx := session.WithPrincipal(context.Background(), bob) + + sess, err := svc.CreateSessionWithProfile(ctx, "/ws", session.ModeDefault, session.Limits{}, + server.ProviderSelector{}, server.ProfileDefault, server.WithOwner(alice)) + if err != nil { + t.Fatalf("CreateSessionWithProfile WithOwner: %v", err) + } + if got := ownerOf(sess.Owner); got != *alice { + t.Errorf("owner = %+v, want the explicit WithOwner principal %+v", got, *alice) + } + + // WithOwner(nil) is the explicit ownerless injection: it must not fall back + // to the context principal (a system caller with no owner to capture). + none, err := svc.CreateSessionWithProfile(ctx, "/ws", session.ModeDefault, session.Limits{}, + server.ProviderSelector{}, server.ProfileDefault, server.WithOwner(nil)) + if err != nil { + t.Fatalf("CreateSessionWithProfile WithOwner(nil): %v", err) + } + if none.Owner != nil { + t.Errorf("WithOwner(nil) owner = %+v, want nil", *none.Owner) + } +} + +// TestCallerIdentity_Scenario3_PreShipSessionNeverBackfilled pins AC3.4: a +// session persisted BEFORE this plan (no owner in its snapshot) stays ownerless +// no matter who touches it — it is never adopted by the first caller to load, +// run, or list it. The pre-ship snapshot is simulated the only honest way: a +// session persisted with no principal in the context at all. +func TestCallerIdentity_Scenario3_PreShipSessionNeverBackfilled(t *testing.T) { + store := memstore.New() + svc := newServiceWithEngineOverStore(t, store, mockllm.New(mockllm.TextTurn("ok"), mockllm.TextTurn("ok"))) + + // "Pre-ship": created with NO principal in the context. + sess, err := svc.CreateSession(context.Background(), "/ws", session.ModeDefault, session.Limits{MaxTurns: 3}) + if err != nil { + t.Fatalf("CreateSession: %v", err) + } + if sess.Owner != nil { + t.Fatalf("pre-ship session created with owner %+v, want nil", *sess.Owner) + } + + // Bob now touches it every way the service allows: a run through the + // run-entry funnel, a GetSession, and a listing. + bobCtx := session.WithPrincipal(context.Background(), bob) + run, err := svc.StartRunContent(bobCtx, sess.ID, "bob's prompt", nil) + if err != nil { + t.Fatalf("StartRunContent: %v", err) + } + drainServerRun(run) + if _, err := svc.GetSession(bobCtx, sess.ID); err != nil { + t.Fatalf("GetSession: %v", err) + } + rows, err := svc.ListSessions(bobCtx) + if err != nil { + t.Fatalf("ListSessions: %v", err) + } + + if got := rowFor(t, rows, sess.ID); got.Owner != nil { + t.Errorf("ListSessions row owner = %+v, want nil (an ownerless session renders as unowned, never adopted)", *got.Owner) + } + after, err := store.Load(context.Background(), sess.ID) + if err != nil { + t.Fatalf("store.Load: %v", err) + } + if after.Owner != nil { + t.Errorf("persisted owner after Bob ran the session = %+v, want nil (never backfilled)", *after.Owner) + } +} + +// TestCallerIdentity_Scenario3_ListRowOwnerIsDisplayOnly pins AC3.5: the owner +// on the list row is DISPLAY only. A request bearing Bob's principal still +// lists Alice's session — this plan accepts and threads identity, it does not +// enforce isolation (that is the isolation track's, #368). Asserted on BOTH +// listing paths so a filter cannot be smuggled into one of them. +func TestCallerIdentity_Scenario3_ListRowOwnerIsDisplayOnly(t *testing.T) { + for name, mk := range map[string]func(t *testing.T) port.SessionStore{ + "MetaLister fast path (jsonlstore)": func(t *testing.T) port.SessionStore { + st, err := jsonlstore.New(t.TempDir()) + if err != nil { + t.Fatalf("jsonlstore: %v", err) + } + return st + }, + "Load-per-row slow path (memstore)": func(*testing.T) port.SessionStore { + return memstore.New() + }, + } { + t.Run(name, func(t *testing.T) { + store := mk(t) + svc := newServiceWithStore(t, store) + + aliceSess, err := svc.CreateSession(session.WithPrincipal(context.Background(), alice), "/ws", session.ModeDefault, session.Limits{}) + if err != nil { + t.Fatalf("CreateSession (alice): %v", err) + } + bobSess, err := svc.CreateSession(session.WithPrincipal(context.Background(), bob), "/ws", session.ModeDefault, session.Limits{}) + if err != nil { + t.Fatalf("CreateSession (bob): %v", err) + } + unowned, err := svc.CreateSession(context.Background(), "/ws", session.ModeDefault, session.Limits{}) + if err != nil { + t.Fatalf("CreateSession (unowned): %v", err) + } + + // Bob lists. He sees ALL three rows, each naming its own owner. + rows, err := svc.ListSessions(session.WithPrincipal(context.Background(), bob)) + if err != nil { + t.Fatalf("ListSessions: %v", err) + } + if len(rows) != 3 { + t.Fatalf("Bob's ListSessions returned %d rows, want 3 (display only — no filtering)", len(rows)) + } + if got := ownerOf(rowFor(t, rows, aliceSess.ID).Owner); got != *alice { + t.Errorf("Alice's row owner = %+v, want %+v", got, *alice) + } + if got := ownerOf(rowFor(t, rows, bobSess.ID).Owner); got != *bob { + t.Errorf("Bob's row owner = %+v, want %+v", got, *bob) + } + if r := rowFor(t, rows, unowned.ID); r.Owner != nil { + t.Errorf("unowned row owner = %+v, want nil", *r.Owner) + } + }) + } +} + +// liveSessionStore is a SessionStore whose Load hands back the SAME +// *session.Session on every call (a legal implementation — the port requires a +// reconstruction, not a fresh copy per Load; a caching or in-process store looks +// exactly like this). It is the fixture that makes an aliasing bug in a +// Load-per-row consumer OBSERVABLE: a consumer that hands a caller a live +// pointer into the loaded session lets that caller corrupt the store. +type liveSessionStore struct { + sessions map[session.SessionID]*session.Session + saved []port.StoredSession + now time.Time +} + +func (s *liveSessionStore) Save(_ context.Context, sess *session.Session) error { + if s.sessions == nil { + s.sessions = map[session.SessionID]*session.Session{} + } + if _, ok := s.sessions[sess.ID]; !ok { + s.saved = append(s.saved, port.StoredSession{ID: sess.ID, ModifiedAt: s.now}) + } + s.sessions[sess.ID] = sess + return nil +} + +func (s *liveSessionStore) Load(_ context.Context, id session.SessionID) (*session.Session, error) { + sess, ok := s.sessions[id] + if !ok { + return nil, port.ErrSessionNotFound + } + return sess, nil +} + +func (s *liveSessionStore) List(_ context.Context) ([]port.StoredSession, error) { + return s.saved, nil +} + +// Delete completes port.PrunableStore, which is what ListSessions type-asserts +// for on the Load-per-row path. +func (s *liveSessionStore) Delete(_ context.Context, id session.SessionID) error { + delete(s.sessions, id) + return nil +} + +// TestListSessionsRowOwnerIsNotAliased pins the copy half of AC3.5: a +// ListSessions row's owner is a COPY, not a live pointer into the loaded +// session. Handing out the live pointer lets any consumer of the row (a mapper, +// a UI, a later plan's isolation check) rewrite the session's recorded owner — +// the aliasing class the shared Principal.Clone exists to close. +func TestListSessionsRowOwnerIsNotAliased(t *testing.T) { + store := &liveSessionStore{now: time.Unix(0, 0)} + svc := newServiceWithStore(t, store) + + sess, err := svc.CreateSession(session.WithPrincipal(context.Background(), alice), "/ws", session.ModeDefault, session.Limits{}) + if err != nil { + t.Fatalf("CreateSession: %v", err) + } + + rows, err := svc.ListSessions(context.Background()) + if err != nil { + t.Fatalf("ListSessions: %v", err) + } + row := rowFor(t, rows, sess.ID) + if row.Owner == nil { + t.Fatal("row owner is nil; the fixture did not exercise the Load-per-row path") + } + row.Owner.Subject = "attacker" + + stored, err := store.Load(context.Background(), sess.ID) + if err != nil { + t.Fatalf("store.Load: %v", err) + } + if got := ownerOf(stored.Owner); got != *alice { + t.Fatalf("mutating the list row rewrote the session's owner: got %+v, want %+v", got, *alice) + } + rows2, err := svc.ListSessions(context.Background()) + if err != nil { + t.Fatalf("second ListSessions: %v", err) + } + if got := ownerOf(rowFor(t, rows2, sess.ID).Owner); got != *alice { + t.Fatalf("second listing owner = %+v, want %+v", got, *alice) + } +} + +type stableOwnerMetaStore struct { + owner *session.Principal +} + +func (*stableOwnerMetaStore) Save(context.Context, *session.Session) error { return nil } +func (*stableOwnerMetaStore) Load(context.Context, session.SessionID) (*session.Session, error) { + return nil, port.ErrSessionNotFound +} +func (s *stableOwnerMetaStore) MetaList(context.Context) ([]port.SessionMeta, error) { + return []port.SessionMeta{{ID: "meta-session", Owner: s.owner}}, nil +} + +func TestMetaListerRowOwnerIsNotAliased(t *testing.T) { + stable := &session.Principal{Issuer: alice.Issuer, Subject: alice.Subject, GrantType: alice.GrantType, Name: alice.Name} + store := &stableOwnerMetaStore{owner: stable} + svc := newServiceWithStore(t, store) + + rows, err := svc.ListSessions(context.Background()) + if err != nil { + t.Fatalf("ListSessions: %v", err) + } + row := rowFor(t, rows, "meta-session") + if row.Owner == nil { + t.Fatal("row owner is nil; the fixture did not exercise the MetaLister path") + } + if row.Owner == stable { + t.Fatal("row owner aliases the MetaLister's stable owner pointer") + } + row.Owner.Subject = "attacker" + if got := ownerOf(stable); got != *alice { + t.Fatalf("mutating the list row rewrote the MetaLister owner: got %+v, want %+v", got, *alice) + } +} + +// newServiceWithEngineOverStore is newServiceWithStore with a scripted LLM, so a +// test can drive a real run through the run-entry funnel over a caller-supplied +// store. +func newServiceWithEngineOverStore(t *testing.T, store port.SessionStore, llm *mockllm.Provider) *server.Service { + t.Helper() + eng := agent.NewEngine(agent.Deps{ + LLM: llm, + Catalog: tool.NewCatalog(), + Policy: permpolicy.NewPolicy(permpolicy.AllowAllFloorRules(), nil), + Model: "test-model", + Store: store, + }) + svc, err := server.NewService(server.Config{ + Engine: eng, + Store: store, + Workspaces: func(root string) tool.Workspace { return memfs.NewWorkspace(root) }, + Now: func() time.Time { return time.Unix(0, 0) }, + }) + if err != nil { + t.Fatalf("NewService: %v", err) + } + return svc +} diff --git a/internal/adapter/server/caller_identity_test.go b/internal/adapter/server/caller_identity_test.go new file mode 100644 index 0000000000..e3fe6345d4 --- /dev/null +++ b/internal/adapter/server/caller_identity_test.go @@ -0,0 +1,946 @@ +package server_test + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/http/httptest" + "slices" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/status" + + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/internal/adapter/server" + "github.com/stacklok/mecatl/internal/syscaller" +) + +// --- the offline fake verifier ---------------------------------------------- +// +// Token VALIDATION (signature, alg, iss/aud/exp/nbf) is delegated to the +// validator behind server.PrincipalValidator (ADR 0100 decision 3) and is NOT +// mecatl's code — so the tests here script the seam rather than mint real JWTs. +// What is under test is mecatl's EDGE behaviour: a verified principal reaches +// the handler context, a rejection never falls through to the handler, a +// transient IdP outage is not a 401, and the limiter keys on (iss, sub). +type fakeValidator struct { + // ok maps a bearer string to the principal the validator vouches for. + ok map[string]session.Principal + // transient lists bearers whose validation fails because the JWKS endpoint + // is unreachable (an IdP outage, not a bad token). + transient map[string]bool +} + +func (f fakeValidator) Validate(_ context.Context, bearer string) (*session.Principal, error) { + if f.transient[bearer] { + return nil, fmt.Errorf("fetch jwks: dial tcp: connection refused: %w", server.ErrIdentityUnavailable) + } + if p, okv := f.ok[bearer]; okv { + return &p, nil + } + return nil, fmt.Errorf("token rejected: %w", server.ErrInvalidToken) +} + +type countingValidator struct { + fakeValidator + calls int +} + +func (v *countingValidator) Validate(ctx context.Context, bearer string) (*session.Principal, error) { + v.calls++ + return v.fakeValidator.Validate(ctx, bearer) +} + +type blockingInvalidValidator struct { + entered chan struct{} + release chan struct{} + calls atomic.Int32 + result *session.Principal + validBearer string +} + +func (v *blockingInvalidValidator) Validate(_ context.Context, bearer string) (*session.Principal, error) { + v.calls.Add(1) + v.entered <- struct{}{} + <-v.release + if v.validBearer != "" && bearer == v.validBearer { + return v.result, nil + } + return nil, server.ErrInvalidToken +} + +type contextValidator struct{} + +func (contextValidator) Validate(ctx context.Context, _ string) (*session.Principal, error) { + return nil, ctx.Err() +} + +// edgeAlice is the principal the good tokens below vouch for. Identity is the +// (iss, sub) PAIR — the tests assert both. +var edgeAlice = session.Principal{ + Issuer: "https://idp.example.com", + Subject: "alice", + GrantType: session.GrantTypeUser, + Name: "Alice Example", +} + +// oidcOnly builds an Authenticator with a wired verifier and NO static token — +// the OIDC deployment shape (AC1.4: identity does not ride authEnabled()). +func oidcOnly(t *testing.T, v fakeValidator, rate float64, burst int) *server.Authenticator { + t.Helper() + return server.NewAuthenticator(server.SecurityConfig{ + Validator: v, + RateLimit: rate, + RateBurst: burst, + }) +} + +// callUnary drives the gRPC unary interceptor with an Authorization bearer (when +// non-empty) and reports the handler context it saw (nil when the handler never +// ran) plus the interceptor error. +func callUnary(a *server.Authenticator, bearer string) (handlerCtx context.Context, err error) { + return callUnaryFrom(a, bearer, "") +} + +func callUnaryFrom(a *server.Authenticator, bearer, addr string) (handlerCtx context.Context, err error) { + return callUnaryContextFrom(context.Background(), a, bearer, addr) +} + +func callUnaryContextFrom(ctx context.Context, a *server.Authenticator, bearer, addr string) (handlerCtx context.Context, err error) { + if addr != "" { + ctx = peer.NewContext(ctx, &peer.Peer{Addr: testAddr(addr)}) + } + if bearer != "" { + ctx = metadata.NewIncomingContext(ctx, metadata.Pairs("authorization", "Bearer "+bearer)) + } + _, err = a.UnaryInterceptor()(ctx, nil, &grpc.UnaryServerInfo{FullMethod: "/mecatl.v1.HarnessService/CreateSession"}, + func(c context.Context, _ any) (any, error) { + handlerCtx = c + return nil, nil + }) + return handlerCtx, err +} + +type testAddr string + +func (testAddr) Network() string { return "tcp" } +func (a testAddr) String() string { return string(a) } + +// fakeServerStream is the minimal grpc.ServerStream the StreamInterceptor needs: +// it only ever reads Context() before delegating, and principalStream wraps it. +type fakeServerStream struct { + grpc.ServerStream + ctx context.Context +} + +func (s fakeServerStream) Context() context.Context { return s.ctx } + +// callStream drives the gRPC STREAM interceptor with an Authorization bearer +// (when non-empty) and reports the stream context the handler saw (nil when the +// handler never ran) plus the interceptor error. The StreamInterceptor has its +// own principalStream wrapping path, distinct from the unary one — so it needs +// its own coverage, not an inference from callUnary. +func callStream(a *server.Authenticator, bearer string) (handlerCtx context.Context, err error) { + return callStreamFrom(a, bearer, "") +} + +func callStreamFrom(a *server.Authenticator, bearer, addr string) (handlerCtx context.Context, err error) { + return callStreamContextFrom(context.Background(), a, bearer, addr) +} + +func callStreamContextFrom(ctx context.Context, a *server.Authenticator, bearer, addr string) (handlerCtx context.Context, err error) { + if addr != "" { + ctx = peer.NewContext(ctx, &peer.Peer{Addr: testAddr(addr)}) + } + if bearer != "" { + ctx = metadata.NewIncomingContext(ctx, metadata.Pairs("authorization", "Bearer "+bearer)) + } + err = a.StreamInterceptor()(nil, fakeServerStream{ctx: ctx}, + &grpc.StreamServerInfo{FullMethod: "/mecatl.v1.HarnessService/Converse"}, + func(_ any, ss grpc.ServerStream) error { + handlerCtx = ss.Context() + return nil + }) + return handlerCtx, err +} + +// callHTTP drives the HTTP middleware and reports the handler context it saw +// (nil when the handler never ran) plus the recorded response. +func callHTTP(a *server.Authenticator, bearer string) (handlerCtx context.Context, rec *httptest.ResponseRecorder) { + return callHTTPFrom(a, bearer, "10.0.0.1:34567", nil) +} + +func callHTTPFrom(a *server.Authenticator, bearer, remoteAddr string, headers http.Header) (handlerCtx context.Context, rec *httptest.ResponseRecorder) { + return callHTTPContextFrom(context.Background(), a, bearer, remoteAddr, headers) +} + +func callHTTPContextFrom(ctx context.Context, a *server.Authenticator, bearer, remoteAddr string, headers http.Header) (handlerCtx context.Context, rec *httptest.ResponseRecorder) { + req := httptest.NewRequest(http.MethodGet, "/v1/sessions", nil).WithContext(ctx) + if bearer != "" { + req.Header.Set("Authorization", "Bearer "+bearer) + } + if headers != nil { + req.Header = headers.Clone() + if bearer != "" { + req.Header.Set("Authorization", "Bearer "+bearer) + } + } + req.RemoteAddr = remoteAddr + rec = httptest.NewRecorder() + a.Middleware(http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) { + handlerCtx = r.Context() + })).ServeHTTP(rec, req) + return handlerCtx, rec +} + +// --- AC1.1 ------------------------------------------------------------------- + +// TestCallerIdentity_Scenario1_ValidTokenYieldsPrincipal pins AC1.1: with a +// verifier wired, a validated token yields the (iss, sub) principal on the +// handler's context, on BOTH surfaces. +func TestCallerIdentity_Scenario1_ValidTokenYieldsPrincipal(t *testing.T) { + t.Parallel() + + // One bearer per signature algorithm the validator accepts. The algorithm is + // the validator's business; what mecatl must do is identical for all three. + v := fakeValidator{ok: map[string]session.Principal{ + "tok-rs256": edgeAlice, + "tok-es256": edgeAlice, + "tok-ps256": edgeAlice, + }} + auth := oidcOnly(t, v, 0, 0) + + for _, tok := range []string{"tok-rs256", "tok-es256", "tok-ps256"} { + t.Run("grpc/"+tok, func(t *testing.T) { + ctx, err := callUnary(auth, tok) + if err != nil { + t.Fatalf("interceptor err = %v, want nil", err) + } + if ctx == nil { + t.Fatal("handler did not run") + } + got := session.PrincipalFromContext(ctx) + if got == nil { + t.Fatal("handler context carries no principal") + } + if *got != edgeAlice { + t.Fatalf("principal = %+v, want %+v", *got, edgeAlice) + } + }) + t.Run("http/"+tok, func(t *testing.T) { + ctx, rec := callHTTP(auth, tok) + if rec.Code != http.StatusOK { + t.Fatalf("status = %d, want 200", rec.Code) + } + if ctx == nil { + t.Fatal("handler did not run") + } + got := session.PrincipalFromContext(ctx) + if got == nil || *got != edgeAlice { + t.Fatalf("principal = %v, want %+v", got, edgeAlice) + } + }) + } +} + +// --- AC1.2 ------------------------------------------------------------------- + +// TestCallerIdentity_Scenario1_BadTokensRejected pins AC1.2: every rejected +// token — wrong issuer/audience, expired, nbf in the future, bad signature, +// alg=none, HS*-confused — and a non-JWT are clean 401-class errors, and the +// handler NEVER runs (there is no fallback branch letting the request through). +func TestCallerIdentity_Scenario1_BadTokensRejected(t *testing.T) { + t.Parallel() + + auth := oidcOnly(t, fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}}, 0, 0) + + bad := []string{ + "wrong-issuer", + "wrong-audience", + "expired", + "nbf-in-the-future", + "bad-signature", + "alg-none", + "hs256-confused", + "not.a.jwt at all", // malformed: a clean rejection, never a fallback + "", // no Authorization header at all + } + for _, tok := range bad { + t.Run("grpc/"+tok, func(t *testing.T) { + ctx, err := callUnary(auth, tok) + if code := status.Code(err); code != codes.Unauthenticated { + t.Fatalf("code = %v, want Unauthenticated (err=%v)", code, err) + } + if ctx != nil { + t.Fatal("handler RAN on a rejected token — fallback branch") + } + }) + t.Run("http/"+tok, func(t *testing.T) { + ctx, rec := callHTTP(auth, tok) + if rec.Code != http.StatusUnauthorized { + t.Fatalf("status = %d, want 401", rec.Code) + } + if ctx != nil { + t.Fatal("handler RAN on a rejected token — fallback branch") + } + }) + } +} + +// --- AC1.3 ------------------------------------------------------------------- + +// TestCallerIdentity_Scenario1_NoAuthByteIdentical pins AC1.3: with no verifier +// wired (and no static token), a request with no credentials is processed +// unauthenticated — the handler runs and sees a NIL principal. No user is +// invented (the ToolHive anonymous-middleware anti-pattern ADR 0100 rejects), +// and the response carries no auth challenge: the default no-token path (the +// TUI's) is unchanged. +func TestCallerIdentity_Scenario1_NoAuthByteIdentical(t *testing.T) { + t.Parallel() + + auth := server.NewAuthenticator(server.SecurityConfig{}) + + ctx, err := callUnary(auth, "") + if err != nil { + t.Fatalf("interceptor err = %v, want nil", err) + } + if ctx == nil { + t.Fatal("handler did not run") + } + if p := session.PrincipalFromContext(ctx); p != nil { + t.Fatalf("principal = %+v, want nil (no user may be invented)", *p) + } + + hctx, rec := callHTTP(auth, "") + if rec.Code != http.StatusOK { + t.Fatalf("status = %d, want 200", rec.Code) + } + if hctx == nil { + t.Fatal("handler did not run") + } + if p := session.PrincipalFromContext(hctx); p != nil { + t.Fatalf("principal = %+v, want nil", *p) + } + if got := rec.Header().Get("WWW-Authenticate"); got != "" { + t.Fatalf("WWW-Authenticate = %q, want empty (no challenge on the no-auth path)", got) + } + + // A bearer presented to a server with neither gate configured is ignored, + // not validated into a principal. + bctx, err := callUnary(auth, "whatever") + if err != nil { + t.Fatalf("interceptor err = %v, want nil", err) + } + if p := session.PrincipalFromContext(bctx); p != nil { + t.Fatalf("principal = %+v, want nil", *p) + } +} + +// --- AC1.4 ------------------------------------------------------------------- + +// TestCallerIdentity_Scenario1_IdentityPredicateIndependent pins AC1.4: the OIDC +// enable predicate is whether a verifier is wired, NOT authEnabled(). A +// shared-token deployment has one credential and zero subjects; an OIDC +// deployment has subjects and no static token. Neither trips the other's gate. +func TestCallerIdentity_Scenario1_IdentityPredicateIndependent(t *testing.T) { + t.Parallel() + + v := fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}} + + t.Run("static token only: authenticated, zero subjects", func(t *testing.T) { + auth := server.NewAuthenticator(server.SecurityConfig{AuthToken: "shared"}) + ctx, err := callUnary(auth, "shared") + if err != nil { + t.Fatalf("valid static token rejected: %v", err) + } + if p := session.PrincipalFromContext(ctx); p != nil { + t.Fatalf("static-token deployment invented a principal: %+v", *p) + } + // The static gate still bites; identity being off does not open it. + if _, err := callUnary(auth, "good"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("code = %v, want Unauthenticated", status.Code(err)) + } + }) + + t.Run("verifier only: subjects, no static token", func(t *testing.T) { + auth := oidcOnly(t, v, 0, 0) + ctx, err := callUnary(auth, "good") + if err != nil { + t.Fatalf("valid token rejected: %v", err) + } + if p := session.PrincipalFromContext(ctx); p == nil || *p != edgeAlice { + t.Fatalf("principal = %v, want %+v", p, edgeAlice) + } + // The identity gate bites with NO static token configured — proof it is + // not gated on authEnabled(). + if _, err := callUnary(auth, ""); status.Code(err) != codes.Unauthenticated { + t.Fatalf("no-token code = %v, want Unauthenticated", status.Code(err)) + } + }) +} + +// --- AC1.5 ------------------------------------------------------------------- + +// TestCallerIdentity_Scenario1_JWKSDownIsTransientNotUnauthorized pins AC1.5: a +// JWKS-unreachable condition is a transient 503-class signal, DISTINCT from a +// 401 bad token — an IdP outage must not be misread as an authn failure. +func TestCallerIdentity_Scenario1_JWKSDownIsTransientNotUnauthorized(t *testing.T) { + t.Parallel() + + auth := oidcOnly(t, fakeValidator{ + ok: map[string]session.Principal{"good": edgeAlice}, + transient: map[string]bool{"jwks-down": true}, + }, 0, 0) + + ctx, err := callUnary(auth, "jwks-down") + if code := status.Code(err); code != codes.Unavailable { + t.Fatalf("code = %v, want Unavailable (err=%v)", code, err) + } + if status.Code(err) == codes.Unauthenticated { + t.Fatal("IdP outage reported as an authn failure") + } + if ctx != nil { + t.Fatal("handler RAN while the IdP was unreachable") + } + + hctx, rec := callHTTP(auth, "jwks-down") + if rec.Code != http.StatusServiceUnavailable { + t.Fatalf("status = %d, want 503", rec.Code) + } + if hctx != nil { + t.Fatal("handler RAN while the IdP was unreachable") + } + + // The distinction is real: a genuinely bad token on the SAME authenticator + // is still a 401 / Unauthenticated. + if _, err := callUnary(auth, "rubbish"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("bad-token code = %v, want Unauthenticated", status.Code(err)) + } + if _, rec := callHTTP(auth, "rubbish"); rec.Code != http.StatusUnauthorized { + t.Fatalf("bad-token status = %d, want 401", rec.Code) + } +} + +// --- AC1.7 ------------------------------------------------------------------- + +// TestCallerIdentity_Scenario1_RateLimitKeyedOnPrincipal pins AC1.7: under OIDC +// the limiter keys on the validated (iss, sub), not the raw token — two +// different valid tokens for the same subject share one bucket, so rotating a +// token is not a limit bypass — and a REJECTED token is never keyed at all. +func TestCallerIdentity_Scenario1_RateLimitKeyedOnPrincipal(t *testing.T) { + t.Parallel() + + v := fakeValidator{ok: map[string]session.Principal{ + "alice-old": edgeAlice, + "alice-new": edgeAlice, // same subject, rotated credential + "bob": {Issuer: edgeAlice.Issuer, Subject: "bob", GrantType: session.GrantTypeUser}, + }} + + t.Run("rotation shares one bucket", func(t *testing.T) { + auth := oidcOnly(t, v, 1, 1) // 1 rps, burst 1 + if _, err := callUnary(auth, "alice-old"); err != nil { + t.Fatalf("first request err = %v, want nil", err) + } + _, err := callUnary(auth, "alice-new") + if code := status.Code(err); code != codes.ResourceExhausted { + t.Fatalf("rotated-token code = %v, want ResourceExhausted (token rotation bypassed the limit)", code) + } + + keys := auth.TrackedClientKeysForTest() + if len(keys) != 1 { + t.Fatalf("tracked keys = %v, want exactly one (iss,sub) bucket", keys) + } + for _, k := range keys { + for _, tok := range []string{"alice-old", "alice-new"} { + if strings.Contains(k, tok) { + t.Fatalf("limiter key %q embeds the raw token %q", k, tok) + } + } + if !strings.Contains(k, edgeAlice.Subject) || !strings.Contains(k, edgeAlice.Issuer) { + t.Fatalf("limiter key %q is not keyed on (iss, sub)", k) + } + } + }) + + t.Run("a different subject gets its own bucket", func(t *testing.T) { + auth := oidcOnly(t, v, 1, 1) + if _, err := callUnary(auth, "alice-old"); err != nil { + t.Fatalf("edgeAlice err = %v, want nil", err) + } + // bob is over the GLOBAL budget here (burst 1), but he must still land in + // his OWN bucket — two subjects never share one. + _, _ = callUnary(auth, "bob") + keys := auth.TrackedClientKeysForTest() + if len(keys) != 2 { + t.Fatalf("tracked keys = %v, want two distinct (iss,sub) buckets", keys) + } + if keys[0] == keys[1] { + t.Fatalf("tracked keys = %v, want distinct", keys) + } + }) + + t.Run("a rejected token is never keyed", func(t *testing.T) { + auth := oidcOnly(t, fakeValidator{ + ok: map[string]session.Principal{"good": edgeAlice}, + transient: map[string]bool{"jwks-down": true}, + }, 1, 1) + for _, tok := range []string{"nope", "also-nope", "jwks-down", ""} { + if _, err := callUnaryFrom(auth, tok, "10.0.0.1:1234"); err == nil { + t.Fatalf("token %q was accepted", tok) + } + } + if keys := auth.TrackedClientKeysForTest(); len(keys) != 0 { + t.Fatalf("tracked keys = %v, want none (a rejected token must not create a post-validation bucket)", keys) + } + // Rejections from one peer do not consume another peer's pre-validation + // budget or the good subject's post-validation budget. + if _, err := callUnaryFrom(auth, "good", "10.0.0.2:1234"); err != nil { + t.Fatalf("valid request after rejections err = %v, want nil", err) + } + if keys := auth.TrackedClientKeysForTest(); !slices.ContainsFunc(keys, func(k string) bool { + return strings.Contains(k, edgeAlice.Subject) + }) { + t.Fatalf("tracked keys = %v, want edgeAlice's bucket", keys) + } + }) +} + +func newLimitedOIDC(v server.PrincipalValidator) *server.Authenticator { + return server.NewAuthenticator(server.SecurityConfig{Validator: v, RateLimit: 0.0001, RateBurst: 1}) +} + +func TestCallerIdentityRejectedBearerLimitSerializesConcurrentValidation(t *testing.T) { + v := &blockingInvalidValidator{entered: make(chan struct{}, 1), release: make(chan struct{})} + var releaseOnce sync.Once + release := func() { releaseOnce.Do(func() { close(v.release) }) } + defer release() + auth := newLimitedOIDC(v) + + first := make(chan error, 1) + go func() { + _, err := callUnaryFrom(auth, "bad", "10.0.0.1:1000") + first <- err + }() + <-v.entered + + const concurrent = 4 + start := make(chan struct{}) + attempting := make(chan struct{}, concurrent) + results := make(chan error, concurrent) + var ready sync.WaitGroup + var done sync.WaitGroup + ready.Add(concurrent) + done.Add(concurrent) + for range concurrent { + go func() { + defer done.Done() + ready.Done() + <-start + attempting <- struct{}{} + _, err := callUnaryFrom(auth, "bad", "10.0.0.1:2000") + results <- err + }() + } + ready.Wait() + close(start) + for range concurrent { + <-attempting + } + + if got := v.calls.Load(); got != 1 { + t.Fatalf("validator calls while first validation is blocked = %d, want 1", got) + } + release() + if err := <-first; status.Code(err) != codes.Unauthenticated { + t.Fatalf("first request code = %v, want Unauthenticated", status.Code(err)) + } + done.Wait() + close(results) + for err := range results { + if status.Code(err) != codes.ResourceExhausted { + t.Fatalf("concurrent request code = %v, want ResourceExhausted", status.Code(err)) + } + } + if got := v.calls.Load(); got != 1 { + t.Fatalf("validator calls = %d, want exactly 1", got) + } +} + +func TestCallerIdentityValidationPreservesContextStatus(t *testing.T) { + auth := newLimitedOIDC(contextValidator{}) + for _, tc := range []struct { + name string + ctx context.Context + want codes.Code + call func(context.Context) error + }{ + { + name: "unary canceled", ctx: canceledContext(), want: codes.Canceled, + call: func(ctx context.Context) error { + _, err := callUnaryContextFrom(ctx, auth, "token", "10.0.0.1:1000") + return err + }, + }, + { + name: "stream deadline", ctx: expiredContext(), want: codes.DeadlineExceeded, + call: func(ctx context.Context) error { + _, err := callStreamContextFrom(ctx, auth, "token", "10.0.0.2:1000") + return err + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + if got := status.Code(tc.call(tc.ctx)); got != tc.want { + t.Fatalf("code = %v, want %v", got, tc.want) + } + }) + } +} + +func TestCallerIdentityHTTPValidationContextStatus(t *testing.T) { + auth := newLimitedOIDC(contextValidator{}) + for _, tc := range []struct { + name string + ctx context.Context + body string + }{ + {name: "canceled", ctx: canceledContext(), body: "request canceled"}, + {name: "deadline", ctx: expiredContext(), body: "request deadline exceeded"}, + } { + t.Run(tc.name, func(t *testing.T) { + _, rec := callHTTPContextFrom(tc.ctx, auth, "token", "10.0.0.1:1000", nil) + if rec.Code != http.StatusRequestTimeout { + t.Fatalf("status = %d, want 408", rec.Code) + } + if rec.Header().Get("WWW-Authenticate") != "" { + t.Fatal("context error set WWW-Authenticate") + } + if !strings.Contains(rec.Body.String(), tc.body) { + t.Fatalf("body = %q, want %q", rec.Body.String(), tc.body) + } + }) + } +} + +func TestCallerIdentityValidationGateHonorsWaitingContext(t *testing.T) { + result := edgeAlice + v := &blockingInvalidValidator{entered: make(chan struct{}, 1), release: make(chan struct{}), result: &result, validBearer: "good"} + var releaseOnce sync.Once + release := func() { releaseOnce.Do(func() { close(v.release) }) } + defer release() + auth := newLimitedOIDC(v) + + first := make(chan error, 1) + go func() { + _, err := callUnaryFrom(auth, "good", "10.0.0.1:1000") + first <- err + }() + <-v.entered + + if _, err := callUnaryContextFrom(canceledContext(), auth, "bad", "10.0.0.1:2000"); status.Code(err) != codes.Canceled { + t.Fatalf("waiting unary code = %v, want Canceled", status.Code(err)) + } + if _, err := callStreamContextFrom(expiredContext(), auth, "bad", "10.0.0.1:3000"); status.Code(err) != codes.DeadlineExceeded { + t.Fatalf("waiting stream code = %v, want DeadlineExceeded", status.Code(err)) + } + if got := v.calls.Load(); got != 1 { + t.Fatalf("validator calls while same-peer gate is blocked = %d, want 1", got) + } + + release() + if err := <-first; err != nil { + t.Fatalf("first validation error = %v", err) + } + if _, err := callUnaryFrom(auth, "bad", "10.0.0.1:4000"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("bad request after canceled waits code = %v, want Unauthenticated", status.Code(err)) + } + if got := v.calls.Load(); got != 2 { + t.Fatalf("validator calls = %d, want 2", got) + } +} + +func canceledContext() context.Context { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + return ctx +} + +func expiredContext() context.Context { + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(-time.Second)) + defer cancel() + return ctx +} + +func TestCallerIdentityRejectedBearerLimitHTTP(t *testing.T) { + v := &countingValidator{fakeValidator: fakeValidator{ + ok: map[string]session.Principal{"good": edgeAlice}, + transient: map[string]bool{"jwks-down": true}, + }} + auth := newLimitedOIDC(v) + + if _, rec := callHTTPFrom(auth, "bad", "10.0.0.1:1000", nil); rec.Code != http.StatusUnauthorized { + t.Fatalf("first bad status = %d, want 401", rec.Code) + } + spoofed := http.Header{"Forwarded": {"for=203.0.113.8"}, "X-Forwarded-For": {"203.0.113.9"}} + if _, rec := callHTTPFrom(auth, "bad-again", "10.0.0.1:2000", spoofed); rec.Code != http.StatusTooManyRequests { + t.Fatalf("second bad status = %d, want 429", rec.Code) + } + if v.calls != 1 { + t.Fatalf("validator calls = %d, want 1 (forwarding headers must not bypass direct-peer limit)", v.calls) + } + if _, rec := callHTTPFrom(auth, "bad", "10.0.0.2:1000", nil); rec.Code != http.StatusUnauthorized { + t.Fatalf("independent peer status = %d, want 401", rec.Code) + } + if v.calls != 2 { + t.Fatalf("validator calls = %d, want 2 after independent peer", v.calls) + } + + validV := &countingValidator{fakeValidator: fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}}} + validAuth := newLimitedOIDC(validV) + for range 3 { + _, _ = callHTTPFrom(validAuth, "good", "10.0.0.3:1000", nil) + } + if _, rec := callHTTPFrom(validAuth, "bad", "10.0.0.3:2000", nil); rec.Code != http.StatusUnauthorized { + t.Fatalf("bad request after valid traffic status = %d, want 401", rec.Code) + } + if validV.calls != 4 { + t.Fatalf("validator calls = %d, want 4 (valid traffic must not consume rejected-token budget)", validV.calls) + } + + unavailableV := &countingValidator{fakeValidator: fakeValidator{transient: map[string]bool{"jwks-down": true}}} + unavailableAuth := newLimitedOIDC(unavailableV) + for range 2 { + if _, rec := callHTTPFrom(unavailableAuth, "jwks-down", "10.0.0.4:1000", nil); rec.Code != http.StatusServiceUnavailable { + t.Fatalf("IdP unavailable status = %d, want 503", rec.Code) + } + } + if unavailableV.calls != 2 { + t.Fatalf("validator calls during repeated outage = %d, want 2", unavailableV.calls) + } +} + +func TestCallerIdentityRejectedBearerTrackingIsBounded(t *testing.T) { + v := &countingValidator{fakeValidator: fakeValidator{}} + auth := newLimitedOIDC(v) + for i := range 4100 { + _, _ = callHTTPFrom(auth, "bad", fmt.Sprintf("10.0.%d.%d:1000", i/256, i%256), nil) + } + if got := auth.RejectedTrackedClientCountForTest(); got > 4096 { + t.Fatalf("tracked rejected-token clients = %d, want at most 4096", got) + } +} + +func TestCallerIdentityRejectedBearerLimitUnary(t *testing.T) { + v := &countingValidator{fakeValidator: fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}}} + auth := newLimitedOIDC(v) + if _, err := callUnaryFrom(auth, "bad", "10.0.0.1:1000"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("first bad code = %v, want Unauthenticated", status.Code(err)) + } + if _, err := callUnaryFrom(auth, "bad-again", "10.0.0.1:2000"); status.Code(err) != codes.ResourceExhausted { + t.Fatalf("second bad code = %v, want ResourceExhausted", status.Code(err)) + } + if _, err := callUnaryFrom(auth, "bad", "10.0.0.2:1000"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("independent peer code = %v, want Unauthenticated", status.Code(err)) + } + if v.calls != 2 { + t.Fatalf("validator calls = %d, want 2", v.calls) + } + + validV := &countingValidator{fakeValidator: fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}}} + validAuth := newLimitedOIDC(validV) + for range 3 { + _, _ = callUnaryFrom(validAuth, "good", "10.0.0.3:1000") + } + if _, err := callUnaryFrom(validAuth, "bad", "10.0.0.3:2000"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("bad request after valid traffic code = %v, want Unauthenticated", status.Code(err)) + } + if validV.calls != 4 { + t.Fatalf("validator calls = %d, want 4", validV.calls) + } +} + +func TestCallerIdentityRejectedBearerLimitStream(t *testing.T) { + v := &countingValidator{fakeValidator: fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}}} + auth := newLimitedOIDC(v) + if _, err := callStreamFrom(auth, "bad", "10.0.0.1:1000"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("first bad code = %v, want Unauthenticated", status.Code(err)) + } + if _, err := callStreamFrom(auth, "bad-again", "10.0.0.1:2000"); status.Code(err) != codes.ResourceExhausted { + t.Fatalf("second bad code = %v, want ResourceExhausted", status.Code(err)) + } + if _, err := callStreamFrom(auth, "bad", "10.0.0.2:1000"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("independent peer code = %v, want Unauthenticated", status.Code(err)) + } + if v.calls != 2 { + t.Fatalf("validator calls = %d, want 2", v.calls) + } + + validV := &countingValidator{fakeValidator: fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}}} + validAuth := newLimitedOIDC(validV) + for range 3 { + _, _ = callStreamFrom(validAuth, "good", "10.0.0.3:1000") + } + if _, err := callStreamFrom(validAuth, "bad", "10.0.0.3:2000"); status.Code(err) != codes.Unauthenticated { + t.Fatalf("bad request after valid traffic code = %v, want Unauthenticated", status.Code(err)) + } + if validV.calls != 4 { + t.Fatalf("validator calls = %d, want 4", validV.calls) + } +} + +// TestCallerIdentityStreamInterceptor covers the STREAM half of the gRPC edge. +// StreamInterceptor owns its own principalStream wrapping — it overrides the +// stream's Context so the handler sees the verified principal, and hands the +// handler the ORIGINAL stream when identity is off. None of that is exercised by +// the unary interceptor, so a regression there would ship silently: a stream RPC +// (Converse, the main prompt surface) would run with no identity at all. +func TestCallerIdentityStreamInterceptor(t *testing.T) { + t.Parallel() + + v := fakeValidator{ + ok: map[string]session.Principal{"good": edgeAlice}, + transient: map[string]bool{"jwks-down": true}, + } + + t.Run("valid token reaches the handler stream", func(t *testing.T) { + ctx, err := callStream(oidcOnly(t, v, 0, 0), "good") + if err != nil { + t.Fatalf("interceptor err = %v, want nil", err) + } + if ctx == nil { + t.Fatal("handler did not run") + } + got := session.PrincipalFromContext(ctx) + if got == nil { + t.Fatal("handler stream context carries no principal (principalStream did not wrap)") + } + if *got != edgeAlice { + t.Fatalf("principal = %+v, want %+v", *got, edgeAlice) + } + }) + + t.Run("bad token never reaches the handler", func(t *testing.T) { + auth := oidcOnly(t, v, 0, 0) + for _, tok := range []string{"rubbish", "not.a.jwt at all", ""} { + ctx, err := callStream(auth, tok) + if code := status.Code(err); code != codes.Unauthenticated { + t.Errorf("token %q: code = %v, want Unauthenticated", tok, code) + } + if ctx != nil { + t.Errorf("token %q: handler RAN on a rejected token", tok) + } + } + // A transient IdP outage stays a 503-class Unavailable on streams too. + ctx, err := callStream(auth, "jwks-down") + if code := status.Code(err); code != codes.Unavailable { + t.Errorf("code = %v, want Unavailable", code) + } + if ctx != nil { + t.Error("handler RAN while the IdP was unreachable") + } + }) + + t.Run("no identity configured: handler runs with a nil principal", func(t *testing.T) { + ctx, err := callStream(server.NewAuthenticator(server.SecurityConfig{}), "") + if err != nil { + t.Fatalf("interceptor err = %v, want nil", err) + } + if ctx == nil { + t.Fatal("handler did not run") + } + if p := session.PrincipalFromContext(ctx); p != nil { + t.Fatalf("principal = %+v, want nil (no user may be invented)", *p) + } + }) +} + +// TestCallerIdentityEdgeRejectsMalformedPrincipal pins the edge's own guard on +// the validator's verdict (AC1.2): a non-nil principal is not automatically +// trustworthy. A principal missing either half of its (iss, sub) identity, one +// carrying a grant type outside the closed enum, and one presenting the INTERNAL +// namespace (mecatl:internal, or the system grant) are all 401-class rejections. +// +// Why each matters: an empty principal is exactly the fabricated-anonymous +// caller ADR 0100 decision 2 rejects, arriving through the front door; and an +// external token presenting the internal issuer is byte-identical to a system +// caller at every downstream consumer — including the isolation track (#368), +// which will read it to make decisions. +func TestCallerIdentityEdgeRejectsMalformedPrincipal(t *testing.T) { + t.Parallel() + + bad := map[string]session.Principal{ + "no issuer": {Subject: "alice", GrantType: session.GrantTypeUser}, + "no subject": {Issuer: edgeAlice.Issuer, GrantType: session.GrantTypeUser}, + "wholly empty": {}, + "unset grant type": {Issuer: edgeAlice.Issuer, Subject: "alice"}, + "bogus grant type": {Issuer: edgeAlice.Issuer, Subject: "alice", GrantType: session.GrantType("anonymous")}, + "internal issuer": {Issuer: syscaller.Issuer, Subject: "childgc", GrantType: session.GrantTypeUser}, + "system grant": {Issuer: edgeAlice.Issuer, Subject: "alice", GrantType: session.GrantTypeSystem}, + "internal issuer sys": {Issuer: syscaller.Issuer, Subject: "scheduler", GrantType: session.GrantTypeSystem}, + } + + v := fakeValidator{ok: map[string]session.Principal{"good": edgeAlice}} + for name, p := range bad { + v.ok[name] = p + } + + for name := range bad { + t.Run("grpc/"+name, func(t *testing.T) { + auth := oidcOnly(t, v, 1, 1) + ctx, err := callUnary(auth, name) + if code := status.Code(err); code != codes.Unauthenticated { + t.Fatalf("code = %v, want Unauthenticated (401-class, never a 503) (err=%v)", code, err) + } + if ctx != nil { + t.Fatal("handler RAN with a malformed principal") + } + if keys := auth.TrackedClientKeysForTest(); len(keys) != 0 { + t.Fatalf("tracked keys = %v, want none (a rejected principal must not create a bucket)", keys) + } + }) + t.Run("http/"+name, func(t *testing.T) { + auth := oidcOnly(t, v, 1, 1) + ctx, rec := callHTTP(auth, name) + if rec.Code != http.StatusUnauthorized { + t.Fatalf("status = %d, want 401", rec.Code) + } + if ctx != nil { + t.Fatal("handler RAN with a malformed principal") + } + if keys := auth.TrackedClientKeysForTest(); len(keys) != 0 { + t.Fatalf("tracked keys = %v, want none", keys) + } + }) + } + + // The guard is narrow: a well-formed principal on the SAME authenticator is + // still accepted, so the rejections above are not a blanket deny. + auth := oidcOnly(t, v, 0, 0) + ctx, err := callUnary(auth, "good") + if err != nil { + t.Fatalf("valid token rejected: %v", err) + } + if p := session.PrincipalFromContext(ctx); p == nil || *p != edgeAlice { + t.Fatalf("principal = %v, want %+v", p, edgeAlice) + } +} + +// TestCallerIdentityErrorSentinels pins the small error taxonomy the edge maps +// on: a bad token and an unreachable IdP are distinct, errors.Is-able sentinels +// (a validator returning a wrapped sentinel must classify correctly). +func TestCallerIdentityErrorSentinels(t *testing.T) { + t.Parallel() + if errors.Is(server.ErrInvalidToken, server.ErrIdentityUnavailable) || + errors.Is(server.ErrIdentityUnavailable, server.ErrInvalidToken) { + t.Fatal("the bad-token and IdP-outage sentinels must be distinct") + } +} diff --git a/internal/adapter/server/export_test.go b/internal/adapter/server/export_test.go index 41ceba0fba..7b3a1502cd 100644 --- a/internal/adapter/server/export_test.go +++ b/internal/adapter/server/export_test.go @@ -6,6 +6,33 @@ import ( "github.com/stacklok/mecatl/engine/session" ) +// TrackedClientKeysForTest returns the post-validation rate-limiter's per-client +// bucket keys (empty when rate limiting is disabled). It lets an external test +// assert WHAT the limiter keys on — the verified (iss, sub) rather than the raw +// token — and that a rejected token creates no post-validation bucket (ADR 0100 +// decision 3). +func (a *Authenticator) TrackedClientKeysForTest() []string { + if a.limiters == nil { + return nil + } + a.limiters.mu.Lock() + defer a.limiters.mu.Unlock() + keys := make([]string, 0, len(a.limiters.clients)) + for k := range a.limiters.clients { + keys = append(keys, k) + } + return keys +} + +func (a *Authenticator) RejectedTrackedClientCountForTest() int { + if a.rejectedLimiters == nil { + return 0 + } + a.rejectedLimiters.mu.Lock() + defer a.rejectedLimiters.mu.Unlock() + return len(a.rejectedLimiters.clients) +} + // SetEngineCloseTimeoutForTest overrides the package-level engineCloseTimeout var // for the duration of one test; it returns a restore func (defer it). The override // lets a test shrink the timeout so a bounded-engine-close assertion runs in diff --git a/internal/adapter/server/grpc_schedule.go b/internal/adapter/server/grpc_schedule.go index ccfa0d4d84..72987715e4 100644 --- a/internal/adapter/server/grpc_schedule.go +++ b/internal/adapter/server/grpc_schedule.go @@ -192,6 +192,16 @@ func (h *ScheduleServer) ListFires(ctx context.Context, req *mecatlv1.ListFiresR // error (the create-seam's Trigger.Validate rejects it). Timestamps without a // created_at are left zero (the create-seam stamps CreatedAt itself, so a caller // need not set it — an honest overwrite, not a silent default). +// +// It deliberately does NOT read in.Owner (ADR 0100 decision 6): a schedule's +// owner is captured by the create seam from the create SURFACE (the executing +// session's owner, or the verified context principal), never from the request +// body — the same discipline that keeps an owner field off CreateSessionRequest. +// The field is projected OUTBOUND only (scheduleSpecToProto). +// +// OriginSessionID is likewise deliberately never populated here and has no v1 +// proto field. It is an in-process-only routing key stamped by the Schedule tool +// from the executing session; network callers cannot select a delivery target. func protoToScheduleSpec(in *mecatlv1.ScheduleSpec) (port.ScheduleSpec, error) { out := port.ScheduleSpec{ Name: in.GetName(), @@ -271,6 +281,10 @@ func scheduleSpecToProto(in port.ScheduleSpec) *mecatlv1.ScheduleSpec { OneShotRetry: in.OneShotRetry, OneShotMaxRetries: ClampInt32(in.OneShotMaxRetries), CarryContext: in.CarryContext, + // The captured owner is projected read-only (ADR 0100 decision 6); a nil + // owner stays a nil message — an ownerless schedule is never rendered as + // an anonymous somebody. + Owner: toProtoPrincipal(in.Owner), } if in.Trigger.Cron != "" || !in.Trigger.OneShot.IsZero() { out.Trigger = &mecatlv1.TriggerSpec{ diff --git a/internal/adapter/server/grpc_schedule_origin_test.go b/internal/adapter/server/grpc_schedule_origin_test.go new file mode 100644 index 0000000000..2ebc5c6acd --- /dev/null +++ b/internal/adapter/server/grpc_schedule_origin_test.go @@ -0,0 +1,32 @@ +package server + +import ( + "testing" + + "google.golang.org/protobuf/reflect/protoreflect" + + mecatlv1 "github.com/stacklok/mecatl/contracts/gen/go/mecatl/v1" +) + +func TestProtoToScheduleSpecLeavesOriginSessionIDEmpty(t *testing.T) { + got, err := protoToScheduleSpec(&mecatlv1.ScheduleSpec{ + Name: "nightly", + Prompt: "run checks", + Trigger: &mecatlv1.TriggerSpec{Cron: "0 1 * * *"}, + }) + if err != nil { + t.Fatalf("protoToScheduleSpec: %v", err) + } + if got.OriginSessionID != "" { + t.Fatalf("OriginSessionID = %q, want empty for a wire-created schedule", got.OriginSessionID) + } +} + +// This descriptor assertion makes adding origin_session_id to the wire an +// explicit review event: the routing key must remain in-process-only. +func TestScheduleSpecDescriptorHasNoOriginSessionID(t *testing.T) { + desc := (&mecatlv1.ScheduleSpec{}).ProtoReflect().Descriptor() + if field := desc.Fields().ByName(protoreflect.Name("origin_session_id")); field != nil { + t.Fatalf("ScheduleSpec unexpectedly exposes origin_session_id as field %d", field.Number()) + } +} diff --git a/internal/adapter/server/mapper.go b/internal/adapter/server/mapper.go index 8f9be40e26..33ecbba231 100644 --- a/internal/adapter/server/mapper.go +++ b/internal/adapter/server/mapper.go @@ -901,6 +901,24 @@ func toProtoSessionSummary(s SessionSummary) *mecatlv1.SessionSummary { ModelId: s.ModelID, CreatedAtUnix: s.CreatedAtUnix, Title: valid(s.Title), + Owner: toProtoPrincipal(s.Owner), + } +} + +// toProtoPrincipal maps the verified owner (ADR 0100) to its proto form. A nil +// principal maps to a nil message — an ABSENT owner must stay absent on the wire, +// never a present-but-empty "anonymous" one. Every string goes through valid() +// (the UTF-8 scrubber every other wire string uses): the issuer/subject come from +// a token, i.e. from outside the process. +func toProtoPrincipal(p *session.Principal) *mecatlv1.Principal { + if p == nil { + return nil + } + return &mecatlv1.Principal{ + Issuer: valid(p.Issuer), + Subject: valid(p.Subject), + GrantType: valid(string(p.GrantType)), + Name: valid(p.Name), } } diff --git a/internal/adapter/server/schedule.go b/internal/adapter/server/schedule.go index 5482bc05d9..57cba3eec3 100644 --- a/internal/adapter/server/schedule.go +++ b/internal/adapter/server/schedule.go @@ -133,15 +133,28 @@ func (s *Service) FireNow(ctx context.Context, name string) (port.ScheduleFire, return mgr.FireNow(ctx, name) } -// EmitScheduleEvent delegates to the embedded scheduleManager. The manager -// appends a SchedulePayload as an EvSchedule* event to the fire session's -// durable EventLog (nil EventLog ⇒ a no-op). When no manager is wired it is a -// no-op too (the byte-identical no-emit path — there is no schedule surface to -// emit for). -func (s *Service) EmitScheduleEvent(payload session.SchedulePayload) { - if m := s.schedMgr; m != nil { - m.EmitScheduleEvent(payload) - } +// EmitScheduleEvent appends a SchedulePayload as an EvSchedule* event to the fire +// session's durable EventLog. It is the composition-injected emit callback the +// scheduler invokes (via scheduler.Config.EmitScheduleEvent) for fired/failed/ +// skipped fires. For v1 delivery is durable-log-only (pull-only via +// GetFire/ListFires); a live broadcast stream is a future phase. A skipped fire +// (no session id) is dropped from the durable log (the log is session-keyed) and +// surfaces only via the operator diagnostic. +// +// It routes through the ONE appendEvent chokepoint so the lifecycle events are +// stamped with the acting caller exactly like the fire's run events — the +// scheduler's system principal for a tick fire, the requester for a manual +// FireNow (ADR 0100 decision 5: every durable append path stamps). ctx is the +// caller's; it is cancel-detached here so a fire's finished/cancelled ctx cannot +// abort the durable append, while its VALUES (the principal) survive. +func (s *Service) EmitScheduleEvent(ctx context.Context, payload session.SchedulePayload) { + if payload.SessionID == "" { + return + } + s.appendEvent(context.WithoutCancel(ctx), payload.SessionID, session.Event{ + Type: scheduleEventType(payload.Kind), + Schedule: &payload, + }) } // scheduleStore returns the ScheduleStore the capabilities gate (Scheduling) diff --git a/internal/adapter/server/schedule_manager.go b/internal/adapter/server/schedule_manager.go index 5a05d199cd..26a5ce6466 100644 --- a/internal/adapter/server/schedule_manager.go +++ b/internal/adapter/server/schedule_manager.go @@ -20,11 +20,11 @@ import ( // *Service exists. The manager holds the ScheduleStore (either an explicit // override passed via ScheduleManagerConfig.ScheduleStore — the // --schedule-store-url composition path — or type-asserted off the session -// store via the scheduleStoreProvider accessor), the cadence floor, the -// durable EventLog, diagnostics, the shared model-inventory pointer +// store via the scheduleStoreProvider accessor), the cadence floor, the shared +// model-inventory pointer // (selector validation reads *models.Load()), and the late-set in-process // scheduler (FireNow). *server.Service delegates its nine port.ScheduleManager -// methods + EmitScheduleEvent + GetFire to this manager — the RPC surface +// methods + GetFire to this manager — the RPC surface // (grpc_schedule.go, the REST /v1/schedules handlers, the mecatui /schedule // overlay) is byte-identical; the create-seam (validateScheduleSpec + // applyScheduleDefaults + the origin/selector/cadence checks) moved verbatim @@ -51,10 +51,8 @@ import ( // Now is the now-func (the same clock the Service uses). Models is the SHARED // model-inventory pointer (selector validation reads *models.Load()); the // Service passes its own pointer so SetModels keeps working with no second -// copy. EventLog + Diagnostics are the durable-log + diagnostic seams -// EmitScheduleEvent rides; nil-safe (a nil EventLog is a no-op, a nil -// Diagnostics tolerates an append failure silently). A store that backs no -// ScheduleStore yields a nil manager (NewScheduleManager returns nil). +// copy. Diagnostics is the operational diagnostic seam; nil-safe. A store that +// backs no ScheduleStore yields a nil manager (NewScheduleManager returns nil). type ScheduleManagerConfig struct { // Store is the port.SessionStore the schedule's origin validation reads // (validateScheduleOrigin). It is also the ScheduleStore discovery source @@ -69,16 +67,15 @@ type ScheduleManagerConfig struct { ScheduleStore port.ScheduleStore Now func() time.Time Models *atomic.Pointer[[]*mecatlv1.ModelInfo] - EventLog port.EventLog Diagnostics port.Diagnostics } // scheduleManager is the store-shaped schedule create/read/update/fire seam // (ADR 0076). It is the single truth the *Service delegates to: the nine -// port.ScheduleManager verbs + EmitScheduleEvent + GetFire. It holds the +// port.ScheduleManager verbs + GetFire. It holds the // ScheduleStore (type-asserted at construction), the session store (origin // validation reads store.Load), a now-func, the cadence floor, the late-set -// in-process scheduler, the durable EventLog, diagnostics, and the shared +// in-process scheduler, diagnostics, and the shared // model-inventory pointer. A nil scheduler (the byte-identical default) means // FireNow distinguishes ErrNoScheduleStore (no store) from // ErrSchedulerNotRunning (store present, no tick loop). The cadence floor @@ -116,13 +113,7 @@ type scheduleManager struct { // scheduler is wired (the byte-identical default — FireNow distinguishes // ErrNoScheduleStore from ErrSchedulerNotRunning). scheduler atomic.Pointer[scheduler.Scheduler] - // eventLog is the durable EventLog EmitScheduleEvent appends to. nil-safe: - // a nil EventLog makes EmitScheduleEvent a no-op (byte-identical to the - // no-emit path). - eventLog port.EventLog - // diag is the operational diagnostics sink EmitScheduleEvent WARNs to on - // an Append failure. nil-safe: a nil Diagnostics tolerates the failure - // silently (the durability gap is the only effect). + // diag is the operational diagnostics sink. nil-safe. diag port.Diagnostics // models is the SHARED selectable-model inventory pointer (the SAME // atomic.Pointer the Service holds and SetModels swaps). Selector @@ -189,7 +180,7 @@ type ScheduleManagerImpl = scheduleManager // Models is OPTIONAL: a standalone-constructed manager (no Models pointer) // admits only the empty selector (an empty inventory) — composition passes // the Service's own pointer so SetModels keeps working with no second copy. -// EventLog + Diagnostics are OPTIONAL and nil-safe. +// Diagnostics is OPTIONAL and nil-safe. // //nolint:revive // intentional unexported return: the manager is an adapter-internal type (ADR 0076); callers consume it via the port.ScheduleManager interface, and the *Service embeds + delegates to it. The unexported type keeps the schedule surface from leaking into the server adapter's public API. func NewScheduleManager(cfg ScheduleManagerConfig) *scheduleManager { @@ -211,7 +202,6 @@ func NewScheduleManager(cfg ScheduleManagerConfig) *scheduleManager { store: cfg.Store, schedStore: schedStore, now: now, - eventLog: cfg.EventLog, diag: cfg.Diagnostics, models: cfg.Models, } @@ -263,7 +253,7 @@ func (m *scheduleManager) scheduleStore() port.ScheduleStore { // schedule. func (m *scheduleManager) CreateSchedule(ctx context.Context, spec port.ScheduleSpec) (port.Schedule, error) { now := m.now() - cronNextFire, err := m.validateScheduleSpec(ctx, spec, now) + cronNextFire, originOwner, err := m.validateScheduleSpec(ctx, spec, now) if err != nil { return port.Schedule{}, err } @@ -280,6 +270,13 @@ func (m *scheduleManager) CreateSchedule(ctx context.Context, spec port.Schedule return port.Schedule{}, lerr } applyScheduleDefaults(&spec) + // Capture the owner ONCE, here (ADR 0100 decision 6). A caller can never + // name it in the request body (protoToScheduleSpec drops any inbound owner, + // the same discipline that keeps an owner field off CreateSessionRequest) — + // it is derived from the create SURFACE. The origin session's owner comes + // from the load validateScheduleSpec ALREADY did, so a sweep deleting the + // origin between the two reads cannot silently produce an ownerless schedule. + spec.Owner = captureScheduleOwner(ctx, spec, originOwner) // Compute the first NextFireAt. A cron trigger's next fire was ALREADY // computed by validateScheduleSpec (it must parse the expression to // validate the grammar, so that parse is reused here rather than calling @@ -367,15 +364,15 @@ func scheduleSingletonExplicit(_ port.ScheduleSpec) bool { return false } // ListModels advertises) and the cadence floor against the composition- // injected scheduler MinInterval — two deployment-level inputs the spec alone // cannot carry. -func (m *scheduleManager) validateScheduleSpec(ctx context.Context, spec port.ScheduleSpec, now time.Time) (time.Time, error) { +func (m *scheduleManager) validateScheduleSpec(ctx context.Context, spec port.ScheduleSpec, now time.Time) (time.Time, *session.Principal, error) { if spec.Name == "" { - return time.Time{}, fmt.Errorf("%w: schedule name is required", ErrInvalidArgument) + return time.Time{}, nil, fmt.Errorf("%w: schedule name is required", ErrInvalidArgument) } if spec.Prompt == "" && len(spec.Parts) == 0 { - return time.Time{}, fmt.Errorf("%w: prompt or parts is required", ErrInvalidArgument) + return time.Time{}, nil, fmt.Errorf("%w: prompt or parts is required", ErrInvalidArgument) } if err := spec.Trigger.Validate(); err != nil { - return time.Time{}, fmt.Errorf("%w: %v", ErrInvalidArgument, err) + return time.Time{}, nil, fmt.Errorf("%w: %v", ErrInvalidArgument, err) } // OriginSessionID validation: a non-empty OriginSessionID must name an // existing session in the store (the session the fire's terminal result @@ -384,18 +381,19 @@ func (m *scheduleManager) validateScheduleSpec(ctx context.Context, spec port.Sc // rather than surfacing hours later as a fire-time failure. An empty // OriginSessionID is always valid (delivery is OFF — the v1 pre-delivery // posture). - if err := m.validateScheduleOrigin(ctx, spec); err != nil { - return time.Time{}, err + originOwner, err := m.validateScheduleOrigin(ctx, spec) + if err != nil { + return time.Time{}, nil, err } // OneShotRetry is one-shot-ONLY: a cron self-heals via misfire already // (decision #1), so a retry budget on a cron is a misconfiguration the // create-seam rejects fail-closed. CarryContext is allowed on either trigger // (a cron carrying its prior fire's context is a valid use case). if spec.OneShotRetry && spec.Trigger.Kind() != port.TriggerOneShot { - return time.Time{}, fmt.Errorf("%w: one_shot_retry is one-shot-only (a cron self-heals via misfire — no retry budget)", ErrInvalidArgument) + return time.Time{}, nil, fmt.Errorf("%w: one_shot_retry is one-shot-only (a cron self-heals via misfire — no retry budget)", ErrInvalidArgument) } if spec.OneShotMaxRetries < 0 { - return time.Time{}, fmt.Errorf("%w: one_shot_max_retries must be >= 0 (got %d)", ErrInvalidArgument, spec.OneShotMaxRetries) + return time.Time{}, nil, fmt.Errorf("%w: one_shot_max_retries must be >= 0 (got %d)", ErrInvalidArgument, spec.OneShotMaxRetries) } // Reject a read-leaning schedule (Mutating=false) with a write-capable Mode // (the scheduler_fire.go:54-55 TODO — a read-leaning schedule must not carry @@ -410,7 +408,7 @@ func (m *scheduleManager) validateScheduleSpec(ctx context.Context, spec port.Sc mode = session.ModeDefault } if !spec.Mutating && mode != session.ModePlan { - return time.Time{}, fmt.Errorf("%w: a non-mutating schedule must use plan mode (got %q)", ErrInvalidArgument, mode) + return time.Time{}, nil, fmt.Errorf("%w: a non-mutating schedule must use plan mode (got %q)", ErrInvalidArgument, mode) } // Validate the workspace PROFILE-AWARE, mirroring the session create-seam // (service.go createSession): a default-profile schedule REQUIRES a workspace @@ -421,14 +419,14 @@ func (m *scheduleManager) validateScheduleSpec(ctx context.Context, spec port.Sc switch SessionProfile(spec.Profile) { case ProfileDefault: if spec.Workspace == "" { - return time.Time{}, fmt.Errorf("%w: a default-profile schedule requires a workspace (the fire mints a filesystem session)", ErrInvalidArgument) + return time.Time{}, nil, fmt.Errorf("%w: a default-profile schedule requires a workspace (the fire mints a filesystem session)", ErrInvalidArgument) } case ProfileNoFS: if spec.Workspace != "" { - return time.Time{}, fmt.Errorf("%w: a %q schedule must not carry a workspace (a no-FS fire has no filesystem to root); got %q", ErrInvalidArgument, ProfileNoFS, spec.Workspace) + return time.Time{}, nil, fmt.Errorf("%w: a %q schedule must not carry a workspace (a no-FS fire has no filesystem to root); got %q", ErrInvalidArgument, ProfileNoFS, spec.Workspace) } default: - return time.Time{}, fmt.Errorf("%w: unknown schedule profile %q (supported: \"\" (default) and %q)", ErrInvalidArgument, spec.Profile, ProfileNoFS) + return time.Time{}, nil, fmt.Errorf("%w: unknown schedule profile %q (supported: \"\" (default) and %q)", ErrInvalidArgument, spec.Profile, ProfileNoFS) } // Selector validation (ADR 0073, AC1.2c): a non-empty selector must name a // provider+model pair the deployment actually serves — resolved against the @@ -438,17 +436,18 @@ func (m *scheduleManager) validateScheduleSpec(ctx context.Context, spec port.Sc // the deployment never configured, surfacing hours later as a fire-time // failure. An empty selector (the deployment default) is ALWAYS valid. if err := m.validateScheduleSelector(spec.Selector); err != nil { - return time.Time{}, err + return time.Time{}, nil, err } switch spec.Trigger.Kind() { case port.TriggerOneShot: if !spec.Trigger.OneShot.After(now) { - return time.Time{}, fmt.Errorf("%w: one-shot trigger time must be in the future", ErrInvalidArgument) + return time.Time{}, nil, fmt.Errorf("%w: one-shot trigger time must be in the future", ErrInvalidArgument) } case port.TriggerCron: - return m.validateCronTrigger(spec, now) + next, cerr := m.validateCronTrigger(spec, now) + return next, originOwner, cerr } - return time.Time{}, nil + return time.Time{}, originOwner, nil } // validateCronTrigger validates the cron arm of the trigger switch: the @@ -483,18 +482,51 @@ func (m *scheduleManager) validateCronTrigger(spec port.ScheduleSpec, now time.T return next, nil } +// captureScheduleOwner resolves the owner a schedule is created with (ADR 0100 +// decision 6), by CREATE SURFACE: +// +// - the Schedule-TOOL path runs inside a session, and the origin binder has +// already stamped OriginSessionID with it — so the owner is that EXECUTING +// session's owner. The tool's caller context belongs to whoever prompted the +// run, which is not necessarily the session's owner, so the session wins. +// - an OUT-OF-BAND create (REST/CLI: no origin session) reads the verified +// principal riding the context. +// +// It NEVER fabricates one: an ownerless origin session and an unauthenticated +// out-of-band create both yield nil. +// +// originOwner is the owner read off the load validateScheduleOrigin ALREADY did +// (nil for an ownerless or absent origin). It is threaded in rather than re-read +// here: a childgc sweep landing between the two reads would turn a validated, +// owned create into a silently OWNERLESS schedule — the exact deletion hazard +// ADR 0100 decision 6 exists for. +func captureScheduleOwner(ctx context.Context, spec port.ScheduleSpec, originOwner *session.Principal) *session.Principal { + if spec.OriginSessionID == "" { + return session.PrincipalFromContext(ctx) + } + return originOwner.Clone() +} + // validateScheduleOrigin rejects (fail-closed) a non-empty OriginSessionID that // names a session not in the held store. An empty OriginSessionID is always // valid (delivery is OFF). This is extracted from validateScheduleSpec to keep the // cyclomatic complexity below the gocyclo threshold of 20. -func (m *scheduleManager) validateScheduleOrigin(ctx context.Context, spec port.ScheduleSpec) error { +// +// It also RETURNS the validated session's owner (nil when there is no origin, or +// the origin is ownerless), so the create-seam captures the owner from THIS load +// instead of re-reading a session a concurrent sweep may already have deleted. +func (m *scheduleManager) validateScheduleOrigin(ctx context.Context, spec port.ScheduleSpec) (*session.Principal, error) { if spec.OriginSessionID == "" { - return nil + return nil, nil } - if _, lerr := m.store.Load(ctx, spec.OriginSessionID); lerr != nil { - return fmt.Errorf("%w: origin_session_id %q must reference an existing session: %w", ErrInvalidArgument, spec.OriginSessionID, lerr) + origin, lerr := m.store.Load(ctx, spec.OriginSessionID) + if lerr != nil { + return nil, fmt.Errorf("%w: origin_session_id %q must reference an existing session: %w", ErrInvalidArgument, spec.OriginSessionID, lerr) } - return nil + if origin == nil { + return nil, nil + } + return origin.Owner.Clone(), nil } // validateScheduleSelector rejects (fail-closed) a non-empty @@ -546,7 +578,7 @@ func (m *scheduleManager) UpdateSchedule(ctx context.Context, spec port.Schedule // The computed cron next-fire is not needed here (Update preserves the // existing State, including NextFireAt); the call is still made for its // validation side effect (the shared create-seam checks). - if _, err := m.validateScheduleSpec(ctx, spec, now); err != nil { + if _, _, err := m.validateScheduleSpec(ctx, spec, now); err != nil { return port.Schedule{}, err } applyScheduleDefaults(&spec) @@ -560,6 +592,10 @@ func (m *scheduleManager) UpdateSchedule(ctx context.Context, spec port.Schedule // to the zero value (which the reconcile update path would otherwise do on // every restart, destroying the audit trail). spec.CreatedAt = existing.Spec.CreatedAt + // The owner is WRITE-ONCE (ADR 0100 decision 4/6): an Update carries the + // captured owner forward verbatim, so editing a schedule can never re-own it + // to the updating caller. + spec.Owner = existing.Spec.Owner updated := port.Schedule{Spec: spec, State: existing.State} if err := m.schedStore.Save(ctx, updated); err != nil { return port.Schedule{}, err @@ -635,44 +671,6 @@ func (m *scheduleManager) FireNow(ctx context.Context, name string) (port.Schedu return fire, nil } -// EmitScheduleEvent appends a SchedulePayload as an EvSchedule* event to the -// fire session's durable EventLog. It is the composition-injected emit callback -// the scheduler invokes (via Config.EmitScheduleEvent) for fired/failed/skipped -// fires. For v1 delivery is durable-log-only (pull-only via GetFire/ListFires); -// a live broadcast stream is a future phase. A skipped fire (no session id) is -// dropped from the durable log (the log is session-keyed) and surfaces only via -// the operator diagnostic. A nil EventLog is a no-op (byte-identical to the -// no-emit path). An Append failure WARNs, never aborts (a broken durable log -// must not break the fire). -func (m *scheduleManager) EmitScheduleEvent(payload session.SchedulePayload) { - m.emitScheduleEvent(payload) -} - -func (m *scheduleManager) emitScheduleEvent(payload session.SchedulePayload) { - if m.eventLog == nil { - return - } - if payload.SessionID == "" { - // A skipped fire has no session to log under; the live client wire (the - // next chunk's handlers) is the channel for skip events. The durable - // log is session-keyed, so a sessionless event has nowhere to land. - return - } - ev := session.Event{ - Type: scheduleEventType(payload.Kind), - Schedule: &payload, - } - // Cancel-detached so a fire's ctx (which may be cancelled when the run - // ends) cannot abort the durable append (the appendEvent precedent). - ctx := context.WithoutCancel(context.Background()) - if err := m.eventLog.Append(ctx, payload.SessionID, ev); err != nil { - if m.diag != nil { - m.diag.Log(ctx, port.LevelWarn, "schedule event log append failed", - "session", string(payload.SessionID), "kind", payload.Kind, "err", err.Error()) - } - } -} - // SetScheduler wires a scheduler onto the manager. It is the late-bind seam for // the scheduled-tasks tick loop (issue #189, Phase 1f): buildScheduler needs the // Service for the FireFunc, so the scheduler is built AFTER NewService and diff --git a/internal/adapter/server/schedule_manager_scenario_test.go b/internal/adapter/server/schedule_manager_scenario_test.go index 0146835a02..448c39b49f 100644 --- a/internal/adapter/server/schedule_manager_scenario_test.go +++ b/internal/adapter/server/schedule_manager_scenario_test.go @@ -197,7 +197,7 @@ func TestScheduleSharedCatalog_Scenario1_ServiceDelegates(t *testing.T) { } // EmitScheduleEvent delegates: nil EventLog ⇒ a no-op that does not panic. - svc.EmitScheduleEvent(session.SchedulePayload{Kind: "fired", SessionID: "s1", ScheduleName: "delegate"}) + svc.EmitScheduleEvent(ctx, session.SchedulePayload{Kind: "fired", SessionID: "s1", ScheduleName: "delegate"}) if err := svc.DeleteSchedule(ctx, "delegate"); err != nil { t.Fatalf("svc.DeleteSchedule: %v", err) diff --git a/internal/adapter/server/service.go b/internal/adapter/server/service.go index d1f67fb6ab..b65ca62d76 100644 --- a/internal/adapter/server/service.go +++ b/internal/adapter/server/service.go @@ -1011,7 +1011,6 @@ func NewService(cfg Config) (*Service, error) { Store: cfg.Store, Now: cfg.Now, Models: &svc.models, - EventLog: cfg.EventLog, Diagnostics: cfg.Diagnostics, }) } @@ -1113,6 +1112,12 @@ type createSessionOpts struct { // first Store.Save so the seeded history is persisted. Empty = no carryover // (byte-identical default). sourceSessionID session.SessionID + // owner overrides the context principal as the created session's owner + // (ADR 0100 decision 4). ownerSet distinguishes "WithOwner was called + // (possibly with nil — an explicitly ownerless session)" from "never + // called", which falls back to session.PrincipalFromContext. + owner *session.Principal + ownerSet bool } // WithSessionID overrides the session id a CreateSession* call mints. When set, @@ -1140,6 +1145,34 @@ func WithSourceSession(id session.SessionID) CreateSessionOption { return func(o *createSessionOpts) { o.sourceSessionID = id } } +// WithOwner overrides the owner a CreateSession* call stamps on the new session +// (ADR 0100 decision 4). By DEFAULT the owner comes from the verified principal +// on the context (session.PrincipalFromContext) — a caller can never name its +// own owner in the request body, which is why CreateSessionRequest has no owner +// field. This option is the in-process injection seam for a caller that already +// holds the owning principal out of band: the scheduler fire path, which runs +// under the system principal but must attribute the fire session to the +// SCHEDULE's captured owner. +// +// WithOwner(nil) is the EXPLICIT ownerless injection (a system-owned session +// with nobody to attribute it to) and does NOT fall back to the context +// principal — a fabricated owner is worse than none. +func WithOwner(p *session.Principal) CreateSessionOption { + return func(o *createSessionOpts) { o.owner, o.ownerSet = p, true } +} + +// resolveOwner picks the owner a create stamps: the explicit WithOwner value +// when the option was passed (nil included — see WithOwner), else the verified +// principal riding the context. An absent principal yields nil — the ownerless +// no-auth path, byte-identical to the pre-ADR-0100 behaviour. It NEVER +// fabricates one. +func resolveOwner(ctx context.Context, opts createSessionOpts) *session.Principal { + if opts.ownerSet { + return opts.owner + } + return session.PrincipalFromContext(ctx) +} + // CreateSession allocates a new idle session on the SHARED engine, persists it, // and returns it. workspace must be non-empty. An unspecified mode falls back to // DefaultMode. It is the no-selector, no-MCP fast path: it delegates to the @@ -1210,11 +1243,17 @@ func (s *Service) CreateSessionWithProfile(ctx context.Context, workspace string // empty-selector default profile this writes the zero values, so a default // session's snapshot is byte-identical to a pre-Phase-1 one (the labels omitempty // out of the JSON). -func setSessionLabels(sess *session.Session, sel ProviderSelector, profile SessionProfile) { +func setSessionLabels(sess *session.Session, sel ProviderSelector, profile SessionProfile, owner *session.Principal) error { sess.Profile = string(profile) sess.ProviderID = sel.ProviderID sess.ModelID = sel.ModelID sess.ReasoningEffort = sel.ReasoningEffort + // The owner is WRITE-ONCE and is stamped through the aggregate (Session is an + // aggregate — never poke the field). On a freshly-minted session the slot is + // empty, so this cannot collide; the error is propagated rather than dropped so + // a future caller that re-labels a LOADED session fails loudly instead of + // silently re-owning it. A nil owner leaves the session ownerless. + return sess.RestoreLabels(owner, "") } // seedCarryover seeds the freshly-created (idle) session with an optional @@ -1339,13 +1378,21 @@ func (s *Service) createSession(ctx context.Context, workspace string, mode sess // DefaultResolvedModel inside validateCarryover); a SAME-provider carryover // replays the history verbatim, a CROSS-provider carryover strips the // provider-private blobs (session.StripProviderState). + // The owner stamped on the new session: the explicit WithOwner injection, else + // the verified principal on the context, else nil (the ownerless no-auth path). + // A carryover fork replaces it with the SOURCE's owner below. + owner := resolveOwner(ctx, opts) + var carrySnap []session.Message if opts.sourceSessionID != "" { - snap, err := s.validateCarryover(ctx, opts.sourceSessionID, sel.ProviderID) + snap, srcOwner, err := s.validateCarryover(ctx, opts.sourceSessionID, sel.ProviderID) if err != nil { return nil, err } carrySnap = snap + // A fork inherits the SOURCE's owner, overriding the context principal + // (and any WithOwner) — see validateCarryover. + owner = srcOwner } needPerSession := s.sessionNeedsPerFactory(sel, specs, profile, workspace) @@ -1355,7 +1402,9 @@ func (s *Service) createSession(ctx context.Context, workspace string, mode sess // exactly the no-per-session case), so setLabels persists nothing new — the // snapshot stays byte-identical to a pre-Phase-1 default session. sess := session.New(mintID(), mode, workspace, limits, s.cfg.Now()) - setSessionLabels(sess, sel, profile) + if err := setSessionLabels(sess, sel, profile, owner); err != nil { + return nil, err + } if err := seedCarryover(sess, carrySnap); err != nil { return nil, err } @@ -1365,7 +1414,7 @@ func (s *Service) createSession(ctx context.Context, workspace string, mode sess return sess, nil } - return s.createPerSessionEngine(ctx, mintID, mode, workspace, limits, sel, specs, profile, carrySnap) + return s.createPerSessionEngine(ctx, mintID, mode, workspace, limits, sel, specs, profile, carrySnap, owner) } // createPerSessionEngine is the per-session-engine create branch, factored out @@ -1376,7 +1425,7 @@ func (s *Service) createSession(ctx context.Context, workspace string, mode sess // evicts the reservation and tears the freshly-built engine down so a failed // create leaks neither a slot nor a connection. See createSession for the // profile-aware workspace rule and the carryover snapshot semantics. -func (s *Service) createPerSessionEngine(ctx context.Context, mintID func() session.SessionID, mode session.PermissionMode, workspace string, limits session.Limits, sel ProviderSelector, specs []mcp.ServerConfig, profile SessionProfile, carrySnap []session.Message) (*session.Session, error) { +func (s *Service) createPerSessionEngine(ctx context.Context, mintID func() session.SessionID, mode session.PermissionMode, workspace string, limits session.Limits, sel ProviderSelector, specs []mcp.ServerConfig, profile SessionProfile, carrySnap []session.Message, owner *session.Principal) (*session.Session, error) { if s.cfg.SessionEngine == nil { return nil, fmt.Errorf("%w: per-session engine not supported (no session-engine factory configured)", ErrInvalidArgument) } @@ -1404,7 +1453,12 @@ func (s *Service) createPerSessionEngine(ctx context.Context, mintID func() sess // creation labels on the aggregate, so a restarted process re-derives the SAME // per-session engine via the factory (rehydrateSession) instead of falling to the // default-provider floor / inferring the profile from the empty-workspace pun. - setSessionLabels(sess, sel, profile) + if err := setSessionLabels(sess, sel, profile, owner); err != nil { + if closeFn != nil { + _ = closeFn() + } + return nil, err + } if err := seedCarryover(sess, carrySnap); err != nil { if closeFn != nil { _ = closeFn() @@ -1935,7 +1989,12 @@ func (s *Service) ForkSession(ctx context.Context, srcID session.SessionID, titl sel.ReasoningEffort = effortOverride } profile := profileForSession(src) - setSessionLabels(forked, sel, profile) + // The fork inherits the SOURCE's owner (ADR 0100 decision 4), NOT the + // principal of whoever called ForkSession — otherwise fork is an + // ownership-laundering path. An ownerless source forks ownerless. + if err := setSessionLabels(forked, sel, profile, src.Owner); err != nil { + return "", err + } if title != "" { forked.Title = title } else { @@ -1993,14 +2052,20 @@ func (s *Service) ForkSession(ctx context.Context, srcID session.SessionID, titl // default). The model is intentionally NOT compared: a model mismatch within a // provider is the point of the /models picker switch, so a same-provider // model change is permitted; a cross-provider model change strips and replays. -func (s *Service) validateCarryover(ctx context.Context, srcID session.SessionID, newProviderID string) ([]session.Message, error) { +func (s *Service) validateCarryover(ctx context.Context, srcID session.SessionID, newProviderID string) ([]session.Message, *session.Principal, error) { src, err := s.loadAndReopen(ctx, srcID) if err != nil { - return nil, err + return nil, nil, err } if src.State == session.StateRunning || src.State == session.StateAwaiting { - return nil, fmt.Errorf("%w: carryover requires a session at a turn boundary; source %q is %s", ErrFailedPrecondition, srcID, src.State) - } + return nil, nil, fmt.Errorf("%w: carryover requires a session at a turn boundary; source %q is %s", ErrFailedPrecondition, srcID, src.State) + } + // The SOURCE's owner travels with the carried history (ADR 0100 decision 4): + // a fork is attributed to whoever owned the session it copied, never to the + // caller doing the forking — otherwise fork is an ownership-laundering path + // (copy someone else's session, become its owner). An ownerless source + // yields an ownerless fork, never a fabricated one. + srcOwner := src.Owner // Canonicalise each side: empty => the server default provider, mirroring how // createSession resolves the selector (a zero ProviderSelector rides the // shared/default engine). DefaultResolvedModel.ProviderID is the composition- @@ -2035,12 +2100,12 @@ func (s *Service) validateCarryover(ctx context.Context, srcID session.SessionID // provider-id check, not an adapter-type check, because the server // layer only has the resolved id, not the adapter. if newProv == "openai" || newProv == "openrouter" { - return synthesizeOpenAIItemIDs(stripped), nil + return synthesizeOpenAIItemIDs(stripped), srcOwner, nil } - return stripped, nil + return stripped, srcOwner, nil } // Same provider: replay the blobs verbatim (warm cache). - return snap, nil + return snap, srcOwner, nil } // synthesizeOpenAIItemIDs synthesises a stable, unique ItemID for every ToolCall @@ -3183,16 +3248,45 @@ func (s *Service) Persist(ctx context.Context, id session.SessionID) { // way they gate Persist). A nil EventLog is a no-op (byte-identical to pre-3a). // An Append failure is best-effort: it WARNs and never aborts the run (a broken // durable log must not break the live stream). +// +// It is ALSO the SINGLE site that stamps session.Event.Actor (ADR 0100 decision +// 5): the attribution is derive-at-append, read from the CONTEXT PRINCIPAL — the +// verified caller who drove this request — so the loop stays storage- and +// identity-agnostic and every emit site leaves Actor nil. Callers pass a +// cancel-detached ctx (context.WithoutCancel), which preserves the context VALUES +// and therefore the caller. A request with no verified caller leaves it nil — +// absence is never fabricated. Do not add a second stamping path. func (s *Service) appendEvent(ctx context.Context, id session.SessionID, ev session.Event) { if s.cfg.EventLog == nil { return } + // The actor is the verified caller who ACTED, NOT the session's owner. The two + // are different questions and routinely different values: this phase ships no + // authorization, so any authenticated caller may act on any session, and an + // owner-derived stamp would put caller A on every event of a run caller B drove + // (worst on EvApproval, where the record IS a human granting a tool + // permission). The owner stays the identity of record for "whose is this?"; the + // actor answers "who did this?". PrincipalFromContext returns a COPY, so a + // later mutation cannot rewrite an already-recorded event. + ev.Actor = session.PrincipalFromContext(ctx) if err := s.cfg.EventLog.Append(ctx, id, ev); err != nil { s.cfg.Diagnostics.Log(ctx, port.LevelWarn, "event log append failed", "session", string(id), "event", string(ev.Type), "err", err.Error()) } } +// AppendRunEvent durably records one event of an in-process run through the +// SINGLE appendEvent path — the same durability, best-effort and Actor-stamping +// contract (never a second stamping path). It exists for the IN-PROCESS +// consumers of a run that are not wire relays: the scheduler's fire loop +// (internal/app) drives its "sched--" session's events itself, so without this +// seam a scheduled fire would be the one run whose events never reach the +// durable log. Pass a cancel-detached ctx (context.WithoutCancel), exactly as +// the relays do, so a finished run cannot abort the write. +func (s *Service) AppendRunEvent(ctx context.Context, id session.SessionID, ev session.Event) { + s.appendEvent(ctx, id, ev) +} + // relayEvent applies the SHARED per-event relay discipline (cloud-native Phase // 3a/3b + the plan-mode auto-approve observer, issue #206 Wave 6a) that every // event-relay loop (gRPC Converse, gRPC ApprovePlan, HTTP relayRunSSE, HTTP @@ -4074,6 +4168,14 @@ type SessionSummary struct { // (walks the conversation for the first genuine user prompt). Empty for a // session with no genuine prompt. Title string + // Owner is the verified caller the session is attributed to (ADR 0100), or + // nil for an ownerless session (a no-auth deployment, or a session persisted + // before the owner label existed — nothing backfills it). DISPLAY ONLY: + // ListSessions applies NO owner filtering, so a caller sees every stored + // session regardless of who owns it. Scoping belongs to the isolation track + // (#368), not here. Populated identically on the MetaLister fast path and the + // Load-per-row fallback. + Owner *session.Principal } // StreamSessionEvents replays a session's durable event log as a lazy iterator @@ -4167,6 +4269,9 @@ func (s *Service) ListSessions(ctx context.Context) ([]SessionSummary, error) { summary.ModelID = sess.ModelID } summary.Title = DeriveTitle(sess) + // Clone: the row must not carry a live pointer into the loaded + // session, or a consumer of the row can rewrite the recorded owner. + summary.Owner = sess.Owner.Clone() } out = append(out, summary) } @@ -4199,6 +4304,7 @@ func listSessionsMeta(ctx context.Context, ml port.MetaLister) ([]SessionSummary CreatedAtUnix: r.CreatedAt.Unix(), ModelID: r.ModelID, Title: r.Title, + Owner: r.Owner.Clone(), } // A zero CreatedAt (a snapshot with no created_at, or a corrupt row that // left CreatedAt at the zero time) maps to 0, NOT the zero time's Unix diff --git a/internal/adapter/server/validator_close_test.go b/internal/adapter/server/validator_close_test.go new file mode 100644 index 0000000000..a49f61a7a7 --- /dev/null +++ b/internal/adapter/server/validator_close_test.go @@ -0,0 +1,70 @@ +package server_test + +import ( + "context" + "sync" + "testing" + + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/internal/adapter/server" +) + +// closingValidator is a PrincipalValidator that ALSO implements io.Closer — the +// shape the real toolhive-core/authn validator has (its Close stops the +// background JWKS refresh). Cancelling the root context does NOT call it, so the +// edge must. +type closingValidator struct { + mu sync.Mutex + closes int +} + +func (*closingValidator) Validate(context.Context, string) (*session.Principal, error) { + return nil, server.ErrInvalidToken +} + +func (v *closingValidator) Close() error { + v.mu.Lock() + defer v.mu.Unlock() + v.closes++ + return nil +} + +func (v *closingValidator) count() int { + v.mu.Lock() + defer v.mu.Unlock() + return v.closes +} + +// TestAuthenticatorCloseTearsDownTheValidatorOnce pins the OPTIONAL teardown +// capability: the edge type-asserts io.Closer on the configured validator and +// closes it on shutdown, exactly once even if shutdown runs twice (a defer plus +// an explicit call). PrincipalValidator itself stays single-method — widening it +// would break every fake. +func TestAuthenticatorCloseTearsDownTheValidatorOnce(t *testing.T) { + t.Parallel() + + v := &closingValidator{} + a := server.NewAuthenticator(server.SecurityConfig{Validator: v}) + + if got := v.count(); got != 0 { + t.Fatalf("validator closed %d times before shutdown, want 0", got) + } + a.Close() + if got := v.count(); got != 1 { + t.Fatalf("validator closed %d times after one shutdown, want 1", got) + } + a.Close() + if got := v.count(); got != 1 { + t.Fatalf("validator closed %d times after a second shutdown, want 1", got) + } +} + +// TestAuthenticatorCloseWithoutACloserIsANoOp pins that teardown stays OPTIONAL: +// a validator with no Close (the fakes throughout these tests) and the identity-OFF +// zero config both shut down without a panic. +func TestAuthenticatorCloseWithoutACloserIsANoOp(t *testing.T) { + t.Parallel() + + server.NewAuthenticator(server.SecurityConfig{}).Close() + server.NewAuthenticator(server.SecurityConfig{Validator: fakeValidator{}}).Close() +} diff --git a/internal/adapter/store/jsonlstore/metalist.go b/internal/adapter/store/jsonlstore/metalist.go index 19fa687604..a29b71d872 100644 --- a/internal/adapter/store/jsonlstore/metalist.go +++ b/internal/adapter/store/jsonlstore/metalist.go @@ -30,6 +30,10 @@ type metaSnapshot struct { ModelID string `json:"model_id,omitempty"` Title string `json:"title,omitempty"` CreatedAt time.Time `json:"created_at"` + // Owner is the session's verified owner (ADR 0100). Decoding it here is + // what keeps the cheap fast path's row IDENTICAL to the Load-per-row + // fallback's; a pre-owner snapshot simply has no key and stays nil. + Owner *session.Principal `json:"owner,omitempty"` } // knownStates is the set of valid session.State values. MetaList validates the @@ -123,6 +127,7 @@ func (st *Store) MetaList(_ context.Context) ([]port.SessionMeta, error) { meta.Turns = m.Counters.Turns meta.ModelID = m.ModelID meta.Title = m.Title + meta.Owner = m.Owner // A zero CreatedAt (a snapshot with no created_at, or the zero time) // must surface as the zero time — NOT .Unix() of the zero time, which // is -62135596800 and would misreport as 0001-01-01. The caller maps diff --git a/internal/adapter/store/jsonlstore/schedulestore.go b/internal/adapter/store/jsonlstore/schedulestore.go index 86fde09f56..68f651fb79 100644 --- a/internal/adapter/store/jsonlstore/schedulestore.go +++ b/internal/adapter/store/jsonlstore/schedulestore.go @@ -641,16 +641,17 @@ func safeFilePart(s string) string { return safeName(session.SessionID(s)) } -// cloneSpec returns a copy of spec whose Parts slice is independent of the -// stored one (so a caller cannot mutate the store's record through the -// returned Schedule). ScheduleSpec is otherwise a struct of values. Mirrors -// memschedulestore.cloneSpec. +// cloneSpec returns a copy of spec whose Parts slice AND Owner pointer are +// independent of the stored one (so a caller cannot mutate the store's record +// through the returned Schedule). ScheduleSpec is otherwise a struct of values. +// Mirrors memschedulestore.cloneSpec. func cloneSpec(spec port.ScheduleSpec) port.ScheduleSpec { out := spec if spec.Parts != nil { out.Parts = make([]session.Content, len(spec.Parts)) copy(out.Parts, spec.Parts) } + out.Owner = spec.Owner.Clone() return out } diff --git a/internal/app/build.go b/internal/app/build.go index dfefceec9b..c3cc05d05c 100644 --- a/internal/app/build.go +++ b/internal/app/build.go @@ -74,6 +74,7 @@ import ( "github.com/stacklok/mecatl/internal/adapter/toolhivellm" "github.com/stacklok/mecatl/internal/adapter/tools" "github.com/stacklok/mecatl/internal/adapter/xdgconfig" + "github.com/stacklok/mecatl/internal/syscaller" ) // defaultContextWindowTokens is the model context window the loop uses to decide @@ -1416,7 +1417,7 @@ func Build(ctx context.Context, cfg Config) (*Built, error) { if agentClose == nil { agentClose = func() {} } - engine, mainMgr, mcpProvider, mcpInventory, sessFactory, learned, policy, assets, scheduleMgr, mcpClose, err := buildEngine(ctx, cfg, reg, provider, store, eventLog, agentReg) + engine, mainMgr, mcpProvider, mcpInventory, sessFactory, learned, policy, assets, scheduleMgr, mcpClose, err := buildEngine(ctx, cfg, reg, provider, store, agentReg) if err != nil { agentClose() storeClose() @@ -2592,7 +2593,7 @@ func chainClose(first, second func()) func() { // resolveAgentSeam (FS or driver) — threaded in, never re-resolved here, so // every consumer (catalog, per-session factory, snapshot, team wiring) shares // the same registry. -func buildEngine(ctx context.Context, cfg Config, reg *providerRegistry, provider port.LLMProvider, store port.SessionStore, eventLog port.EventLog, agentReg *agents.Registry) (*agent.Engine, *mcp.Manager, mcp.Provider, []mcpsource.SourceInfo, server.SessionEngineFactory, *permstore.Memory, port.PermissionPolicy, catalogAssets, *server.ScheduleManagerImpl, func(), error) { +func buildEngine(ctx context.Context, cfg Config, reg *providerRegistry, provider port.LLMProvider, store port.SessionStore, agentReg *agents.Registry) (*agent.Engine, *mcp.Manager, mcp.Provider, []mcpsource.SourceInfo, server.SessionEngineFactory, *permstore.Memory, port.PermissionPolicy, catalogAssets, *server.ScheduleManagerImpl, func(), error) { // SkillDraft trust boundary: when enabled, the quarantine dir must live OUTSIDE // the workspace root (so the model's workspace-confined Write/Edit cannot reach // it) and be disjoint from every active skills dir. Fatal on a misconfig. @@ -2663,7 +2664,6 @@ func buildEngine(ctx context.Context, cfg Config, reg *providerRegistry, provide scheduleMgr := server.NewScheduleManager(server.ScheduleManagerConfig{ Store: store, ScheduleStore: toolSchedStore, - EventLog: eventLog, Diagnostics: cfg.diag(), }) scheduleManagerFactory := func() port.ScheduleManager { @@ -4550,6 +4550,9 @@ func registerSkillDraft(ctx context.Context, cfg Config, cat *tool.Catalog, exis // goroutine when MemoryConsolidateInterval is positive. It shares ctx (so the loop // exits on shutdown) and the same LLM provider as the agent. func startMemoryConsolidation(ctx context.Context, cfg Config, store tool.MemoryStore, provider port.LLMProvider) { + // No caller: the consolidator runs as the explicit system principal + // (ADR 0100 decision 7). + ctx = syscaller.Context(ctx, syscaller.RootMemoryConsolidation) if cfg.MemoryConsolidateInterval <= 0 { cfg.diag().Log(ctx, port.LevelInfo, "memory consolidation DISABLED") return @@ -4575,6 +4578,9 @@ func startMemoryConsolidation(ctx context.Context, cfg Config, store tool.Memory // false otherwise — a small testability seam so a test can assert the OFF-by-default // posture (interval 0 ⇒ no goroutine) without observing the background loop. func startUserModelConsolidation(ctx context.Context, cfg Config, store tool.MemoryStore, provider port.LLMProvider) bool { + // No caller: the consolidator runs as the explicit system principal + // (ADR 0100 decision 7). + ctx = syscaller.Context(ctx, syscaller.RootUserModelConsolidation) if cfg.UserModelConsolidateInterval <= 0 { cfg.diag().Log(ctx, port.LevelInfo, "user-model consolidation DISABLED") return false diff --git a/internal/app/caller_identity_schedule_test.go b/internal/app/caller_identity_schedule_test.go new file mode 100644 index 0000000000..20944f1ab4 --- /dev/null +++ b/internal/app/caller_identity_schedule_test.go @@ -0,0 +1,348 @@ +package app + +import ( + "context" + "errors" + "testing" + "time" + + "github.com/stacklok/mecatl/engine/adapter/memfs" + "github.com/stacklok/mecatl/engine/adapter/memschedulestore" + "github.com/stacklok/mecatl/engine/adapter/memstore" + "github.com/stacklok/mecatl/engine/adapter/mockllm" + "github.com/stacklok/mecatl/engine/adapter/permpolicy" + "github.com/stacklok/mecatl/engine/agent" + "github.com/stacklok/mecatl/engine/port" + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/engine/tool" + "github.com/stacklok/mecatl/internal/adapter/server" + "github.com/stacklok/mecatl/internal/adapter/store/jsonlstore" + "github.com/stacklok/mecatl/internal/syscaller" +) + +// alicePrincipal is the verified human caller these scenario tests attribute +// schedules to. Identity is the (issuer, subject) PAIR (ADR 0100 decision 1). +var alicePrincipal = session.Principal{ + Issuer: "https://idp.example", + Subject: "alice", + GrantType: session.GrantTypeUser, + Name: "Alice", +} + +// bobPrincipal is the SECOND caller: the one whose context is present while +// Alice's session is the schedule's origin, so an origin-capture test can prove +// the origin session's owner wins over the calling context. +var bobPrincipal = session.Principal{ + Issuer: "https://idp.example", + Subject: "bob", + GrantType: session.GrantTypeUser, +} + +// newScheduleOwnerFixture builds the create-seam under test over in-memory +// adapters: a memstore SessionStore (which is also the PrunableStore childgc +// sweeps) plus a memschedulestore ScheduleStore. It is the SAME +// server.NewScheduleManager composition wires into the Service, so the owner +// capture is exercised where it really lives — not in a stand-in. +func newScheduleOwnerFixture(t *testing.T) (*memstore.Store, interface { + CreateSchedule(context.Context, port.ScheduleSpec) (port.Schedule, error) + GetSchedule(context.Context, string) (port.Schedule, error) + UpdateSchedule(context.Context, port.ScheduleSpec) (port.Schedule, error) +}, +) { + t.Helper() + sessions := memstore.New() + mgr := server.NewScheduleManager(server.ScheduleManagerConfig{ + Store: sessions, + ScheduleStore: memschedulestore.New(), + Diagnostics: port.NopDiagnostics{}, + }) + if mgr == nil { + t.Fatal("NewScheduleManager returned nil (no ScheduleStore wired)") + } + return sessions, mgr +} + +// saveOwnedSession persists an idle session owned by owner (nil = ownerless). +func saveOwnedSession(t *testing.T, store *memstore.Store, id session.SessionID, owner *session.Principal) { + t.Helper() + sess := session.New(id, session.ModePlan, "/ws", session.Limits{}, time.Now()) + if err := sess.RestoreLabels(owner, ""); err != nil { + t.Fatalf("RestoreLabels: %v", err) + } + if err := store.Save(context.Background(), sess); err != nil { + t.Fatalf("Save(%q): %v", id, err) + } +} + +// ownedScheduleSpec is a minimal valid one-shot spec (non-mutating ⇒ plan mode, +// default profile ⇒ a workspace is required). +func ownedScheduleSpec(name string, origin session.SessionID) port.ScheduleSpec { + return port.ScheduleSpec{ + Name: name, + Prompt: "check the build", + Workspace: "/ws", + Mode: session.ModePlan, + Trigger: port.TriggerSpec{OneShot: time.Now().Add(time.Hour)}, + OriginSessionID: origin, + } +} + +// TestCallerIdentity_Scenario4_ScheduleOwnerCapturedAtCreate pins AC4.3: a +// schedule created FROM Alice's session records Alice as its owner at CREATE +// time, and that owner survives the origin session being swept by childgc. +// +// The childgc half is the point (ADR 0100 decision 6): deriving the owner at +// FIRE time would read a session that no longer exists, so the capture must be +// durable on the schedule itself. The test therefore sweeps the origin away and +// re-reads the schedule from the store. +// +// It also proves the ORIGIN wins over the calling context: the create runs +// under BOB's principal while Alice's session is the origin, so a capture that +// lazily read the context principal would name Bob and fail here. +func TestCallerIdentity_Scenario4_ScheduleOwnerCapturedAtCreate(t *testing.T) { + t.Parallel() + sessions, mgr := newScheduleOwnerFixture(t) + const originID = session.SessionID("origin-alice") + saveOwnedSession(t, sessions, originID, &alicePrincipal) + + // The create runs under Bob's context — the origin session's owner must win. + ctx := session.WithPrincipal(context.Background(), &bobPrincipal) + created, err := mgr.CreateSchedule(ctx, ownedScheduleSpec("nightly", originID)) + if err != nil { + t.Fatalf("CreateSchedule: %v", err) + } + assertOwner(t, "created schedule", created.Spec.Owner, alicePrincipal.Issuer, alicePrincipal.Subject, session.GrantTypeUser) + + // Sweep the origin session away, exactly as the retention sweeper does. + gc := &childGC{ + store: sessions, + policy: childGCPolicy{mainRetention: time.Nanosecond}, + isLive: func(session.SessionID) bool { return false }, + now: func() time.Time { return time.Now().Add(time.Hour) }, + diag: port.NopDiagnostics{}, + } + if deleted, _ := gc.sweep(context.Background()); deleted != 1 { + t.Fatalf("childgc swept %d sessions, want 1 (the origin)", deleted) + } + if _, err := sessions.Load(context.Background(), originID); !errors.Is(err, port.ErrSessionNotFound) { + t.Fatalf("origin session still loadable after sweep (err=%v); the AC4.3 premise requires it gone", err) + } + + // The schedule still names its owner, read back from the store. + loaded, err := mgr.GetSchedule(context.Background(), "nightly") + if err != nil { + t.Fatalf("GetSchedule after sweep: %v", err) + } + assertOwner(t, "schedule after origin sweep", loaded.Spec.Owner, alicePrincipal.Issuer, alicePrincipal.Subject, session.GrantTypeUser) + + // Write-once: an Update must not re-own the schedule to the updating caller. + updated, err := mgr.UpdateSchedule(session.WithPrincipal(context.Background(), &bobPrincipal), ownedScheduleSpec("nightly", "")) + if err != nil { + t.Fatalf("UpdateSchedule: %v", err) + } + assertOwner(t, "schedule after update", updated.Spec.Owner, alicePrincipal.Issuer, alicePrincipal.Subject, session.GrantTypeUser) +} + +// vanishingStore serves the origin session on its FIRST Load and reports it +// gone on every later one, reproducing the childgc sweep landing between the +// create-seam's origin validation and its owner capture. It is a legal +// port.SessionStore: a deleted session is exactly ErrSessionNotFound. +type vanishingStore struct { + inner *memstore.Store + id session.SessionID + loads int +} + +func (v *vanishingStore) Save(ctx context.Context, s *session.Session) error { + return v.inner.Save(ctx, s) +} + +func (v *vanishingStore) Load(ctx context.Context, id session.SessionID) (*session.Session, error) { + if id == v.id { + v.loads++ + if v.loads > 1 { + return nil, port.ErrSessionNotFound + } + } + return v.inner.Load(ctx, id) +} + +// TestCallerIdentity_Scenario4_ScheduleOwnerSurvivesOriginDeletionRace pins the +// race half of AC4.3: the captured owner comes from the load the create-seam +// ALREADY validated, not from a second read of the origin session. A childgc +// sweep landing between the two reads must not turn a validated, owned create +// into a silently OWNERLESS schedule — an ownerless schedule can never be +// attributed, and validation had already passed. +func TestCallerIdentity_Scenario4_ScheduleOwnerSurvivesOriginDeletionRace(t *testing.T) { + t.Parallel() + const originID = session.SessionID("origin-alice-racing") + sessions := memstore.New() + store := &vanishingStore{inner: sessions, id: originID} + mgr := server.NewScheduleManager(server.ScheduleManagerConfig{ + Store: store, + ScheduleStore: memschedulestore.New(), + Diagnostics: port.NopDiagnostics{}, + }) + if mgr == nil { + t.Fatal("NewScheduleManager returned nil") + } + saveOwnedSession(t, sessions, originID, &alicePrincipal) + + created, err := mgr.CreateSchedule(context.Background(), ownedScheduleSpec("racing", originID)) + if err != nil { + t.Fatalf("CreateSchedule: %v", err) + } + if store.loads != 1 { + t.Errorf("origin session Loaded %d times, want 1 (the validated load is threaded, not re-read)", store.loads) + } + assertOwner(t, "schedule created across an origin sweep", created.Spec.Owner, + alicePrincipal.Issuer, alicePrincipal.Subject, session.GrantTypeUser) +} + +// TestCallerIdentity_Scenario4_OutOfBandScheduleOwnerFromContext pins AC4.6: a +// schedule created out of band (REST/CLI — no origin session) under a verified +// principal records the CONTEXT principal as its owner, not an origin lookup. +// An unauthenticated create stays ownerless — never a fabricated owner. +func TestCallerIdentity_Scenario4_OutOfBandScheduleOwnerFromContext(t *testing.T) { + t.Parallel() + _, mgr := newScheduleOwnerFixture(t) + + ctx := session.WithPrincipal(context.Background(), &bobPrincipal) + created, err := mgr.CreateSchedule(ctx, ownedScheduleSpec("out-of-band", "")) + if err != nil { + t.Fatalf("CreateSchedule: %v", err) + } + assertOwner(t, "out-of-band schedule", created.Spec.Owner, bobPrincipal.Issuer, bobPrincipal.Subject, session.GrantTypeUser) + + // No principal on the context ⇒ ownerless, never fabricated. + anon, err := mgr.CreateSchedule(context.Background(), ownedScheduleSpec("anon", "")) + if err != nil { + t.Fatalf("CreateSchedule (no principal): %v", err) + } + if anon.Spec.Owner != nil { + t.Errorf("unauthenticated create recorded owner %+v, want nil (never fabricated)", *anon.Spec.Owner) + } +} + +// TestCallerIdentity_Scenario4_FireRunsAsOwnerClientCredentials pins AC4.4: a +// scheduled fire's "sched--" session records the SCHEDULE's owner subject with +// GrantType client_credentials — injected via the explicit WithOwner +// CreateSessionOption — while its durable EVENTS name the acting principal: the +// scheduler's SYSTEM principal. +// +// That split is the point. The owner is accountable ("whose is this?"); the +// scheduler is what acted ("who did this?"). Alice is still named on the session, +// but the events no longer claim she personally acted at 3am. +// +// The fire runs under the scheduler's SYSTEM principal (syscaller.Context), so +// without the injection the create-seam's resolveOwner would stamp +// mecatl:internal/scheduler as the fire session's OWNER. The test asserts that +// system principal does NOT leak onto the session. +func TestCallerIdentity_Scenario4_FireRunsAsOwnerClientCredentials(t *testing.T) { + t.Parallel() + storeDir := t.TempDir() + workspace := t.TempDir() + + store, err := jsonlstore.New(storeDir) + if err != nil { + t.Fatalf("jsonlstore.New: %v", err) + } + llm := mockllm.New(mockllm.TextTurn("fire done")) + engine := agent.NewEngine(agent.Deps{ + LLM: llm, + Catalog: tool.NewCatalog(), + Policy: permpolicy.NewPolicy(permpolicy.AllowAllFloorRules(), nil), + Model: "test-model", + Store: store, + }) + svc, err := server.NewService(server.Config{ + Engine: engine, + Store: store, + Workspaces: func(root string) tool.Workspace { return memfs.NewWorkspace(root) }, + Now: time.Now, + DefaultCapabilities: llm.Capabilities(), + EventLog: store, + Diagnostics: port.NopDiagnostics{}, + }) + if err != nil { + t.Fatalf("NewService: %v", err) + } + + owner := alicePrincipal + sched := port.Schedule{Spec: port.ScheduleSpec{ + Name: "owned-fire", + Prompt: "say hi", + Workspace: workspace, + Mode: session.ModePlan, + Owner: &owner, + }} + + // The scheduler's fire goroutine runs under the system principal. + ctx := syscaller.Context(context.Background(), syscaller.RootScheduler) + fire := makeFireFunc(svc, store.ScheduleStore(), defaultFireTimeout, nil) + rec, err := fire(ctx, sched, time.Now()) + if err != nil { + t.Fatalf("fire: %v", err) + } + if rec.Stop != session.StopEndTurn { + t.Fatalf("fire stop = %q, want %q", rec.Stop, session.StopEndTurn) + } + + fired, err := store.Load(context.Background(), rec.SessionID) + if err != nil { + t.Fatalf("Load fire session %q: %v", rec.SessionID, err) + } + assertOwner(t, "fire session", fired.Owner, owner.Issuer, owner.Subject, session.GrantTypeClientCredentials) + if fired.Owner != nil && fired.Owner.Issuer == syscaller.Issuer { + t.Errorf("fire session owner issuer = %q: the scheduler's system principal leaked through", fired.Owner.Issuer) + } + + // The schedule LIFECYCLE event ("fired") is what the scheduler emits after the + // FireFunc returns, on the same system-principal context. It must reach the log + // through the ONE stamping chokepoint — not as an unstamped direct Append. + svc.EmitScheduleEvent(ctx, session.SchedulePayload{ + ScheduleName: sched.Spec.Name, + FireID: rec.ID, + SessionID: rec.SessionID, + Kind: "fired", + Stop: rec.Stop, + }) + + // The fire's durable events name the ACTING principal — the scheduler's system + // principal — not the accountable owner on the session. + var events int + var sawFired bool + for ev, err := range store.Read(context.Background(), rec.SessionID) { + if err != nil { + t.Fatalf("EventLog.Read: %v", err) + } + events++ + if ev.Type == session.EvScheduleFired { + sawFired = true + } + assertOwner(t, "event "+string(ev.Type)+" actor", ev.Actor, + syscaller.Issuer, string(syscaller.RootScheduler), session.GrantTypeSystem) + } + if events == 0 { + t.Fatal("the fire session's durable log is empty; the actor assertion never ran") + } + if !sawFired { + t.Fatal("no schedule.fired event in the durable log; the lifecycle-stamp assertion never ran") + } +} + +// assertOwner asserts a recorded principal names the expected (issuer, subject) +// pair with the expected grant type. A nil principal is a failure — these ACs +// are about a PRESENT attribution. +func assertOwner(t *testing.T, what string, got *session.Principal, issuer, subject string, grant session.GrantType) { + t.Helper() + if got == nil { + t.Fatalf("%s: owner is nil, want subject %q", what, subject) + } + if got.Issuer != issuer || got.Subject != subject { + t.Errorf("%s: identity = (%q, %q), want (%q, %q)", what, got.Issuer, got.Subject, issuer, subject) + } + if got.GrantType != grant { + t.Errorf("%s: grant type = %q, want %q", what, got.GrantType, grant) + } +} diff --git a/internal/app/childgc.go b/internal/app/childgc.go index 21c62cef51..cd26624232 100644 --- a/internal/app/childgc.go +++ b/internal/app/childgc.go @@ -20,6 +20,7 @@ import ( "github.com/stacklok/mecatl/engine/agent" "github.com/stacklok/mecatl/engine/port" "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/internal/syscaller" ) // childSessionPrefixes are the delegation families' child-session id @@ -323,6 +324,9 @@ func (g *childGC) sweepPartition(ctx context.Context, entries []port.StoredSessi // liveness predicate is the Service's in-flight run registry, threaded in by // Build AFTER the Service exists. func startChildGC(ctx context.Context, cfg Config, store port.SessionStore, isLive func(session.SessionID) bool) { + // The sweeper has no caller: it runs as the explicit system principal + // (ADR 0100 decision 7), never an absent one. + ctx = syscaller.Context(ctx, syscaller.RootChildGC) policy := childGCPolicy{ retention: cfg.ChildRetention, maxPerFamily: cfg.ChildRetentionMaxPerFamily, diff --git a/internal/app/export_test.go b/internal/app/export_test.go new file mode 100644 index 0000000000..aac9f89a99 --- /dev/null +++ b/internal/app/export_test.go @@ -0,0 +1,38 @@ +package app + +import ( + "context" + + mecatlv1 "github.com/stacklok/mecatl/contracts/gen/go/mecatl/v1" + "github.com/stacklok/mecatl/engine/port" +) + +// Test seams for the EXTERNAL app_test package (which must import +// internal/cliconfig — that package imports app, so the pinning test cannot be +// an in-package test). Only the internal goroutine starters whose +// system-principal wrap is pinned by +// TestCallerIdentity_Scenario2_InternalGoroutinesRunAsSystem are exported here. +var ( + StartChildGCForTest = startChildGC + StartMemoryConsolidationForTest = startMemoryConsolidation + StartUserModelConsolidationForTest = startUserModelConsolidation +) + +type modelRefreshProbe func(context.Context) + +func (p modelRefreshProbe) ListModels(ctx context.Context) ([]modelEntry, error) { + p(ctx) + return []modelEntry{{ID: "probe/model"}}, nil +} + +type discardModelSwap struct{} + +func (discardModelSwap) SetModels([]*mecatlv1.ModelInfo) {} + +// ObserveStartupModelRefreshForTest drives the real startup refresh entry point +// through a probe lister. The synchronous mode changes only scheduling; it uses +// the same root-context construction as the production background branch. +func ObserveStartupModelRefreshForTest(seen func(context.Context)) { + reg := regWithLister(modelRefreshProbe(seen)) + startLiveModelRefresh(port.NopDiagnostics{}, reg, discardModelSwap{}, true, 0)() +} diff --git a/internal/app/modellister.go b/internal/app/modellister.go index f7182367fd..1ccf592586 100644 --- a/internal/app/modellister.go +++ b/internal/app/modellister.go @@ -13,6 +13,7 @@ import ( "github.com/stacklok/mecatl/internal/adapter/openrouter" "github.com/stacklok/mecatl/internal/adapter/providercatalog" "github.com/stacklok/mecatl/internal/adapter/server" + "github.com/stacklok/mecatl/internal/syscaller" "github.com/stacklok/mecatl/provider/anthropic" ) @@ -102,15 +103,16 @@ func startLiveModelRefresh(d port.Diagnostics, reg *providerRegistry, swap model } return func() {} // nothing to refresh } + rootCtx := syscaller.Context(context.Background(), syscaller.RootModelCatalogRefresh) if runSync { - ctx, cancel := context.WithTimeout(context.Background(), liveModelRefreshTimeout) + ctx, cancel := context.WithTimeout(rootCtx, liveModelRefreshTimeout) defer cancel() byProvider := liveModelSnapshot(ctx, d, reg) publishSnapshot(d, reg, swap, byProvider) reg.meta.markRefreshCompleted() // sync path SETTLES after the swap. return func() {} } - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(rootCtx) var wg sync.WaitGroup wg.Add(1) go func() { diff --git a/internal/app/modellister_test.go b/internal/app/modellister_test.go index f0296d6790..fc57eab7df 100644 --- a/internal/app/modellister_test.go +++ b/internal/app/modellister_test.go @@ -15,8 +15,10 @@ import ( mecatlv1 "github.com/stacklok/mecatl/contracts/gen/go/mecatl/v1" "github.com/stacklok/mecatl/engine/adapter/mockllm" "github.com/stacklok/mecatl/engine/port" + "github.com/stacklok/mecatl/engine/session" "github.com/stacklok/mecatl/internal/adapter/openaicompat" "github.com/stacklok/mecatl/internal/adapter/openrouter" + "github.com/stacklok/mecatl/internal/syscaller" ) // TestOpenCodeListerStampsImageModality is the F1 regression: OpenCode Go's @@ -91,6 +93,35 @@ func (f *fakeLister) ListModels(context.Context) ([]modelEntry, error) { return f.models, nil } +type principalLister struct { + seen chan *session.Principal +} + +func (l *principalLister) ListModels(ctx context.Context) ([]modelEntry, error) { + l.seen <- session.PrincipalFromContext(ctx) + return []modelEntry{{ID: "live/model"}}, nil +} + +func TestStartupModelRefreshListerSeesSystemPrincipal(t *testing.T) { + lister := &principalLister{seen: make(chan *session.Principal, 1)} + reg := regWithLister(lister) + closer := startLiveModelRefresh(port.NopDiagnostics{}, reg, newFakeSwapper(), false, 0) + defer closer() + + select { + case got := <-lister.seen: + if got == nil { + t.Fatal("lister principal is nil, want explicit system principal") + } + if got.Issuer != syscaller.Issuer || got.Subject != string(syscaller.RootModelCatalogRefresh) || got.GrantType != session.GrantTypeSystem { + t.Fatalf("lister principal = %+v, want issuer=%q subject=%q grant=%q", got, + syscaller.Issuer, syscaller.RootModelCatalogRefresh, session.GrantTypeSystem) + } + case <-time.After(10 * time.Second): + t.Fatal("startup model refresh did not call lister") + } +} + // regWithLister builds a registry with openai (no lister) + openrouter (the given // lister), both backed by canned mocks, for the composition merge tests. func regWithLister(lister modelLister) *providerRegistry { diff --git a/internal/app/scheduler_fire.go b/internal/app/scheduler_fire.go index c48c780400..107376c872 100644 --- a/internal/app/scheduler_fire.go +++ b/internal/app/scheduler_fire.go @@ -83,7 +83,9 @@ func makeFireFunc(svc *server.Service, store port.ScheduleStore, defaultTimeout // override means the fire's persisted session carries the sched-- family // prefix the GC retention sweep (ScheduleFireRetention) partitions on. fireID := newFireID(sched.Spec.Name, now) - sess, err := svc.CreateSessionWithProfile(ctx, sched.Spec.Workspace, mode, limits, sel, profile, server.WithSessionID(session.SessionID(fireID))) + sess, err := svc.CreateSessionWithProfile(ctx, sched.Spec.Workspace, mode, limits, sel, profile, + server.WithSessionID(session.SessionID(fireID)), + server.WithOwner(fireSessionOwner(sched.Spec.Owner))) if err != nil { return fireFailed(sched, now, "", err), err } @@ -182,7 +184,18 @@ func makeFireFunc(svc *server.Service, store port.ScheduleStore, defaultTimeout // pointer to the session id. var stop session.StopReason var runErr string + // Cancel-detached, exactly as the wire relays' logCtx: the fire's ctx may + // already be cancelled (watchdog, shutdown) when the terminal events land, + // and the durable log exists precisely to record that tail. + logCtx := context.WithoutCancel(ctx) for ev := range run.Events() { + // The fire loop is this run's only consumer, so it owns the durable + // append the gRPC/HTTP relays do for a client-driven run. It routes + // through the ONE stamping path (Service.appendEvent), which attributes + // each event to the caller on this ctx — the scheduler's SYSTEM + // principal, the thing that actually acted. The schedule's owner stays + // on the fire SESSION (ADR 0100 decisions 5 + 6). + svc.AppendRunEvent(logCtx, sess.ID, ev) // RecordFireProgress on turn-boundary / activity events (issue #386): // NOT every chunk — once per EvToolCall / EvTurnEnd / EvResult, so a // long streaming turn does not stamp a per-delta. Best-effort WARN. @@ -247,6 +260,28 @@ func makeFireFunc(svc *server.Service, store port.ScheduleStore, defaultTimeout } } +// fireSessionOwner projects the SCHEDULE's captured owner (ADR 0100 decision 6) +// onto the fire session's owner: the same (issuer, subject) identity, with +// GrantType client_credentials — a fire is automated, not interactive, and the +// grant type says so honestly while attribution still collapses to the +// accountable person. +// +// It is passed to CreateSessionWithProfile UNCONDITIONALLY (server.WithOwner): +// the fire runs under the scheduler's SYSTEM principal, so without the explicit +// injection the create-seam would stamp mecatl:internal/scheduler as the fire +// session's owner. A nil (ownerless) schedule yields WithOwner(nil) — the +// EXPLICIT ownerless injection, which deliberately does NOT fall back to the +// context principal: an ownerless schedule's fire stays ownerless rather than +// being adopted by the harness. +func fireSessionOwner(owner *session.Principal) *session.Principal { + out := owner.Clone() + if out == nil { + return nil + } + out.GrantType = session.GrantTypeClientCredentials + return out +} + // newFireID mints a per-fire identifier: "sched----". // It is pre-minted on the fire path (ADR 0059 decision #7 Phase-2) and passed // as the WithSessionID override to CreateSessionWithProfile, so the fire's diff --git a/internal/app/system_principal_test.go b/internal/app/system_principal_test.go new file mode 100644 index 0000000000..8d379ad1d7 --- /dev/null +++ b/internal/app/system_principal_test.go @@ -0,0 +1,282 @@ +package app_test + +import ( + "context" + "sync" + "testing" + "time" + + "github.com/stacklok/mecatl/engine/adapter/memschedulestore" + "github.com/stacklok/mecatl/engine/adapter/memstore" + "github.com/stacklok/mecatl/engine/adapter/wallclock" + "github.com/stacklok/mecatl/engine/port" + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/engine/tool" + "github.com/stacklok/mecatl/internal/adapter/scheduler" + "github.com/stacklok/mecatl/internal/adapter/server" + "github.com/stacklok/mecatl/internal/app" + "github.com/stacklok/mecatl/internal/cliconfig" + "github.com/stacklok/mecatl/internal/syscaller" +) + +// observe records the context a port actually saw on the named path, from +// whatever goroutine the production wiring ran it on. The path label is what +// lets a root with SEVERAL boundary-crossing paths (the scheduler: tick, fire, +// delivery, reconcile) be asserted on EACH of them rather than on whichever one +// happens to report first. +type observe func(ctx context.Context, path string) + +// starter drives ONE registered internal goroutine root through its REAL +// production entry point, wired to port probes that hand back the context the +// goroutine crossed each boundary with. paths enumerates every path the root +// MUST be observed on; the harness waits for all of them and asserts each. +type starter struct { + paths []string + run func(ctx context.Context, t *testing.T, seen observe) +} + +// TestCallerIdentity_Scenario2_InternalGoroutinesRunAsSystem pins AC2.2: every +// internal goroutine root runs under an EXPLICIT system principal, never an +// absent one (ADR 0100 decision 7). +// +// The set is enumerated ONCE — syscaller.Roots is the registry, and this table +// must cover it exactly. A goroutine that registers a root but forgets the wrap +// at its call site fails its subtest (its port observes a nil principal); a root +// registered with no driver here fails the coverage assertion. +func TestCallerIdentity_Scenario2_InternalGoroutinesRunAsSystem(t *testing.T) { + t.Parallel() + + starters := map[syscaller.Root]starter{ + syscaller.RootChildGC: {paths: []string{"store.List"}, run: func(ctx context.Context, _ *testing.T, seen observe) { + // The sweeper's first act is a store List — the port boundary. + app.StartChildGCForTest(ctx, app.Config{ChildRetention: time.Hour}, + &probeSessionStore{Store: memstore.New(), seen: seen}, + func(session.SessionID) bool { return false }) + }}, + syscaller.RootMemoryConsolidation: {paths: []string{"memory.List"}, run: func(ctx context.Context, _ *testing.T, seen observe) { + app.StartMemoryConsolidationForTest(ctx, + app.Config{MemoryConsolidateInterval: time.Millisecond}, + probeMemoryStore{seen: seen}, nil) + }}, + syscaller.RootUserModelConsolidation: {paths: []string{"memory.List"}, run: func(ctx context.Context, _ *testing.T, seen observe) { + app.StartUserModelConsolidationForTest(ctx, + app.Config{UserModelConsolidateInterval: time.Millisecond}, + probeMemoryStore{seen: seen}, nil) + }}, + // The scheduler root fans out into FOUR boundary-crossing paths, all + // descending from Start's one syscaller wrap. Every one is asserted: the + // tick's Due poll alone would leave fire, delivery and reconcile resting + // on an inheritance argument, so a stray context.Background() in any of + // them would pass. + syscaller.RootScheduler: { + paths: []string{"store.Due", "fire", "delivery", "reconcile"}, + run: startProbedScheduler, + }, + syscaller.RootModelCatalogRefresh: {paths: []string{"lister.ListModels"}, run: func(_ context.Context, _ *testing.T, seen observe) { + app.ObserveStartupModelRefreshForTest(func(ctx context.Context) { + seen(ctx, "lister.ListModels") + }) + }}, + syscaller.RootJWKSRefresh: {paths: []string{"validator.New"}, run: func(ctx context.Context, t *testing.T, seen observe) { + // The validator owns background key rotation, so the ctx it is + // CONSTRUCTED with is the refresh goroutine's root. + _, err := cliconfig.OIDCValidator(ctx, cliconfig.OIDCConfig{ + Issuer: "https://idp.example", + Audience: "mecatl", + NewValidator: func(ctx context.Context, _ cliconfig.OIDCConfig) (server.PrincipalValidator, error) { + seen(ctx, "validator.New") + return probeValidator{}, nil + }, + }) + if err != nil { + t.Fatalf("OIDCValidator: %v", err) + } + }}, + } + + // The registry and the table are ONE set: a new root with no driver here is + // red, and a driver for an unregistered root is red. + if len(starters) != len(syscaller.Roots) { + t.Fatalf("registry/table drift: %d registered roots, %d drivers", len(syscaller.Roots), len(starters)) + } + for _, root := range syscaller.Roots { + if _, ok := starters[root]; !ok { + t.Fatalf("registered root %q has no driver in this test", root) + } + } + + for _, root := range syscaller.Roots { + t.Run(string(root), func(t *testing.T) { + t.Parallel() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + // The root context carries NO principal: whatever the port sees is + // what the production wiring stamped, nothing inherited from here. + st := starters[root] + rec := &pathRecorder{want: st.paths, got: map[string]context.Context{}, done: make(chan struct{})} + st.run(ctx, t, rec.observe) + select { + case <-rec.done: + case <-time.After(10 * time.Second): + t.Fatalf("%s: never crossed these port boundaries: %v", root, rec.missing()) + } + for _, path := range st.paths { + p := session.PrincipalFromContext(rec.contextFor(path)) + if p == nil { + t.Fatalf("%s (%s): port observed an ABSENT principal; that path's context is not wrapped with the system principal", root, path) + } + if p.GrantType != session.GrantTypeSystem { + t.Errorf("%s (%s): grant type = %q, want %q", root, path, p.GrantType, session.GrantTypeSystem) + } + if p.Subject != string(root) { + t.Errorf("%s (%s): subject = %q, want %q (the root must stamp its OWN identity)", root, path, p.Subject, root) + } + } + }) + } +} + +// pathRecorder collects the FIRST context observed on each declared path and +// closes done once every one has reported. Observations arrive from the +// production goroutines, so it is mutex-guarded. +type pathRecorder struct { + mu sync.Mutex + want []string + got map[string]context.Context + done chan struct{} + closed bool +} + +func (r *pathRecorder) observe(ctx context.Context, path string) { + r.mu.Lock() + defer r.mu.Unlock() + if _, seen := r.got[path]; !seen { + r.got[path] = ctx + } + if r.closed || len(r.got) < len(r.want) { + return + } + for _, p := range r.want { + if _, seen := r.got[p]; !seen { + return + } + } + r.closed = true + close(r.done) +} + +func (r *pathRecorder) contextFor(path string) context.Context { + r.mu.Lock() + defer r.mu.Unlock() + return r.got[path] +} + +func (r *pathRecorder) missing() []string { + r.mu.Lock() + defer r.mu.Unlock() + var out []string + for _, p := range r.want { + if _, seen := r.got[p]; !seen { + out = append(out, p) + } + } + return out +} + +// startProbedScheduler drives the REAL scheduler through Start (the one place +// the syscaller wrap happens) with its store pre-seeded so all four paths fire: +// a DUE cron schedule drives the fire path and, through RecordFire, the delivery +// callback; a stale claimed-but-never-started fire drives the reconcile scan; +// and the tick's own Due poll is observed by the store probe. +func startProbedScheduler(ctx context.Context, t *testing.T, seen observe) { + store := memschedulestore.New() + now := time.Now() + if err := store.Save(context.Background(), port.Schedule{ + Spec: port.ScheduleSpec{ + Name: "due-cron", + Prompt: "x", + Trigger: port.TriggerSpec{Cron: "* * * * *"}, + }, + State: port.ScheduleState{NextFireAt: now.Add(-time.Second), Enabled: true}, + }); err != nil { + t.Fatalf("Save(due-cron): %v", err) + } + // Claimed (NextFireAt already advanced) but never started, and old enough to + // be past the reconciler's stale window. + if err := store.Save(context.Background(), port.Schedule{ + Spec: port.ScheduleSpec{ + Name: "crashed-claim", + Prompt: "x", + Trigger: port.TriggerSpec{Cron: "* * * * *"}, + }, + State: port.ScheduleState{ + NextFireAt: now.Add(time.Hour), + Enabled: true, + LastFireAt: now.Add(-2 * time.Hour), + LastFireSessionID: port.PendingFireSessionID, + }, + }); err != nil { + t.Fatalf("Save(crashed-claim): %v", err) + } + + s := scheduler.New(scheduler.Config{ + Store: &probeScheduleStore{Store: store, seen: seen}, + Clock: wallclock.Clock{}, + TickInterval: time.Millisecond, + }) + s.SetFire(func(fctx context.Context, _ port.Schedule, _ time.Time) (port.ScheduleFire, error) { + seen(fctx, "fire") + return port.ScheduleFire{ID: "fire-1", SessionID: "sched--due-cron", Stop: "end_turn"}, nil + }) + s.SetDeliverFireResult(func(dctx context.Context, _ port.Schedule, _ port.ScheduleFire) { + seen(dctx, "delivery") + }) + s.SetReconcileStaleFire(func(rctx context.Context, _ port.Schedule) { + seen(rctx, "reconcile") + }) + if err := s.Start(ctx); err != nil { + t.Fatalf("scheduler.Start: %v", err) + } + t.Cleanup(func() { _ = s.Stop() }) +} + +// --- port probes: real reference adapters, wrapped to report the ctx --------- + +type probeSessionStore struct { + *memstore.Store + seen observe +} + +func (p *probeSessionStore) List(ctx context.Context) ([]port.StoredSession, error) { + p.seen(ctx, "store.List") + return p.Store.List(ctx) +} + +type probeScheduleStore struct { + *memschedulestore.Store + seen observe +} + +func (p *probeScheduleStore) Due(ctx context.Context, now time.Time) ([]port.Schedule, error) { + p.seen(ctx, "store.Due") + return p.Store.Due(ctx, now) +} + +// probeMemoryStore reports the ctx of the consolidator's first port call. The +// consolidator's List is its entry point and a 0-entry store is a no-op run, so +// no other method is ever reached. +type probeMemoryStore struct { + tool.MemoryStore + seen observe +} + +func (p probeMemoryStore) List(ctx context.Context, _ string) ([]tool.MemoryEntry, error) { + p.seen(ctx, "memory.List") + return nil, nil +} + +type probeValidator struct{} + +func (probeValidator) Validate(context.Context, string) (*session.Principal, error) { + return nil, server.ErrInvalidToken +} diff --git a/internal/app/usermodelreview.go b/internal/app/usermodelreview.go index 932c6b55b1..5d507149a5 100644 --- a/internal/app/usermodelreview.go +++ b/internal/app/usermodelreview.go @@ -59,15 +59,12 @@ func (h *userModelReviewHooks) Run(ctx context.Context, ev governance.HookEvent) if ev.Phase == governance.PhaseStop && h.admit() { sessionID := ev.SessionID - // Detach: a Stop must never wait on the (LLM-backed) review. context.Background - // is DELIBERATE — the run's ctx is cancelled as the run ends (the Stop hook - // fires on the terminal transition), so threading it would cancel the review - // the instant it starts. The detached review is best-effort and bounded by the - // reviewer's own child limits, not the (already-finished) run ctx. - //nolint:gosec // G118: intentional background ctx — see comment above. + // Detach cancellation without dropping the originating caller's context + // values. The review derives user-model facts from that caller's session. + reviewCtx := context.WithoutCancel(ctx) go func() { - if rerr := h.reviewer.Review(context.Background(), sessionID); rerr != nil { - h.diag.Log(context.Background(), port.LevelWarn, "user-model background review failed", "session", sessionID, "err", rerr) + if rerr := h.reviewer.Review(reviewCtx, sessionID); rerr != nil { + h.diag.Log(reviewCtx, port.LevelWarn, "user-model background review failed", "session", sessionID, "err", rerr) } }() } diff --git a/internal/app/usermodelreview_test.go b/internal/app/usermodelreview_test.go index 89484615a7..ba33d6aac1 100644 --- a/internal/app/usermodelreview_test.go +++ b/internal/app/usermodelreview_test.go @@ -34,12 +34,16 @@ func (r *recordingHookRunner) Run(_ context.Context, _ governance.HookEvent) (go // after Load (no child engine run, no LLM), making each decorator FIRE observable on // the channel without background churn. type signalStore struct { - loaded chan struct{} + loaded chan struct{} + principal chan *session.Principal } -func newSignalStore() *signalStore { return &signalStore{loaded: make(chan struct{}, 16)} } +func newSignalStore() *signalStore { + return &signalStore{loaded: make(chan struct{}, 16), principal: make(chan *session.Principal, 16)} +} -func (s *signalStore) Load(_ context.Context, id session.SessionID) (*session.Session, error) { +func (s *signalStore) Load(ctx context.Context, id session.SessionID) (*session.Session, error) { + s.principal <- session.PrincipalFromContext(ctx) s.loaded <- struct{}{} // Empty conversation → renderTranscript empty → Review returns before any run. return session.New(id, session.ModeDefault, "/proj", session.Limits{}, time.Now()), nil @@ -121,6 +125,33 @@ func TestUserModelReviewHooksFiresOnStopDebounced(t *testing.T) { } } +func TestUserModelReviewHooksPreservesPrincipal(t *testing.T) { + store := newSignalStore() + hooks := newUserModelReviewHooks(&recordingHookRunner{}, minimalReviewer(t, store), 1, port.NopDiagnostics{}) + principal := &session.Principal{ + Issuer: "https://idp.example", + Subject: "alice", + GrantType: session.GrantTypeUser, + } + + if _, err := hooks.Run(session.WithPrincipal(context.Background(), principal), governance.HookEvent{ + Phase: governance.PhaseStop, SessionID: "s", + }); err != nil { + t.Fatalf("Run: %v", err) + } + if !store.firedWithin(t) { + t.Fatal("review did not load the source session") + } + select { + case got := <-store.principal: + if got == nil || *got != *principal { + t.Fatalf("Load principal = %#v, want %#v", got, principal) + } + case <-time.After(2 * time.Second): + t.Fatal("Load did not observe a principal") + } +} + // TestUserModelReviewHooksIgnoresNonStop proves a non-Stop phase NEVER fires the // reviewer, even though it still delegates to the inner runner. func TestUserModelReviewHooksIgnoresNonStop(t *testing.T) { diff --git a/internal/cliconfig/authnvalidator.go b/internal/cliconfig/authnvalidator.go new file mode 100644 index 0000000000..dd9426c987 --- /dev/null +++ b/internal/cliconfig/authnvalidator.go @@ -0,0 +1,55 @@ +package cliconfig + +import ( + "context" + "errors" + "fmt" + + oidcauthn "github.com/stacklok/mecatl/authn/oidc" + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/internal/adapter/server" +) + +// authnValidator keeps the server's identity-error contract at the root module +// boundary while reusable token verification lives in authn/oidc. +type authnValidator struct { + validator *oidcauthn.Validator +} + +func (a authnValidator) Validate(ctx context.Context, bearer string) (*session.Principal, error) { + principal, err := a.validator.Validate(ctx, bearer) + if err != nil { + return nil, errToSentinel(err) + } + return principal, nil +} + +func (a authnValidator) Close() error { return a.validator.Close() } + +func errToSentinel(err error) error { + switch { + case errors.Is(err, context.Canceled), errors.Is(err, context.DeadlineExceeded): + return err + case errors.Is(err, oidcauthn.ErrIdentityUnavailable): + return fmt.Errorf("%w: %v", server.ErrIdentityUnavailable, err) + case errors.Is(err, oidcauthn.ErrInvalidToken): + return fmt.Errorf("%w: %v", server.ErrInvalidToken, err) + default: + return fmt.Errorf("%w: unrecognised validator failure", server.ErrInvalidToken) + } +} + +func defaultNewValidator(ctx context.Context, c OIDCConfig) (server.PrincipalValidator, error) { + validator, err := oidcauthn.NewValidator(ctx, oidcauthn.Config{ + Issuer: c.Issuer, + JWKSURI: c.JWKSURI, + Audience: c.Audience, + MaxJWKSStaleness: c.MaxJWKSStaleness, + InsecureAllowPrivateIssuer: c.InsecureAllowPrivateIssuer, + HTTPClient: c.httpClient, + }) + if err != nil { + return nil, err + } + return authnValidator{validator: validator}, nil +} diff --git a/internal/cliconfig/authnvalidator_test.go b/internal/cliconfig/authnvalidator_test.go new file mode 100644 index 0000000000..b4e2c8ba41 --- /dev/null +++ b/internal/cliconfig/authnvalidator_test.go @@ -0,0 +1,158 @@ +package cliconfig + +import ( + "context" + "crypto/rand" + "crypto/rsa" + "encoding/base64" + "encoding/json" + "errors" + "math/big" + "net/http" + "net/http/httptest" + "sync/atomic" + "testing" + "time" + + "github.com/golang-jwt/jwt/v5" + + oidcauthn "github.com/stacklok/mecatl/authn/oidc" + "github.com/stacklok/mecatl/engine/session" + "github.com/stacklok/mecatl/internal/adapter/server" +) + +func TestErrToSentinelPreservesRootContractAndContext(t *testing.T) { + t.Parallel() + for _, tc := range []struct { + name string + err error + want error + opposite error + }{ + {name: "invalid", err: oidcauthn.ErrInvalidToken, want: server.ErrInvalidToken, opposite: server.ErrIdentityUnavailable}, + {name: "unavailable", err: oidcauthn.ErrIdentityUnavailable, want: server.ErrIdentityUnavailable, opposite: server.ErrInvalidToken}, + {name: "canceled", err: context.Canceled, want: context.Canceled, opposite: server.ErrInvalidToken}, + {name: "deadline", err: context.DeadlineExceeded, want: context.DeadlineExceeded, opposite: server.ErrInvalidToken}, + {name: "unknown fails closed", err: errors.New("unknown"), want: server.ErrInvalidToken, opposite: server.ErrIdentityUnavailable}, + } { + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + got := errToSentinel(tc.err) + if !errors.Is(got, tc.want) { + t.Fatalf("errToSentinel(%v) = %v, want %v", tc.err, got, tc.want) + } + if errors.Is(got, tc.opposite) { + t.Fatalf("errToSentinel(%v) = %v, unexpectedly wraps %v", tc.err, got, tc.opposite) + } + }) + } +} + +const ( + rootTestKID = "root-test-key-1" + rootTestAudience = "mecatl" + rootTestSubject = "alice" +) + +type rootJWKSFixture struct { + srv *httptest.Server + key *rsa.PrivateKey + discovery atomic.Int64 + jwks atomic.Int64 +} + +func newRootJWKSFixture(t *testing.T) *rootJWKSFixture { + t.Helper() + key, err := rsa.GenerateKey(rand.Reader, 2048) + if err != nil { + t.Fatalf("rsa.GenerateKey: %v", err) + } + fixture := &rootJWKSFixture{key: key} + mux := http.NewServeMux() + mux.HandleFunc("/keys", func(w http.ResponseWriter, _ *http.Request) { + fixture.jwks.Add(1) + w.Header().Set("Content-Type", "application/json") + _ = json.NewEncoder(w).Encode(map[string]any{"keys": []map[string]string{{ + "kty": "RSA", "use": "sig", "alg": "RS256", "kid": rootTestKID, + "n": base64.RawURLEncoding.EncodeToString(key.N.Bytes()), + "e": base64.RawURLEncoding.EncodeToString(big.NewInt(int64(key.E)).Bytes()), + }}}) + }) + mux.HandleFunc("/.well-known/openid-configuration", func(w http.ResponseWriter, _ *http.Request) { + fixture.discovery.Add(1) + w.Header().Set("Content-Type", "application/json") + _ = json.NewEncoder(w).Encode(map[string]any{ + "issuer": fixture.srv.URL, "jwks_uri": fixture.srv.URL + "/keys", + }) + }) + fixture.srv = httptest.NewTLSServer(mux) + t.Cleanup(fixture.srv.Close) + return fixture +} + +func (f *rootJWKSFixture) sign(t *testing.T, audience string) string { + t.Helper() + now := time.Now() + token := jwt.NewWithClaims(jwt.SigningMethodRS256, jwt.MapClaims{ + "iss": f.srv.URL, "aud": audience, "sub": rootTestSubject, "name": "Alice", + "iat": now.Unix(), "nbf": now.Unix(), "exp": now.Add(10 * time.Minute).Unix(), + }) + token.Header["kid"] = rootTestKID + signed, err := token.SignedString(f.key) + if err != nil { + t.Fatalf("sign: %v", err) + } + return signed +} + +// validator builds through OIDCValidator's nil-constructor default so these +// tests pin root composition, not only the reusable adapter beneath it. +func (f *rootJWKSFixture) validator(t *testing.T) server.PrincipalValidator { + t.Helper() + validator, err := OIDCValidator(context.Background(), OIDCConfig{ + Issuer: f.srv.URL, Audience: rootTestAudience, JWKSURI: f.srv.URL + "/keys", + httpClient: f.srv.Client(), + }) + if err != nil { + t.Fatalf("OIDCValidator: %v", err) + } + if closer, ok := validator.(interface{ Close() error }); ok { + t.Cleanup(func() { _ = closer.Close() }) + } + return validator +} + +func TestDefaultOIDCValidatorAcceptsSignedToken(t *testing.T) { + fixture := newRootJWKSFixture(t) + principal, err := fixture.validator(t).Validate(context.Background(), fixture.sign(t, rootTestAudience)) + if err != nil { + t.Fatalf("Validate: %v", err) + } + want := session.Principal{ + Issuer: fixture.srv.URL, Subject: rootTestSubject, Name: "Alice", GrantType: session.GrantTypeUser, + } + if principal == nil || *principal != want { + t.Fatalf("principal = %#v, want %#v", principal, want) + } +} + +func TestDefaultOIDCValidatorMapsWrongAudience(t *testing.T) { + fixture := newRootJWKSFixture(t) + _, err := fixture.validator(t).Validate(context.Background(), fixture.sign(t, "other-service")) + if !errors.Is(err, server.ErrInvalidToken) || errors.Is(err, server.ErrIdentityUnavailable) { + t.Fatalf("wrong audience error = %v, want server.ErrInvalidToken only", err) + } +} + +func TestDefaultOIDCValidatorUsesPinnedJWKS(t *testing.T) { + fixture := newRootJWKSFixture(t) + if _, err := fixture.validator(t).Validate(context.Background(), fixture.sign(t, rootTestAudience)); err != nil { + t.Fatalf("Validate: %v", err) + } + if got := fixture.discovery.Load(); got != 0 { + t.Fatalf("discovery fetched %d times with a pinned JWKS URI", got) + } + if got := fixture.jwks.Load(); got == 0 { + t.Fatal("pinned JWKS endpoint was not fetched") + } +} diff --git a/internal/cliconfig/insecure_issuer_test.go b/internal/cliconfig/insecure_issuer_test.go new file mode 100644 index 0000000000..39cb16c6d6 --- /dev/null +++ b/internal/cliconfig/insecure_issuer_test.go @@ -0,0 +1,123 @@ +// Tests the opt-in private-issuer relaxation using the validator construction path. +// The relaxation is for controlled test IdPs and is off by default. + +package cliconfig + +import ( + "context" + "net/http" + "net/http/httptest" + "strings" + "testing" +) + +// jwksOnly serves just enough of an IdP to get past construction: the validator +// fetches the pinned JWKS during NewValidator, so the URL has to answer. +func jwksOnly(t *testing.T, tls bool) *httptest.Server { + t.Helper() + h := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{"keys":[]}`)) + }) + var srv *httptest.Server + if tls { + srv = httptest.NewTLSServer(h) + } else { + srv = httptest.NewServer(h) + } + t.Cleanup(srv.Close) + return srv +} + +// --- AC3.3 ------------------------------------------------------------------- + +// TestCallerIdentityE2E_Scenario3_PrivateIssuerRefusedByDefault pins AC3.3: the +// flag is OFF by default, and with it off BOTH relaxations stay in force — an +// `http://` issuer is refused on the scheme, and an https issuer resolving to +// loopback is refused on the address. Turning it on is what accepts them. +// +// The two refusals come from checks at DIFFERENT layers (a Config-level scheme +// check, and an address check at dial time), which is why one case each is not +// redundant: a change that relaxed only one would leave the other subtest green. +func TestCallerIdentityE2E_Scenario3_PrivateIssuerRefusedByDefault(t *testing.T) { + // The zero value must be the safe one — nothing else in this test matters if + // a fresh OIDCConfig arrives with the relaxation already on. + if (OIDCConfig{}).InsecureAllowPrivateIssuer { + t.Fatal("InsecureAllowPrivateIssuer defaults to TRUE — the SSRF defences are off unless an operator opts back in") + } + + build := func(t *testing.T, srv *httptest.Server, insecure bool) error { + t.Helper() + // No httpClient override: this asserts what the validator's OWN client + // does, which is the only thing a real deployment has. + _, err := OIDCValidator(context.Background(), OIDCConfig{ + Issuer: srv.URL, + Audience: "mecatl", + JWKSURI: srv.URL + "/", + NewValidator: defaultNewValidator, + InsecureAllowPrivateIssuer: insecure, + }) + return err + } + + t.Run("off: an http:// issuer is refused on the scheme", func(t *testing.T) { + if err := build(t, jwksOnly(t, false), false); err == nil { + t.Fatal("a plaintext http:// issuer was accepted with the flag off") + } + }) + + t.Run("off: an https issuer at a loopback address is refused", func(t *testing.T) { + if err := build(t, jwksOnly(t, true), false); err == nil { + t.Fatal("a loopback issuer was accepted with the flag off — the check that blocks a jwks_uri aimed at 169.254.169.254 is not in force") + } + }) + + t.Run("on: the same http:// loopback issuer is accepted", func(t *testing.T) { + // Proves the flag does BOTH relaxations. A plain-http loopback server needs + // the scheme check AND the address check lifted; if the flag only moved one, + // this stays red. + if err := build(t, jwksOnly(t, false), true); err != nil { + t.Fatalf("the flag did not relax both checks: %v", err) + } + }) +} + +// --- AC3.4 ------------------------------------------------------------------- + +// TestCallerIdentityE2E_Scenario3_InsecureIssuerFlagWarns pins AC3.4: enabling +// the flag produces an operator-facing warning that names it and says it is +// test-only, and NOT enabling it produces silence. +// +// The warning is the only signal an operator gets that they have disabled an SSRF +// defence — a flag that relaxes security quietly is how a test fixture becomes a +// production vulnerability. +func TestCallerIdentityE2E_Scenario3_InsecureIssuerFlagWarns(t *testing.T) { + on := OIDCConfig{Issuer: "https://idp.example.com", Audience: "mecatl", InsecureAllowPrivateIssuer: true} + + w := on.InsecureIssuerWarning() + if w == "" { + t.Fatal("enabling the flag produced no warning: an operator gets no signal that an SSRF defence is off") + } + for _, want := range []string{"oidc-insecure-allow-private-issuer", "169.254.169.254", "NOT"} { + if !strings.Contains(w, want) { + t.Fatalf("warning does not mention %q, so it does not tell the operator what was turned off or that it is test-only:\n%s", want, w) + } + } + + t.Run("silent when the flag is off", func(t *testing.T) { + off := on + off.InsecureAllowPrivateIssuer = false + if got := off.InsecureIssuerWarning(); got != "" { + t.Fatalf("warned with the flag off: %q", got) + } + }) + + t.Run("silent when identity is off entirely", func(t *testing.T) { + // The flag is meaningless without an issuer; warning then would train + // operators to ignore the message. + noIdentity := OIDCConfig{InsecureAllowPrivateIssuer: true} + if got := noIdentity.InsecureIssuerWarning(); got != "" { + t.Fatalf("warned with caller identity disabled: %q", got) + } + }) +} diff --git a/internal/cliconfig/oidc.go b/internal/cliconfig/oidc.go new file mode 100644 index 0000000000..36bf8d3165 --- /dev/null +++ b/internal/cliconfig/oidc.go @@ -0,0 +1,166 @@ +// Package cliconfig: OIDC caller-identity wiring shared by the server mains +// (cmd/mecated, cmd/mecak8s), so the flag names, the required-audience rule and +// the fail-CLOSED startup decision cannot drift between them (ADR 0100 +// decision 3). +// +// Token VALIDATION is not implemented here and never will be: it is delegated to +// the validator behind server.PrincipalValidator. This file only resolves the +// operator's flags into one and decides that a broken resolution is FATAL. + +package cliconfig + +import ( + "context" + "errors" + "flag" + "fmt" + "net/http" + "time" + + "github.com/stacklok/mecatl/internal/adapter/server" + "github.com/stacklok/mecatl/internal/syscaller" +) + +// OIDCConfig carries the caller-identity flags. The zero value is identity OFF +// — the byte-identical no-auth posture. +type OIDCConfig struct { + // Issuer is the IdP that mints the tokens (the `iss` claim, byte-exact). It + // is the ON switch: empty means caller identity is off. + Issuer string + // JWKSURI, when set, is the STATIC signing-key endpoint; it short-circuits + // OIDC discovery (the offline-test and air-gap hook). + JWKSURI string + // Audience is the `aud` this deployment accepts. REQUIRED when Issuer is + // set: an audience-less verifier accepts tokens minted for other services. + Audience string + + // MaxJWKSStaleness bounds how long cached signing keys remain trusted when + // refresh cannot reach the IdP. Zero explicitly disables the upper bound. + MaxJWKSStaleness time.Duration + + // NewValidator constructs the token validator. Nil selects the production + // toolhive-core/authn adapter. Tests may replace it to observe construction or + // force a startup failure; it is not a deployment extension point. + NewValidator func(ctx context.Context, c OIDCConfig) (server.PrincipalValidator, error) + + // httpClient is an in-package test seam for a local TLS issuer's private CA. + // Production flag parsing leaves it nil, preserving the hardened client. + httpClient *http.Client + + // InsecureAllowPrivateIssuer relaxes TWO of the validator's SSRF defences at + // once: it permits an `http://` issuer/JWKS URL, and permits those URLs to + // resolve to a private, loopback or link-local address. + // + // BOTH are required together for its one consumer — the end-to-end suite, + // whose IdP is a plaintext JWKS pod at an in-cluster address. They are checks + // at different layers (a Config-level scheme check; an address check at dial + // time, re-applied per redirect hop), so relaxing one still refuses that pod. + // + // There is no test-only injection point for this case the way there is + // in-process: the agent binary constructs its own validator, so the relaxation + // has to be a real flag on a real deployment. + // + // It is OFF by default and must stay so. With it off, the default that blocks + // a jwks_uri resolving to cloud instance metadata (169.254.169.254) is intact. + // Turning it on is what makes an SSRF against the JWKS fetch possible — hence + // `insecure` in the flag's own name, the warning below, and `task + // deploy:check` failing if the string appears in any published manifest. + InsecureAllowPrivateIssuer bool +} + +// InsecureIssuerWarning returns the operator-facing warning for a configuration +// that has relaxed the issuer-URL and private-address checks, or "" when it has +// not. +// +// It is a returned STRING rather than a log call because cliconfig owns no logger +// — the same shape as ResolvedKeys.AuthFileWarning, which the cmd/ mains surface +// with slog.Warn. Both server mains log this one too. +// +// Silence here is how a test flag becomes a production vulnerability: an operator +// who copy-pastes it out of a test fixture gets no other signal that they have +// switched off an SSRF defence. +func (c OIDCConfig) InsecureIssuerWarning() string { + if !c.Enabled() || !c.InsecureAllowPrivateIssuer { + return "" + } + return "SECURITY: --oidc-insecure-allow-private-issuer is set. " + + "The token validator will accept an http:// issuer and a jwks_uri resolving to a " + + "private, loopback or link-local address, which disables the check that blocks a " + + "jwks_uri aimed at cloud instance metadata (169.254.169.254). This flag exists for " + + "end-to-end tests against an in-cluster IdP and must NOT be used in a real deployment." +} + +// Enabled reports whether the operator asked for caller identity. +func (c OIDCConfig) Enabled() bool { return c.Issuer != "" } + +// DefaultMaxJWKSStaleness is the bounded-by-default key-cache policy (ADR 0101). +const DefaultMaxJWKSStaleness = time.Hour + +// RegisterOIDCFlags registers the caller-identity flags on fs. Both server +// mains call it so the names and help text are identical. +func RegisterOIDCFlags(fs *flag.FlagSet, c *OIDCConfig) { + fs.StringVar(&c.Issuer, "oidc-issuer", "", + "OIDC issuer URL (the `iss` claim, byte-exact) whose tokens identify callers. Setting it turns caller identity ON: every request must present a bearer the IdP vouches for, and the verified (iss, sub) is recorded as the session owner. Empty (default) disables it — requests are processed unauthenticated exactly as before. Requires --oidc-audience; a validator that cannot be constructed is FATAL, never a silent fall-back to unauthenticated") + fs.StringVar(&c.JWKSURI, "oidc-jwks-uri", "", + "STATIC JWKS endpoint for --oidc-issuer; short-circuits OIDC discovery (the air-gapped / pinned-key deployment). Empty derives it from the issuer's discovery document") + fs.BoolVar(&c.InsecureAllowPrivateIssuer, "oidc-insecure-allow-private-issuer", false, + "TEST ONLY. Permit an http:// OIDC issuer/JWKS URL and permit those URLs to resolve to a private, loopback or link-local address. It disables the check that blocks a jwks_uri aimed at cloud instance metadata (169.254.169.254), so it makes an SSRF against the key fetch possible. It exists for the end-to-end suite, whose IdP is a JWKS pod inside the cluster; enabling it logs a SECURITY warning. Never set it in a real deployment") + fs.StringVar(&c.Audience, "oidc-audience", "", + "audience (`aud`) this deployment accepts, REQUIRED with --oidc-issuer: an audience-less verifier would accept tokens minted for a different service") + fs.DurationVar(&c.MaxJWKSStaleness, "oidc-max-jwks-staleness", DefaultMaxJWKSStaleness, + "maximum age of cached JWKS signing keys when refresh cannot reach the IdP; stale, unrefreshable keys yield 503 instead of validating tokens. 0 disables the upper bound; negative values are rejected") +} + +// ErrOIDCMisconfigured is returned when caller identity is requested but cannot +// be wired. It is fatal at startup by design. +var ErrOIDCMisconfigured = errors.New("oidc: misconfigured") + +// ValidateOIDCAuthToken rejects two incompatible edge-authentication modes. An +// opaque static bearer cannot also be the OIDC JWT that caller identity validates. +// Keeping this in shared config makes mecated and mecak8s fail identically. +func ValidateOIDCAuthToken(c OIDCConfig, authToken string) error { + if c.Enabled() && authToken != "" { + return fmt.Errorf("%w: --auth-token and --oidc-issuer are mutually exclusive", ErrOIDCMisconfigured) + } + return nil +} + +// OIDCValidator resolves c into a token validator, or (nil, nil) when caller +// identity is off (the unchanged path). +// +// ctx MUST be the SERVER-ROOT context: the validator owns background JWKS +// refresh, so binding it to a per-request context would tear key rotation down +// with the first request. +// +// Every failure is FATAL — the caller must refuse to start. Degrading to the +// unauthenticated path here would silently turn an authenticated deployment into +// an open one. +func OIDCValidator(ctx context.Context, c OIDCConfig) (server.PrincipalValidator, error) { + if c.MaxJWKSStaleness < 0 { + return nil, fmt.Errorf("%w: --oidc-max-jwks-staleness must not be negative: %s", ErrOIDCMisconfigured, c.MaxJWKSStaleness) + } + if !c.Enabled() { + return nil, nil + } + if c.Audience == "" { + return nil, fmt.Errorf("%w: --oidc-issuer is set but --oidc-audience is empty", ErrOIDCMisconfigured) + } + if c.NewValidator == nil { + // Default to the real adapter (authnvalidator.go). It is defaulted HERE, in + // the one place the config is resolved, rather than in each main: a main + // that forgot would refuse to start with "no validator available", which is + // fail-closed but indistinguishable from the pre-dependency state — the + // exact confusion that made a kind rollout look like a validator bug. + c.NewValidator = defaultNewValidator + } + // The validator's background JWKS refresh has no caller: it runs as the + // explicit system principal (ADR 0100 decision 7). + v, err := c.NewValidator(syscaller.Context(ctx, syscaller.RootJWKSRefresh), c) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrOIDCMisconfigured, err) + } + if v == nil { + return nil, fmt.Errorf("%w: validator constructor returned no validator", ErrOIDCMisconfigured) + } + return v, nil +} diff --git a/internal/cliconfig/oidc_test.go b/internal/cliconfig/oidc_test.go new file mode 100644 index 0000000000..202beb38a3 --- /dev/null +++ b/internal/cliconfig/oidc_test.go @@ -0,0 +1,67 @@ +package cliconfig + +import ( + "context" + "errors" + "flag" + "io" + "testing" + "time" +) + +func TestOIDCMaxJWKSStalenessFlag(t *testing.T) { + tests := []struct { + name string + args []string + want time.Duration + }{ + {name: "default", want: time.Hour}, + {name: "override", args: []string{"--oidc-max-jwks-staleness=15m"}, want: 15 * time.Minute}, + {name: "disabled", args: []string{"--oidc-max-jwks-staleness=0"}, want: 0}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + fs := flag.NewFlagSet(tc.name, flag.ContinueOnError) + fs.SetOutput(io.Discard) + var cfg OIDCConfig + RegisterOIDCFlags(fs, &cfg) + if err := fs.Parse(tc.args); err != nil { + t.Fatalf("Parse: %v", err) + } + if cfg.MaxJWKSStaleness != tc.want { + t.Fatalf("MaxJWKSStaleness = %v, want %v", cfg.MaxJWKSStaleness, tc.want) + } + }) + } +} + +func TestOIDCValidatorRejectsNegativeMaxJWKSStaleness(t *testing.T) { + _, err := OIDCValidator(context.Background(), OIDCConfig{MaxJWKSStaleness: -time.Second}) + if !errors.Is(err, ErrOIDCMisconfigured) { + t.Fatalf("OIDCValidator error = %v, want ErrOIDCMisconfigured", err) + } +} + +func TestValidateOIDCAuthToken(t *testing.T) { + for _, tc := range []struct { + name string + oidc OIDCConfig + authToken string + wantErr bool + }{ + {name: "neither"}, + {name: "static token only", authToken: "secret"}, + {name: "OIDC only", oidc: OIDCConfig{Issuer: "https://idp.example"}}, + {name: "both", oidc: OIDCConfig{Issuer: "https://idp.example"}, authToken: "secret", wantErr: true}, + } { + t.Run(tc.name, func(t *testing.T) { + err := ValidateOIDCAuthToken(tc.oidc, tc.authToken) + if tc.wantErr && !errors.Is(err, ErrOIDCMisconfigured) { + t.Fatalf("ValidateOIDCAuthToken() error = %v, want ErrOIDCMisconfigured", err) + } + if !tc.wantErr && err != nil { + t.Fatalf("ValidateOIDCAuthToken() error = %v, want nil", err) + } + }) + } +} diff --git a/internal/syscaller/syscaller.go b/internal/syscaller/syscaller.go new file mode 100644 index 0000000000..6219e144b3 --- /dev/null +++ b/internal/syscaller/syscaller.go @@ -0,0 +1,74 @@ +// Package syscaller stamps the EXPLICIT system principal (ADR 0100 decision 7) +// on the root context of every internal goroutine that has no caller. +// +// Internal work — the session GC, the two dream consolidators, the scheduler's +// tick/fire/delivery/reconcile loops, the startup model-catalog refresh, and the +// token validator's background JWKS refresh — crosses port boundaries with nobody to attribute it to. It runs as +// an explicit `system` principal rather than an ABSENT one, so the day an +// enforcement check lands (the isolation track, #368) these callers neither +// break silently nor get mistaken for an anonymous user. +// +// This is a composition/server concern: the agent loop stays identity-agnostic +// and must never import it (AGENTS.md — the layering rule). +// +// Root is the REGISTRY: every internal context root has a const here and an +// entry in Roots, and the pinning test +// (TestCallerIdentity_Scenario2_InternalGoroutinesRunAsSystem in internal/app) +// drives each registered root through its real production starter and asserts +// the principal the port actually observes. A new internal goroutine registers +// its root here; forgetting the wrap at the call site turns that root's +// subtest red. +package syscaller + +import ( + "context" + + "github.com/stacklok/mecatl/engine/session" +) + +// Root names one internal goroutine root. It is the Subject of that root's +// system principal, so an observed principal says WHICH internal caller acted. +type Root string + +const ( + // RootChildGC is the session retention sweeper (internal/app.startChildGC). + RootChildGC Root = "childgc" + // RootMemoryConsolidation is the project-memory dream consolidator. + RootMemoryConsolidation Root = "memory-consolidation" + // RootUserModelConsolidation is the user-model dream consolidator. + RootUserModelConsolidation Root = "user-model-consolidation" + // RootScheduler is the scheduler's lifecycle root: every tick, fire, + // delivery and reconcile context descends from Scheduler.Start's ctx. + RootScheduler Root = "scheduler" + // RootModelCatalogRefresh is the one-shot startup live-model refresh. It does + // not cover request-driven stale-model refreshes, which retain their caller. + RootModelCatalogRefresh Root = "model-catalog-refresh" + // RootJWKSRefresh is the token validator's background JWKS refresh, which + // owns the server-root context handed to the validator constructor. + RootJWKSRefresh Root = "jwks-refresh" +) + +// Issuer is the synthetic issuer half of a system principal's (iss, sub) +// identity pair. It is deliberately not a URL: no IdP mints these. +const Issuer = "mecatl:internal" + +// Roots is the registry of internal context roots — the single enumeration the +// production wiring and the pinning test share. +var Roots = []Root{ + RootChildGC, + RootMemoryConsolidation, + RootUserModelConsolidation, + RootScheduler, + RootModelCatalogRefresh, + RootJWKSRefresh, +} + +// Context returns ctx carrying the explicit system principal for root. Call it +// where the goroutine's root context is CREATED, not per port call. +func Context(ctx context.Context, root Root) context.Context { + return session.WithPrincipal(ctx, &session.Principal{ + Issuer: Issuer, + Subject: string(root), + GrantType: session.GrantTypeSystem, + }) +} diff --git a/llms.txt b/llms.txt index d1f2fd00e3..d5fca7b7a2 100644 --- a/llms.txt +++ b/llms.txt @@ -1,47 +1,47 @@ # mecatl -> A markdown documentation corpus of 173 document(s) across 10 component(s), with 1874 heading(s) and 1538 resolved reference(s). Entries are ordered by importance (most-connected first). 17 document(s) excluded from rendering by emitExclude (still in the corpus: link-checked and ranked). Compactness 0.81, docs ~2.3 clicks apart. +> A markdown documentation corpus of 177 document(s) across 10 component(s), with 1901 heading(s) and 1575 resolved reference(s). Entries are ordered by importance (most-connected first). 17 document(s) excluded from rendering by emitExclude (still in the corpus: link-checked and ranked). Compactness 0.81, docs ~2.3 clicks apart. ## Documentation -- [ADR 0002 — Documentation lifecycle: living truth, frozen records, one tracker](docs/adr/0002-documentation-lifecycle.md): ADR 0002 — Documentation lifecycle: living truth, frozen records, one tracker (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0003-consolidate-design-records-as-adrs.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0036-engine-module.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0043-ephemeral-turn0-instruction-fragments.md, docs/adr/0045-explicit-bucket-latency-histograms.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0047-absolute-path-resolution.md, docs/adr/0049-guardrails-remove-maxchecks.md, docs/adr/0050-guardrails-remove-maxcontentbytes.md, docs/adr/0051-guardrails-advisory-tui-visibility.md, docs/adr/0052-guardrails-checker-down-toggle.md, docs/adr/0053-guardrails-default-block.md, docs/adr/0058-writable-named-specialist-subagent.md, docs/adr/0060-guardrails-bash-default.md, docs/adr/0061-guardrails-human-override.md, docs/adr/0062-guardrails-approve-once.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0068-effort-change-via-fork.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0070-model-visible-affordance-gate.md, docs/adr/0072-acceptance-plan-spine.md, docs/adr/0076-schedule-shared-catalog.md, docs/adr/0077-direct-write-subagent.md, docs/adr/0079-delegation-observability-convergence.md, docs/adr/0088-daemon-config-file.md, docs/adr/0096-live-feed-reconnect.md, docs/adr/0097-scheduled-fire-inflight-state.md, docs/adr/0099-external-transcript-import.md, docs/adr/0102-toolhive-direct-mode.md, docs/adr/README.md, docs/adr/template.md, docs/agent-identity-model.md, docs/agent-identity-outbound.md, docs/cloud-native-harness-systems.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) -- [ADR 0027 — Cloud-native arc: disposable process, externalized state, durable record](docs/adr/0027-cloud-native.md): ADR 0027 — Cloud-native arc: disposable process, externalized state, durable record (linked from: docs/acceptance/README.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/path-escape-posture.md, docs/acceptance/spine-convergence.md, docs/adr/0012-compaction.md, docs/adr/0015-background-subagents.md, docs/adr/0028-mecatequi.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0031-subagent-model-router.md, docs/adr/0032-worktree-binding.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0038-event-sourced-rehydration.md, docs/adr/0044-host-supplied-askid-discriminator.md, docs/adr/0048-mecak8s.md, docs/adr/0057-mcp-server-notifications.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0062-guardrails-approve-once.md, docs/adr/0063-mcp-structured-failclosed-callmcpwithquery.md, docs/adr/0064-toolhive-llm-gateway-provider.md, docs/adr/0065-conversation-fork.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0073-schedule-tool.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0075-fire-result-delivery.md, docs/adr/0077-resume-a-failed-subagent.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/0097-permanent-provider-error-signal.md, docs/adr/0097-scheduled-fire-inflight-state.md, docs/adr/0098-headless-telemetry.md, docs/adr/README.md, docs/agent-identity-model.md, docs/cloud-native-harness-systems.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) -- [ADR 0037 — engine public-API stability contract](docs/adr/0037-engine-stability-contract.md): ADR 0037 — engine public-API stability contract (linked from: AGENTS.md, README.md, docs/acceptance/README.md, docs/acceptance/delegation-observability-convergence.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/spine-convergence.md, docs/adr/0036-engine-module.md, docs/adr/0038-event-sourced-rehydration.md, docs/adr/0055-reasoning-effort.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/0079-delegation-observability-convergence.md, docs/adr/0093-provider-modules.md, docs/adr/README.md, docs/architecture.md, docs/architecture/api-surface.md, docs/architecture/extensibility.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, engine/CHANGELOG.md, engine/COMPATIBILITY.md, engine/api/README.md) -- [ADR 0021 — Guardrails: LLM-backed tool-content inspection](docs/adr/0021-guardrails.md): ADR 0021 — Guardrails: LLM-backed tool-content inspection (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0022-allow-all-posture.md, docs/adr/0023-workspace-trust.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0031-subagent-model-router.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0049-guardrails-remove-maxchecks.md, docs/adr/0050-guardrails-remove-maxcontentbytes.md, docs/adr/0051-guardrails-advisory-tui-visibility.md, docs/adr/0052-guardrails-checker-down-toggle.md, docs/adr/0053-guardrails-default-block.md, docs/adr/0060-guardrails-bash-default.md, docs/adr/0061-guardrails-human-override.md, docs/adr/0062-guardrails-approve-once.md, docs/adr/0080-guardrail-routed-escape-checking.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) +- [ADR 0002 — Documentation lifecycle: living truth, frozen records, one tracker](docs/adr/0002-documentation-lifecycle.md): ADR 0002 — Documentation lifecycle: living truth, frozen records, one tracker (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0003-consolidate-design-records-as-adrs.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0036-engine-module.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0043-ephemeral-turn0-instruction-fragments.md, docs/adr/0045-explicit-bucket-latency-histograms.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0047-absolute-path-resolution.md, docs/adr/0049-guardrails-remove-maxchecks.md, docs/adr/0050-guardrails-remove-maxcontentbytes.md, docs/adr/0051-guardrails-advisory-tui-visibility.md, docs/adr/0052-guardrails-checker-down-toggle.md, docs/adr/0053-guardrails-default-block.md, docs/adr/0058-writable-named-specialist-subagent.md, docs/adr/0060-guardrails-bash-default.md, docs/adr/0061-guardrails-human-override.md, docs/adr/0062-guardrails-approve-once.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0068-effort-change-via-fork.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0070-model-visible-affordance-gate.md, docs/adr/0072-acceptance-plan-spine.md, docs/adr/0076-schedule-shared-catalog.md, docs/adr/0077-direct-write-subagent.md, docs/adr/0079-delegation-observability-convergence.md, docs/adr/0088-daemon-config-file.md, docs/adr/0096-live-feed-reconnect.md, docs/adr/0097-scheduled-fire-inflight-state.md, docs/adr/0099-external-transcript-import.md, docs/adr/0100-caller-identity-threading.md, docs/adr/0102-toolhive-direct-mode.md, docs/adr/README.md, docs/adr/template.md, docs/agent-identity-model.md, docs/agent-identity-outbound.md, docs/cloud-native-harness-systems.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) +- [ADR 0027 — Cloud-native arc: disposable process, externalized state, durable record](docs/adr/0027-cloud-native.md): ADR 0027 — Cloud-native arc: disposable process, externalized state, durable record (linked from: docs/acceptance/README.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/path-escape-posture.md, docs/acceptance/spine-convergence.md, docs/adr/0012-compaction.md, docs/adr/0015-background-subagents.md, docs/adr/0028-mecatequi.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0031-subagent-model-router.md, docs/adr/0032-worktree-binding.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0038-event-sourced-rehydration.md, docs/adr/0044-host-supplied-askid-discriminator.md, docs/adr/0048-mecak8s.md, docs/adr/0057-mcp-server-notifications.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0062-guardrails-approve-once.md, docs/adr/0063-mcp-structured-failclosed-callmcpwithquery.md, docs/adr/0064-toolhive-llm-gateway-provider.md, docs/adr/0065-conversation-fork.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0073-schedule-tool.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0075-fire-result-delivery.md, docs/adr/0077-resume-a-failed-subagent.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/0097-permanent-provider-error-signal.md, docs/adr/0097-scheduled-fire-inflight-state.md, docs/adr/0098-headless-telemetry.md, docs/adr/0100-caller-identity-threading.md, docs/adr/0101-bounded-jwks-staleness.md, docs/adr/README.md, docs/agent-identity-model.md, docs/cloud-native-harness-systems.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) +- [ADR 0037 — engine public-API stability contract](docs/adr/0037-engine-stability-contract.md): ADR 0037 — engine public-API stability contract (linked from: AGENTS.md, README.md, docs/acceptance/README.md, docs/acceptance/delegation-observability-convergence.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/spine-convergence.md, docs/adr/0036-engine-module.md, docs/adr/0038-event-sourced-rehydration.md, docs/adr/0055-reasoning-effort.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/0079-delegation-observability-convergence.md, docs/adr/0093-provider-modules.md, docs/adr/0100-caller-identity-threading.md, docs/adr/README.md, docs/architecture.md, docs/architecture/api-surface.md, docs/architecture/extensibility.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, engine/CHANGELOG.md, engine/COMPATIBILITY.md, engine/api/README.md) - [ADR 0059 — Scheduled tasks: durable registry, tick loop, leader-lease, claim-before-fire at-most-once](docs/adr/0059-scheduled-tasks.md): ADR 0059 — Scheduled tasks: durable registry, tick loop, leader-lease, claim-before-fire at-most-once (linked from: docs/acceptance/README.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/adr/0073-schedule-tool.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0075-fire-result-delivery.md, docs/adr/0097-scheduled-fire-inflight-state.md, docs/adr/README.md, docs/architecture.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage.md, docs/usage/mecated.md) - [ADR 0036 — engine/ is its own Go module (monorepo via go.work)](docs/adr/0036-engine-module.md): ADR 0036 — engine/ is its own Go module (monorepo via go.work) (linked from: AGENTS.md, README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0037-engine-stability-contract.md, docs/adr/0038-event-sourced-rehydration.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/0093-provider-modules.md, docs/adr/README.md, docs/architecture.md, docs/architecture/extensibility.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/install.md, engine/CHANGELOG.md, engine/COMPATIBILITY.md) +- [ADR 0021 — Guardrails: LLM-backed tool-content inspection](docs/adr/0021-guardrails.md): ADR 0021 — Guardrails: LLM-backed tool-content inspection (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0022-allow-all-posture.md, docs/adr/0023-workspace-trust.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0031-subagent-model-router.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0049-guardrails-remove-maxchecks.md, docs/adr/0050-guardrails-remove-maxcontentbytes.md, docs/adr/0051-guardrails-advisory-tui-visibility.md, docs/adr/0052-guardrails-checker-down-toggle.md, docs/adr/0053-guardrails-default-block.md, docs/adr/0060-guardrails-bash-default.md, docs/adr/0061-guardrails-human-override.md, docs/adr/0062-guardrails-approve-once.md, docs/adr/0080-guardrail-routed-escape-checking.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) +- [ADR 0038 — Event-sourced SessionStore rehydration (the reference fold)](docs/adr/0038-event-sourced-rehydration.md): ADR 0038 — Event-sourced SessionStore rehydration (the reference fold) (linked from: AGENTS.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0027-cloud-native.md, docs/adr/0043-ephemeral-turn0-instruction-fragments.md, docs/adr/0065-conversation-fork.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/0100-caller-identity-threading.md, docs/adr/README.md, docs/architecture.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/install.md, engine/CHANGELOG.md, engine/COMPATIBILITY.md) - [ADR 0016 — Multi-provider and multi-model](docs/adr/0016-multi-provider.md): ADR 0016 — Multi-provider and multi-model (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0017-openai-responses-api.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0055-reasoning-effort.md, docs/adr/0064-toolhive-llm-gateway-provider.md, docs/adr/0067-openai-chat-completions-adapter.md, docs/adr/0071-seamless-model-switch.md, docs/adr/0100-provider-prompt-caching.md, docs/adr/0101-openai-reasoning-multiplicity.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0005 — Driver seams: ports, the gRPC driver protocol, and conformance](docs/adr/0005-driver-seams.md): ADR 0005 — Driver seams: ports, the gRPC driver protocol, and conformance (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0004-v1-architecture.md, docs/adr/0028-mecatequi.md, docs/adr/0044-host-supplied-askid-discriminator.md, docs/adr/0048-mecak8s.md, docs/adr/README.md, docs/cloud-native-harness-systems.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) -- [ADR 0038 — Event-sourced SessionStore rehydration (the reference fold)](docs/adr/0038-event-sourced-rehydration.md): ADR 0038 — Event-sourced SessionStore rehydration (the reference fold) (linked from: AGENTS.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0027-cloud-native.md, docs/adr/0043-ephemeral-turn0-instruction-fragments.md, docs/adr/0065-conversation-fork.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/README.md, docs/architecture.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/install.md, engine/CHANGELOG.md, engine/COMPATIBILITY.md) - [ADR 0069 — Plan-approval gate](docs/adr/0069-plan-approval-gate.md): ADR 0069 — Plan-approval gate (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0070-model-visible-affordance-gate.md, docs/adr/README.md, docs/architecture/agent-loop.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage.md, docs/usage/grpc-api.md, docs/usage/http-sse-api.md, docs/usage/mecated.md) +- [mecatl — Architecture](docs/architecture.md): mecatl — Architecture (linked from: AGENTS.md, README.md, docs/READING.md, docs/README.md, docs/acceptance/README.md, docs/acceptance/caller-identity.md, docs/acceptance/path-escape-posture.md, docs/acceptance/spine-convergence.md, docs/adr/0001-acp-adapter.md, docs/adr/0002-documentation-lifecycle.md, docs/adr/0004-v1-architecture.md, docs/adr/0036-engine-module.md, docs/adr/0039-parallel-auto-merge.md, docs/adr/0048-mecak8s.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0065-conversation-fork.md, docs/adr/0068-effort-change-via-fork.md, docs/adr/0073-schedule-tool.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0075-fire-result-delivery.md, docs/adr/0103-oidc-authn-module.md, docs/adr/README.md, docs/architecture/agent-loop.md, docs/architecture/api-surface.md, docs/architecture/context-and-compaction.md, docs/architecture/deployment-and-hardening.md, docs/architecture/domain-model.md, docs/architecture/extensibility.md, docs/architecture/hooks-and-guardrails.md, docs/architecture/mecatl.modelith.md, docs/architecture/memory.md, docs/architecture/observability.md, docs/architecture/parallelism.md, docs/architecture/ports.md, docs/architecture/providers.md, docs/architecture/subagents-and-teams.md, docs/cloud-native-harness-kit.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/README.md, docs/development-process.md, docs/tui.md, docs/usage.md) - [ADR 0048 — mecak8s: Kubernetes-native agent harness (storage-free, managed-service state)](docs/adr/0048-mecak8s.md): ADR 0048 — mecak8s: Kubernetes-native agent harness (storage-free, managed-service state) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0063-mcp-structured-failclosed-callmcpwithquery.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0082-factory-mcp-wiring.md, docs/adr/0098-headless-telemetry.md, docs/adr/README.md, docs/agent-identity-model.md, docs/cloud-native-harness-systems.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) - [ADR 0023 — Workspace Trust](docs/adr/0023-workspace-trust.md): ADR 0023 — Workspace Trust (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0021-guardrails.md, docs/adr/0022-allow-all-posture.md, docs/adr/0032-worktree-binding.md, docs/adr/0033-dirty-aware-readonly-fork.md, docs/adr/0092-no-project-trust-pin.md, docs/adr/0094-opt-in-project-ingestion.md, docs/adr/0095-root-aware-project-trust.md, docs/adr/0096-diagnostic-only-posture-reporting.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) -- [mecatl — Architecture](docs/architecture.md): mecatl — Architecture (linked from: AGENTS.md, README.md, docs/READING.md, docs/README.md, docs/acceptance/README.md, docs/acceptance/path-escape-posture.md, docs/acceptance/spine-convergence.md, docs/adr/0001-acp-adapter.md, docs/adr/0002-documentation-lifecycle.md, docs/adr/0004-v1-architecture.md, docs/adr/0036-engine-module.md, docs/adr/0039-parallel-auto-merge.md, docs/adr/0048-mecak8s.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0065-conversation-fork.md, docs/adr/0068-effort-change-via-fork.md, docs/adr/0073-schedule-tool.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0075-fire-result-delivery.md, docs/adr/README.md, docs/architecture/agent-loop.md, docs/architecture/api-surface.md, docs/architecture/context-and-compaction.md, docs/architecture/deployment-and-hardening.md, docs/architecture/domain-model.md, docs/architecture/extensibility.md, docs/architecture/hooks-and-guardrails.md, docs/architecture/mecatl.modelith.md, docs/architecture/memory.md, docs/architecture/observability.md, docs/architecture/parallelism.md, docs/architecture/ports.md, docs/architecture/providers.md, docs/architecture/subagents-and-teams.md, docs/cloud-native-harness-kit.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/README.md, docs/development-process.md, docs/tui.md, docs/usage.md) - [ADR 0022 — Unattended / allow-all posture (the "YOLO mode" question)](docs/adr/0022-allow-all-posture.md): ADR 0022 — Unattended / allow-all posture (the "YOLO mode" question) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0021-guardrails.md, docs/adr/0023-workspace-trust.md, docs/adr/0028-mecatequi.md, docs/adr/0092-no-project-trust-pin.md, docs/adr/0094-opt-in-project-ingestion.md, docs/adr/0095-root-aware-project-trust.md, docs/adr/0096-diagnostic-only-posture-reporting.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0014 — Agent teams](docs/adr/0014-agent-teams.md): ADR 0014 — Agent teams (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0013-agent-definitions.md, docs/adr/0015-background-subagents.md, docs/adr/0033-dirty-aware-readonly-fork.md, docs/adr/0040-writable-subagent-and-serialized-merge.md, docs/adr/0077-direct-write-subagent.md, docs/adr/0077-resume-a-failed-subagent.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0028 — mecatequi: Single-Shot GitHub Action Runner](docs/adr/0028-mecatequi.md): ADR 0028 — mecatequi: Single-Shot GitHub Action Runner (linked from: README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0048-mecak8s.md, docs/adr/0082-factory-mcp-wiring.md, docs/adr/0098-headless-telemetry.md, docs/adr/0103-mecatui-seed-prompt.md, docs/adr/README.md, docs/design/MECAK8S-PLAN.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecatequi-ci.md) - [ADR 0017 — OpenAI Responses API adapter](docs/adr/0017-openai-responses-api.md): ADR 0017 — OpenAI Responses API adapter (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0016-multi-provider.md, docs/adr/0100-provider-prompt-caching.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0011 — Soul and user-model: persistent identity and cross-session learning](docs/adr/0011-soul-and-user-model.md): ADR 0011 — Soul and user-model: persistent identity and cross-session learning (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0008-memory-on-by-default.md, docs/adr/0010-semantic-memory-recall.md, docs/adr/0024-system-prompt-research.md, docs/adr/0043-ephemeral-turn0-instruction-fragments.md, docs/adr/0081-rules-source-port.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) -- [ADR 0004 — v1 Architecture: hexagonal DDD harness](docs/adr/0004-v1-architecture.md): ADR 0004 — v1 Architecture: hexagonal DDD harness (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0005-driver-seams.md, docs/adr/0006-v1-step-chain.md, docs/adr/0016-multi-provider.md, docs/adr/0027-cloud-native.md, docs/adr/0029-repomap-tree-sitter.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0046 — Guardrails slot enables (configure = enable)](docs/adr/0046-guardrails-slot-enable.md): ADR 0046 — Guardrails slot enables (configure = enable) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0049-guardrails-remove-maxchecks.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md, docs/usage/mecated.md, docs/usage/model-routing.md) +- [ADR 0004 — v1 Architecture: hexagonal DDD harness](docs/adr/0004-v1-architecture.md): ADR 0004 — v1 Architecture: hexagonal DDD harness (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0005-driver-seams.md, docs/adr/0006-v1-step-chain.md, docs/adr/0016-multi-provider.md, docs/adr/0027-cloud-native.md, docs/adr/0029-repomap-tree-sitter.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) ## Optional -- [ADR 0024 — System-Prompt Research and Enhancement](docs/adr/0024-system-prompt-research.md): ADR 0024 — System-Prompt Research and Enhancement (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0007-twelve-patterns-audit.md, docs/adr/0041-output-economy-default-prompt.md, docs/adr/0054-reasoning-rebalance-default-prompt.md, docs/adr/0070-model-visible-affordance-gate.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0001 — Agent Client Protocol (ACP) adapter](docs/adr/0001-acp-adapter.md): ADR 0001 — Agent Client Protocol (ACP) adapter (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/README.md, docs/architecture.md, docs/architecture/api-surface.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0030 — Layered model-selection heuristics](docs/adr/0030-model-selection-heuristics.md): ADR 0030 — Layered model-selection heuristics (linked from: README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0031-subagent-model-router.md, docs/adr/0032-worktree-binding.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0069-plan-approval-gate.md, docs/adr/README.md, docs/architecture/api-surface.md, docs/architecture/providers.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md) +- [ADR 0024 — System-Prompt Research and Enhancement](docs/adr/0024-system-prompt-research.md): ADR 0024 — System-Prompt Research and Enhancement (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0007-twelve-patterns-audit.md, docs/adr/0041-output-economy-default-prompt.md, docs/adr/0054-reasoning-rebalance-default-prompt.md, docs/adr/0070-model-visible-affordance-gate.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0031 — The operator-gated semantic subagent model router](docs/adr/0031-subagent-model-router.md): ADR 0031 — The operator-gated semantic subagent model router (linked from: README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0083-routing-reason-on-delegation-start.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md, docs/usage/model-routing.md) - [ADR 0006 — v1 Implementation step-chain](docs/adr/0006-v1-step-chain.md): ADR 0006 — v1 Implementation step-chain (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0004-v1-architecture.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0009 — Tiered memory: tier-0 index and BM25 search](docs/adr/0009-tiered-memory.md): ADR 0009 — Tiered memory: tier-0 index and BM25 search (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0008-memory-on-by-default.md, docs/adr/0010-semantic-memory-recall.md, docs/adr/0011-soul-and-user-model.md, docs/adr/0012-compaction.md, docs/adr/0043-ephemeral-turn0-instruction-fragments.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0086 — Remove the output-economy control surface](docs/adr/0086-remove-output-economy-control.md): ADR 0086 — Remove the output-economy control surface (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0041-output-economy-default-prompt.md, docs/adr/0089-cli-clean-break-grammar.md, docs/adr/README.md, docs/architecture.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0050 — Remove the guardrails oversized-content inspection skip](docs/adr/0050-guardrails-remove-maxcontentbytes.md): ADR 0050 — Remove the guardrails oversized-content inspection skip (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) +- [ADR 0073 — Schedule tool: model-facing scheduling, on-by-default, drop the declarative/CLI surfaces](docs/adr/0073-schedule-tool.md): ADR 0073 — Schedule tool: model-facing scheduling, on-by-default, drop the declarative/CLI surfaces (linked from: docs/acceptance/README.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/schedule-shared-catalog.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0075-fire-result-delivery.md, docs/adr/0076-schedule-shared-catalog.md, docs/adr/README.md, docs/architecture.md, docs/design/principles.md, docs/development-process.md, docs/usage.md, docs/usage/mecated.md) - [ADR 0049 — Remove the guardrails per-session checker call-count cap](docs/adr/0049-guardrails-remove-maxchecks.md): ADR 0049 — Remove the guardrails per-session checker call-count cap (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0021-guardrails.md, docs/adr/0050-guardrails-remove-maxcontentbytes.md, docs/adr/0051-guardrails-advisory-tui-visibility.md, docs/adr/0052-guardrails-checker-down-toggle.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0053 — Flip guardrails default mode from advisory to block](docs/adr/0053-guardrails-default-block.md): ADR 0053 — Flip guardrails default mode from advisory to block (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0060-guardrails-bash-default.md, docs/adr/0061-guardrails-human-override.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md) - [ADR 0012 — Conversation compaction](docs/adr/0012-compaction.md): ADR 0012 — Conversation compaction (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0011-soul-and-user-model.md, docs/adr/0027-cloud-native.md, docs/adr/0043-ephemeral-turn0-instruction-fragments.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) +- [ADR 0042 — Taxonomy-gated subagent model router (enable by config, not a flag)](docs/adr/0042-taxonomy-gated-model-router.md): ADR 0042 — Taxonomy-gated subagent model router (enable by config, not a flag) (linked from: README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0031-subagent-model-router.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md, docs/usage/mecated.md, docs/usage/model-routing.md) - [ADR 0051 — Surface advisory guardrail findings to the TUI](docs/adr/0051-guardrails-advisory-tui-visibility.md): ADR 0051 — Surface advisory guardrail findings to the TUI (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0021-guardrails.md, docs/adr/0053-guardrails-default-block.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md) - [ADR 0018 — Performance observability](docs/adr/0018-perf-observability.md): ADR 0018 — Performance observability (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0019-perf-tracking.md, docs/adr/0020-diagnostics.md, docs/adr/0045-explicit-bucket-latency-histograms.md, docs/adr/0098-headless-telemetry.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/perf-measurement-survey.md) -- [ADR 0042 — Taxonomy-gated subagent model router (enable by config, not a flag)](docs/adr/0042-taxonomy-gated-model-router.md): ADR 0042 — Taxonomy-gated subagent model router (enable by config, not a flag) (linked from: README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0031-subagent-model-router.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md, docs/usage/mecated.md, docs/usage/model-routing.md) -- [ADR 0073 — Schedule tool: model-facing scheduling, on-by-default, drop the declarative/CLI surfaces](docs/adr/0073-schedule-tool.md): ADR 0073 — Schedule tool: model-facing scheduling, on-by-default, drop the declarative/CLI surfaces (linked from: docs/acceptance/README.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/schedule-shared-catalog.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/adr/0074-many-loops-scheduler-shape.md, docs/adr/0075-fire-result-delivery.md, docs/adr/0076-schedule-shared-catalog.md, docs/adr/README.md, docs/architecture.md, docs/design/principles.md, docs/development-process.md, docs/usage.md, docs/usage/mecated.md) - [ADR 0015 — Background subagents and per-child cancel](docs/adr/0015-background-subagents.md): ADR 0015 — Background subagents and per-child cancel (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0013-agent-definitions.md, docs/adr/0014-agent-teams.md, docs/adr/0027-cloud-native.md, docs/adr/0090-background-bash.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0033 — Dirty-aware read-only fork (uncommitted-state overlay)](docs/adr/0033-dirty-aware-readonly-fork.md): ADR 0033 — Dirty-aware read-only fork (uncommitted-state overlay) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0065-conversation-fork.md, docs/adr/README.md, docs/architecture/parallelism.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0010 — Semantic memory recall: BM25 shipped, semantic deferred](docs/adr/0010-semantic-memory-recall.md): ADR 0010 — Semantic memory recall: BM25 shipped, semantic deferred (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0008-memory-on-by-default.md, docs/adr/0009-tiered-memory.md, docs/adr/0011-soul-and-user-model.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) @@ -53,21 +53,24 @@ - [ADR 0052 — Global guardrails checker-down posture toggle](docs/adr/0052-guardrails-checker-down-toggle.md): ADR 0052 — Global guardrails checker-down posture toggle (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md) - [ADR 0008 — Memory on by default in the embedded mecatui server](docs/adr/0008-memory-on-by-default.md): ADR 0008 — Memory on by default in the embedded mecatui server (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0009-tiered-memory.md, docs/adr/0010-semantic-memory-recall.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0013 — Agent definitions (Tier 1)](docs/adr/0013-agent-definitions.md): ADR 0013 — Agent definitions (Tier 1) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0014-agent-teams.md, docs/adr/0015-background-subagents.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) +- [ADR 0055 — Reasoning-effort knob](docs/adr/0055-reasoning-effort.md): ADR 0055 — Reasoning-effort knob (linked from: docs/acceptance/README.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/adr/0064-toolhive-llm-gateway-provider.md, docs/adr/0067-openai-chat-completions-adapter.md, docs/adr/0068-effort-change-via-fork.md, docs/adr/0100-provider-prompt-caching.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md, docs/usage/mecak8s.md, docs/usage/mecated.md, engine/CHANGELOG.md) - [ADR 0025 — mecatui UX Discoverability](docs/adr/0025-ux-discoverability.md): ADR 0025 — mecatui UX Discoverability (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0026-clipboard-image-paste.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/tui.md) - [ADR 0026 — Clipboard Image Paste](docs/adr/0026-clipboard-image-paste.md): ADR 0026 — Clipboard Image Paste (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0025-ux-discoverability.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/tui.md) - [ADR 0090 — Background Bash commands](docs/adr/0090-background-bash.md): ADR 0090 — Background Bash commands (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/architecture/ports.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0054 — Reasoning rebalance of the default-tone prompt](docs/adr/0054-reasoning-rebalance-default-prompt.md): ADR 0054 — Reasoning rebalance of the default-tone prompt (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0086-remove-output-economy-control.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) -- [ADR 0055 — Reasoning-effort knob](docs/adr/0055-reasoning-effort.md): ADR 0055 — Reasoning-effort knob (linked from: docs/acceptance/README.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/adr/0064-toolhive-llm-gateway-provider.md, docs/adr/0067-openai-chat-completions-adapter.md, docs/adr/0068-effort-change-via-fork.md, docs/adr/0100-provider-prompt-caching.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md, docs/usage/mecak8s.md, docs/usage/mecated.md, engine/CHANGELOG.md) +- [ADR 0100 — Caller identity: accept a principal, thread it everywhere, record the owner](docs/adr/0100-caller-identity-threading.md): ADR 0100 — Caller identity: accept a principal, thread it everywhere, record the owner (linked from: docs/acceptance/README.md, docs/acceptance/caller-identity.md, docs/acceptance/spine-convergence.md, docs/adr/0101-bounded-jwks-staleness.md, docs/adr/0103-oidc-authn-module.md, docs/adr/README.md, docs/architecture.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md, engine/CHANGELOG.md, engine/COMPATIBILITY.md) - [ADR 0029 — Repo-map Tree-sitter Binding](docs/adr/0029-repomap-tree-sitter.md): ADR 0029 — Repo-map Tree-sitter Binding (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0068 — Change reasoning effort via conversation fork (keep the transcript)](docs/adr/0068-effort-change-via-fork.md): ADR 0068 — Change reasoning effort via conversation fork (keep the transcript) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) - [ADR 0098 — Telemetry for the headless binaries (mecatequi, mecak8s)](docs/adr/0098-headless-telemetry.md): ADR 0098 — Telemetry for the headless binaries (mecatequi, mecak8s) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md) -- [ADR 0077 — Direct-write writable Subagent (no fork, no merge-back)](docs/adr/0077-direct-write-subagent.md): ADR 0077 — Direct-write writable Subagent (no fork, no merge-back) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0044-host-supplied-askid-discriminator.md, docs/adr/0058-writable-named-specialist-subagent.md, docs/adr/0065-conversation-fork.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0077-resume-a-failed-subagent.md, docs/adr/README.md, docs/cloud-native-harness-systems.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) - [ADR 0034 — Extend the model router to team members and Parallel branches](docs/adr/0034-team-parallel-model-routing.md): ADR 0034 — Extend the model router to team members and Parallel branches (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0083-routing-reason-on-delegation-start.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md) - [ADR 0062 — Out-of-band approve-once for guardrail blocks](docs/adr/0062-guardrails-approve-once.md): ADR 0062 — Out-of-band approve-once for guardrail blocks (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0061-guardrails-human-override.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0080-guardrail-routed-escape-checking.md, docs/adr/README.md, docs/architecture/agent-loop.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/principles.md, docs/development-process.md, engine/CHANGELOG.md) +- [ADR 0077 — Direct-write writable Subagent (no fork, no merge-back)](docs/adr/0077-direct-write-subagent.md): ADR 0077 — Direct-write writable Subagent (no fork, no merge-back) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0044-host-supplied-askid-discriminator.md, docs/adr/0058-writable-named-specialist-subagent.md, docs/adr/0065-conversation-fork.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0077-resume-a-failed-subagent.md, docs/adr/README.md, docs/cloud-native-harness-systems.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md) - [ADR 0060 — Add Bash to the default guardrail rule set with a read-only pre-filter](docs/adr/0060-guardrails-bash-default.md): ADR 0060 — Add Bash to the default guardrail rule set with a read-only pre-filter (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0061-guardrails-human-override.md, docs/adr/0062-guardrails-approve-once.md, docs/adr/0080-guardrail-routed-escape-checking.md, docs/adr/0090-background-bash.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/guardrails.md, docs/usage/mecated.md) -- [ADR 0066 — Route unpinned agent-defs and writable explorers; explicit inherit is the pin](docs/adr/0066-route-unpinned-and-writable-delegations.md): ADR 0066 — Route unpinned agent-defs and writable explorers; explicit inherit is the pin (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0031-subagent-model-router.md, docs/adr/0077-direct-write-subagent.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/principles.md, docs/development-process.md) - [ADR 0039 — Parallel single-branch auto-merge](docs/adr/0039-parallel-auto-merge.md): ADR 0039 — Parallel single-branch auto-merge (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0040-writable-subagent-and-serialized-merge.md, docs/adr/README.md, docs/architecture/parallelism.md, docs/cloud-native-harness-systems.md, docs/design/principles.md, docs/development-process.md, docs/scoped-resource-grants.md, docs/usage/mecated.md) - [ADR 0095 — Root-aware project trust](docs/adr/0095-root-aware-project-trust.md): ADR 0095 — Root-aware project trust (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0092-no-project-trust-pin.md, docs/adr/0094-opt-in-project-ingestion.md, docs/adr/0096-diagnostic-only-posture-reporting.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecak8s.md, docs/usage/mecated.md, docs/usage/mecatequi-ci.md, docs/usage/workspace-trust.md) +- [ADR 0066 — Route unpinned agent-defs and writable explorers; explicit inherit is the pin](docs/adr/0066-route-unpinned-and-writable-delegations.md): ADR 0066 — Route unpinned agent-defs and writable explorers; explicit inherit is the pin (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0031-subagent-model-router.md, docs/adr/0077-direct-write-subagent.md, docs/adr/README.md, docs/architecture/providers.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/principles.md, docs/development-process.md) +- [ADR 0103 — Ship reusable OIDC caller identity as an opt-in module](docs/adr/0103-oidc-authn-module.md): ADR 0103 — Ship reusable OIDC caller identity as an opt-in module (linked from: README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/architecture.md, docs/design/principles.md, docs/development-process.md, engine/CHANGELOG.md) +- [ADR 0101 — Bound cached JWKS staleness](docs/adr/0101-bounded-jwks-staleness.md): ADR 0101 — Bound cached JWKS staleness (linked from: docs/acceptance/README.md, docs/acceptance/caller-identity.md, docs/acceptance/spine-convergence.md, docs/adr/0027-cloud-native.md, docs/adr/0103-oidc-authn-module.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md) - [ADR 0043 — Ephemeral turn-0 instruction fragments](docs/adr/0043-ephemeral-turn0-instruction-fragments.md): ADR 0043 — Ephemeral turn-0 instruction fragments (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0009-tiered-memory.md, docs/adr/0011-soul-and-user-model.md, docs/adr/0012-compaction.md, docs/adr/0081-rules-source-port.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/principles.md, docs/development-process.md) - [ADR 0070 — Model-visible affordance gate](docs/adr/0070-model-visible-affordance-gate.md): ADR 0070 — Model-visible affordance gate (linked from: docs/acceptance/README.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/schedule-shared-catalog.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/adr/0073-schedule-tool.md, docs/adr/0076-schedule-shared-catalog.md, docs/adr/0077-resume-a-failed-subagent.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md) - [ADR 0090 — Per-server operator opt-in for plain-http token-bearing MCP endpoints](docs/adr/0090-mcp-insecure-http-optin.md): ADR 0090 — Per-server operator opt-in for plain-http token-bearing MCP endpoints (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecak8s.md, docs/usage/mecated.md, docs/usage/mecatequi-ci.md) @@ -75,10 +78,10 @@ - [ADR 0075 — Fire-result delivery: a scheduled fire reports back into the originating chat](docs/adr/0075-fire-result-delivery.md): ADR 0075 — Fire-result delivery: a scheduled fire reports back into the originating chat (linked from: docs/acceptance/README.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/schedule-shared-catalog.md, docs/acceptance/spine-convergence.md, docs/adr/0076-schedule-shared-catalog.md, docs/adr/0096-live-feed-reconnect.md, docs/adr/0097-scheduled-fire-inflight-state.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md) - [ADR 0096 — Diagnostic-only posture reporting](docs/adr/0096-diagnostic-only-posture-reporting.md): ADR 0096 — Diagnostic-only posture reporting (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0095-root-aware-project-trust.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md) - [ADR 0089 — CLI clean break: one canonical spelling per action](docs/adr/0089-cli-clean-break-grammar.md): ADR 0089 — CLI clean break: one canonical spelling per action (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0086-remove-output-economy-control.md, docs/adr/0087-mecatui-staged-transport-migration.md, docs/adr/0103-mecatui-seed-prompt.md, docs/adr/README.md, docs/architecture.md, docs/design/principles.md, docs/development-process.md) -- [ADR 0081 — RulesSource port for .claude/rules discovery](docs/adr/0081-rules-source-port.md): ADR 0081 — RulesSource port for .claude/rules discovery (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/principles.md, docs/development-process.md, docs/usage/skills-soul-usermodel.md) - [ADR 0088 — Explicit daemon.yaml (listener topology config)](docs/adr/0088-daemon-config-file.md): ADR 0088 — Explicit daemon.yaml (listener topology config) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md) - [ADR 0097 — Scheduled fires are observable in-flight: a first-class persisted lifecycle stage](docs/adr/0097-scheduled-fire-inflight-state.md): ADR 0097 — Scheduled fires are observable in-flight: a first-class persisted lifecycle stage (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecated.md) - [ADR 0093 — Ship the real LLM provider adapters as opt-in Go modules under provider/](docs/adr/0093-provider-modules.md): ADR 0093 — Ship the real LLM provider adapters as opt-in Go modules under provider/ (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0100-provider-prompt-caching.md, docs/adr/README.md, docs/architecture.md, docs/design/principles.md, docs/development-process.md) +- [ADR 0081 — RulesSource port for .claude/rules discovery](docs/adr/0081-rules-source-port.md): ADR 0081 — RulesSource port for .claude/rules discovery (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/README.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/principles.md, docs/development-process.md, docs/usage/skills-soul-usermodel.md) - [ADR 0078 — MCP typed tool results](docs/adr/0078-mcp-typed-tool-results.md): ADR 0078 — MCP typed tool results (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0027-cloud-native.md, docs/adr/0063-mcp-structured-failclosed-callmcpwithquery.md, docs/adr/README.md, docs/design/principles.md, docs/development-process.md, engine/CHANGELOG.md) - [ADR 0057 — MCP client: consume server-initiated notifications](docs/adr/0057-mcp-server-notifications.md): ADR 0057 — MCP client: consume server-initiated notifications (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0078-mcp-typed-tool-results.md, docs/adr/README.md, docs/architecture/extensibility.md, docs/design/principles.md, docs/development-process.md) - [ADR 0040 — Writable Subagent mode + serialized merge-back](docs/adr/0040-writable-subagent-and-serialized-merge.md): ADR 0040 — Writable Subagent mode + serialized merge-back (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0077-direct-write-subagent.md, docs/adr/README.md, docs/cloud-native-harness-systems.md, docs/design/principles.md, docs/development-process.md) @@ -114,7 +117,7 @@ - [ADR 0100 — Provider-side conversation prompt caching (Anthropic, OpenAI, OpenRouter, openaichat)](docs/adr/0100-provider-prompt-caching.md): ADR 0100 — Provider-side conversation prompt caching (Anthropic, OpenAI, OpenRouter, openaichat) (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/design/IMPLEMENTATION-NOTES.md, docs/design/PRODUCTION-READINESS.md, docs/design/principles.md, docs/development-process.md, docs/usage/mecak8s.md, docs/usage/mecated.md, docs/usage/openai-compatible.md) - [Architecture Decision Records](docs/adr/README.md): Architecture Decision Records (linked from: docs/READING.md, docs/README.md, docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0003-consolidate-design-records-as-adrs.md, docs/architecture.md, docs/design/README.md, docs/design/principles.md, docs/development-process.md) - [ADR 0101 — OpenAI reasoning multiplicity: adapter-packed items + bounded encrypted-content repair](docs/adr/0101-openai-reasoning-multiplicity.md): ADR 0101 — OpenAI reasoning multiplicity: adapter-packed items + bounded encrypted-content repair (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/architecture/providers.md, docs/design/principles.md, docs/development-process.md) -- [AGENTS.md — mecatl](AGENTS.md): AGENTS.md — mecatl (linked from: README.md, docs/README.md, docs/acceptance/README.md, docs/acceptance/delegation-observability-convergence.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/path-escape-posture.md, docs/acceptance/schedule-shared-catalog.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/design/principles.md) +- [AGENTS.md — mecatl](AGENTS.md): AGENTS.md — mecatl (linked from: README.md, docs/README.md, docs/acceptance/README.md, docs/acceptance/delegation-observability-convergence.md, docs/acceptance/fire-result-delivery.md, docs/acceptance/path-escape-posture.md, docs/acceptance/schedule-shared-catalog.md, docs/acceptance/schedule-tool.md, docs/acceptance/spine-convergence.md, docs/adr/0100-caller-identity-threading.md, docs/design/principles.md) - [Implementation Notes](docs/design/IMPLEMENTATION-NOTES.md): Implementation Notes (linked from: docs/READING.md, docs/acceptance/delegation-observability-convergence.md, docs/adr/0003-consolidate-design-records-as-adrs.md, docs/adr/0004-v1-architecture.md, docs/adr/0005-driver-seams.md, docs/adr/0006-v1-step-chain.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0031-subagent-model-router.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0049-guardrails-remove-maxchecks.md, docs/adr/0050-guardrails-remove-maxcontentbytes.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0071-seamless-model-switch.md, docs/adr/0077-resume-a-failed-subagent.md, docs/adr/0097-permanent-provider-error-signal.md, docs/adr/0102-toolhive-direct-mode.md, docs/adr/0103-mecatui-seed-prompt.md, docs/architecture.md, docs/design/README.md, docs/design/principles.md, docs/development-process.md) - [Development process](docs/development-process.md): Development process (linked from: docs/acceptance/README.md, docs/acceptance/spine-convergence.md, docs/adr/0072-acceptance-plan-spine.md, docs/design/principles.md) - [Acceptance plans](docs/acceptance/README.md): Acceptance plans (linked from: docs/acceptance/spine-convergence.md, docs/adr/0072-acceptance-plan-spine.md, docs/design/principles.md, docs/development-process.md) @@ -122,6 +125,7 @@ - [mecatl — Usage & Operator Guide](docs/usage.md): mecatl — Usage & Operator Guide (linked from: AGENTS.md, README.md, docs/READING.md, docs/README.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0031-subagent-model-router.md, docs/adr/0036-engine-module.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0046-guardrails-slot-enable.md, docs/adr/0048-mecak8s.md, docs/adr/0049-guardrails-remove-maxchecks.md, docs/adr/0050-guardrails-remove-maxcontentbytes.md, docs/adr/0051-guardrails-advisory-tui-visibility.md, docs/adr/0052-guardrails-checker-down-toggle.md, docs/adr/0064-toolhive-llm-gateway-provider.md, docs/adr/0065-conversation-fork.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0102-toolhive-direct-mode.md, docs/architecture.md, docs/architecture/deployment-and-hardening.md, docs/configuration-reference.md, docs/design/MECAK8S-PLAN.md, docs/development-process.md, docs/tui.md, docs/usage/e2e.md, docs/usage/grpc-api.md, docs/usage/hooks.md, docs/usage/http-sse-api.md, docs/usage/mecak8s.md, docs/usage/openai-compatible.md, docs/usage/permissions-config.md, docs/usage/quickstart.md, docs/usage/skills-soul-usermodel.md, docs/usage/troubleshooting.md, docs/usage/workspace-trust.md) - [Production Readiness — status & roadmap](docs/design/PRODUCTION-READINESS.md): Production Readiness — status & roadmap (linked from: README.md, docs/READING.md, docs/README.md, docs/adr/0002-documentation-lifecycle.md, docs/adr/0003-consolidate-design-records-as-adrs.md, docs/adr/0007-twelve-patterns-audit.md, docs/adr/0048-mecak8s.md, docs/adr/0056-mcp-client-reconnect.md, docs/adr/0059-scheduled-tasks.md, docs/adr/0065-conversation-fork.md, docs/adr/0071-seamless-model-switch.md, docs/adr/README.md, docs/design/MECAK8S-PLAN.md, docs/design/README.md) - [Providers — OpenAI adapter & multi-provider](docs/architecture/providers.md): Providers — OpenAI adapter & multi-provider (linked from: docs/READING.md, docs/adr/0030-model-selection-heuristics.md, docs/adr/0031-subagent-model-router.md, docs/adr/0034-team-parallel-model-routing.md, docs/adr/0035-per-delegation-model-surface.md, docs/adr/0042-taxonomy-gated-model-router.md, docs/adr/0064-toolhive-llm-gateway-provider.md, docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/adr/0101-openai-reasoning-multiplicity.md, docs/adr/0102-toolhive-direct-mode.md, docs/architecture.md, docs/architecture/api-surface.md, docs/architecture/context-and-compaction.md, docs/architecture/extensibility.md, docs/architecture/observability.md, docs/architecture/ports.md, docs/architecture/subagents-and-teams.md, docs/design/PRODUCTION-READINESS.md) +- [Caller identity — completed acceptance record](docs/acceptance/caller-identity.md): Caller identity — completed acceptance record (linked from: docs/acceptance/README.md, docs/adr/0100-caller-identity-threading.md) - [Schedule tool — acceptance plan](docs/acceptance/schedule-tool.md): Schedule tool — acceptance plan (linked from: docs/acceptance/README.md, docs/acceptance/schedule-shared-catalog.md) - [Path-escape posture relax — acceptance plan](docs/acceptance/path-escape-posture.md): Path-escape posture relax — acceptance plan (linked from: docs/acceptance/README.md, docs/adr/0080-guardrail-routed-escape-checking.md) - [The agent loop & permission pause/resume](docs/architecture/agent-loop.md): The agent loop & permission pause/resume (linked from: docs/READING.md, docs/adr/0069-plan-approval-gate.md, docs/adr/0097-permanent-provider-error-signal.md, docs/architecture.md, docs/architecture/api-surface.md, docs/architecture/context-and-compaction.md, docs/architecture/domain-model.md, docs/architecture/extensibility.md, docs/architecture/hooks-and-guardrails.md, docs/architecture/memory.md, docs/architecture/parallelism.md, docs/architecture/ports.md, docs/architecture/subagents-and-teams.md, docs/design/PRODUCTION-READINESS.md) @@ -138,31 +142,32 @@ - [Deployment & server hardening](docs/architecture/deployment-and-hardening.md): Deployment & server hardening (linked from: docs/READING.md, docs/architecture.md, docs/architecture/api-surface.md, docs/architecture/hooks-and-guardrails.md, docs/architecture/observability.md, docs/architecture/parallelism.md, docs/design/PRODUCTION-READINESS.md) - [Parallelism — fork-join](docs/architecture/parallelism.md): Parallelism — fork-join (linked from: docs/READING.md, docs/architecture.md, docs/architecture/agent-loop.md, docs/architecture/api-surface.md, docs/architecture/subagents-and-teams.md, docs/design/PRODUCTION-READINESS.md) - [Memory — cross-session recall & consolidation](docs/architecture/memory.md): Memory — cross-session recall & consolidation (linked from: docs/READING.md, docs/architecture.md, docs/architecture/agent-loop.md, docs/architecture/context-and-compaction.md, docs/design/PRODUCTION-READINESS.md) -- [Engine compatibility policy](engine/COMPATIBILITY.md): Engine compatibility policy (linked from: AGENTS.md, README.md, docs/READING.md, docs/README.md, docs/acceptance/delegation-observability-convergence.md, docs/adr/0037-engine-stability-contract.md, docs/adr/0038-event-sourced-rehydration.md, docs/architecture.md, docs/architecture/api-surface.md, docs/architecture/extensibility.md, engine/CHANGELOG.md, engine/api/README.md) +- [Engine compatibility policy](engine/COMPATIBILITY.md): Engine compatibility policy (linked from: AGENTS.md, README.md, docs/READING.md, docs/README.md, docs/acceptance/delegation-observability-convergence.md, docs/adr/0037-engine-stability-contract.md, docs/adr/0038-event-sourced-rehydration.md, docs/adr/0100-caller-identity-threading.md, docs/architecture.md, docs/architecture/api-surface.md, docs/architecture/extensibility.md, engine/CHANGELOG.md, engine/api/README.md) - [mecak8s — MVP Implementation Plan](docs/design/MECAK8S-PLAN.md): mecak8s — MVP Implementation Plan (linked from: docs/adr/0048-mecak8s.md, docs/design/PRODUCTION-READINESS.md) - [mecatui — the terminal UI for mecatl](docs/tui.md): mecatui — the terminal UI for mecatl (linked from: README.md, docs/adr/0068-effort-change-via-fork.md, docs/adr/0071-seamless-model-switch.md, docs/adr/0097-permanent-provider-error-signal.md, docs/adr/0103-mecatui-seed-prompt.md, docs/architecture.md, docs/usage/configuration.md) - [Extensibility — MCP, tools & progressive disclosure](docs/architecture/extensibility.md): Extensibility — MCP, tools & progressive disclosure (linked from: docs/READING.md, docs/adr/0056-mcp-client-reconnect.md, docs/architecture.md, docs/architecture/agent-loop.md, docs/architecture/api-surface.md) +- [3. Running the server (mecated)](docs/usage/mecated.md): 3. Running the server (mecated) (linked from: docs/READING.md, docs/README.md, docs/acceptance/caller-identity.md, docs/configuration-reference.md, docs/tui.md, docs/usage.md, docs/usage/mecak8s.md, docs/usage/openai-compatible.md, docs/usage/quickstart.md) - [mecatl — Progressive reading map](docs/READING.md): mecatl — Progressive reading map (linked from: docs/README.md, docs/architecture.md, docs/architecture/context-and-compaction.md, docs/architecture/memory.md, docs/usage.md) -- [3. Running the server (mecated)](docs/usage/mecated.md): 3. Running the server (mecated) (linked from: docs/READING.md, docs/README.md, docs/configuration-reference.md, docs/tui.md, docs/usage.md, docs/usage/mecak8s.md, docs/usage/openai-compatible.md, docs/usage/quickstart.md) - [14. OpenAI & compatible endpoints](docs/usage/openai-compatible.md): 14. OpenAI & compatible endpoints (linked from: docs/usage.md, docs/usage/mecated.md) - [The domain model](docs/architecture/domain-model.md): The domain model (linked from: docs/READING.md, docs/architecture.md, docs/architecture/ports.md, docs/architecture/subagents-and-teams.md) - [Cloud-Native Harness Kit — definition](docs/cloud-native-harness-kit.md): Cloud-Native Harness Kit — definition (linked from: docs/adr/0027-cloud-native.md, docs/cloud-native-harness-systems.md, docs/scoped-resource-grants.md) - [Measuring & observing performance in Go — a reference for mecatl](docs/perf-measurement-survey.md): Measuring & observing performance in Go — a reference for mecatl (linked from: docs/adr/0018-perf-observability.md, docs/architecture.md, docs/architecture/observability.md) -- [mecatl](README.md): mecatl (linked from: AGENTS.md, docs/READING.md, docs/README.md, docs/adr/0037-engine-stability-contract.md, engine/COMPATIBILITY.md) - [mecatl — Agentic Coding Harness](docs/architecture/mecatl.modelith.md): mecatl — Agentic Coding Harness (linked from: docs/adr/0002-documentation-lifecycle.md, docs/architecture.md, docs/architecture/domain-model.md, docs/cloud-native-harness-kit.md) +- [mecatl](README.md): mecatl (linked from: AGENTS.md, docs/READING.md, docs/README.md, docs/adr/0037-engine-stability-contract.md, engine/COMPATIBILITY.md) - [1. Prerequisites & install](docs/usage/install.md): 1. Prerequisites & install (linked from: docs/READING.md, docs/README.md, docs/usage.md, docs/usage/quickstart.md) - [2. The 60-second demo](docs/usage/quickstart.md): 2. The 60-second demo (linked from: docs/READING.md, docs/README.md, docs/usage.md) - [5. Per-slot models (models:, ADR 0030)](docs/usage/model-routing.md): 5. Per-slot models (models:, ADR 0030) (linked from: docs/adr/0066-route-unpinned-and-writable-delegations.md, docs/usage.md, docs/usage/openai-compatible.md) - [6. Workspace trust & posture](docs/usage/workspace-trust.md): 6. Workspace trust & posture (linked from: docs/usage.md, docs/usage/mecatequi-ci.md, docs/usage/permissions-config.md, docs/usage/skills-soul-usermodel.md) - [mecatl documentation](docs/README.md): mecatl documentation (linked from: README.md) - [mecatl live e2e suite](e2e/README.md): mecatl live e2e suite (linked from: README.md) +- [engine/api/ — committed public-API snapshots](engine/api/README.md): engine/api/ — committed public-API snapshots (linked from: engine/CHANGELOG.md) +- [Agent identity: mecatl as its own SPIFFE trust domain](docs/agent-identity-model.md): Agent identity: mecatl as its own SPIFFE trust domain (linked from: docs/adr/0100-caller-identity-threading.md, docs/agent-identity-outbound.md, docs/cloud-native-harness-kit.md) - [Cloud-Native Harness Systems — future work scoping](docs/cloud-native-harness-systems.md): Cloud-Native Harness Systems — future work scoping (linked from: docs/cloud-native-harness-kit.md, docs/scoped-resource-grants.md) - [9. The gRPC API](docs/usage/grpc-api.md): 9. The gRPC API (linked from: docs/usage.md, docs/usage/e2e.md, docs/usage/http-sse-api.md) - [10. The HTTP / SSE API](docs/usage/http-sse-api.md): 10. The HTTP / SSE API (linked from: docs/usage.md, docs/usage/e2e.md, docs/usage/grpc-api.md) - [File-based permission config (.mecatl/settings.yaml)](docs/usage/permissions-config.md): File-based permission config (.mecatl/settings.yaml) (linked from: docs/usage.md, docs/usage/hooks.md, docs/usage/workspace-trust.md) - [Platform principles](docs/design/principles.md): Platform principles (linked from: docs/adr/0072-acceptance-plan-spine.md, docs/design/README.md) - [Changelog — github.com/stacklok/mecatl/engine](engine/CHANGELOG.md): Changelog — github.com/stacklok/mecatl/engine (linked from: docs/adr/0037-engine-stability-contract.md, docs/adr/0077-direct-write-subagent.md, engine/api/README.md) -- [engine/api/ — committed public-API snapshots](engine/api/README.md): engine/api/ — committed public-API snapshots (linked from: engine/CHANGELOG.md) - [Scoped resource grants: a filesystem and tool substrate](docs/scoped-resource-grants.md): Scoped resource grants: a filesystem and tool substrate (linked from: docs/agent-identity-model.md, docs/agent-identity-outbound.md, docs/cloud-native-harness-kit.md) - [11. Configuration](docs/usage/configuration.md): 11. Configuration (linked from: docs/configuration-reference.md, docs/usage.md) - [13. Hooks](docs/usage/hooks.md): 13. Hooks (linked from: docs/usage.md, docs/usage/permissions-config.md) @@ -173,7 +178,6 @@ - [8. mecak8s (Kubernetes-native agent)](docs/usage/mecak8s.md): 8. mecak8s (Kubernetes-native agent) (linked from: docs/usage.md) - [15. Running mecatequi from GitHub Actions](docs/usage/mecatequi-ci.md): 15. Running mecatequi from GitHub Actions (linked from: docs/usage.md) - [17. Troubleshooting / FAQ](docs/usage/troubleshooting.md): 17. Troubleshooting / FAQ (linked from: docs/usage.md) -- [Agent identity: mecatl as its own SPIFFE trust domain](docs/agent-identity-model.md): Agent identity: mecatl as its own SPIFFE trust domain (linked from: docs/agent-identity-outbound.md, docs/cloud-native-harness-kit.md) - [Example skills](docs/examples/README.md): Example skills (linked from: docs/usage/skills-soul-usermodel.md) - [Agent identity, part 2: the outbound hop](docs/agent-identity-outbound.md): Agent identity, part 2: the outbound hop (linked from: docs/cloud-native-harness-kit.md) - [Commit style](docs/examples/skills/commit-style/SKILL.md): Write Conventional-Commits messages for this repo, with the required Co-Authored-By trailer. (linked from: docs/examples/README.md) @@ -191,9 +195,9 @@ _Associative trails (Bush 1945): a topologically-valid path through each cluster 2. [mecatl — Architecture](docs/architecture.md) 3. [ADR 0002 — Documentation lifecycle: living truth, frozen records, one tracker](docs/adr/0002-documentation-lifecycle.md) 4. [mecatl — Usage & Operator Guide](docs/usage.md) -5. [Implementation Notes](docs/design/IMPLEMENTATION-NOTES.md) -6. [Production Readiness — status & roadmap](docs/design/PRODUCTION-READINESS.md) -7. [ADR 0027 — Cloud-native arc: disposable process, externalized state, durable record](docs/adr/0027-cloud-native.md) +5. [ADR 0027 — Cloud-native arc: disposable process, externalized state, durable record](docs/adr/0027-cloud-native.md) +6. [Implementation Notes](docs/design/IMPLEMENTATION-NOTES.md) +7. [Production Readiness — status & roadmap](docs/design/PRODUCTION-READINESS.md) 8. [ADR 0037 — engine public-API stability contract](docs/adr/0037-engine-stability-contract.md) 9. [ADR 0036 — engine/ is its own Go module (monorepo via go.work)](docs/adr/0036-engine-module.md) 10. [ADR 0021 — Guardrails: LLM-backed tool-content inspection](docs/adr/0021-guardrails.md) @@ -202,162 +206,166 @@ _Associative trails (Bush 1945): a topologically-valid path through each cluster 13. [ADR 0023 — Workspace Trust](docs/adr/0023-workspace-trust.md) 14. [ADR 0022 — Unattended / allow-all posture (the "YOLO mode" question)](docs/adr/0022-allow-all-posture.md) 15. [Architecture Decision Records](docs/adr/README.md) -16. [ADR 0003 — Consolidate design records as ADRs](docs/adr/0003-consolidate-design-records-as-adrs.md) -17. [The agent loop & permission pause/resume](docs/architecture/agent-loop.md) -18. [Providers — OpenAI adapter & multi-provider](docs/architecture/providers.md) -19. [mecatl — Agentic Coding Harness](docs/architecture/mecatl.modelith.md) +16. [mecatl — Agentic Coding Harness](docs/architecture/mecatl.modelith.md) +17. [ADR 0003 — Consolidate design records as ADRs](docs/adr/0003-consolidate-design-records-as-adrs.md) +18. [The agent loop & permission pause/resume](docs/architecture/agent-loop.md) +19. [Providers — OpenAI adapter & multi-provider](docs/architecture/providers.md) 20. [ADR 0004 — v1 Architecture: hexagonal DDD harness](docs/adr/0004-v1-architecture.md) 21. [ADR 0016 — Multi-provider and multi-model](docs/adr/0016-multi-provider.md) 22. [ADR 0018 — Performance observability](docs/adr/0018-perf-observability.md) 23. [ADR NNNN —](docs/adr/template.md) 24. [ADR 0011 — Soul and user-model: persistent identity and cross-session learning](docs/adr/0011-soul-and-user-model.md) -25. [ADR 0024 — System-Prompt Research and Enhancement](docs/adr/0024-system-prompt-research.md) +25. [ADR 0100 — Caller identity: accept a principal, thread it everywhere, record the owner](docs/adr/0100-caller-identity-threading.md) 26. [ADR 0015 — Background subagents and per-child cancel](docs/adr/0015-background-subagents.md) -27. [Platform principles](docs/design/principles.md) -28. [mecatl](README.md) -29. [ADR 0014 — Agent teams](docs/adr/0014-agent-teams.md) -30. [ADR 0043 — Ephemeral turn-0 instruction fragments](docs/adr/0043-ephemeral-turn0-instruction-fragments.md) -31. [ADR 0009 — Tiered memory: tier-0 index and BM25 search](docs/adr/0009-tiered-memory.md) -32. [The ports (engine/port)](docs/architecture/ports.md) -33. [ADR 0086 — Remove the output-economy control surface](docs/adr/0086-remove-output-economy-control.md) -34. [The API surface](docs/architecture/api-surface.md) -35. [Observability, persistence & reliability](docs/architecture/observability.md) +27. [ADR 0024 — System-Prompt Research and Enhancement](docs/adr/0024-system-prompt-research.md) +28. [Platform principles](docs/design/principles.md) +29. [mecatl](README.md) +30. [ADR 0014 — Agent teams](docs/adr/0014-agent-teams.md) +31. [ADR 0043 — Ephemeral turn-0 instruction fragments](docs/adr/0043-ephemeral-turn0-instruction-fragments.md) +32. [ADR 0009 — Tiered memory: tier-0 index and BM25 search](docs/adr/0009-tiered-memory.md) +33. [The ports (engine/port)](docs/architecture/ports.md) +34. [ADR 0086 — Remove the output-economy control surface](docs/adr/0086-remove-output-economy-control.md) +35. [The API surface](docs/architecture/api-surface.md) 36. [ADR 0069 — Plan-approval gate](docs/adr/0069-plan-approval-gate.md) -37. [ADR 0005 — Driver seams: ports, the gRPC driver protocol, and conformance](docs/adr/0005-driver-seams.md) -38. [ADR 0012 — Conversation compaction](docs/adr/0012-compaction.md) -39. [ADR 0019 — Long-term performance and resource regression tracking](docs/adr/0019-perf-tracking.md) -40. [Subagents & teams](docs/architecture/subagents-and-teams.md) -41. [Deployment & server hardening](docs/architecture/deployment-and-hardening.md) +37. [Observability, persistence & reliability](docs/architecture/observability.md) +38. [ADR 0005 — Driver seams: ports, the gRPC driver protocol, and conformance](docs/adr/0005-driver-seams.md) +39. [ADR 0012 — Conversation compaction](docs/adr/0012-compaction.md) +40. [ADR 0019 — Long-term performance and resource regression tracking](docs/adr/0019-perf-tracking.md) +41. [Subagents & teams](docs/architecture/subagents-and-teams.md) 42. [ADR 0030 — Layered model-selection heuristics](docs/adr/0030-model-selection-heuristics.md) -43. [ADR 0041 — Output-economy default prompt](docs/adr/0041-output-economy-default-prompt.md) +43. [Deployment & server hardening](docs/architecture/deployment-and-hardening.md) 44. [ADR 0020 — Diagnostics, audit, and the global-slog ban](docs/adr/0020-diagnostics.md) -45. [ADR 0017 — OpenAI Responses API adapter](docs/adr/0017-openai-responses-api.md) -46. [ADR 0059 — Scheduled tasks: durable registry, tick loop, leader-lease, claim-before-fire at-most-once](docs/adr/0059-scheduled-tasks.md) -47. [ADR 0089 — CLI clean break: one canonical spelling per action](docs/adr/0089-cli-clean-break-grammar.md) -48. [Changelog — github.com/stacklok/mecatl/engine](engine/CHANGELOG.md) -49. [Hooks & guardrails](docs/architecture/hooks-and-guardrails.md) -50. [ADR 0049 — Remove the guardrails per-session checker call-count cap](docs/adr/0049-guardrails-remove-maxchecks.md) -51. [ADR 0031 — The operator-gated semantic subagent model router](docs/adr/0031-subagent-model-router.md) -52. [ADR 0010 — Semantic memory recall: BM25 shipped, semantic deferred](docs/adr/0010-semantic-memory-recall.md) -53. [mecatui — the terminal UI for mecatl](docs/tui.md) +45. [ADR 0041 — Output-economy default prompt](docs/adr/0041-output-economy-default-prompt.md) +46. [ADR 0017 — OpenAI Responses API adapter](docs/adr/0017-openai-responses-api.md) +47. [Changelog — github.com/stacklok/mecatl/engine](engine/CHANGELOG.md) +48. [ADR 0059 — Scheduled tasks: durable registry, tick loop, leader-lease, claim-before-fire at-most-once](docs/adr/0059-scheduled-tasks.md) +49. [ADR 0089 — CLI clean break: one canonical spelling per action](docs/adr/0089-cli-clean-break-grammar.md) +50. [Hooks & guardrails](docs/architecture/hooks-and-guardrails.md) +51. [ADR 0049 — Remove the guardrails per-session checker call-count cap](docs/adr/0049-guardrails-remove-maxchecks.md) +52. [ADR 0031 — The operator-gated semantic subagent model router](docs/adr/0031-subagent-model-router.md) +53. [ADR 0010 — Semantic memory recall: BM25 shipped, semantic deferred](docs/adr/0010-semantic-memory-recall.md) 54. [ADR 0013 — Agent definitions (Tier 1)](docs/adr/0013-agent-definitions.md) -55. [Context management & the compaction cascade](docs/architecture/context-and-compaction.md) -56. [Measuring & observing performance in Go — a reference for mecatl](docs/perf-measurement-survey.md) -57. [Parallelism — fork-join](docs/architecture/parallelism.md) -58. [ADR 0048 — mecak8s: Kubernetes-native agent harness (storage-free, managed-service state)](docs/adr/0048-mecak8s.md) -59. [ADR 0051 — Surface advisory guardrail findings to the TUI](docs/adr/0051-guardrails-advisory-tui-visibility.md) -60. [mecatl — Progressive reading map](docs/READING.md) -61. [ADR 0062 — Out-of-band approve-once for guardrail blocks](docs/adr/0062-guardrails-approve-once.md) -62. [Extensibility — MCP, tools & progressive disclosure](docs/architecture/extensibility.md) -63. [ADR 0073 — Schedule tool: model-facing scheduling, on-by-default, drop the declarative/CLI surfaces](docs/adr/0073-schedule-tool.md) -64. [3. Running the server (mecated)](docs/usage/mecated.md) -65. [ADR 0042 — Taxonomy-gated subagent model router (enable by config, not a flag)](docs/adr/0042-taxonomy-gated-model-router.md) -66. [ADR 0028 — mecatequi: Single-Shot GitHub Action Runner](docs/adr/0028-mecatequi.md) -67. [ADR 0007 — Twelve agentic-harness patterns: pluggability audit](docs/adr/0007-twelve-patterns-audit.md) -68. [Memory — cross-session recall & consolidation](docs/architecture/memory.md) -69. [ADR 0078 — MCP typed tool results](docs/adr/0078-mcp-typed-tool-results.md) -70. [The domain model](docs/architecture/domain-model.md) -71. [ADR 0006 — v1 Implementation step-chain](docs/adr/0006-v1-step-chain.md) -72. [ADR 0095 — Root-aware project trust](docs/adr/0095-root-aware-project-trust.md) -73. [ADR 0055 — Reasoning-effort knob](docs/adr/0055-reasoning-effort.md) -74. [ADR 0008 — Memory on by default in the embedded mecatui server](docs/adr/0008-memory-on-by-default.md) -75. [ADR 0066 — Route unpinned agent-defs and writable explorers; explicit inherit is the pin](docs/adr/0066-route-unpinned-and-writable-delegations.md) -76. [ADR 0001 — Agent Client Protocol (ACP) adapter](docs/adr/0001-acp-adapter.md) -77. [File-based permission config (.mecatl/settings.yaml)](docs/usage/permissions-config.md) -78. [ADR 0025 — mecatui UX Discoverability](docs/adr/0025-ux-discoverability.md) -79. [ADR 0026 — Clipboard Image Paste](docs/adr/0026-clipboard-image-paste.md) -80. [ADR 0060 — Add Bash to the default guardrail rule set with a read-only pre-filter](docs/adr/0060-guardrails-bash-default.md) -81. [Cloud-Native Harness Kit — definition](docs/cloud-native-harness-kit.md) -82. [6. Workspace trust & posture](docs/usage/workspace-trust.md) -83. [ADR 0071 — Seamless model switch: always keep the conversation](docs/adr/0071-seamless-model-switch.md) -84. [ADR 0077 — Direct-write writable Subagent (no fork, no merge-back)](docs/adr/0077-direct-write-subagent.md) -85. [ADR 0046 — Guardrails slot enables (configure = enable)](docs/adr/0046-guardrails-slot-enable.md) -86. [ADR 0054 — Reasoning rebalance of the default-tone prompt](docs/adr/0054-reasoning-rebalance-default-prompt.md) -87. [ADR 0093 — Ship the real LLM provider adapters as opt-in Go modules under provider/](docs/adr/0093-provider-modules.md) -88. [ADR 0100 — Provider-side conversation prompt caching (Anthropic, OpenAI, OpenRouter, openaichat)](docs/adr/0100-provider-prompt-caching.md) -89. [9. The gRPC API](docs/usage/grpc-api.md) -90. [10. The HTTP / SSE API](docs/usage/http-sse-api.md) -91. [ADR 0045 — Explicit-bucket latency histograms (zero-config quantiles on /metrics)](docs/adr/0045-explicit-bucket-latency-histograms.md) -92. [ADR 0039 — Parallel single-branch auto-merge](docs/adr/0039-parallel-auto-merge.md) -93. [ADR 0082 — Factory MCP wiring for the one-shot mains](docs/adr/0082-factory-mcp-wiring.md) -94. [ADR 0034 — Extend the model router to team members and Parallel branches](docs/adr/0034-team-parallel-model-routing.md) -95. [ADR 0070 — Model-visible affordance gate](docs/adr/0070-model-visible-affordance-gate.md) -96. [13. Hooks](docs/usage/hooks.md) -97. [ADR 0053 — Flip guardrails default mode from advisory to block](docs/adr/0053-guardrails-default-block.md) -98. [Configuration reference](docs/configuration-reference.md) -99. [ADR 0087 — Staged mecatui transport migration](docs/adr/0087-mecatui-staged-transport-migration.md) -100. [ADR 0061 — Human one-shot guardrail override (/guardrail-allow)](docs/adr/0061-guardrails-human-override.md) -101. [ADR 0081 — RulesSource port for .claude/rules discovery](docs/adr/0081-rules-source-port.md) -102. [1. Prerequisites & install](docs/usage/install.md) -103. [ADR 0032 — First-class worktree binding for a session](docs/adr/0032-worktree-binding.md) -104. [ADR 0056 — MCP client: reconnect on connection drop](docs/adr/0056-mcp-client-reconnect.md) -105. [AGENTS.md — mecatl](AGENTS.md) -106. [5. Per-slot models (models:, ADR 0030)](docs/usage/model-routing.md) -107. [11. Configuration](docs/usage/configuration.md) -108. [ADR 0050 — Remove the guardrails oversized-content inspection skip](docs/adr/0050-guardrails-remove-maxcontentbytes.md) -109. [ADR 0097 — Neutral permanent-provider-error signal](docs/adr/0097-permanent-provider-error-signal.md) -110. [ADR 0090 — Background Bash commands](docs/adr/0090-background-bash.md) -111. [ADR 0033 — Dirty-aware read-only fork (uncommitted-state overlay)](docs/adr/0033-dirty-aware-readonly-fork.md) -112. [ADR 0065 — Conversation fork: peer session from a history snapshot](docs/adr/0065-conversation-fork.md) +55. [mecatui — the terminal UI for mecatl](docs/tui.md) +56. [ADR 0048 — mecak8s: Kubernetes-native agent harness (storage-free, managed-service state)](docs/adr/0048-mecak8s.md) +57. [3. Running the server (mecated)](docs/usage/mecated.md) +58. [Context management & the compaction cascade](docs/architecture/context-and-compaction.md) +59. [ADR 0101 — Bound cached JWKS staleness](docs/adr/0101-bounded-jwks-staleness.md) +60. [Measuring & observing performance in Go — a reference for mecatl](docs/perf-measurement-survey.md) +61. [ADR 0051 — Surface advisory guardrail findings to the TUI](docs/adr/0051-guardrails-advisory-tui-visibility.md) +62. [Parallelism — fork-join](docs/architecture/parallelism.md) +63. [mecatl — Progressive reading map](docs/READING.md) +64. [Extensibility — MCP, tools & progressive disclosure](docs/architecture/extensibility.md) +65. [ADR 0073 — Schedule tool: model-facing scheduling, on-by-default, drop the declarative/CLI surfaces](docs/adr/0073-schedule-tool.md) +66. [ADR 0062 — Out-of-band approve-once for guardrail blocks](docs/adr/0062-guardrails-approve-once.md) +67. [ADR 0042 — Taxonomy-gated subagent model router (enable by config, not a flag)](docs/adr/0042-taxonomy-gated-model-router.md) +68. [ADR 0028 — mecatequi: Single-Shot GitHub Action Runner](docs/adr/0028-mecatequi.md) +69. [ADR 0007 — Twelve agentic-harness patterns: pluggability audit](docs/adr/0007-twelve-patterns-audit.md) +70. [ADR 0078 — MCP typed tool results](docs/adr/0078-mcp-typed-tool-results.md) +71. [Memory — cross-session recall & consolidation](docs/architecture/memory.md) +72. [ADR 0006 — v1 Implementation step-chain](docs/adr/0006-v1-step-chain.md) +73. [The domain model](docs/architecture/domain-model.md) +74. [ADR 0095 — Root-aware project trust](docs/adr/0095-root-aware-project-trust.md) +75. [ADR 0008 — Memory on by default in the embedded mecatui server](docs/adr/0008-memory-on-by-default.md) +76. [ADR 0055 — Reasoning-effort knob](docs/adr/0055-reasoning-effort.md) +77. [ADR 0066 — Route unpinned agent-defs and writable explorers; explicit inherit is the pin](docs/adr/0066-route-unpinned-and-writable-delegations.md) +78. [File-based permission config (.mecatl/settings.yaml)](docs/usage/permissions-config.md) +79. [ADR 0001 — Agent Client Protocol (ACP) adapter](docs/adr/0001-acp-adapter.md) +80. [ADR 0025 — mecatui UX Discoverability](docs/adr/0025-ux-discoverability.md) +81. [ADR 0026 — Clipboard Image Paste](docs/adr/0026-clipboard-image-paste.md) +82. [ADR 0060 — Add Bash to the default guardrail rule set with a read-only pre-filter](docs/adr/0060-guardrails-bash-default.md) +83. [Cloud-Native Harness Kit — definition](docs/cloud-native-harness-kit.md) +84. [6. Workspace trust & posture](docs/usage/workspace-trust.md) +85. [ADR 0077 — Direct-write writable Subagent (no fork, no merge-back)](docs/adr/0077-direct-write-subagent.md) +86. [ADR 0071 — Seamless model switch: always keep the conversation](docs/adr/0071-seamless-model-switch.md) +87. [AGENTS.md — mecatl](AGENTS.md) +88. [ADR 0103 — Ship reusable OIDC caller identity as an opt-in module](docs/adr/0103-oidc-authn-module.md) +89. [ADR 0046 — Guardrails slot enables (configure = enable)](docs/adr/0046-guardrails-slot-enable.md) +90. [ADR 0054 — Reasoning rebalance of the default-tone prompt](docs/adr/0054-reasoning-rebalance-default-prompt.md) +91. [ADR 0100 — Provider-side conversation prompt caching (Anthropic, OpenAI, OpenRouter, openaichat)](docs/adr/0100-provider-prompt-caching.md) +92. [ADR 0093 — Ship the real LLM provider adapters as opt-in Go modules under provider/](docs/adr/0093-provider-modules.md) +93. [9. The gRPC API](docs/usage/grpc-api.md) +94. [10. The HTTP / SSE API](docs/usage/http-sse-api.md) +95. [ADR 0039 — Parallel single-branch auto-merge](docs/adr/0039-parallel-auto-merge.md) +96. [ADR 0045 — Explicit-bucket latency histograms (zero-config quantiles on /metrics)](docs/adr/0045-explicit-bucket-latency-histograms.md) +97. [ADR 0082 — Factory MCP wiring for the one-shot mains](docs/adr/0082-factory-mcp-wiring.md) +98. [ADR 0034 — Extend the model router to team members and Parallel branches](docs/adr/0034-team-parallel-model-routing.md) +99. [ADR 0070 — Model-visible affordance gate](docs/adr/0070-model-visible-affordance-gate.md) +100. [13. Hooks](docs/usage/hooks.md) +101. [ADR 0053 — Flip guardrails default mode from advisory to block](docs/adr/0053-guardrails-default-block.md) +102. [Configuration reference](docs/configuration-reference.md) +103. [Agent identity: mecatl as its own SPIFFE trust domain](docs/agent-identity-model.md) +104. [ADR 0087 — Staged mecatui transport migration](docs/adr/0087-mecatui-staged-transport-migration.md) +105. [ADR 0061 — Human one-shot guardrail override (/guardrail-allow)](docs/adr/0061-guardrails-human-override.md) +106. [ADR 0081 — RulesSource port for .claude/rules discovery](docs/adr/0081-rules-source-port.md) +107. [1. Prerequisites & install](docs/usage/install.md) +108. [ADR 0032 — First-class worktree binding for a session](docs/adr/0032-worktree-binding.md) +109. [ADR 0056 — MCP client: reconnect on connection drop](docs/adr/0056-mcp-client-reconnect.md) +110. [11. Configuration](docs/usage/configuration.md) +111. [5. Per-slot models (models:, ADR 0030)](docs/usage/model-routing.md) +112. [ADR 0050 — Remove the guardrails oversized-content inspection skip](docs/adr/0050-guardrails-remove-maxcontentbytes.md) 113. [Scoped resource grants: a filesystem and tool substrate](docs/scoped-resource-grants.md) -114. [ADR 0092 — Project-trust suppression pin](docs/adr/0092-no-project-trust-pin.md) -115. [7. Skills, soul, user model](docs/usage/skills-soul-usermodel.md) -116. [ADR 0075 — Fire-result delivery: a scheduled fire reports back into the originating chat](docs/adr/0075-fire-result-delivery.md) -117. [2. The 60-second demo](docs/usage/quickstart.md) -118. [ADR 0057 — MCP client: consume server-initiated notifications](docs/adr/0057-mcp-server-notifications.md) -119. [ADR 0096 — Diagnostic-only posture reporting](docs/adr/0096-diagnostic-only-posture-reporting.md) -120. [14. OpenAI & compatible endpoints](docs/usage/openai-compatible.md) -121. [ADR 0102 — ToolHive LLM gateway DIRECT mode (in-process OIDC token injection)](docs/adr/0102-toolhive-direct-mode.md) -122. [ADR 0035 — Surface the per-delegation model for ALL children, not just routed ones](docs/adr/0035-per-delegation-model-surface.md) -123. [ADR 0064 — Auto-detect the ToolHive LLM gateway proxy as a native provider](docs/adr/0064-toolhive-llm-gateway-provider.md) -124. [ADR 0040 — Writable Subagent mode + serialized merge-back](docs/adr/0040-writable-subagent-and-serialized-merge.md) -125. [mecak8s — MVP Implementation Plan](docs/design/MECAK8S-PLAN.md) -126. [Agent identity: mecatl as its own SPIFFE trust domain](docs/agent-identity-model.md) -127. [ADR 0094 — Opt-in project ingestion: two-axis positive grants](docs/adr/0094-opt-in-project-ingestion.md) -128. [ADR 0090 — Per-server operator opt-in for plain-http token-bearing MCP endpoints](docs/adr/0090-mcp-insecure-http-optin.md) -129. [16. Live e2e suite](docs/usage/e2e.md) -130. [4. Guardrails — LLM-backed tool-content inspection (guardrails:)](docs/usage/guardrails.md) -131. [8. mecak8s (Kubernetes-native agent)](docs/usage/mecak8s.md) -132. [15. Running mecatequi from GitHub Actions](docs/usage/mecatequi-ci.md) -133. [17. Troubleshooting / FAQ](docs/usage/troubleshooting.md) -134. [ADR 0067 — OpenAI Chat Completions adapter (OpenCode Go provider)](docs/adr/0067-openai-chat-completions-adapter.md) -135. [ADR 0083 — Expose the routing miss/gate reason on delegation-start events](docs/adr/0083-routing-reason-on-delegation-start.md) -136. [ADR 0047 — Absolute path resolution inside the workspace root](docs/adr/0047-absolute-path-resolution.md) -137. [ADR 0101 — OpenAI reasoning multiplicity: adapter-packed items + bounded encrypted-content repair](docs/adr/0101-openai-reasoning-multiplicity.md) -138. [Cloud-Native Harness Systems — future work scoping](docs/cloud-native-harness-systems.md) -139. [ADR 0052 — Global guardrails checker-down posture toggle](docs/adr/0052-guardrails-checker-down-toggle.md) -140. [ADR 0079 — Converge delegation observability on two tiers (bounded previews for Subagent/Parallel)](docs/adr/0079-delegation-observability-convergence.md) -141. [engine/api/ — committed public-API snapshots](engine/api/README.md) -142. [ADR 0058 — Writable named-specialist Subagent (mode:"read-write" + agent)](docs/adr/0058-writable-named-specialist-subagent.md) -143. [Agent identity, part 2: the outbound hop](docs/agent-identity-outbound.md) -144. [ADR 0029 — Repo-map Tree-sitter Binding](docs/adr/0029-repomap-tree-sitter.md) -145. [ADR 0068 — Change reasoning effort via conversation fork (keep the transcript)](docs/adr/0068-effort-change-via-fork.md) -146. [ADR 0098 — Telemetry for the headless binaries (mecatequi, mecak8s)](docs/adr/0098-headless-telemetry.md) -147. [ADR 0076 — The schedule manager is store-shaped and pre-Service; the shared catalog carries the Schedule tool](docs/adr/0076-schedule-shared-catalog.md) -148. [mecatl documentation](docs/README.md) -149. [Example skills](docs/examples/README.md) -150. [ADR 0088 — Explicit daemon.yaml (listener topology config)](docs/adr/0088-daemon-config-file.md) -151. [ADR 0097 — Scheduled fires are observable in-flight: a first-class persisted lifecycle stage](docs/adr/0097-scheduled-fire-inflight-state.md) -152. [ADR 0080 — Guardrail-routed path-escape checking (composition pre-check, auto-only)](docs/adr/0080-guardrail-routed-escape-checking.md) -153. [ADR 0096 — mecatui live-feed reconnect: client-owned backoff + durable catch-up, no server cursor](docs/adr/0096-live-feed-reconnect.md) -154. [Acceptance plans](docs/acceptance/README.md) -155. [Development process](docs/development-process.md) -156. [Path-escape posture relax — acceptance plan](docs/acceptance/path-escape-posture.md) -157. [ADR 0044 — Host-supplied askID discriminator (cross-process-reconstructable askID)](docs/adr/0044-host-supplied-askid-discriminator.md) -158. [ADR 0063 — MCP structured results: fail-closed + CallMcpWithQuery](docs/adr/0063-mcp-structured-failclosed-callmcpwithquery.md) -159. [ADR 0072 — The acceptance-plan spine (to-acceptance-plan / plan-orchestrate / ac-trace)](docs/adr/0072-acceptance-plan-spine.md) -160. [ADR 0074 — Many concurrent agent loops per server; the scheduler is single-leader for the tick, pooled (then sharded) for the drive](docs/adr/0074-many-loops-scheduler-shape.md) -161. [ADR 0077 — A failed delegated child is resumable (Recover, not refuse)](docs/adr/0077-resume-a-failed-subagent.md) -162. [ADR 0099 — External transcript import (mecated import)](docs/adr/0099-external-transcript-import.md) -163. [ADR 0103 — mecatui seed prompt (-p/--prompt, --prompt-file)](docs/adr/0103-mecatui-seed-prompt.md) -164. [Schedule tool — acceptance plan](docs/acceptance/schedule-tool.md) -165. [Delegation observability convergence — acceptance plan](docs/acceptance/delegation-observability-convergence.md) -166. [Fire-result delivery — acceptance plan](docs/acceptance/fire-result-delivery.md) -167. [Schedule shared catalog — acceptance plan](docs/acceptance/schedule-shared-catalog.md) -168. [Spine convergence — acceptance plan](docs/acceptance/spine-convergence.md) -169. [mecatl live e2e suite](e2e/README.md) -170. [Commit style](docs/examples/skills/commit-style/SKILL.md) -171. [Go table-driven tests](docs/examples/skills/go-table-tests/SKILL.md) +114. [ADR 0097 — Neutral permanent-provider-error signal](docs/adr/0097-permanent-provider-error-signal.md) +115. [ADR 0090 — Background Bash commands](docs/adr/0090-background-bash.md) +116. [ADR 0033 — Dirty-aware read-only fork (uncommitted-state overlay)](docs/adr/0033-dirty-aware-readonly-fork.md) +117. [ADR 0065 — Conversation fork: peer session from a history snapshot](docs/adr/0065-conversation-fork.md) +118. [ADR 0092 — Project-trust suppression pin](docs/adr/0092-no-project-trust-pin.md) +119. [7. Skills, soul, user model](docs/usage/skills-soul-usermodel.md) +120. [ADR 0075 — Fire-result delivery: a scheduled fire reports back into the originating chat](docs/adr/0075-fire-result-delivery.md) +121. [2. The 60-second demo](docs/usage/quickstart.md) +122. [ADR 0057 — MCP client: consume server-initiated notifications](docs/adr/0057-mcp-server-notifications.md) +123. [ADR 0096 — Diagnostic-only posture reporting](docs/adr/0096-diagnostic-only-posture-reporting.md) +124. [14. OpenAI & compatible endpoints](docs/usage/openai-compatible.md) +125. [ADR 0102 — ToolHive LLM gateway DIRECT mode (in-process OIDC token injection)](docs/adr/0102-toolhive-direct-mode.md) +126. [ADR 0035 — Surface the per-delegation model for ALL children, not just routed ones](docs/adr/0035-per-delegation-model-surface.md) +127. [ADR 0064 — Auto-detect the ToolHive LLM gateway proxy as a native provider](docs/adr/0064-toolhive-llm-gateway-provider.md) +128. [Caller identity — completed acceptance record](docs/acceptance/caller-identity.md) +129. [mecak8s — MVP Implementation Plan](docs/design/MECAK8S-PLAN.md) +130. [ADR 0040 — Writable Subagent mode + serialized merge-back](docs/adr/0040-writable-subagent-and-serialized-merge.md) +131. [ADR 0094 — Opt-in project ingestion: two-axis positive grants](docs/adr/0094-opt-in-project-ingestion.md) +132. [ADR 0090 — Per-server operator opt-in for plain-http token-bearing MCP endpoints](docs/adr/0090-mcp-insecure-http-optin.md) +133. [16. Live e2e suite](docs/usage/e2e.md) +134. [4. Guardrails — LLM-backed tool-content inspection (guardrails:)](docs/usage/guardrails.md) +135. [8. mecak8s (Kubernetes-native agent)](docs/usage/mecak8s.md) +136. [15. Running mecatequi from GitHub Actions](docs/usage/mecatequi-ci.md) +137. [17. Troubleshooting / FAQ](docs/usage/troubleshooting.md) +138. [ADR 0067 — OpenAI Chat Completions adapter (OpenCode Go provider)](docs/adr/0067-openai-chat-completions-adapter.md) +139. [ADR 0083 — Expose the routing miss/gate reason on delegation-start events](docs/adr/0083-routing-reason-on-delegation-start.md) +140. [Cloud-Native Harness Systems — future work scoping](docs/cloud-native-harness-systems.md) +141. [ADR 0047 — Absolute path resolution inside the workspace root](docs/adr/0047-absolute-path-resolution.md) +142. [ADR 0101 — OpenAI reasoning multiplicity: adapter-packed items + bounded encrypted-content repair](docs/adr/0101-openai-reasoning-multiplicity.md) +143. [ADR 0052 — Global guardrails checker-down posture toggle](docs/adr/0052-guardrails-checker-down-toggle.md) +144. [ADR 0079 — Converge delegation observability on two tiers (bounded previews for Subagent/Parallel)](docs/adr/0079-delegation-observability-convergence.md) +145. [ADR 0058 — Writable named-specialist Subagent (mode:"read-write" + agent)](docs/adr/0058-writable-named-specialist-subagent.md) +146. [Agent identity, part 2: the outbound hop](docs/agent-identity-outbound.md) +147. [engine/api/ — committed public-API snapshots](engine/api/README.md) +148. [ADR 0029 — Repo-map Tree-sitter Binding](docs/adr/0029-repomap-tree-sitter.md) +149. [ADR 0068 — Change reasoning effort via conversation fork (keep the transcript)](docs/adr/0068-effort-change-via-fork.md) +150. [ADR 0098 — Telemetry for the headless binaries (mecatequi, mecak8s)](docs/adr/0098-headless-telemetry.md) +151. [ADR 0076 — The schedule manager is store-shaped and pre-Service; the shared catalog carries the Schedule tool](docs/adr/0076-schedule-shared-catalog.md) +152. [Example skills](docs/examples/README.md) +153. [mecatl documentation](docs/README.md) +154. [ADR 0088 — Explicit daemon.yaml (listener topology config)](docs/adr/0088-daemon-config-file.md) +155. [ADR 0097 — Scheduled fires are observable in-flight: a first-class persisted lifecycle stage](docs/adr/0097-scheduled-fire-inflight-state.md) +156. [ADR 0080 — Guardrail-routed path-escape checking (composition pre-check, auto-only)](docs/adr/0080-guardrail-routed-escape-checking.md) +157. [ADR 0096 — mecatui live-feed reconnect: client-owned backoff + durable catch-up, no server cursor](docs/adr/0096-live-feed-reconnect.md) +158. [Acceptance plans](docs/acceptance/README.md) +159. [Development process](docs/development-process.md) +160. [Path-escape posture relax — acceptance plan](docs/acceptance/path-escape-posture.md) +161. [ADR 0044 — Host-supplied askID discriminator (cross-process-reconstructable askID)](docs/adr/0044-host-supplied-askid-discriminator.md) +162. [ADR 0063 — MCP structured results: fail-closed + CallMcpWithQuery](docs/adr/0063-mcp-structured-failclosed-callmcpwithquery.md) +163. [ADR 0072 — The acceptance-plan spine (to-acceptance-plan / plan-orchestrate / ac-trace)](docs/adr/0072-acceptance-plan-spine.md) +164. [ADR 0074 — Many concurrent agent loops per server; the scheduler is single-leader for the tick, pooled (then sharded) for the drive](docs/adr/0074-many-loops-scheduler-shape.md) +165. [ADR 0077 — A failed delegated child is resumable (Recover, not refuse)](docs/adr/0077-resume-a-failed-subagent.md) +166. [ADR 0099 — External transcript import (mecated import)](docs/adr/0099-external-transcript-import.md) +167. [ADR 0103 — mecatui seed prompt (-p/--prompt, --prompt-file)](docs/adr/0103-mecatui-seed-prompt.md) +168. [Schedule tool — acceptance plan](docs/acceptance/schedule-tool.md) +169. [Delegation observability convergence — acceptance plan](docs/acceptance/delegation-observability-convergence.md) +170. [Fire-result delivery — acceptance plan](docs/acceptance/fire-result-delivery.md) +171. [Schedule shared catalog — acceptance plan](docs/acceptance/schedule-shared-catalog.md) +172. [Spine convergence — acceptance plan](docs/acceptance/spine-convergence.md) +173. [mecatl live e2e suite](e2e/README.md) +174. [Commit style](docs/examples/skills/commit-style/SKILL.md) +175. [Go table-driven tests](docs/examples/skills/go-table-tests/SKILL.md) ## Known gaps diff --git a/user-docs/deployment/mecak8s.md b/user-docs/deployment/mecak8s.md index ed1c37f2c2..1fb8d4335c 100644 --- a/user-docs/deployment/mecak8s.md +++ b/user-docs/deployment/mecak8s.md @@ -269,6 +269,192 @@ For the scripted version of exactly this (plus the case above), see `task e2e:k8 --- +## Multi-user: caller identity (opt-in) + +By default mecak8s has no user concept: one shared deployment, no subjects, and +whoever can reach the API is "the caller". Caller identity changes that — a real +IdP authenticates each request, and every session and schedule records the +verified `(issuer, subject)` that owns it. + +### Read this before you enable it + +**This is attribution, not a tenancy boundary.** It records who acted. It refuses +nothing. Specifically, with identity on and two callers sharing a deployment: + +- either caller can prompt, cancel, fork or delete **the other's** sessions +- either caller can **approve the other's pending permission ask**, which is a + human authorising a tool call +- all sessions run in the **same pod filesystem at the same workspace path**, so + one caller's files are readable by the other's session +- listing is unfiltered: everyone sees everyone's sessions and their owners + +If you need callers separated from each other, this is not that feature and +deploying it as one would be a mistake. Per-caller access control is later work. + +### Validator and bounded signing-key cache + +The production OIDC/JWT validator is a delegated, actively-maintained library — +mecatl never hand-rolls token verification. A bad OIDC +configuration, including an unreachable initial key fetch, fails closed at startup +rather than serving unauthenticated traffic. After a successful fetch, the last +good JWKS can cover a short IdP outage. The overlay explicitly sets +`--oidc-max-jwks-staleness=1h`: once keys are older than that, the validator +refreshes before deciding and returns **503 Service Unavailable** when it cannot +obtain current keys. A bad, expired, wrong-issuer, or wrong-audience token remains +**401**. Set the flag to `0` only to deliberately accept unbounded cached-key +availability and its signing-key revocation exposure. + +This bounds **signing-key** revocation exposure during an IdP outage; it does not +provide per-token revocation before normal token expiry. The JWKS cache is +process-local and unpersisted, so a restarted pod fetches current keys again. + +### Turning it on + +Use the opt-in overlay, which appends four flags to the agent: + +```sh +# Use a registry your target cluster can pull from; ko.local is not sufficient. +export KO_DOCKER_REPO=registry.example/mecatl +task deploy:apply ROOT=deploy/mecak8s-oidc # edit the three values first +``` + +| Flag | Meaning | +|---|---| +| `--oidc-issuer` | your IdP's issuer URL, compared **byte-exact** against the token's `iss` | +| `--oidc-audience` | the audience this deployment accepts. **Required** — an audience-less verifier accepts tokens minted for a different service | +| `--oidc-jwks-uri` | *optional.* Pin the signing-key endpoint and skip discovery. Only for an air-gapped or pinned-key deployment; leave it out and the issuer's discovery document is used | +| `--oidc-max-jwks-staleness=1h` | Maximum time a last-good JWKS remains trusted when refresh cannot reach the IdP. `0` deliberately disables the bound. | + +Point it at a **real IdP over HTTPS**. That is the only configuration that works +with the validator's defaults intact: it refuses an `http://` issuer, and refuses +a `jwks_uri` that resolves to a private, loopback or link-local address — the +check that stops a `jwks_uri` aimed at cloud instance metadata +(`169.254.169.254`). An **in-cluster** IdP needs a flag that relaxes both, which +exists for our end-to-end tests only and is deliberately absent from these +manifests. + +No `NetworkPolicy` change is needed for an external IdP: the base egress already +allows DNS and TCP 443 to any destination. An in-cluster IdP on another port +**does** need its own egress rule — the namespace default-deny is real, and a +missing rule shows up as the agent failing to fetch the JWKS and the pod +CrashLoopBackOff'ing at startup. + +### Use it from the TUI + +`mecatui` is an external gRPC client. Obtain a token using your normal IdP +login flow, then use `mecatui connect` and provide the token with +`--auth-token` (or `MECATL_AUTH_TOKEN`). The TUI sends it as bearer metadata on +every RPC; it does not obtain or refresh OIDC tokens for you. + +For a development port-forward, bearer traffic stays on loopback: + +```sh +kubectl port-forward -n mecatl service/mecak8s-agent 8080:8080 & +export MECATL_AUTH_TOKEN="$(your-oidc-cli print-access-token)" +bin/mecatui connect 127.0.0.1:8080 --auth-token "$MECATL_AUTH_TOKEN" --workspace /tmp +``` + +To prove that the token is actually required, remove the environment fallback and +submit a prompt in a separate TUI session: + +```sh +env -u MECATL_AUTH_TOKEN \ + bin/mecatui connect 127.0.0.1:8080 --workspace /tmp +``` + +A gRPC dial can succeed before credentials are checked; the unauthenticated +session's first request must fail before it produces a model response. If it +replies, treat that as an authentication bypass. + +`--workspace` identifies a directory on the **agent pod**, not the machine +running the TUI. Use a path that exists in the pod; `/tmp` is appropriate for +this connectivity check, but is not a shared developer checkout. For a remote +endpoint, use TLS (`--tls`, and `--tls-ca` for a private CA): the TUI rejects a +bearer on a non-loopback cleartext connection. + +After creating a session in the TUI, verify the saved owner through the HTTP +API (port-forward `8081:8081` as well if needed): + +```sh +curl -s http://127.0.0.1:8081/v1/sessions \ + -H "Authorization: Bearer $MECATL_AUTH_TOKEN" +``` + +The returned session row contains the verified `owner`. This is a practical +end-user path through the same gRPC authentication edge that the TUI uses; the +kind e2e suite additionally exercises it against a real in-cluster Dex. + +### Seeing who owns what + +`GET /v1/sessions` carries the owner, so `curl` is enough: + +```json +{ "session_id": "9bfb79d9…", + "state": "completed", + "owner": { "issuer": "https://idp.example.com", + "subject": "CglhbGljZS11aWQSBWxvY2Fs", + "grant_type": "user", + "name": "alice" } } +``` + +`(issuer, subject)` is the durable identity. `subject` is whatever your IdP uses +— often an opaque id rather than a username — and `name` is a **cosmetic snapshot +of the token's `name` claim**, which your IdP may change later. Match on +`(issuer, subject)`, display `name`. + +An owner is written **once**, at session creation, from the verified token and +never from the request body. Children (subagents, parallel branches, team members, +scheduled fires) inherit their parent's owner; a fork inherits the **source's** +owner. Nothing backfills: sessions created before you enabled identity stay +unowned and render as such. + +### Who *did* something, versus who owns it + +These are different questions and the answers routinely differ, because any +authenticated caller can act on any session. If Bob prompts Alice's session, the +session still belongs to Alice and each durable event records **Bob** as the actor. + +That per-event actor is written only to the **durable event log** — it is not on +any API response, gRPC or HTTP. Today the only way to read it is out of the store +directly, e.g. `redis-cli LRANGE mecatl:events: 0 -1`, where each +record is `{"v":"redisstore-eventlog/1","ev":{…,"Actor":{…}}}`. If "who did what" +needs to be queryable for you, say so — it is a known gap, not a design intent. + +### Troubleshooting: start here + +Two IdP misconfigurations account for most first-deployment 401s, and neither +produces a helpful error: + +1. **The audience is not in the token.** Keycloak, for example, puts only + `account` in `aud` by default; your client id appears only if you attach an + Audience protocol mapper. Then `--oidc-audience=` never + matches and **every** caller gets 401. Decode a token and check `aud` before + anything else. +2. **The issuer string does not match.** `iss` is compared byte-exact, and an IdP + stamps whatever external hostname it is configured to advertise — regardless of + how your pods reach it. Take `--oidc-issuer` from the IdP's + `/.well-known/openid-configuration`, never from the in-cluster Service URL. + +Beyond that: a **401** means the credential was rejected; a **503** means a +required JWKS refresh could not obtain current keys after the configured +staleness bound. Before that bound, a last-good JWKS can keep validation available +during a short IdP outage. Authn failures are **not currently logged**, so neither +is visible in the agent's output — you will see the status code and nothing else. + +### What this does not give you + +Stated plainly so it is not inferred: + +| | | +|---|---| +| **Isolation** | None. Any authenticated caller reaches any session and any workspace file. | +| **Signing-key revocation** | Bounded, not immediate: with the default `--oidc-max-jwks-staleness=1h`, a last-good JWKS may remain trusted for up to one hour during an IdP outage; then validation fails 503 until refresh succeeds. `0` deliberately restores unbounded exposure. This is **not per-token revocation**: an otherwise valid token remains accepted until expiry. | +| **Rate limiting / quotas** | mecak8s registers no rate-limit flags at all; a pod is assumed to sit behind a Service or mesh. One caller can exhaust the shared Redis, lease namespace and provider budget. | +| **Store confidentiality** | `--redis-url` takes a bare `host:port`: no password, no TLS. Conversations and owner labels sit in plaintext, protected only by the NetworkPolicy. | +| **PII controls** | `name` (often an email) is copied onto every durable event, the session snapshot and schedule records, unredacted, with no retention or erasure hook. | +| **Audit signals** | Telemetry is opt-in and off by default (`--metrics-addr` to expose `/metrics`, `--otlp-*` to push to a collector), and **no authn metric exists at all** — the emitted set covers runs, events, permission asks and process stats, not authentication outcomes. Combined with failures not being logged, an authn problem is invisible: you see the caller's status code and nothing on the server side. | +| **Machine-vs-human grant** | `grant_type` is best-effort and IdP-dependent. A token with no grant hint resolves to `user`, which includes most IdPs' service accounts. | + ## Scaling Add replicas freely. The `coordination.k8s.io` Lease backend enforces single-writer per session: when two pods both try to start a run on the same session, the second gets `ErrSessionLeasedElsewhere` (HTTP 409 / gRPC `FAILED_PRECONDITION`). The acquiring pod renews its lease on a background goroutine; the interval defaults to `--session-lease-ttl / 3`. diff --git a/user-docs/deployment/mecated.md b/user-docs/deployment/mecated.md index 7a859b3f63..35a389b57a 100644 --- a/user-docs/deployment/mecated.md +++ b/user-docs/deployment/mecated.md @@ -101,8 +101,52 @@ loopback-only server. Flags not covered here are advanced operator tuning; run | `--tls-cert` | `""` | PEM server certificate; enables TLS on both listeners when paired with `--tls-key` | | `--tls-key` | `""` | PEM server private key | | `--client-ca` | `""` | PEM client-CA bundle; enables mTLS (requires `--tls-cert`/`--tls-key`) | -| `--rate-limit` | `0` (off) | Sustained per-client request rate in req/s | -| `--rate-burst` | `0` (derived) | Token-bucket burst; zero derives a sane default from `--rate-limit` | +| `--rate-limit` | `0` (off) | Sustained per-client request rate in req/s; with OIDC, also limits rejected bearer validation per direct transport peer IP | +| `--rate-burst` | `0` (derived) | Token-bucket burst; zero derives a sane default from `--rate-limit`, including the OIDC rejected-token bucket | +| `--oidc-issuer` | `""` (off) | OIDC issuer URL whose tokens identify callers; setting it turns caller identity on. See [Caller identity](#caller-identity-oidc) | +| `--oidc-jwks-uri` | `""` (derived) | Static JWKS endpoint, short-circuiting OIDC discovery (air-gapped or pinned-key deployments) | +| `--oidc-audience` | `""` | Audience (`aud`) this deployment accepts; **required** with `--oidc-issuer` | +| `--oidc-max-jwks-staleness` | `1h` | Maximum age of last-good signing keys during an IdP outage. `0` deliberately disables this bound; negative values are rejected. | + +#### Caller identity (OIDC) + +`--oidc-issuer` names the identity provider whose tokens identify your callers. +When it is set, every request must present a bearer that provider vouches for, +and the verified `(issuer, subject)` pair is recorded as the **owner** of each +session the caller creates. `--oidc-audience` is required alongside it — an +audience-less verifier would accept tokens minted for a different service. +`--oidc-jwks-uri` pins the signing-key endpoint instead of discovering it. + +**This is attribution, not isolation.** Sessions, schedules and event-log +records gain an owner so you can see who did what; nothing is refused on +identity grounds. Any authenticated caller can still list and act on any +session — per-caller access control is a separate, later piece of work. Do not +deploy these flags as a tenancy boundary. + +The production OIDC/JWT validator is a delegated, actively-maintained library — +mecatl never hand-rolls token verification. A bad OIDC +configuration, including an unreachable initial key fetch, fails closed at startup +rather than falling back to unauthenticated traffic. After a successful fetch, the +last good JWKS can cover a brief IdP outage. `--oidc-max-jwks-staleness=1h` bounds +that fallback: once keys are older than the bound, a failed refresh returns **503 +Service Unavailable**. `0` is an explicit acceptance of unbounded cached-key +availability and its signing-key revocation exposure. + +When OIDC and `--rate-limit` are both enabled, rejected bearer traffic has a +separate pre-validation bucket keyed only by the **direct transport peer IP**. +The server never trusts `Forwarded` or `X-Forwarded-For` for this decision. Once +a peer exhausts the bucket, requests return HTTP **429** / gRPC +`RESOURCE_EXHAUSTED` before another validator call. Valid tokens do not consume +that bucket; they continue to the existing verified-principal limiter and are +charged there once. A normally admitted bad token remains **401** / gRPC +`UNAUTHENTICATED`, while an IdP outage remains **503** / gRPC `UNAVAILABLE`. + +This is a bound on **signing-key** revocation during an outage, not per-token +revocation. An otherwise valid token remains acceptable until its normal expiry. +The JWKS cache is process-local and not persisted; a restarted process fetches +current keys again. The flags are identical on `mecak8s`. Full reference: +[usage.md](https://github.com/stacklok/mecatl/blob/main/docs/usage.md) and +[ADR 0100](https://github.com/stacklok/mecatl/blob/main/docs/adr/0100-caller-identity-threading.md). #### Daemon config file (`daemon.yaml`) @@ -313,6 +357,10 @@ mecatl exposes command and file execution. The security model has three layers: interface. No traffic crosses the machine. 2. **Authentication.** Off by default for the loopback case. Enable a bearer token (`--auth-token` / `MECATL_AUTH_TOKEN`) before binding a non-loopback address. + [Caller identity](#caller-identity-oidc) is a separate, additive axis: a shared + token is one credential with no subject behind it, while `--oidc-issuer` gives + each caller a distinct identity. Identity records **who** acted; it does not + yet decide **what** they may act on. 3. **Transport.** Plaintext by default. Add `--tls-cert` + `--tls-key` for TLS; add `--client-ca` to require and verify client certificates (mTLS).