methods

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package methods is the single source of truth for Harbor Protocol method names (CLAUDE.md §8: "Method names live in internal/protocol/methods/methods.go. No hardcoded method strings elsewhere."). Other packages reference these constants; no Protocol method string is hardcoded outside this file. The Phase 58 lint formalises this — Phase 54 lays the foundation so that lint is a no-op formalisation.

The Phase 54 set: the task control surface

Phase 54 ships the ten canonical task-control method names (RFC §5.2 "Task control" row): `start` plus the nine steering-control entries from the RFC §6.3 control taxonomy. `start` spawns a task; the nine controls map 1:1 onto the nine steering.ControlType values. Later Protocol surfaces (state snapshots, topology, artifacts, traces, metrics — RFC §5.2's other rows) add their method names here in their own phases.

The wire strings are lowercase snake_case — `inject_context`, `user_message` — matching the RFC §5.2 table verbatim. They are NOT the uppercase steering.ControlType wire strings (`INJECT_CONTEXT`, `USER_MESSAGE`): the Protocol method name is the client-facing name, and the protocol.ControlSurface translates a method name into its steering.ControlType. Keeping the two namespaces distinct is deliberate — the Protocol surface owns its own method vocabulary (brief 07's "the runtime owns the protocol it speaks").

The Wave 13 extension: the streaming-events method-name anchors

Phase 72 elevates `events.subscribe` to a canonical method-name constant. The wire-transport route is still `GET /v1/events` (Phase 60 SSE), but the canonical method name is now the contract third-party Console implementations branch on — same pattern as the Phase 54 task-control nine. Phase 72a adds `events.aggregate` (`POST /v1/events/aggregate`) for time-bucketed event-type counts. `events.subscribe` and `events.aggregate` are streaming-events methods, NOT task-control methods: `IsControlMethod` returns false for both (the predicate stays exclusive to the Phase 54 steering- control nine) and `Methods()` returns the augmented sorted set with the new entries. See `docs/plans/phase-72-console-subscription-scope.md` and `docs/plans/phase-72a-events-filter-and-aggregate.md`.

The Wave 13 search cluster (Phase 72c / D-108)

Phase 72c adds the five `search.*` methods used by the Console command palette and per-section search bars. `search.query` is the pure aggregator that fans out to the per-index methods (`search.sessions`, `search.tasks`, `search.events`, `search.artifacts`). The five methods are NOT control methods: `IsControlMethod` returns false for them (the steering inbox stays exclusive). A separate `IsSearchMethod` predicate lets transport adapters branch the route table. See `docs/plans/phase-72c-search-cluster.md`.

The Wave 13 posture cluster (Phase 72f / D-111 + Phase 72g / D-112)

Phase 72f adds the five read-only `runtime.*` / `metrics.*` posture methods: `runtime.info` (build identity + version + uptime + capabilities), `runtime.health` (per-subsystem readiness rollup), `runtime.counters` (low-cardinality live counters), `runtime.drivers` (configured driver names per persistence-shaped subsystem), and `metrics.snapshot` (a Protocol-shaped projection over the Phase 56 MetricsRegistry). Phase 72g extends the cluster with the two config- posture methods the Console Settings page consumes: `governance.posture` (the read-only D-081 `IdentityTiers` view) and `llm.posture` (the bound LLM provider/model/region + `MockMode` flag per D-089). None of the seven methods are control or search methods — `IsControlMethod` / `IsSearchMethod` return false; a dedicated `IsPostureMethod` predicate routes them through the PostureSurface dispatcher, a sibling of the task-control surface, not an extension. They are read-only — no mutation counterpart ships at V1. See `docs/plans/phase-72f-runtime-posture.md` and `docs/plans/phase-72g-governance-llm-posture.md`.

The Wave 13 topology method (Phase 74 / D-114)

Phase 74 adds `topology.snapshot` — the request-side surface that returns the Runtime engine's canonical TopologyProjection (static node graph + live per-edge queue depth). It is NOT a task-control method (`IsControlMethod` returns false), NOT a streaming-events method, and NOT a search method: `IsTopologyMethod` is its own O(1) predicate. The wire-transport route is the existing `POST /v1/control/{method}` REST surface. The paired in-flight surface — `topology.changed` — is a canonical EVENT, not a method, so it is not in the method registry. See `docs/plans/phase-74-console-topology.md`.

No registration escape hatch

canonicalMethods is a fixed package-level map, not a write-once registry. The Phase 54 task-control set is closed; a new Protocol method is a new phase that declares a new constant + extends the map + (if reader-facing) updates the master plan / glossary — there is no RegisterMethod seam to drift through. This mirrors the steering taxonomy's fixed-enum posture (D-070 §2).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAgentsControlMethod added in v1.3.0

func IsAgentsControlMethod(m Method) bool

IsAgentsControlMethod reports whether m is one of the five mutating `agents.*` fleet-control verbs (`agents.pause` / `agents.drain` / `agents.restart` / `agents.force_stop` / `agents.deregister`) that require the verified `auth.ScopeAdmin` control claim (D-066). The Agents wire handler uses this to decide whether to enforce the gate.

func IsAgentsMethod

func IsAgentsMethod(m Method) bool

IsAgentsMethod reports whether m is one of the thirteen canonical `agents.*` methods (Phase 73e / D-124 + Phase 108l / D-184). The wire handler branches on this to route the request through the agents dispatcher instead of the task-control / search / posture / topology surfaces.

func IsArtifactsMethod

func IsArtifactsMethod(m Method) bool

IsArtifactsMethod reports whether m is one of the canonical artifacts methods (Phase 73l / D-120 — `artifacts.list` / `artifacts.put` / `artifacts.get_ref` — plus the Phase 108o / D-187 admin `artifacts.delete` mutation). The control transport branches on this to route the request through the artifacts dispatcher instead of the task-control / search / posture surfaces. NOT a control method — a new non-control method extends THIS predicate, never the steering inbox.

func IsAuthMethod

func IsAuthMethod(m Method) bool

IsAuthMethod reports whether m is one of the canonical `auth.*` methods (Phase 73m / D-129 — today just `auth.rotate_token`). The stream transport branches on this to route the request through the auth handler instead of the task-control / search / posture surfaces. NOT a control method — a new non-control method extends THIS predicate, never the steering inbox.

func IsControlMethod

func IsControlMethod(m Method) bool

IsControlMethod reports whether m is one of the nine steering-control methods — every canonical method except MethodStart AND the streaming-events methods (Phase 72 / 72a) AND the Phase 72c `search.*` cluster AND the Phase 72f `runtime.*` / `metrics.*` posture cluster AND the Phase 72e pause-snapshot method AND the Phase 74 `topology.snapshot` method AND the Phase 73j `memory.*` read cluster (each a separate surface from the steering inbox). The protocol.ControlSurface uses this to branch: a control method maps onto a steering.ControlEvent; MethodStart maps onto the task registry; a streaming-events method routes through the SSE / events-aggregate transport; a search method maps onto the Phase 72c search dispatcher; a posture method maps onto the Phase 72f PostureSurface; a pause-snapshot method maps onto the Phase 72e pause-list handler; a topology method maps onto the Phase 74 topology dispatcher. A new non-control method (state inspection, artifacts — future phases) extends THIS predicate, NOT the steering-control inbox.

func IsFlowsMethod

func IsFlowsMethod(m Method) bool

IsFlowsMethod reports whether m is one of the six Flows-page methods (Phase 73i / D-117). Five are read-only; `flows.run` is the single mutating method. The Flows-page surface is distinct from the steering inbox, the streaming-events surface, the search cluster, and the posture surface — a transport adapter branches on this predicate to route the request through the Flows dispatcher.

func IsMCPAdminMethod

func IsMCPAdminMethod(m Method) bool

IsMCPAdminMethod reports whether m is one of the three `mcp.servers.*` admin verbs (`refresh_binding` / `revoke_binding` / `set_raw_html_trust`) that gate on the `auth.ScopeAdmin` claim (D-079). The MCPSurface dispatcher uses it to apply the admin gate.

func IsMCPServersMethod

func IsMCPServersMethod(m Method) bool

IsMCPServersMethod reports whether m is one of the twelve canonical `mcp.servers.*` methods (Phase 73k / D-119). The control transport branches on this to route the request through the MCPSurface dispatcher instead of the task-control / search / posture surfaces. NOT a control method — a new non-control method extends THIS predicate, never the steering inbox.

func IsMemoryMethod

func IsMemoryMethod(m Method) bool

IsMemoryMethod reports whether m is one of the canonical `memory.*` methods — the Phase 73j (Wave 13 / D-118) read trio plus the Phase 108n (D-186) `memory.strategy_trace` read + `memory.put` / `memory.delete` admin mutation pair. The control transport branches on this to route the request through the memory handlers instead of the task-control / search / posture / pause / topology surfaces. NOT a control method — a new non-control memory method extends THIS predicate, never the steering inbox; the mutation methods gate on `admin` at the handler edge (D-079).

func IsPauseMethod

func IsPauseMethod(m Method) bool

IsPauseMethod reports whether m is one of the pause-snapshot methods landed in Wave 13 (Phase 72e — currently only MethodPauseList). The pause-snapshot surface is a read-only projection over the unified pause/resume Coordinator (Phase 50); it is NOT a steering control, NOT a streaming-events method, and NOT a search method. A transport adapter branches on this predicate to route the request through the pause-list snapshot handler instead of the task-control surface.

func IsPostureMethod

func IsPostureMethod(m Method) bool

IsPostureMethod reports whether m is one of the seven read-only posture methods — the five `runtime.*` / `metrics.*` reads (Phase 72f / D-111) and the two `governance.posture` / `llm.posture` config reads (Phase 72g / D-112). The PostureSurface uses this to branch in transport adapters that want a single route table over all canonical methods.

func IsRunsMethod

func IsRunsMethod(m Method) bool

IsRunsMethod reports whether m is one of the canonical `runs.*` methods (Phase 73n / D-130 — today just `runs.set_overrides`). The stream transport branches on this to route the request through the Runs handler instead of the task-control / search / posture / pause / topology / artifacts / memory / mcp / tools / flows / agents / sessions surfaces. NOT a control method — a new non-control method extends THIS predicate, never the steering inbox.

func IsSearchMethod

func IsSearchMethod(m Method) bool

IsSearchMethod reports whether m is one of the five canonical `search.*` methods. The Phase 72c control transport branches on this to route the request through the search dispatcher instead of the task-control surface.

func IsSessionsMethod

func IsSessionsMethod(m Method) bool

IsSessionsMethod reports whether m is one of the two canonical Sessions-page methods (Phase 73c / D-122 — `sessions.list`, `sessions.inspect`). The stream transport branches on this to route the request through the Sessions handler instead of the task-control / search / posture / pause / topology / artifacts / memory / mcp / tools / flows surfaces. NOT a control method — a new non-control method extends THIS predicate, never the steering inbox.

func IsStreamingEventsMethod

func IsStreamingEventsMethod(m Method) bool

IsStreamingEventsMethod reports whether m is one of the streaming- events methods landed in Wave 13 (MethodEventsSubscribe or MethodEventsAggregate). The transport-side router uses this to classify a method into its routing branch without re-listing the streaming set.

func IsTasksMethod

func IsTasksMethod(m Method) bool

IsTasksMethod reports whether m is one of the two canonical `tasks.*` methods (Phase 73d / D-123 — `tasks.list`, `tasks.get`). The stream transport branches on this to route the request through the Tasks dispatcher instead of the task-control / search / posture / topology surfaces. NOT a control method — both are reads; the Console Tasks page consumes the shipped Phase 54 control verbs for mutation.

func IsToolsAdminMethod

func IsToolsAdminMethod(m Method) bool

IsToolsAdminMethod reports whether m is one of the two mutating `tools.*` methods (`tools.set_approval_policy` / `tools.revoke_oauth`) that require the verified `auth.ScopeAdmin` claim (D-079). The Tools wire handler uses this to decide whether to enforce the scope gate.

func IsToolsMethod

func IsToolsMethod(m Method) bool

IsToolsMethod reports whether m is one of the seven canonical `tools.*` methods (Phase 73f / D-116). The control transport branches on this to route the request through the Tools dispatcher instead of the task-control / search / posture / topology surfaces. NOT a control method — a new non-control method extends THIS predicate, never the steering inbox.

func IsTopologyMethod

func IsTopologyMethod(m Method) bool

IsTopologyMethod reports whether m is one of the canonical topology-projection methods (Phase 74 / D-114 — today just `topology.snapshot`). The control transport branches on this to route the request through the topology dispatcher instead of the task-control / search surfaces. NOT a control method — a new non-control method extends THIS predicate, never the steering inbox.

func IsValidMethod

func IsValidMethod(m Method) bool

IsValidMethod reports whether m is one of the canonical Protocol method names — the Phase 54 task-control ten plus the Wave 13 streaming-events additions plus the Phase 72c search cluster.

Types

type Method

type Method string

Method is the string-typed enum of canonical Harbor Protocol method names. The wire form is the lowercase snake_case string.

const (
	// MethodStart asks the Runtime to spawn a new task / foreground run.
	// Maps onto tasks.TaskRegistry.Spawn (Phase 20).
	MethodStart Method = "start"
	// MethodCancel cancels a run (soft by default; `hard: true` in the
	// payload propagates a cancellation context). Maps onto the CANCEL
	// steering control.
	MethodCancel Method = "cancel"
	// MethodPause pauses a run at the next planner-step boundary. Maps
	// onto the PAUSE steering control; the run loop routes it through
	// the unified pauseresume.Coordinator.
	MethodPause Method = "pause"
	// MethodResume resumes a paused run. Maps onto the RESUME steering
	// control; the run loop routes it through pauseresume.Coordinator.
	MethodResume Method = "resume"
	// MethodRedirect rewrites a run's goal. Maps onto the REDIRECT
	// steering control; the new goal is the payload's `goal` string.
	MethodRedirect Method = "redirect"
	// MethodInjectContext appends operator-supplied context to a run's
	// trajectory, visible on the planner's next step. Maps onto the
	// INJECT_CONTEXT steering control.
	MethodInjectContext Method = "inject_context"
	// MethodApprove approves a HITL-gated step. Maps onto the APPROVE
	// steering control; the run loop advances the pause via
	// pauseresume.Coordinator.
	MethodApprove Method = "approve"
	// MethodReject rejects a HITL-gated step. Maps onto the REJECT
	// steering control; the run loop advances the pause and the run
	// terminates with Finish{ConstraintsConflict}.
	MethodReject Method = "reject"
	// MethodPrioritize changes a run's task priority. Maps onto the
	// PRIORITIZE steering control; the new priority is the payload's
	// `priority` number.
	MethodPrioritize Method = "prioritize"
	// MethodUserMessage injects a user-authored message into a run,
	// visible on the planner's next step. Maps onto the USER_MESSAGE
	// steering control; the message is the payload's `message` string.
	MethodUserMessage Method = "user_message"

	// MethodEventsSubscribe opens a server-filtered event subscription
	// (Phase 72 / D-105). The wire-transport route is `GET /v1/events`
	// SSE (Phase 60); the canonical method name is the contract a
	// third-party Console branches on. Identity-mandatory; a request
	// with `?admin=1` (cross-tenant fan-in) requires the verified
	// `auth.ScopeAdmin` or `auth.ScopeConsoleFleet` scope claim
	// (D-079). The reject path returns the canonical
	// `errors.CodeIdentityScopeRequired` Code (HTTP 403). NOT a
	// task-control method — IsControlMethod returns false; the Phase
	// 54 control nine stays exclusive.
	MethodEventsSubscribe Method = "events.subscribe"

	// MethodEventsAggregate returns time-bucketed event-type counts
	// over a window (Phase 72a / D-106). Powers the per-event-type
	// stacked-area sparkline on the Console Events page (Phase 73g).
	// The wire-transport route is `POST /v1/events/aggregate`.
	// Identity-mandatory + D-079 cross-tenant scope rules apply (same
	// posture as MethodEventsSubscribe).
	//
	// NOT a control method: `IsControlMethod(MethodEventsAggregate)`
	// returns false.
	MethodEventsAggregate Method = "events.aggregate"

	// MethodSearchQuery — Phase 72c (Wave 13) the Console palette
	// dispatcher. Pure aggregator: fans out concurrently to the
	// runtime-side per-index search methods, merges + paginates the
	// union. Carries no index of its own. See `docs/plans/phase-72c-search-cluster.md`.
	MethodSearchQuery Method = "search.query"
	// MethodSearchSessions — Phase 72c. Server-enforced session-index
	// search scoped to the caller's identity triple; cross-tenant
	// requires the `auth.ScopeAdmin` claim (D-079).
	MethodSearchSessions Method = "search.sessions"
	// MethodSearchTasks — Phase 72c. Server-enforced task-index search;
	// same identity-scope contract as MethodSearchSessions.
	MethodSearchTasks Method = "search.tasks"
	// MethodSearchEvents — Phase 72c. Server-enforced events-index
	// search (filters by event type + header fields + time window).
	// Reuses the Phase 72a EventFilter predicate. Substring search over
	// event payload contents is post-V1.
	MethodSearchEvents Method = "search.events"
	// MethodSearchArtifacts — Phase 72c. Server-enforced artifact-index
	// search; rows always carry a `ref` (artifacts are by-reference by
	// construction per D-026).
	MethodSearchArtifacts Method = "search.artifacts"

	// MethodRuntimeInfo — Phase 72f (D-111). Read-only posture method:
	// returns the Runtime's build identity (version / commit / Go
	// toolchain / build date), Protocol version, advertised
	// capabilities, uptime, instance ID, and operator-configured
	// display name. NOT a control method; dispatched by PostureSurface.
	MethodRuntimeInfo Method = "runtime.info"
	// MethodRuntimeHealth — Phase 72f. Read-only posture method:
	// returns the per-subsystem readiness rollup (`ready` / `degraded`
	// / `unavailable`) across the runtime's registered subsystems.
	MethodRuntimeHealth Method = "runtime.health"
	// MethodRuntimeCounters — Phase 72f. Read-only posture method:
	// returns the low-cardinality live counters the Console footer /
	// sidebar chips render (events/sec, tasks running, background jobs,
	// MCP connections, sessions active). Identity-scoped; the response
	// is the roll-up, never a per-run / per-task breakdown.
	MethodRuntimeCounters Method = "runtime.counters"
	// MethodRuntimeDrivers — Phase 72f. Read-only posture method:
	// returns the configured driver names per persistence-shaped
	// subsystem (`state`, `artifacts`, `memory`, `eventlog`). Returns
	// the driver name + optional posture mode — never the DSN.
	MethodRuntimeDrivers Method = "runtime.drivers"
	// MethodMetricsSnapshot — Phase 72f. Read-only posture method:
	// returns a Protocol-shaped projection over the Phase 56
	// MetricsRegistry — counters, histograms, gauges as flat wire
	// values. NOT an OpenTelemetry SDK re-export.
	MethodMetricsSnapshot Method = "metrics.snapshot"

	// MethodGovernancePosture — Phase 72g (Wave 13; D-112). Returns the
	// runtime's read-only governance configuration: the D-081
	// `IdentityTiers` map (per-tier `BudgetCeilingUSD` + token-bucket
	// `RateLimit` + `MaxTokens`) plus the `DefaultTier` selector and the
	// caller-resolved tier. Identity-mandatory; cross-tenant reads
	// require the `auth.ScopeAdmin` claim (D-079). NOT a control method
	// and NOT a search method — it is a posture method (read-only
	// runtime-config projection). `IsControlMethod` / `IsSearchMethod`
	// both return false; `IsPostureMethod` returns true. See
	// `docs/plans/phase-72g-governance-llm-posture.md`.
	MethodGovernancePosture Method = "governance.posture"

	// MethodLLMPosture — Phase 72g (Wave 13; D-112). Returns the
	// runtime's read-only LLM provider posture: provider name, model id,
	// region/endpoint, and a `MockMode` boolean — `true` iff the runtime
	// booted with `HARBOR_DEV_ALLOW_MOCK=1` (D-089). Identity-mandatory;
	// cross-tenant reads require the `auth.ScopeAdmin` claim (D-079). A
	// posture method, same posture as MethodGovernancePosture.
	MethodLLMPosture Method = "llm.posture"

	// MethodPauseList — Phase 72e (Wave 13; D-110) the paginated,
	// identity-scope-filtered snapshot of currently-paused runs from
	// the unified pause/resume Coordinator (Phase 50). Read-only: it
	// does NOT mutate the registry and does NOT call Resume — resume
	// actions continue through MethodResume / MethodApprove /
	// MethodReject. The wire-transport route is
	// `POST /v1/pause/list`. Identity-mandatory; a cross-tenant filter
	// requires the verified `auth.ScopeAdmin` claim (D-079). NOT a
	// task-control method — `IsControlMethod(MethodPauseList)` returns
	// false; the Phase 54 control nine stays exclusive. See
	// `docs/plans/phase-72e-pause-list-snapshot.md`.
	MethodPauseList Method = "pause.list"

	// MethodFlowsList — Phase 73i (Wave 13 / D-117). Returns the
	// paginated catalog of registered engine-graph flows with aggregate
	// run metrics (runs-in-window, p50/p95 latency, success rate, last
	// run, per-flow Budget per D-023). Identity-mandatory; a cross-tenant
	// filter requires the verified `auth.ScopeAdmin` claim (D-079). NOT a
	// task-control method — `IsFlowsMethod` returns true; `IsControlMethod`
	// returns false. See `docs/plans/phase-73i-console-flows-page.md`.
	MethodFlowsList Method = "flows.list"
	// MethodFlowsDescribe — Phase 73i. Returns a single flow's full
	// engine-graph description: nodes + edges + per-node descriptor +
	// per-node policy + a string source reference (Go path or YAML
	// descriptor per D-023 — never executable code) + live Budget
	// consumption. Identity-mandatory; an unknown flow id fails with
	// CodeNotFound.
	MethodFlowsDescribe Method = "flows.describe"
	// MethodFlowsRunsList — Phase 73i. Returns a flow's paginated run
	// history (per-run status / trigger / timing / cost / identity).
	// Identity-mandatory; a cross-tenant filter requires the verified
	// `auth.ScopeAdmin` claim (D-079).
	MethodFlowsRunsList Method = "flows.runs.list"
	// MethodFlowsRunsDescribe — Phase 73i. Returns a single flow run's
	// per-node execution timeline + final-output reference. Heavy outputs
	// are shipped by-reference via FlowArtifactRef (D-026) — NEVER inline
	// bytes. Identity-mandatory; an unknown run id fails with
	// CodeNotFound.
	MethodFlowsRunsDescribe Method = "flows.runs.describe"
	// MethodFlowsRun — Phase 73i. Invokes a one-shot run of a registered
	// flow. This is the ONLY mutating Flows-page method; it is gated on
	// identity AND the verified `auth.ScopeAdmin` claim (D-079 closed
	// scope set). A request without the claim is rejected with
	// CodeScopeMismatch (HTTP 403). Every other Flows-page method is
	// read-only.
	MethodFlowsRun Method = "flows.run"
	// MethodFlowsMetrics — Phase 73i. Returns a flow's time-bucketed
	// sparkline aggregates (runs-per-bucket, p95 latency, success rate,
	// cost, budget consumption) over a window. Read-only; identity-
	// mandatory.
	MethodFlowsMetrics Method = "flows.metrics"

	// MethodTopologySnapshot — Phase 74 (Wave 13 / D-114). Returns the
	// canonical TopologyProjection of the Runtime's engine — the static
	// node graph + live per-edge queue depth. Request → reply (on-demand
	// cold-start surface); the paired in-flight surface is the
	// `topology.changed` canonical event. The wire-transport route is
	// the existing `POST /v1/control/{method}` REST surface. NOT a
	// task-control method (it reaches the engine's read-only Topology
	// accessor, not the steering inbox) and NOT a streaming-events or
	// search method — `IsControlMethod` / `IsStreamingEventsMethod` /
	// `IsSearchMethod` all return false; `IsTopologyMethod` returns
	// true. Identity-mandatory; a cross-tenant snapshot requires the
	// `auth.ScopeAdmin` claim (D-079). See `docs/plans/phase-74-console-topology.md`.
	MethodTopologySnapshot Method = "topology.snapshot"

	// MethodArtifactsList — Phase 73l (Wave 13 / D-120). Returns the
	// identity-scope-filtered catalog of artifacts from the runtime's
	// content-addressed artifact store, with the Phase 73l filter
	// extensions (mime / source / size-range / created-range / tags)
	// applied as a Go-side projection. Identity-mandatory; a cross-tenant
	// list requires the `auth.ScopeAdmin` claim (D-079). The wire-transport
	// route is the existing `POST /v1/control/{method}` REST surface. NOT a
	// task-control, streaming-events, search, posture, pause, or topology
	// method — `IsArtifactsMethod` is its own O(1) predicate. See
	// `docs/plans/phase-73l-console-artifacts-page.md`.
	MethodArtifactsList Method = "artifacts.list"
	// MethodArtifactsPut — Phase 73l (Wave 13 / D-120). The Console (and
	// Playground) file-upload pipeline per Brief 11 §PG-2: accepts bytes +
	// PutOpts, routes the payload through `audit.Redactor`, stores it via
	// `artifacts.ArtifactStore.PutBytes`, and returns the canonical
	// ArtifactRef. Heavy bytes never travel inline through the LLM edge
	// (D-026) — the put returns a reference, never echoes the body.
	// Identity-mandatory; a body whose scope tenant disagrees with the
	// caller's verified tenant is rejected with CodeScopeMismatch.
	MethodArtifactsPut Method = "artifacts.put"
	// MethodArtifactsGetRef — Phase 73l (Wave 13 / D-120). The read-side
	// presigned-URL resolver: invokes `artifacts.Presigner.PresignGet` via
	// type-assertion on the underlying ArtifactStore. Drivers that do not
	// implement `Presigner` (in-mem / fs / sqlite-blob / postgres-blob)
	// return `CodePresignUnsupported` loudly — no silent fallback. The
	// Console's Preview / Download / Share / bulk-Download all route
	// through this single resolver per D-022 / D-026. Identity-mandatory;
	// expiry is bounded [1m, 7d].
	MethodArtifactsGetRef Method = "artifacts.get_ref"

	// MethodArtifactsDelete — Phase 108o (D-187). The admin-gated, audited
	// "evict an artifact" mutation: removes the keyed artifact from the
	// scope via the shipped `ArtifactStore.Delete` (idempotent). Requires
	// the verified `admin` scope claim (D-079 / page-artifacts §9 — Delete
	// is a mutating verb, strictly more than the read scope); fails closed
	// without it. Emits `artifacts.deleted` for audit. Routes through the
	// control surface at `POST /v1/control/artifacts.delete`.
	MethodArtifactsDelete Method = "artifacts.delete"

	// MethodMemoryList — Phase 73j (Wave 13 / D-118). Returns the
	// paginated, identity-scope-filtered set of memory records the
	// Console Memory page renders. Read-only — it composes over the
	// shipped `MemoryStore.Snapshot` surface (Phases 23–25) and the
	// `events.aggregate` counters (Phase 72a). The wire-transport route
	// is `POST /v1/memory/list`. Identity-mandatory; a cross-tenant
	// filter requires the verified `auth.ScopeAdmin` (or
	// `auth.ScopeConsoleFleet`) claim from the D-079 closed two-scope
	// set — NO new memory scope is minted (audit B1). NOT a control /
	// search / posture / pause / topology method; `IsMemoryMethod` is
	// its own O(1) predicate. See
	// `docs/plans/phase-73j-console-memory-page.md`.
	MethodMemoryList Method = "memory.list"

	// MethodMemoryGet — Phase 73j. Returns the full detail of a single
	// memory record: metadata + post-redaction value (below the D-026
	// heavy-content threshold) OR a by-reference `MemoryArtifactRef`
	// (at or above the threshold) — NEVER inline bytes above threshold.
	// The wire-transport route is `POST /v1/memory/get`. Same identity-
	// scope contract as MethodMemoryList.
	MethodMemoryGet Method = "memory.get"

	// MethodMemoryHealth — Phase 73j. Returns aggregate memory-health
	// counters (total records / expiring-in-1h / identity-rejected-24h
	// / recovery-dropped-24h) plus the per-scope driver mapping. The
	// 24-h-window counters derive from `events.aggregate` over the
	// `memory.*` event types. The wire-transport route is
	// `POST /v1/memory/health`. Same identity-scope contract as
	// MethodMemoryList.
	MethodMemoryHealth Method = "memory.health"

	// MethodMemoryStrategyTrace — Phase 108n (D-186). Returns the live
	// read-only projection of how the configured memory strategy is
	// compacting the caller's session memory right now (the rolling-
	// summary text + the verbatim-turn count + the token estimate +
	// health) — the strategy's real `GetLLMContext` + `Health` output, not
	// a fabricated selection trace. The wire-transport route is
	// `POST /v1/memory/strategy_trace`. Same identity-scope contract as
	// MethodMemoryList (read scope; no admin claim).
	MethodMemoryStrategyTrace Method = "memory.strategy_trace"

	// MethodMemoryPut — Phase 108n (D-186). The admin-gated, audited
	// "add a memory turn" mutation: appends an operator-supplied
	// conversation turn to the caller's session memory via the shipped
	// `MemoryStore.AddTurn`. Requires the verified `admin` scope claim
	// (D-079); fails closed without it. The wire-transport route is
	// `POST /v1/memory/put`.
	MethodMemoryPut Method = "memory.put"

	// MethodMemoryDelete — Phase 108n (D-186). The admin-gated, audited
	// "evict a memory turn" mutation: removes the keyed turn from the
	// caller's session memory via a `Snapshot` → drop-turn → `Restore`
	// read-modify-write on the shipped MemoryStore. Requires the verified
	// `admin` scope claim (D-079); fails closed without it. The
	// wire-transport route is `POST /v1/memory/delete`.
	MethodMemoryDelete Method = "memory.delete"

	// MethodMCPServersList — paged, filterable list of the configured
	// MCP southbound servers with live state.
	MethodMCPServersList Method = "mcp.servers.list"
	// MethodMCPServersGet — single-server detail read.
	MethodMCPServersGet Method = "mcp.servers.get"
	// MethodMCPServersResources — list of the resources a server
	// advertises.
	MethodMCPServersResources Method = "mcp.servers.resources"
	// MethodMCPServersPrompts — list of the prompts a server
	// advertises.
	MethodMCPServersPrompts Method = "mcp.servers.prompts"
	// MethodMCPServersRefreshDiscovery — control-plane verb: re-runs
	// the server's tools/resources/prompts discovery.
	MethodMCPServersRefreshDiscovery Method = "mcp.servers.refresh_discovery"
	// MethodMCPServersProbe — control-plane verb: runs a transport
	// ping / tools-list round-trip.
	MethodMCPServersProbe Method = "mcp.servers.probe"
	// MethodMCPServersHealth — handshake-latency sparkline + reconnect
	// history + transport-error rate.
	MethodMCPServersHealth Method = "mcp.servers.health"
	// MethodMCPServersBindingsList — list of a server's OAuth bindings
	// (metadata only — never token plaintext, D-083).
	MethodMCPServersBindingsList Method = "mcp.servers.bindings.list"
	// MethodMCPServersPolicy — read-only ToolPolicy projection.
	MethodMCPServersPolicy Method = "mcp.servers.policy"
	// MethodMCPServersRefreshBinding — admin verb: initiates an OAuth
	// (re)connect flow for a binding. Requires the `auth.ScopeAdmin`
	// claim (D-079).
	MethodMCPServersRefreshBinding Method = "mcp.servers.refresh_binding"
	// MethodMCPServersRevokeBinding — admin verb: revokes an OAuth
	// binding. Requires the `auth.ScopeAdmin` claim (D-079).
	MethodMCPServersRevokeBinding Method = "mcp.servers.revoke_binding"
	// MethodMCPServersSetRawHTMLTrust — admin verb: sets the per-server
	// raw-HTML opt-in flag and emits the `mcp.raw_html_trust_toggled`
	// audit event. Requires the `auth.ScopeAdmin` claim (D-079).
	MethodMCPServersSetRawHTMLTrust Method = "mcp.servers.set_raw_html_trust"

	// MethodToolsList — Phase 73f (Wave 13 / D-116). Returns the
	// catalog of registered tools visible to the caller's identity
	// scope, with optional facet filters (scope / transport / OAuth
	// status / approval policy / reliability tier) plus aggregate
	// counters (Total / Active / Pending approval / Awaiting OAuth) for
	// the filtered view. Powers the Console Tools page catalog table.
	// Identity-mandatory; a cross-tenant fan-in requires the
	// `auth.ScopeAdmin` claim (D-079). NOT a control / search /
	// posture / topology method — `IsToolsMethod` returns true. The
	// wire-transport route is `POST /v1/tools/list`. See
	// `docs/plans/phase-73f-console-tools-page.md`.
	MethodToolsList Method = "tools.list"
	// MethodToolsGet — Phase 73f. Returns a single tool's catalog row
	// projection by ID. The lighter sibling of `tools.describe` — the
	// row shape the Console renders in the detail-panel header.
	MethodToolsGet Method = "tools.get"
	// MethodToolsDescribe — Phase 73f. Returns the full manifest of a
	// registered tool descriptor: transport, version, scopes, the
	// argument / output JSON Schemas, examples, OAuth binding scope
	// (D-083), approval policy (D-086), and the reliability shell
	// (D-024). Powers the Tools-page Manifest / Inputs / Outputs tabs.
	MethodToolsDescribe Method = "tools.describe"
	// MethodToolsMetrics — Phase 73f. Returns per-tool error-rate
	// gauges over a selectable window (1h / 24h / 7d) plus a status
	// pill (`Healthy` / `Degraded` / `Offline`). Powers the Tools-page
	// Status + Error-rate right-rail card.
	MethodToolsMetrics Method = "tools.metrics"
	// MethodToolsContentStats — Phase 73f. Returns the per-tool
	// distribution of recent result sizes vs the heavy-content
	// threshold (RFC §6.5 / D-026) plus the negotiated `DisplayMode`
	// snapshot (D-062). Powers the Tools-page Content-size card.
	MethodToolsContentStats Method = "tools.content_stats"
	// MethodToolsSetApprovalPolicy — Phase 73f. ADMIN method: updates a
	// tool's approval policy. Requires the verified `auth.ScopeAdmin`
	// claim (D-079; there is NO `tools.admin` scope — the closed
	// two-scope set is the only admit surface). Emits an
	// `audit.admin_scope_used` event through the shipped audit.Redactor.
	MethodToolsSetApprovalPolicy Method = "tools.set_approval_policy"
	// MethodToolsRevokeOAuth — Phase 73f. ADMIN method: revokes all
	// OAuth bindings for a tool. Requires the verified `auth.ScopeAdmin`
	// claim (D-079). Emits an `audit.admin_scope_used` event through
	// the shipped audit.Redactor.
	MethodToolsRevokeOAuth Method = "tools.revoke_oauth"

	// MethodTasksList — Phase 73d (Wave 13 / D-123). Returns the
	// paginated list of tasks visible to the caller's identity scope,
	// with optional facet filters (status / kind / parent-task /
	// identity / time-window / error-class / latency-above / free-text)
	// plus per-status aggregate counters (Pending / Running / Paused /
	// Failed / Complete / Cancelled) for the filtered view. Powers the
	// Console Tasks-page kanban board + list-mode table. Identity-
	// mandatory; a cross-tenant fan-in requires the `auth.ScopeAdmin`
	// claim (D-079). NOT a control / search / posture method —
	// `IsTasksMethod` returns true. The wire-transport route is
	// `POST /v1/tasks/list`. See
	// `docs/plans/phase-73d-console-tasks-page.md`.
	MethodTasksList Method = "tasks.list"
	// MethodTasksGet — Phase 73d. Returns the enriched detail of a
	// single task: the full Task projection (heavy values via
	// ArtifactRef per D-026), parent-session reference, parent-task
	// reference (when child), per-step cost rollup aggregated from
	// `llm.cost.recorded` events, and the planner-checkpoint reference
	// at spawn time. A cross-tenant TaskID lookup returns CodeNotFound
	// (existence is never revealed across tenants). The wire-transport
	// route is `POST /v1/tasks/get`.
	MethodTasksGet Method = "tasks.get"

	// MethodAgentsList — Phase 73e (Wave 13 / D-124). Returns the
	// catalog of agents registered under the caller's identity scope,
	// with optional facet filters (status / planner type / free-text
	// search) plus aggregate counters. Powers the Console Agents page
	// cards grid. Identity-mandatory; a cross-tenant fan-in requires the
	// `auth.ScopeAdmin` claim (D-079). `IsAgentsMethod` returns true.
	// The wire-transport route is `POST /v1/agents/list`.
	MethodAgentsList Method = "agents.list"
	// MethodAgentsGet — Phase 73e. Returns one agent's full
	// registration-identity projection: agent_id / incarnation /
	// version_hash (D-059), hosting (D-060), status, health, and the
	// AgentConfig projection. Powers the Agents detail header + the
	// Identity / Autonomy tabs.
	MethodAgentsGet Method = "agents.get"
	// MethodAgentsTools — Phase 73e. Returns the agent's tool bindings
	// joined to per-binding OAuth status (D-083). Powers the Tools tab.
	MethodAgentsTools Method = "agents.tools"
	// MethodAgentsMemory — Phase 73e. Returns the agent's configured
	// memory strategy (Phase 24), TTL, and scope. Powers the Memory tab.
	MethodAgentsMemory Method = "agents.memory"
	// MethodAgentsGovernance — Phase 73e. Returns the agent's
	// per-identity-tier cost ceilings + spend (Phase 36a) and rate-limit
	// posture (Phase 36b). Powers the Cost tab.
	MethodAgentsGovernance Method = "agents.governance"
	// MethodAgentsSkills — Phase 73e. Returns the agent's attached
	// skills (Phase 38 + Phase 41 generated skills). Powers the Skills
	// tab.
	MethodAgentsSkills Method = "agents.skills"
	// MethodAgentsPermissions — Phase 73e. Returns the agent's
	// permission model — V1 default is implicit ("every authenticated
	// user in the tenant"); an explicit ACL surface is post-V1.
	MethodAgentsPermissions Method = "agents.permissions"
	// MethodAgentsMetrics — Phase 73e. Returns the registry-wide rollup
	// (Active Agents / Running Tasks / Total Cost / Total Tokens) for
	// the caller's identity scope. Powers the Agents page hero numbers.
	MethodAgentsMetrics Method = "agents.metrics"

	// MethodAgentsPause — Phase 108l (D-184). The fleet-control verb that
	// pauses an agent (stop accepting new tasks until Resume). Wraps the
	// shipped `registry.Pause` in-process control verb behind a Protocol
	// method so the Console can drive it. MUTATES registry state and
	// therefore requires the elevated `auth.ScopeAdmin` control claim
	// (D-066); emits `agent.paused`. `IsAgentsControlMethod` returns true.
	// Supersedes the D-132/F4 deferral.
	MethodAgentsPause Method = "agents.pause"
	// MethodAgentsDrain — Phase 108l. Gracefully drains an agent (accept
	// no new tasks, finish existing). Wraps `registry.Drain`; emits
	// `agent.drained`. Control-scope gated (D-066).
	MethodAgentsDrain Method = "agents.drain"
	// MethodAgentsRestart — Phase 108l. Restarts an agent (bump
	// incarnation; rehydrate from StateStore). Wraps `registry.Restart`;
	// emits `agent.restart_requested`. Control-scope gated (D-066).
	MethodAgentsRestart Method = "agents.restart"
	// MethodAgentsForceStop — Phase 108l. Hard-stops an agent. Wraps
	// `registry.ForceStop`; emits `agent.force_stopped`. Control-scope
	// gated (D-066).
	MethodAgentsForceStop Method = "agents.force_stop"
	// MethodAgentsDeregister — Phase 108l. Removes an agent from the
	// registry (irreversible). Wraps `registry.Deregister`; emits
	// `agent.deregistered`. Control-scope gated (D-066).
	MethodAgentsDeregister Method = "agents.deregister"

	// MethodAuthRotateToken — Phase 73m (Wave 13 / D-129). Rotates the
	// operator's current Protocol-auth token: the Runtime re-mints a
	// JWT for the caller's already-verified `(tenant, user, session)`
	// identity and returns it once (one-time-reveal). The ONLY net-new
	// Protocol method Phase 73m ships — the Console Settings page is
	// otherwise a pure consumer of the 72f / 72g posture methods. ADMIN
	// method: requires the verified `auth.ScopeAdmin` claim (D-079
	// closed two-scope set — there is NO `auth.admin` scope). A request
	// without the claim is rejected 403 with CodeIdentityScopeRequired.
	// Every successful rotation emits a redacted `audit.admin_scope_used`
	// event. NOT a control / search / posture / pause / topology
	// method — `IsAuthMethod` is its own O(1) predicate. The
	// wire-transport route is `POST /v1/auth/rotate_token`. See
	// `docs/plans/phase-73m-console-settings-page.md`.
	MethodAuthRotateToken Method = "auth.rotate_token" //nolint:gosec // G101 false positive — this is a Protocol method name, not a credential.

	// MethodSessionsList — Phase 73c (Wave 13 / D-122). Returns the
	// paginated, identity-scope-filtered projection of the
	// SessionRegistry the Console Sessions page renders — the
	// past-and-active durable record of every Harbor execution the
	// operator has access to. Carries the full filter set (status /
	// agent / user / tenant / started-window / has-intervention /
	// has-failed-task / cost-above) plus cursor pagination. Read-only;
	// identity-mandatory. A cross-tenant filter (a `tenant_ids` entry
	// outside the caller's verified tenant) requires the verified
	// `auth.ScopeAdmin` claim (D-079 closed two-scope set — NO new
	// scope is minted). NOT a control / streaming-events / search /
	// posture / pause / topology / artifacts / memory / mcp / tools /
	// flows method — `IsSessionsMethod` is its own O(1) predicate. The
	// wire-transport route is `POST /v1/sessions/list`. See
	// `docs/plans/phase-73c-console-sessions-page.md`.
	MethodSessionsList Method = "sessions.list"
	// MethodSessionsInspect — Phase 73c. Returns the full per-session
	// snapshot the Console Sessions detail view renders — the
	// right-rail Session Summary projection (id / status / started /
	// duration / events / tasks / agent / user / tenant / cost / last
	// activity) plus the capped `recent_interventions` /
	// `recent_artifacts` slices. Read-only; identity-mandatory; same
	// cross-tenant scope contract as MethodSessionsList. The
	// wire-transport route is `POST /v1/sessions/inspect`.
	MethodSessionsInspect Method = "sessions.inspect"

	// MethodRunsSetOverrides — Phase 73n (Wave 13 / D-130). Records the
	// reasoning-effort / temperature / max-tokens / system-prompt
	// override the Console Playground page applies to the NEXT message
	// in a session. The override is session-scoped (keyed by the
	// identity triple) and one-shot: it applies to the next
	// `user_message` / `start` and is consumed at that point — it does
	// NOT apply retroactively to past messages, and a session that sets
	// an override then never sends drops it. Identity-mandatory
	// (`session_id` required; tenant / user inferred from the verified
	// JWT); a cross-session override is rejected with CodeScopeMismatch.
	// NOT a control / streaming-events / search / posture / pause /
	// topology / artifacts / memory / mcp / tools / flows / agents /
	// sessions / tasks method — `IsRunsMethod` is its own O(1)
	// predicate. The wire-transport route is `POST /v1/runs/set_overrides`.
	// See `docs/plans/phase-73n-console-playground-page.md`.
	MethodRunsSetOverrides Method = "runs.set_overrides"
)

The ten canonical task-control method names (RFC §5.2 "Task control" row + RFC §6.3 control taxonomy) PLUS the two streaming-events method names landed in Wave 13 (Phase 72 / 72a) — `events.subscribe` and `events.aggregate` — the first non-task-control Protocol surface, PLUS the five `search.*` methods landed in Phase 72c (D-108).

func Methods

func Methods() []Method

Methods returns a deterministic, lexicographically-sorted snapshot of every canonical method name (the Phase 54 task-control ten + the Wave 13 streaming-events additions + the Phase 72c search cluster). Useful for exhaustiveness tests and for a transport adapter's route table.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL