From d9f288da93907df79ee42158cbd4499b3d4ddb7f Mon Sep 17 00:00:00 2001 From: hivecommons-hive <280983584+hivecommons-hive@users.noreply.github.com> Date: Thu, 3 Dec 2026 06:42:19 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20docs:=20resync=20the=20docs/cont?= =?UTF-8?q?ent=20mirrors=20from=20upstream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- ...rid-wire-and-transcript-cost-accounting.md | 279 ++++++++++++++++++ docs/content/hive/adr/readme.md | 1 + docs/content/hive/agent-configuration.md | 21 ++ docs/content/hive/api-reference/auth.md | 32 +- docs/content/hive/api-reference/beads.md | 10 +- .../hive/api-reference/configuration.md | 210 ++++++------- .../api-reference/cost-tokens-telemetry.md | 13 +- .../hive/api-reference/dashboard-misc.md | 46 +-- .../api-reference/health-status-events.md | 26 +- docs/content/hive/api-reference/inception.md | 28 +- docs/content/hive/api-reference/knowledge.md | 96 +++--- docs/content/hive/api-reference/nous.md | 50 ++-- .../hive/api-reference/packs-and-acmm.md | 38 +-- .../hive/api-reference/snapshots-and-style.md | 2 +- docs/content/hive/cli-pins.md | 15 +- docs/content/hive/contributor-relay.md | 14 +- .../overview-and-metrics.md | 2 + docs/content/hive/dashboard.md | 68 ++++- docs/content/hive/data-janitor.md | 51 +++- docs/content/hive/design/workflow-models.md | 20 +- docs/content/hive/editing-hive-yaml.md | 78 +++++ docs/content/hive/env-vars.md | 16 + docs/content/hive/github-app-setup.md | 2 +- .../hive/integrations/clanker-cortex.md | 104 +++++++ docs/content/hive/integrations/forgejo.md | 2 +- docs/content/hive/meetings.md | 14 +- docs/content/hive/native-merge-queue.md | 25 +- .../content/hive/operator-reference/readme.md | 34 ++- .../operator-reference/runtime-and-quota.md | 135 +++++++++ docs/content/hive/roadmap.md | 4 +- docs/content/hive/security-model.md | 27 ++ docs/content/hive/settings.md | 2 +- docs/content/hive/troubleshooting.md | 24 ++ docs/content/hive/upstream-watch.md | 3 +- scripts/sync-hive-docs.files.json | 6 + src/app/docs/page-map.ts | 2 + 36 files changed, 1181 insertions(+), 319 deletions(-) create mode 100644 docs/content/hive/adr/0027-hybrid-wire-and-transcript-cost-accounting.md create mode 100644 docs/content/hive/integrations/clanker-cortex.md diff --git a/docs/content/hive/adr/0027-hybrid-wire-and-transcript-cost-accounting.md b/docs/content/hive/adr/0027-hybrid-wire-and-transcript-cost-accounting.md new file mode 100644 index 00000000..86cdf127 --- /dev/null +++ b/docs/content/hive/adr/0027-hybrid-wire-and-transcript-cost-accounting.md @@ -0,0 +1,279 @@ +> **Synced from Hive.** This page is pulled from [hivecommons/hive@v5](https://github.com/hivecommons/hive/blob/v5/src/docs/adr/0027-hybrid-wire-and-transcript-cost-accounting.md) during the docs build. Edit the canonical source in the Hive repository. + +# ADR-0027: Hybrid wire and transcript cost accounting + +Status: Proposed + +**Wire** means token usage the proxy observes on an inference request it +carries. **Transcript** means token usage a scanner reads from the CLI session +file an agent wrote. This record makes them one ledger without pretending they +are the same measurement. + +## Context + +Hive prices agent work from token counts, and two independent observation paths +already exist. They were built separately and do not share a ledger. + +**The transcript path.** The scanners under `src/pkg/tokens/` (Claude, Copilot, +Bob, Codex, Cline, sandbox) read each CLI's session file into a +`SessionSummary` with a per-message `UsageEvent` timeline +(`src/pkg/tokens/collector.go`, `usage_timeline.go`). The collector merges every +scanner into one `AggregateSummary`, and that aggregate is what the dashboard +cost endpoints (`src/pkg/dashboard/cost.go`), the repo-cost join +(`src/pkg/dashboard/repo_cost.go`), the governor budget and the hub heartbeat +all read. This is the only path that carries enough per-message timing to +attribute spend to the pull requests an agent touched. + +**The wire path.** The proxy observes the usage block on responses it carries. +The inference translator records it through the `UsageSink` seam +(`src/crux/proxy/host_seams.go`) into `InferenceSink` +(`src/pkg/tokens/inference_sink.go`), and the Copilot sniff path records live +completions the same way (`src/crux/proxy/github_proxy_copilot.go`). That sink +keeps a cumulative per-agent counter and atomically rewrites one +`inference-.jsonl` file per agent; the collector then scans that file +like any other session and deduplicates by session ID. + +Today that split has five consequences: + +1. **No request grain.** Neither path records a request. The sink keeps a + running total, and the transcript parsers read `message.usage` only. + "How many requests, each with what usage" cannot be answered, so one event + per request cannot be asserted. +2. **No provenance.** A total cannot say whether it came from the wire or from + a transcript. The two are summed into the same aggregate with no marker. +3. **No billing basis.** Token counts times list price are presented the same + way whether a metered gateway billed the request or a subscription covered + it. A list price is not spend. +4. **Overlap is handled ad hoc.** The Copilot scanner defers its + `session.shutdown` totals to live wire capture behind a start-time + predicate (`SetCopilotLiveCapture`), a rule that exists because a naive sum + produced the $18k to $394 double-count regression. There is no general rule. +5. **Two blind spots are unnamed.** Direct-to-provider traffic that bypasses + the proxy is invisible on the wire, and an agent whose transcript cannot be + parsed is invisible to the scanners. Which source covers which, and what + stays unattributed, is not written down. + +Price provenance is being pinned separately (#21082), and tunnelled egress +destinations are being audited separately, metadata only, with no new denies +(#21080). Neither closes the usage-accounting gap this record addresses. + +## Decision + +### 1. Two sources, one usage ledger + +Add a single append-only usage ledger. Every row is one observation, tagged +with the source that observed it: + +- **Wire rows** are emitted by the proxy at the two points that already parse a + usage block: the inference translator, for both the streaming and + non-streaming response paths + (`src/crux/proxy/github_proxy_inference.go`), and the Copilot sniff + (`src/crux/proxy/github_proxy_copilot.go`). The emitter mints a `request_id` + at request entry and uses a once guard, so a request produces exactly one + row even when the upstream is retried, the response is streamed, or the + client cancels. Retries are folded into the same row and counted in an + `attempts` field. +- **Transcript rows** are derived by the scanners from the per-message usage + they already parse. Their identity is `(backend, session_id, event_index)`, + since a transcript line carries no provider request id today. + +The ledger is additive to, not a replacement for, the existing cumulative +sink files in the first phase. P1 writes the ledger and changes no total. P2 +makes the collector read wire usage from the ledger instead of the sink's +cumulative file, with a test proving the totals are identical when only +transcripts exist. The flag that disables emission reverts to the sink path +unchanged. + +A test drives a streaming request, a non-streaming request, a retried request +and a cancelled request, and asserts exactly one ledger row per `request_id`. + +**Trade-off.** A new append-only artifact is a second source of wire truth +until P2 removes the sink read. The alternative, extending the cumulative sink +in place, cannot express a per-request row or a request id without changing its +publication model, which is what makes it safe across restarts. + +### 2. Precedence and dedupe + +Rows are joined, never summed across sources for the same request: + +| Condition | Winner | Recorded as | +|---|---|---| +| A wire row and a transcript row share a request id | One reconciled row | `reconciled` | +| No shared id, and the agent has a transcript covering the request window | Transcript | `transcript` | +| No shared id, and the agent has no transcript | Wire | `wire` | +| Neither source saw the request | Nothing | Counted as a coverage gap, never as zero | + +The winner is recorded on the row and on every aggregate derived from it +(`measure_source`, plus a `sources` set and `mixed` marker at the total level). +A total may sum disjoint rows from different sources; what is forbidden is +summing two observations of the same request, or presenting a mixed total +without saying that it is mixed. + +The existing Copilot live-capture deferral is the per-session instance of this +rule and must be preserved exactly: wire wins for a session the proxy observed +from its start, transcript wins for sessions that predate capture. That +predicate (`LiveCaptureSinceMs`) is re-expressed in ledger terms, not removed. + +**Trade-off.** Transcript lines carry no provider request id today, so the +reconciled row is dormant until a scanner learns the id. Until then precedence +is decided per agent session, which is coarser than per request. Choosing +transcript-first when both exist means a wire-only helper call inside an agent +that also writes a transcript is missing from totals; it appears in the +reconciliation report instead. This is deliberate: it keeps totals stable and +keeps PR attribution intact. + +### 3. Provenance + +Measurement and price are independent questions, so they get independent +fields. The existing `PriceSource` (`src/pkg/tokens/gateway_pricing.go`) is +reused for price and is not overloaded: + +| Field | Values | Answers | +|---|---|---| +| `measure_source` | `wire`, `transcript`, `reconciled` | Who measured this row | +| `price_source` | `gateway`, `table`, `tier`, `unknown` (existing) | Where the rate came from | +| `price_catalog_pin` | catalog commit and table date (from #21082) | Which rate table was used | +| `billing_basis` | `cash`, `avoided`, `unknown` | What the money means | + +Every cost row carries all four. The dashboard shows, per row, the measurement +source and the price source, and the catalog pin in the footer beside the +existing price-table date. A total shows its `sources` set, and a mixed total +carries a `mixed` chip that opens the per-source breakdown. A row with +`price_source: unknown` stays excluded from the total and is shown as "price +unknown", never as $0, which is the existing behaviour and stays. + +**Trade-off.** Three fields plus a pin is more payload and more UI than one +badge. It is accepted because collapsing them lets a reader mistake a +transcript-priced row for a wire-measured one, or an estimate for a bill. + +### 4. Billing basis + +`billing_basis` separates what the tokens are worth from what was actually +paid: + +- **`cash`**: the request was billed per token by a metered gateway. Where the + gateway reports native spend (`/api/cost` native probe), that figure remains + the cash truth and the ledger estimate is only a fallback, labelled + estimated. +- **`avoided`**: the request was authenticated by a subscription (a Claude, + Copilot or Codex plan). Token counts times list price are the cost avoided, + not money spent. +- **`unknown`**: the authentication method is not observable for this row. + +Dashboard wording follows the basis. A subscription row reads "avoided (list +value)". A cash row reads "estimated cash" until the native probe confirms it, +and "spend" only when the gateway reports it. A list price is never labelled +"spend". + +The benchmarks `cost.basis` values stay exactly as they are: +`tokens_x_pricing` means a list-price estimate, `unknown` means no +attribution, and `reported` stays reserved for a gateway-billed figure. The +benchmark schema is not changed by this record, and `billing_basis` is not +folded into `cost.basis`. + +**Trade-off.** One agent can mix bases across requests, so a per-agent total +can be mixed-basis. Basis is therefore per row and the total is labelled, the +same as measurement source. + +### 5. Coverage limits, stated plainly + +| Path | Transcript written | Transcript readable | Wire sees it | Attribution | +|---|---|---|---|---| +| Through the proxy, CLI writes a session file | Yes | Yes | Yes | Reconciled or transcript; PR attribution intact | +| Through the proxy, bare-mode agent, no session file | No | n/a | Yes | Wire; agent-level only, no PR attribution | +| Through the proxy, session file unparseable | Yes | No | Yes | Wire; agent-level only | +| Bypasses the proxy, CLI writes a session file | Yes | Yes | No | Transcript; PR attribution intact; wire blind | +| Bypasses the proxy, no session file | No | n/a | No | Unattributed, reported as a gap | +| Caller not identified, request refused | n/a | n/a | No | No row; counted in proxy refusal diagnostics | + +The two blind spots are therefore: + +1. **Direct-to-provider traffic that bypasses the proxy.** The transcript + covers it when the CLI wrote one and the scanner can read it. It stays + invisible when neither holds. +2. **Any agent whose transcript we cannot parse.** The wire covers it only if + the request went through the proxy. + +Everything in the last two rows stays unattributed. It is reported as a gap and +is never shown as zero spend. The tunnel destination audit (#21080) records +which hosts were reached and how many bytes moved; it does not record tokens +and does not close this gap. + +**Trade-off.** Forcing every provider request through the proxy would close +blind spot 1. That is a policy change to what is allowed, and it is a non-goal +here (see section 7). + +### 6. No payload retention + +A wire row carries metadata and token counts only. The allowlist is: + +`request_id`, `agent`, `backend`, `model`, `input_tokens`, `output_tokens`, +`cache_read_tokens`, `cache_creation_tokens`, `started_at`, `ended_at`, +`outcome`, `attempts`, `measure_source`, `billing_basis`, `price_catalog_pin`. + +A wire row never carries a request or response body, a header of any kind +(including `Authorization` and `x-api-key`), a query string, a credential, a +prompt, a completion, tool content, a file path or a repository name. The agent +name is already public inside the pod and the model id is routing metadata. + +This matches the metadata-only posture of the tunnel destination audit +(#21080): both are observation, neither adds a deny, and neither records +payload. P1 to P4 of this record do not make the ledger authoritative for a +budget, so a damaged row cannot move a gate. If a later phase makes ledger rows +budget-authoritative, those rows go through the existing hash chain. + +The proxy already writes truncated request and response previews at INFO in +some debug paths. This record adds no new payload retention and does not change +those lines; narrowing them is a separate change. + +**Trade-off.** Metadata-only rows cannot be re-priced from content, and cannot +explain a surprising delta beyond model and token counts. That is the point: +cost accounting does not need an agent's prompt. + +### 7. Non-goals + +- No change to what the proxy allows or denies. No new deny, no altered + connection handling, no new gate. +- No replacement of transcript attribution to pull requests. The repo-cost join + keeps using transcript events for PR rows. +- No dependency on an external tool, service or schema for the ledger. +- No payload capture, and no retroactive re-pricing of history. +- No change to the benchmark schema or its `cost.basis` values. +- No implementation in this record's PR. The phases below are separate issues + and none is started until the owner accepts this record. + +### 8. Rollout + +Each phase is shippable on its own and reversible. No phase before P4 changes +an existing total. + +| Phase | Change | Reversible by | Totals | +|---|---|---|---| +| P1 | Wire rows emitted, metadata only, one per request, into the append-only ledger. Nothing reads them. | Disable emission; sink path untouched | Unchanged | +| P2 | Ledger merge, precedence, provenance on every row. Collector reads wire usage from the ledger instead of the cumulative sink file. Tests prove one row per request, and totals identical to today when only transcripts exist. | Flag back to the sink read | Unchanged | +| P3 | Wire-only attribution shown: agent-level totals, PR attribution explicitly absent, dashboard label. Repo-cost reports these in a wire-only bucket, not as unattributed. | Hide the label and bucket | Unchanged | +| P4 | Reconciliation report: wire versus transcript deltas per agent and model, with reason buckets (`transcript_preferred`, `wire_only`, `reconciled`, `wire_extra`, `transcript_extra`, `no_usage_block`, `bypass_suspected`). Read-only endpoint. | Remove the endpoint | Unchanged | +| later | Any change that replaces a transcript total with a wire total | Its own reviewed change | Changes only after P4 | + +P5, a contributor-relay usage reporting protocol, is a separate epic. It is not +filed under this record and is not a dependency of it. + +## Consequences + +- A cost figure can finally say how it was measured and how it was priced. The + trade-off is more fields in the payload and more UI, and a second wire + artifact during P1 until P2 removes the sink read. +- Totals become stable by design: adding wire observation to an agent that + already has a transcript does not move its total. Wire-only deltas surface in + the reconciliation report instead, which is what lets a total change be + reviewed rather than discovered. +- Subscription cost is separated from cash, so list prices stop reading as + spend. The trade-off is that basis can be wrong per row when an agent mixes a + subscription and a gateway key, and the total must then be labelled mixed. +- The two blind spots are named and reported, not hidden. Direct-to-provider + traffic without a readable transcript stays unattributed, and no phase here + closes it. +- The existing Copilot live-capture deferral survives as a special case of the + general precedence rule rather than as an unstated exception. + +Refs #21080, #21082. diff --git a/docs/content/hive/adr/readme.md b/docs/content/hive/adr/readme.md index ef8fb341..52ce15ee 100644 --- a/docs/content/hive/adr/readme.md +++ b/docs/content/hive/adr/readme.md @@ -82,3 +82,4 @@ sequencing; ADR-0019/0025 give their current action/mode contract first. - [ADR-0024: Provider credential lifecycle](/docs/hive/adr/0024-provider-credential-lifecycle) — **Proposed**, not a credential-pool or refresh-service setup guide. - [ADR-0025: One stage engine derives and writes every `stage/*` label](/docs/hive/adr/0025-central-stage-engine) - [ADR-0026: Sandbox runtime selection](/docs/hive/adr/0026-sandbox-runtime-selection) (Accepted — phase 1 implemented, runtime opt-in) +- [ADR-0027: Hybrid wire and transcript cost accounting](/docs/hive/adr/0027-hybrid-wire-and-transcript-cost-accounting) — **Proposed**, design only; no phase is started. diff --git a/docs/content/hive/agent-configuration.md b/docs/content/hive/agent-configuration.md index 5ac5b40f..cfcb7373 100644 --- a/docs/content/hive/agent-configuration.md +++ b/docs/content/hive/agent-configuration.md @@ -434,10 +434,29 @@ Three optional blocks replace hardcoded behavior with declarations: - name: github-mcp type: mcp # mcp | api | knowledge uri: "stdio:///usr/local/bin/mcp-github" + - name: tasks + type: mcp + uri: "https://tasks.example.com/mcp" + auth: + type: env + env_var: TASKS_MCP_TOKEN # sent as "Authorization: Bearer " ``` Presets map onto modes (`advisory` denies issue and PR creation, `issues-only` denies PRs, `issues-prs` and `full` deny nothing), and an explicit `allow` rule overrides a preset `deny`. +#### MCP connections + +The `claude` backend, and the inference backends that launch through it, load every `type: mcp` connection. Hive passes them to the CLI as one `--mcp-config` argument, keyed by connection `name`: + +| `uri` | Server entry | +|---|---| +| `http://…` or `https://…` | `{"type": "http", "url": ""}` | +| `stdio:///path/to/bin arg1 arg2` | `{"type": "stdio", "command": "/path/to/bin", "args": ["arg1", "arg2"]}` (split on whitespace) | + +Hive skips other schemes. For an HTTP server with `auth.type: env`, the entry gets `"headers": {"Authorization": "Bearer ${ENV_VAR}"}`. Hive exports the variable from its own environment into the agent's tmux session with `tmux set-environment`. The Claude CLI expands `${ENV_VAR}` when it connects. The token never appears in the launch command, the pane, or the logs. `auth.type: file` is not applied to MCP connections. A stdio server inherits the agent's environment, so it can read the exported variable itself. + +Other backends (copilot, codex, gemini, …) ignore `type: mcp` connections for now. + ### Replicated agents Set `replicas: N` on a declared agent to run a small pool with the same prompt, backend, model, mode, channel, tool, and metadata settings. `N` defaults to `1` and is capped at `5`; config load fails if it is outside `1..5`. Hive materializes derived names as `-2`, `-3`, ... (`scanner`, `scanner-2`, `scanner-3`). Do not declare those derived names yourself: a real `scanner-2` entry collides with `scanner: { replicas: 2 }` and is rejected. Derived replicas get their own IDs and bead directories (`/data/beads/scanner-2`) but inherit the base agent's kick template/prompt selection. Runtime-derived replicas are stripped before saving and recreated on the next load. For the reviewer lane, `review.reviewers.autoscale` can raise and lower the materialised count at runtime between `min` and `max`; the declared `replicas` then only seeds the initial size. See [review-swarm.md](/docs/hive/operations/automation-and-review/review-swarm#reviewer-autoscale-reviewreviewersautoscale). @@ -1404,6 +1423,8 @@ Where you will see it: the agent's Prompt Template tab renders the guide where t Parking remains for risk categories: security posture, data loss, irreversible or public-facing behaviour, governance/policy/licensing, spend, credentials/secrets/infra the hive cannot access (owner-only), or a question about a human's intent that cannot be inferred. Parked issue bodies should include `Risk: ` so the maintainer can see why a person is needed. Human-origin issue filings are unaffected. +Before parking, the default policies have the agent check the target repository's own AGENTS.md / CLAUDE.md for an owner ruling that covers the case (for example an "Owner's standing decisions" section). Only the copy injected into the prompt or read from the repository's default branch counts: a checked-out copy on a contributor branch or fork is not a source, and where it differs from the default branch the difference is not a ruling. A ruling can only settle a governance/policy/licensing park: where one covers the case, the agent takes the option it allows, records `Decision taken by hive: per "
" ()`, and does not park. A ruling cannot waive a security-posture, data-loss, irreversible or public-facing, spend, or credentials park; those park regardless of any repository file. A park whose recommended option is to take no action is not a decision either; the agent takes it and says so in one comment. Anything the ruling leaves to the owner (secrets, new permissions or token scopes, repository settings, loosening a check, releases, licensing) still parks, and no repository file overrides hive's safety and authorization rules ([#21008](https://github.com/hivecommons/hive/issues/21008)). + ```yaml project: agent_issue_decision_policy: resolve # resolve (default) or escalate diff --git a/docs/content/hive/api-reference/auth.md b/docs/content/hive/api-reference/auth.md index 12010ff5..1ffc6fba 100644 --- a/docs/content/hive/api-reference/auth.md +++ b/docs/content/hive/api-reference/auth.md @@ -7,13 +7,13 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| -| `GET` | `/api/gh-auth` | Dashboard auth/session | GitHub Auth | `pkg/dashboard/api.go:172` | -| `GET` | `/api/gh-rate-limits` | Dashboard auth/session | GitHub Rate Limits | `pkg/dashboard/api.go:173` | -| `GET` | `/api/gh-user-auth/status` | Public | GitHub User Auth Status | `pkg/dashboard/api.go:174` | -| `POST` | `/api/gh-user-auth/start` | Public | GitHub User Auth Start | `pkg/dashboard/api.go:175` | -| `POST` | `/api/gh-user-auth/poll` | Public | GitHub User Auth Poll | `pkg/dashboard/api.go:176` | -| `POST` | `/api/gh-user-auth/logout` | Public | GitHub User Auth Logout | `pkg/dashboard/api.go:177` | -| `GET` | `/api/gh-user-auth/session` | Public | GitHub User Auth Session | `pkg/dashboard/api.go:178` | +| `GET` | `/api/gh-auth` | Dashboard auth/session | GitHub Auth | `pkg/dashboard/api.go:175` | +| `GET` | `/api/gh-rate-limits` | Dashboard auth/session | GitHub Rate Limits | `pkg/dashboard/api.go:176` | +| `GET` | `/api/gh-user-auth/status` | Public | GitHub User Auth Status | `pkg/dashboard/api.go:177` | +| `POST` | `/api/gh-user-auth/start` | Public | GitHub User Auth Start | `pkg/dashboard/api.go:178` | +| `POST` | `/api/gh-user-auth/poll` | Public | GitHub User Auth Poll | `pkg/dashboard/api.go:179` | +| `POST` | `/api/gh-user-auth/logout` | Public | GitHub User Auth Logout | `pkg/dashboard/api.go:180` | +| `GET` | `/api/gh-user-auth/session` | Public | GitHub User Auth Session | `pkg/dashboard/api.go:181` | | `GET` | `/api/claude-auth/status` | Dashboard auth/session | Claude Auth Status | `pkg/dashboard/claude_auth.go:54` | | `POST` | `/api/claude-auth/start` | Dashboard auth/session | Claude Auth Start | `pkg/dashboard/claude_auth.go:55` | | `POST` | `/api/claude-auth/exchange` | Dashboard auth/session | Claude Auth Exchange | `pkg/dashboard/claude_auth.go:56` | @@ -26,12 +26,12 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | `GET` | `/api/openrouter/models` | Dashboard auth/session | Open Router Models | `pkg/dashboard/openrouter.go:47` | | `GET` | `/api/openrouter/credit` | Dashboard auth/session | Open Router Credit | `pkg/dashboard/openrouter.go:48` | | `GET` | `/openrouter/callback` | Public | Open Router Callback | `pkg/dashboard/openrouter.go:49` | -| `POST` | `/api/github-app/recheck` | Dashboard auth/session | GitHub App Recheck | `pkg/dashboard/server.go:1865` | -| `POST` | `/api/github-app/install-clicked` | Dashboard auth/session | GitHub App Install Clicked | `pkg/dashboard/server.go:1866` | -| `GET` | `/gh-setup` | Public | GitHub App Setup Callback | `pkg/dashboard/server.go:1867` | -| `GET` | `/api/github-owner-identity` | Owner only | The hive owner's GitHub identity for remote repos ([#18197](https://github.com/hivecommons/hive/issues/18197)): `connected`, `login`, `scope`, `connected_at`, `usable`, `reason`, `verified_at`, `scope_required` (`public_repo`), `private_repos_supported` (false) and `file` (the token file path on the spoke). Never the token | `pkg/dashboard/api.go:594` | -| `POST` | `/api/github-owner-identity/start` | Owner only | Start the consent: a GitHub device flow with the spoke's `oauth_client_id` asking for `public_repo`, separate from the scope-free login flow. Returns `user_code`, `verification_uri`, `expires_in`, `interval`, `scope` and the `flow_id` the poll must present. 502 when GitHub refused the device-code request | `pkg/dashboard/api.go:595` | -| `POST` | `/api/github-owner-identity/poll` | Owner only | Poll the consent with `{"flow_id"}`: `status` `pending` / `slow_down` (poll again), `complete` (with `login` and the identity) or `error`. On completion the granted scope must cover `public_repo`, the token must validate and the account must be the logged-in owner's; the identity is then stored on the spoke (`/data/secrets/github-owner-token`, `HIVE_GITHUB_OWNER_TOKEN_FILE` overrides) and the reference-repo policies re-resolve. 400 without a live flow or with the wrong `flow_id`; audited as `github_owner_identity_connected` / `_rejected` | `pkg/dashboard/api.go:596` | -| `DELETE` | `/api/github-owner-identity` | Owner only | Disconnect: removes the token file, drops every write-tier reference repo to read-only on the next pass, returns the previous `login` and a `note` that GitHub-side revocation is done under Settings → Applications on github.com; audited as `github_owner_identity_disconnected` | `pkg/dashboard/api.go:597` | -| `GET` | `/api/github-token` | Owner only | PAT status for PAT-mode hives ([#19633](https://github.com/hivecommons/hive/issues/19633)): `mode` (`pat` / `app`), `rotatable`, `configured`, `fingerprint` (the sha256 prefix `/api/config/export` shows) and, when this process verified the token, `login` and `verified_at`. Never the token | `pkg/dashboard/api.go:600` | -| `PUT` | `/api/github-token` | Owner only | Rotate the PAT without a restart with `{"token"}`. Verified against `github.api_url` first (`GET /user`, read access to every `project.repos` entry, the boot scope check for the current ACMM level); a failure is 422 and nothing changes. A verified token is saved through the normal keystore-sealed config save, adopted as a new PAT client, and running agents get fresh credentials. Returns the GET body plus `sealed` (true when the saved token is a keystore envelope; false when it was written as plaintext, in which case the config file is kept owner-only, 0600). Needs `Content-Type: application/json` (415 otherwise) and refuses `Sec-Fetch-Site: cross-site` (403). 409 when `github.app_id` is set (rechecked under the GitHub config lock); 500 when the config has no source path, so the token would not survive a restart. After a rejected token, further attempts get 429 with `Retry-After` for 15 seconds (`HIVE_GITHUB_TOKEN_REJECT_COOLDOWN`, a Go duration, `0` turns it off). Audited as `github_token_rotated` / `github_token_rejected` by fingerprint | `pkg/dashboard/api.go:601` | +| `POST` | `/api/github-app/recheck` | Dashboard auth/session | GitHub App Recheck | `pkg/dashboard/server.go:1869` | +| `POST` | `/api/github-app/install-clicked` | Dashboard auth/session | GitHub App Install Clicked | `pkg/dashboard/server.go:1870` | +| `GET` | `/gh-setup` | Public | GitHub App Setup Callback | `pkg/dashboard/server.go:1871` | +| `GET` | `/api/github-owner-identity` | Owner only | The hive owner's GitHub identity for remote repos ([#18197](https://github.com/hivecommons/hive/issues/18197)): `connected`, `login`, `scope`, `connected_at`, `usable`, `reason`, `verified_at`, `scope_required` (`public_repo`), `private_repos_supported` (false) and `file` (the token file path on the spoke). Never the token | `pkg/dashboard/api.go:597` | +| `POST` | `/api/github-owner-identity/start` | Owner only | Start the consent: a GitHub device flow with the spoke's `oauth_client_id` asking for `public_repo`, separate from the scope-free login flow. Returns `user_code`, `verification_uri`, `expires_in`, `interval`, `scope` and the `flow_id` the poll must present. 502 when GitHub refused the device-code request | `pkg/dashboard/api.go:598` | +| `POST` | `/api/github-owner-identity/poll` | Owner only | Poll the consent with `{"flow_id"}`: `status` `pending` / `slow_down` (poll again), `complete` (with `login` and the identity) or `error`. On completion the granted scope must cover `public_repo`, the token must validate and the account must be the logged-in owner's; the identity is then stored on the spoke (`/data/secrets/github-owner-token`, `HIVE_GITHUB_OWNER_TOKEN_FILE` overrides) and the reference-repo policies re-resolve. 400 without a live flow or with the wrong `flow_id`; audited as `github_owner_identity_connected` / `_rejected` | `pkg/dashboard/api.go:599` | +| `DELETE` | `/api/github-owner-identity` | Owner only | Disconnect: removes the token file, drops every write-tier reference repo to read-only on the next pass, returns the previous `login` and a `note` that GitHub-side revocation is done under Settings → Applications on github.com; audited as `github_owner_identity_disconnected` | `pkg/dashboard/api.go:600` | +| `GET` | `/api/github-token` | Owner only | PAT status for PAT-mode hives ([#19633](https://github.com/hivecommons/hive/issues/19633)): `mode` (`pat` / `app`), `rotatable`, `configured`, `fingerprint` (the sha256 prefix `/api/config/export` shows) and, when this process verified the token, `login` and `verified_at`. Never the token | `pkg/dashboard/api.go:603` | +| `PUT` | `/api/github-token` | Owner only | Rotate the PAT without a restart with `{"token"}`. Verified against `github.api_url` first (`GET /user`, read access to every `project.repos` entry, the boot scope check for the current ACMM level); a failure is 422 and nothing changes. A verified token is saved through the normal keystore-sealed config save, adopted as a new PAT client, and running agents get fresh credentials. Returns the GET body plus `sealed` (true when the saved token is a keystore envelope; false when it was written as plaintext, in which case the config file is kept owner-only, 0600). Needs `Content-Type: application/json` (415 otherwise) and refuses `Sec-Fetch-Site: cross-site` (403). 409 when `github.app_id` is set (rechecked under the GitHub config lock); 500 when the config has no source path, so the token would not survive a restart. After a rejected token, further attempts get 429 with `Retry-After` for 15 seconds (`HIVE_GITHUB_TOKEN_REJECT_COOLDOWN`, a Go duration, `0` turns it off). Audited as `github_token_rotated` / `github_token_rejected` by fingerprint | `pkg/dashboard/api.go:604` | diff --git a/docs/content/hive/api-reference/beads.md b/docs/content/hive/api-reference/beads.md index 67857ef9..558dfb90 100644 --- a/docs/content/hive/api-reference/beads.md +++ b/docs/content/hive/api-reference/beads.md @@ -7,8 +7,8 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| -| `GET` | `/api/beads` | Dashboard auth/session | Beads List | `pkg/dashboard/api.go:502` | -| `GET` | `/api/beads/{agent}` | Dashboard auth/session | Beads List | `pkg/dashboard/api.go:503` | -| `POST` | `/api/beads/{agent}` | Owner only | Beads Create | `pkg/dashboard/api.go:504` | -| `POST` | `/api/beads/reset` | Owner only | Beads Reset | `pkg/dashboard/api.go:505` | -| `POST` | `/api/beads/reset/{agent}` | Owner only | Beads Reset Agent | `pkg/dashboard/api.go:506` | +| `GET` | `/api/beads` | Dashboard auth/session | Beads List | `pkg/dashboard/api.go:505` | +| `GET` | `/api/beads/{agent}` | Dashboard auth/session | Beads List | `pkg/dashboard/api.go:506` | +| `POST` | `/api/beads/{agent}` | Owner only | Beads Create | `pkg/dashboard/api.go:507` | +| `POST` | `/api/beads/reset` | Owner only | Beads Reset | `pkg/dashboard/api.go:508` | +| `POST` | `/api/beads/reset/{agent}` | Owner only | Beads Reset Agent | `pkg/dashboard/api.go:509` | diff --git a/docs/content/hive/api-reference/configuration.md b/docs/content/hive/api-reference/configuration.md index 04143d2a..b43d6302 100644 --- a/docs/content/hive/api-reference/configuration.md +++ b/docs/content/hive/api-reference/configuration.md @@ -15,13 +15,13 @@ JSON, see [Editing `hive.yaml`](/docs/hive/editing-hive-yaml#view-yaml-or-export | `GET` | `/api/config` | Dashboard auth/session | Config | `pkg/dashboard/api.go:53` | | `GET` | `/api/config/triggers` | Verified owner only | Ordered Event triggers, opaque `version`/ETag, existing agents and managed repository values/labels; applies on next evaluation without restart | `pkg/dashboard/api_event_triggers.go` | | `PUT` | `/api/config/triggers` | Verified owner only | Compile-to-bool and durably compare-and-save `{rules:[{name,agent,expr,priority}],preset?:{index,kind,repo}}`; exact `If-Match` required (428 missing, 412 stale), validation 400, persistence failure 500 leaves live rules unchanged. No enabled field or source/webhook installation | `pkg/dashboard/api_event_triggers.go` | -| `GET` | `/api/config/dashboard` | Owner only | Dashboard runtime settings (`dashboard.*`): port, agent poll interval, `experiment_lab`, `subscription_gauge_header`, hub-proxied auth, whether an auth token is configured (never the token), access allowlist, issue bands and stage-tracker toast timings | `pkg/dashboard/api.go:207` | -| `PUT` | `/api/config/dashboard` | Owner only | Update any subset of those fields (an absent field is unchanged), including `subscription_gauge_header` (adds the owner-only usage gauge chip to the header, covering every plan the agents spend: Claude, Copilot and others); validated, saved and audit-logged as `config_dashboard_settings` | `pkg/dashboard/api.go:208` | +| `GET` | `/api/config/dashboard` | Owner only | Dashboard runtime settings (`dashboard.*`): port, agent poll interval, `experiment_lab`, `subscription_gauge_header`, hub-proxied auth, whether an auth token is configured (never the token), access allowlist, issue bands and stage-tracker toast timings | `pkg/dashboard/api.go:210` | +| `PUT` | `/api/config/dashboard` | Owner only | Update any subset of those fields (an absent field is unchanged), including `subscription_gauge_header` (adds the write-tier usage gauge chip to the header, covering every plan the agents spend: Claude, Copilot and others); validated, saved and audit-logged as `config_dashboard_settings` | `pkg/dashboard/api.go:211` | | `GET` | `/api/config/dashboard/theme` | Owner only | Dashboard theme selection, overrides, effective theme, and built-in catalog | `pkg/dashboard/api.go:62` | | `PUT` | `/api/config/dashboard/theme` | Owner only | Persist `dashboard.theme` and `dashboard.theme_overrides` with validation, CSS/background guardrails, and audit logging | `pkg/dashboard/api.go:63` | | `GET` | `/api/config/download` | Owner only | Config Download | `pkg/dashboard/api.go:54` | -| `GET` | `/api/config/sla` | Owner only | Delivery SLA targets: `{targets:{start_to_pr_h,pr_to_merge_h,open_to_merge_h}, effective_targets:{...}, defaults:{...}}`, hours, from `sla.targets` in `hive.yaml` with defaults 4/24/72 | `pkg/dashboard/api.go:256` | -| `PUT` | `/api/config/sla` | Owner only | Replace `sla.targets` (`{targets:{start_to_pr_h,pr_to_merge_h,open_to_merge_h}}`; each 0 (default) to 8760, validated before anything is persisted); the Throughput Delivery SLA panel recolours on the next status poll | `pkg/dashboard/api.go:257` | +| `GET` | `/api/config/sla` | Owner only | Delivery SLA targets: `{targets:{start_to_pr_h,pr_to_merge_h,open_to_merge_h}, effective_targets:{...}, defaults:{...}}`, hours, from `sla.targets` in `hive.yaml` with defaults 4/24/72 | `pkg/dashboard/api.go:259` | +| `PUT` | `/api/config/sla` | Owner only | Replace `sla.targets` (`{targets:{start_to_pr_h,pr_to_merge_h,open_to_merge_h}}`; each 0 (default) to 8760, validated before anything is persisted); the Throughput Delivery SLA panel recolours on the next status poll | `pkg/dashboard/api.go:260` | | `GET` | `/api/config/export` | Owner only | Redacted JSON export of the effective config, layer files, side files, and provenance | `pkg/dashboard/api_config_export.go` | | `GET` | `/api/config/provenance` | Owner only | Config Provenance | `pkg/dashboard/api.go:57` | | `GET` | `/api/config/variables` | Dashboard auth/session | Variables List | `pkg/dashboard/api.go:58` | @@ -29,120 +29,120 @@ JSON, see [Editing `hive.yaml`](/docs/hive/editing-hive-yaml#view-yaml-or-export | `PUT` | `/api/config/variables/{name}` | Owner only | Variable Upsert | `pkg/dashboard/api.go:64` | | `DELETE` | `/api/config/variables/{name}` | Owner only | Variable Delete | `pkg/dashboard/api.go:65` | -| `GET` | `/api/config/agent/{name}` | Dashboard auth/session | Agent Config Get | `pkg/dashboard/api.go:187` | -| `PUT` | `/api/config/agent/{name}/general` | Owner only | Agent Config General | `pkg/dashboard/api.go:188` | -| `PUT` | `/api/config/agent/{name}/cadences` | Owner only | Agent Config Cadences | `pkg/dashboard/api.go:189` | -| `PUT` | `/api/config/agent/{name}/models` | Owner only | Agent Config Models | `pkg/dashboard/api.go:190` | -| `POST` | `/api/config/agents/bulk-models` | Owner only | Bulk switch backend/model (dry run, undo) | `pkg/dashboard/api.go:191` | -| `GET` | `/api/config/agents/bulk-models/last` | Any | Previous assignment of the last bulk switch | `pkg/dashboard/api.go:192` | -| `PUT` | `/api/config/agent/{name}/pipeline` | Owner only | Agent Config Pipeline | `pkg/dashboard/api.go:193` | -| `PUT` | `/api/config/agent/{name}/hooks` | Owner only | Agent Config Hooks | `pkg/dashboard/api.go:194` | -| `PUT` | `/api/config/agent/{name}/restrictions` | Owner only | Agent Config Restrictions | `pkg/dashboard/api.go:195` | -| `PUT` | `/api/config/agent/{name}/stats` | Owner only | Agent Config Stats | `pkg/dashboard/api.go:196` | -| `GET` | `/api/config/agent/{name}/prompt` | Dashboard auth/session | Agent Prompt | `pkg/dashboard/api.go:197` | -| `PUT` | `/api/config/agent/{name}/prompt` | Owner only | Agent Prompt Save | `pkg/dashboard/api.go:198` | -| `GET` | `/api/config/agent/{name}/export` | Dashboard auth/session | Agent Export | `pkg/dashboard/api.go:199` | -| `PUT` | `/api/config/agent/{name}/channels` | Owner only | Agent Config Channels | `pkg/dashboard/api.go:200` | -| `PUT` | `/api/config/agent/{name}/tools` | Owner only | Agent Config Tools | `pkg/dashboard/api.go:201` | -| `PUT` | `/api/config/agent/{name}/connections` | Owner only | Agent Config Connections | `pkg/dashboard/api.go:202` | +| `GET` | `/api/config/agent/{name}` | Dashboard auth/session | Agent Config Get | `pkg/dashboard/api.go:190` | +| `PUT` | `/api/config/agent/{name}/general` | Owner only | Agent Config General | `pkg/dashboard/api.go:191` | +| `PUT` | `/api/config/agent/{name}/cadences` | Owner only | Agent Config Cadences | `pkg/dashboard/api.go:192` | +| `PUT` | `/api/config/agent/{name}/models` | Owner only | Agent Config Models | `pkg/dashboard/api.go:193` | +| `POST` | `/api/config/agents/bulk-models` | Owner only | Bulk switch backend/model (dry run, undo) | `pkg/dashboard/api.go:194` | +| `GET` | `/api/config/agents/bulk-models/last` | Any | Previous assignment of the last bulk switch | `pkg/dashboard/api.go:195` | +| `PUT` | `/api/config/agent/{name}/pipeline` | Owner only | Agent Config Pipeline | `pkg/dashboard/api.go:196` | +| `PUT` | `/api/config/agent/{name}/hooks` | Owner only | Agent Config Hooks | `pkg/dashboard/api.go:197` | +| `PUT` | `/api/config/agent/{name}/restrictions` | Owner only | Agent Config Restrictions | `pkg/dashboard/api.go:198` | +| `PUT` | `/api/config/agent/{name}/stats` | Owner only | Agent Config Stats | `pkg/dashboard/api.go:199` | +| `GET` | `/api/config/agent/{name}/prompt` | Dashboard auth/session | Agent Prompt | `pkg/dashboard/api.go:200` | +| `PUT` | `/api/config/agent/{name}/prompt` | Owner only | Agent Prompt Save | `pkg/dashboard/api.go:201` | +| `GET` | `/api/config/agent/{name}/export` | Dashboard auth/session | Agent Export | `pkg/dashboard/api.go:202` | +| `PUT` | `/api/config/agent/{name}/channels` | Owner only | Agent Config Channels | `pkg/dashboard/api.go:203` | +| `PUT` | `/api/config/agent/{name}/tools` | Owner only | Agent Config Tools | `pkg/dashboard/api.go:204` | +| `PUT` | `/api/config/agent/{name}/connections` | Owner only | Agent Config Connections | `pkg/dashboard/api.go:205` | | `GET` | `/api/config/agent/{name}/variables` | Dashboard auth/session | Per-agent Variables tab: the agent's own `${VAR}` definitions plus the hive-level ones it inherits (each flagged `overridden` when the agent redefines it) and the seed-only exec/http gate flags. Never returns values — only name, type, scope and a non-secret source hint | `pkg/dashboard/api_variables.go:298` | | `PUT` | `/api/config/agent/{name}/variables/{var}` | Owner only | Create or update one per-agent variable (`static`/`env` only; `script`/`http` are 403 and seed-only; scope `template` or `both`; secret-looking static values rejected). Persisted on the agent entry; overrides a same-named hive-level variable in this agent's kick prompt | `pkg/dashboard/api_variables.go:299` | | `DELETE` | `/api/config/agent/{name}/variables/{var}` | Owner only | Delete one per-agent variable (404 for inherited hive-level variables — delete those via `/api/config/variables/{name}`) | `pkg/dashboard/api_variables.go:300` | -| `GET` | `/api/config/stat-sources` | Dashboard auth/session | Stat Sources | `pkg/dashboard/api.go:203` | -| `GET` | `/api/config/governor` | Dashboard auth/session | Governor Config Get | `pkg/dashboard/api.go:205` | +| `GET` | `/api/config/stat-sources` | Dashboard auth/session | Stat Sources | `pkg/dashboard/api.go:206` | +| `GET` | `/api/config/governor` | Dashboard auth/session | Governor Config Get | `pkg/dashboard/api.go:208` | | `PATCH` | `/api/config/governor` | Owner only | Update `merge_train_stall_warn_s`; omitted values stay unchanged, 0 disables warnings; returns the effective interval | `pkg/dashboard/api_governor_merge_train.go` | -| `PUT` | `/api/config/governor/sensing` | Owner only | Governor Sensing | `pkg/dashboard/api.go:209` | -| `PUT` | `/api/config/governor/thresholds` | Owner only | Governor Thresholds | `pkg/dashboard/api.go:210` | -| `PUT` | `/api/config/governor/labels` | Owner only | Governor Labels | `pkg/dashboard/api.go:217` | -| `PUT` | `/api/config/governor/budget` | Owner only | Governor Budget | `pkg/dashboard/api.go:218` | -| `PUT` | `/api/config/governor/notifications` | Owner only | Governor Notifications | `pkg/dashboard/api.go:222` | -| `PUT` | `/api/config/governor/health` | Owner only | Governor Health | `pkg/dashboard/api.go:223` | -| `PUT` | `/api/config/governor/logging` | Owner only | Governor Logging | `pkg/dashboard/api.go:235` | -| `PUT` | `/api/config/governor/attribution` | Owner only | Governor Attribution | `pkg/dashboard/api.go:236` | -| `PUT` | `/api/config/governor/hub` | Owner only | Governor Hub | `pkg/dashboard/api.go:237` | -| `PUT` | `/api/config/governor/litellm` | Owner only | Governor Lite LLM | `pkg/dashboard/api.go:238` | -| `PUT` | `/api/config/governor/trajectory` | Owner only | Governor Trajectory | `pkg/dashboard/api.go:239` | +| `PUT` | `/api/config/governor/sensing` | Owner only | Governor Sensing | `pkg/dashboard/api.go:212` | +| `PUT` | `/api/config/governor/thresholds` | Owner only | Governor Thresholds | `pkg/dashboard/api.go:213` | +| `PUT` | `/api/config/governor/labels` | Owner only | Governor Labels | `pkg/dashboard/api.go:220` | +| `PUT` | `/api/config/governor/budget` | Owner only | Governor Budget | `pkg/dashboard/api.go:221` | +| `PUT` | `/api/config/governor/notifications` | Owner only | Governor Notifications | `pkg/dashboard/api.go:225` | +| `PUT` | `/api/config/governor/health` | Owner only | Governor Health | `pkg/dashboard/api.go:226` | +| `PUT` | `/api/config/governor/logging` | Owner only | Governor Logging | `pkg/dashboard/api.go:238` | +| `PUT` | `/api/config/governor/attribution` | Owner only | Governor Attribution | `pkg/dashboard/api.go:239` | +| `PUT` | `/api/config/governor/hub` | Owner only | Governor Hub | `pkg/dashboard/api.go:240` | +| `PUT` | `/api/config/governor/litellm` | Owner only | Governor Lite LLM | `pkg/dashboard/api.go:241` | +| `PUT` | `/api/config/governor/trajectory` | Owner only | Governor Trajectory | `pkg/dashboard/api.go:242` | | `GET` | `/api/config/governor/backup` | Owner only | Backup Key Status (presence + safe source label; never the key value) | `pkg/dashboard/backup_key.go` | | `PUT` | `/api/config/governor/backup` | Owner only | Backup Key Set (64-hex AES-256 key; stored 0600, path-only in `hive.yaml`) | `pkg/dashboard/backup_key.go` | | `DELETE` | `/api/config/governor/backup` | Owner only | Backup Key Clear (backups are refused again) | `pkg/dashboard/backup_key.go` | -| `GET` | `/api/config/governor/bob` | Dashboard auth/session | Governor Bob Status | `pkg/dashboard/api.go:285` | -| `PUT` | `/api/config/governor/bob` | Owner only | Governor Bob Key | `pkg/dashboard/api.go:286` | -| `DELETE` | `/api/config/governor/bob` | Owner only | Governor Bob Key Clear | `pkg/dashboard/api.go:287` | +| `GET` | `/api/config/governor/bob` | Dashboard auth/session | Governor Bob Status | `pkg/dashboard/api.go:288` | +| `PUT` | `/api/config/governor/bob` | Owner only | Governor Bob Key | `pkg/dashboard/api.go:289` | +| `DELETE` | `/api/config/governor/bob` | Owner only | Governor Bob Key Clear | `pkg/dashboard/api.go:290` | -| `GET` | `/api/config/governor/cadence-scope` | Owner only | Governor Cadence Scope Get (`aggregate` or `per_repo`) | `pkg/dashboard/api.go:211` | -| `PUT` | `/api/config/governor/cadence-scope` | Owner only | Governor Cadence Scope Set (`cadenceScope`/`cadence_scope`: `aggregate`, `per_repo`, or empty for default) | `pkg/dashboard/api.go:212` | -| `POST` | `/api/config/governor/bob/test` | Dashboard auth/session | Governor Bob Key Test | `pkg/dashboard/api.go:289` | -| `POST` | `/api/config/governor/litellm/test` | Dashboard auth/session | Governor Lite LLMTest | `pkg/dashboard/api.go:290` | -| `GET` | `/api/config/governor/gateways` | Dashboard auth/session | Governor Gateways List | `pkg/dashboard/api.go:293` | -| `PUT` | `/api/config/governor/gateways` | Owner only | Governor Gateways Upsert | `pkg/dashboard/api.go:294` | -| `DELETE` | `/api/config/governor/gateways/{name}` | Owner only | Governor Gateways Delete | `pkg/dashboard/api.go:295` | -| `POST` | `/api/config/governor/gateways/{name}/test` | Dashboard auth/session | Governor Gateways Test | `pkg/dashboard/api.go:296` | -| `POST` | `/api/config/governor/gateways/discover` | Owner only | Governor Gateways Discover | `pkg/dashboard/api.go:297` | -| `POST` | `/api/config/governor/agents` | Owner only | Governor Add Agent | `pkg/dashboard/api.go:303` | -| `DELETE` | `/api/config/governor/agents/{name}` | Owner only | Governor Remove Agent | `pkg/dashboard/api.go:304` | -| `PUT` | `/api/config/governor/repos` | Owner only | Governor Repos | `pkg/dashboard/api.go:305` | -| `POST` | `/api/config/governor/repos/check-access` | Dashboard auth/session | Governor Repo Check Access | `pkg/dashboard/api.go:309` | -| `PUT` | `/api/config/github` | Owner only | Config GitHub | `pkg/dashboard/api.go:310` | -| `GET` | `/api/config/github/forge-apps` | Dashboard auth/session | Config GitHub Forge Apps | `pkg/dashboard/api.go:313` | +| `GET` | `/api/config/governor/cadence-scope` | Owner only | Governor Cadence Scope Get (`aggregate` or `per_repo`) | `pkg/dashboard/api.go:214` | +| `PUT` | `/api/config/governor/cadence-scope` | Owner only | Governor Cadence Scope Set (`cadenceScope`/`cadence_scope`: `aggregate`, `per_repo`, or empty for default) | `pkg/dashboard/api.go:215` | +| `POST` | `/api/config/governor/bob/test` | Dashboard auth/session | Governor Bob Key Test | `pkg/dashboard/api.go:292` | +| `POST` | `/api/config/governor/litellm/test` | Dashboard auth/session | Governor Lite LLMTest | `pkg/dashboard/api.go:293` | +| `GET` | `/api/config/governor/gateways` | Dashboard auth/session | Governor Gateways List | `pkg/dashboard/api.go:296` | +| `PUT` | `/api/config/governor/gateways` | Owner only | Governor Gateways Upsert | `pkg/dashboard/api.go:297` | +| `DELETE` | `/api/config/governor/gateways/{name}` | Owner only | Governor Gateways Delete | `pkg/dashboard/api.go:298` | +| `POST` | `/api/config/governor/gateways/{name}/test` | Dashboard auth/session | Governor Gateways Test | `pkg/dashboard/api.go:299` | +| `POST` | `/api/config/governor/gateways/discover` | Owner only | Governor Gateways Discover | `pkg/dashboard/api.go:300` | +| `POST` | `/api/config/governor/agents` | Owner only | Governor Add Agent | `pkg/dashboard/api.go:306` | +| `DELETE` | `/api/config/governor/agents/{name}` | Owner only | Governor Remove Agent | `pkg/dashboard/api.go:307` | +| `PUT` | `/api/config/governor/repos` | Owner only | Governor Repos | `pkg/dashboard/api.go:308` | +| `POST` | `/api/config/governor/repos/check-access` | Dashboard auth/session | Governor Repo Check Access | `pkg/dashboard/api.go:312` | +| `PUT` | `/api/config/github` | Owner only | Config GitHub | `pkg/dashboard/api.go:313` | +| `GET` | `/api/config/github/forge-apps` | Dashboard auth/session | Config GitHub Forge Apps | `pkg/dashboard/api.go:316` | | `GET` | `/api/config/github/webhooks` | Owner only | Config GitHub Webhooks (payload URL, events, secret source, receiver health, App hook permissions) | `pkg/dashboard/api_github_webhook_setup.go:88` | | `POST` | `/api/config/github/webhooks/secret` | Owner only | Config GitHub Webhooks Generate Secret (returned once) | `pkg/dashboard/api_github_webhook_setup.go:89` | | `POST` | `/api/config/github/webhooks/create` | Owner only | Config GitHub Webhooks Create Hook (through the App installation) | `pkg/dashboard/api_github_webhook_setup.go:90` | -| `GET` | `/api/config/sidebar` | Dashboard auth/session | Sidebar Get | `pkg/dashboard/api.go:373` | -| `PUT` | `/api/config/sidebar` | Dashboard auth/session | Sidebar Set | `pkg/dashboard/api.go:374` | -| `GET` | `/api/config/backends` | Dashboard auth/session | Backends | `pkg/dashboard/api.go:375` | -| `GET` | `/api/compliance/status` | Merger or owner | Evaluated compliance controls for the frameworks in `compliance.frameworks` (`compliance.Report`, JSON): per control `meets`/`deviates`/`off`/`not_covered` with current vs recommended value per mapped setting, a summary, and the non-certification disclaimer — see [Compliance](/docs/hive/security/compliance-controls) ([#11078](https://github.com/hivecommons/hive/issues/11078)) | `pkg/dashboard/api.go:365` | -| `GET` | `/api/compliance/posture` | Merger or owner | Posture-check catalogue, effective interval / window / history retention, and the latest run (`compliance.PostureRun`: schedule/manual trigger, `triggered_by` identity, and per-check `pass`/`fail`/`skip`/`error`, detail, control ids, evidence refs); `?since=` (RFC 3339, `YYYY-MM-DD` or a look-back such as `168h`) adds every run since then, oldest first, capped at 1000 — see [Compliance](/docs/hive/security/compliance-controls#posture-checks-catalogue) ([#11079](https://github.com/hivecommons/hive/issues/11079)) | `pkg/dashboard/api.go:366` | -| `POST` | `/api/compliance/posture/run` | Merger or owner | Run the posture checks now, attributed to the authenticated user, and record the pass in the history; audited as `compliance_posture_run`; `409` when no framework is selected or a pass is already running ([#11079](https://github.com/hivecommons/hive/issues/11079)) | `pkg/dashboard/api.go:367` | -| `GET` | `/api/compliance/posture/history` | Owner only | Posture history for `?since=`/`?until=` (default the last 30 days) as one series per check: points (`at`, `status`), status counts, `last_fail_at` and the latest result with detail and evidence refs; at most the 1000 most recent runs — see [Compliance](/docs/hive/security/compliance-controls#evidence-exports-and-attestations) ([#11081](https://github.com/hivecommons/hive/issues/11081)) | `pkg/dashboard/api.go:368` | -| `GET` | `/api/compliance/export` | Owner only | Evidence download for `?since=`/`?until=`: `kind=controls` (`json`/`md`), `posture` (`json`/`csv`), `audit` (`json`), `config` (redacted effective config + sha256, `json`), `attestations` (`json`/`csv`) or `bundle` (`json`). Every format includes source, period, generator, selected profile versions, attesters, retention and a per-section SHA-256 manifest; audited as `compliance_export` with the SHA-256 of the delivered bytes ([#11081](https://github.com/hivecommons/hive/issues/11081), [#13582](https://github.com/hivecommons/hive/issues/13582)) | `pkg/dashboard/api.go:369` | -| `GET` | `/api/compliance/attestations` | Owner only | Owner attestations, newest first (`?framework=` filters) ([#11081](https://github.com/hivecommons/hive/issues/11081)) | `pkg/dashboard/api.go:370` | -| `POST` | `/api/compliance/attestations` | Owner only | Record `{"framework", "reviewed_on", "note"}` for the signed-in owner; audited as `compliance_attestation`; `201` with the attestation, `400` for an unknown framework, a bad or future date, or a note over 2000 characters ([#11081](https://github.com/hivecommons/hive/issues/11081)) | `pkg/dashboard/api.go:371` | -| `PUT` | `/api/config/governor/compliance` | Owner only | Settings → Compliance framework picker: `{"frameworks": [...]}` sets `compliance.frameworks` (empty list deselects all, absent key leaves it unchanged; unknown/duplicate ids are a `400` before any change); audited as `config_compliance`; returns the re-evaluated `compliance.Report` ([#11080](https://github.com/hivecommons/hive/issues/11080)) | `pkg/dashboard/api.go:545` | +| `GET` | `/api/config/sidebar` | Dashboard auth/session | Sidebar Get | `pkg/dashboard/api.go:376` | +| `PUT` | `/api/config/sidebar` | Dashboard auth/session | Sidebar Set | `pkg/dashboard/api.go:377` | +| `GET` | `/api/config/backends` | Dashboard auth/session | Backends | `pkg/dashboard/api.go:378` | +| `GET` | `/api/compliance/status` | Merger or owner | Evaluated compliance controls for the frameworks in `compliance.frameworks` (`compliance.Report`, JSON): per control `meets`/`deviates`/`off`/`not_covered` with current vs recommended value per mapped setting, a summary, and the non-certification disclaimer — see [Compliance](/docs/hive/security/compliance-controls) ([#11078](https://github.com/hivecommons/hive/issues/11078)) | `pkg/dashboard/api.go:368` | +| `GET` | `/api/compliance/posture` | Merger or owner | Posture-check catalogue, effective interval / window / history retention, and the latest run (`compliance.PostureRun`: schedule/manual trigger, `triggered_by` identity, and per-check `pass`/`fail`/`skip`/`error`, detail, control ids, evidence refs); `?since=` (RFC 3339, `YYYY-MM-DD` or a look-back such as `168h`) adds every run since then, oldest first, capped at 1000 — see [Compliance](/docs/hive/security/compliance-controls#posture-checks-catalogue) ([#11079](https://github.com/hivecommons/hive/issues/11079)) | `pkg/dashboard/api.go:369` | +| `POST` | `/api/compliance/posture/run` | Merger or owner | Run the posture checks now, attributed to the authenticated user, and record the pass in the history; audited as `compliance_posture_run`; `409` when no framework is selected or a pass is already running ([#11079](https://github.com/hivecommons/hive/issues/11079)) | `pkg/dashboard/api.go:370` | +| `GET` | `/api/compliance/posture/history` | Owner only | Posture history for `?since=`/`?until=` (default the last 30 days) as one series per check: points (`at`, `status`), status counts, `last_fail_at` and the latest result with detail and evidence refs; at most the 1000 most recent runs — see [Compliance](/docs/hive/security/compliance-controls#evidence-exports-and-attestations) ([#11081](https://github.com/hivecommons/hive/issues/11081)) | `pkg/dashboard/api.go:371` | +| `GET` | `/api/compliance/export` | Owner only | Evidence download for `?since=`/`?until=`: `kind=controls` (`json`/`md`), `posture` (`json`/`csv`), `audit` (`json`), `config` (redacted effective config + sha256, `json`), `attestations` (`json`/`csv`) or `bundle` (`json`). Every format includes source, period, generator, selected profile versions, attesters, retention and a per-section SHA-256 manifest; audited as `compliance_export` with the SHA-256 of the delivered bytes ([#11081](https://github.com/hivecommons/hive/issues/11081), [#13582](https://github.com/hivecommons/hive/issues/13582)) | `pkg/dashboard/api.go:372` | +| `GET` | `/api/compliance/attestations` | Owner only | Owner attestations, newest first (`?framework=` filters) ([#11081](https://github.com/hivecommons/hive/issues/11081)) | `pkg/dashboard/api.go:373` | +| `POST` | `/api/compliance/attestations` | Owner only | Record `{"framework", "reviewed_on", "note"}` for the signed-in owner; audited as `compliance_attestation`; `201` with the attestation, `400` for an unknown framework, a bad or future date, or a note over 2000 characters ([#11081](https://github.com/hivecommons/hive/issues/11081)) | `pkg/dashboard/api.go:374` | +| `PUT` | `/api/config/governor/compliance` | Owner only | Settings → Compliance framework picker: `{"frameworks": [...]}` sets `compliance.frameworks` (empty list deselects all, absent key leaves it unchanged; unknown/duplicate ids are a `400` before any change); audited as `config_compliance`; returns the re-evaluated `compliance.Report` ([#11080](https://github.com/hivecommons/hive/issues/11080)) | `pkg/dashboard/api.go:548` | | `GET`/`PUT` | `/api/config/chat/config-assist` | Owner only | Settings → Features → Chat → Config assist panel: GET returns `enabled`, `model`, `fallback_model` (`chat.grounded_answers.model`) and `runner_attached`; PUT `{"enabled": bool, "model": string}` sets `chat.config_assist.enabled` (default off) and `chat.config_assist.model` (empty clears it, falling back to `chat.grounded_answers.model`, then the reviewer model; [#20092](https://github.com/hivecommons/hive/issues/20092)); an absent key leaves it unchanged; `400` for a model id with whitespace or over 200 characters; audited as `config_chat_assist` with before/after values; `409` when the hive has no config source path to persist it ([#19979](https://github.com/hivecommons/hive/issues/19979), [RFC #19788](https://github.com/hivecommons/hive/blob/v5/docs/rfc-19788-hive-chat-config-assist.md)) | `pkg/dashboard/api.go:543` | -| `POST` | `/api/chat/config-proposals/{id}/decline` | Owner only | Dismiss on a Hive Chat config assist proposal card: removes the pending proposal (only the owner who requested it can) and audits `chat_config_declined`; `404` when it is unknown, expired or another user's. With `chat.config_assist.enabled` on, a verified owner's config-shaped chat message gets at most one checked proposal (`config_proposal` on the `/api/chat` reply) whose card opens the agent config dialog pre-filled; that dialog's Save adds `?via=chat&proposal=` to the section PUT, and the server records `via=chat` only for a stored, unexpired proposal of the same user, agent and section ([#19978](https://github.com/hivecommons/hive/issues/19978), [RFC #19788](https://github.com/hivecommons/hive/blob/v5/docs/rfc-19788-hive-chat-config-assist.md)) | `pkg/dashboard/api.go:550` | -| `POST` | `/api/chat/config-proposals/{id}/undo` | Owner only | Undo on an applied Hive Chat config assist card ([#19985](https://github.com/hivecommons/hive/issues/19985)): returns a reverse proposal (`config_proposal` with `reverses`) built from the applied proposal's before value, or from its `chat_config_proposed` audit line after a restart, bound to the section as it is now; nothing is written until the card applies it. `403` with `chat.config_assist.enabled` off, `404` when there is no applied, not yet undone proposal of this user with that id, `409` when the section changed since the Apply. The card's **Apply** (and the Undo it builds) sends the stored body to `PUT /api/config/agent/{name}/{section}` with an `X-Hive-Chat-Proposal: ` header; under the config lock the proposal must be this user's, unexpired, not already in flight or applied, for that agent and section, with the same body and an unchanged section hash, or the PUT answers `409` and changes nothing. A seed-owned key (`github`, `hub`, `variables`, `acmm_level`, `hive_id`), a secret field or anything off the chat allowlist is refused with `403`. A 2xx consumes it and audits `chat_config_applied`; any other status returns it to pending and audits `chat_config_apply_failed`; an applied Undo audits `chat_config_undo`. The applied and undo lines carry value fingerprints (`before_fp`, `after_fp`), never the values | `pkg/dashboard/api.go:553` | +| `POST` | `/api/chat/config-proposals/{id}/decline` | Owner only | Dismiss on a Hive Chat config assist proposal card: removes the pending proposal (only the owner who requested it can) and audits `chat_config_declined`; `404` when it is unknown, expired or another user's. With `chat.config_assist.enabled` on, a verified owner's config-shaped chat message gets at most one checked proposal (`config_proposal` on the `/api/chat` reply) whose card opens the agent config dialog pre-filled; that dialog's Save adds `?via=chat&proposal=` to the section PUT, and the server records `via=chat` only for a stored, unexpired proposal of the same user, agent and section ([#19978](https://github.com/hivecommons/hive/issues/19978), [RFC #19788](https://github.com/hivecommons/hive/blob/v5/docs/rfc-19788-hive-chat-config-assist.md)) | `pkg/dashboard/api.go:553` | +| `POST` | `/api/chat/config-proposals/{id}/undo` | Owner only | Undo on an applied Hive Chat config assist card ([#19985](https://github.com/hivecommons/hive/issues/19985)): returns a reverse proposal (`config_proposal` with `reverses`) built from the applied proposal's before value, or from its `chat_config_proposed` audit line after a restart, bound to the section as it is now; nothing is written until the card applies it. `403` with `chat.config_assist.enabled` off, `404` when there is no applied, not yet undone proposal of this user with that id, `409` when the section changed since the Apply. The card's **Apply** (and the Undo it builds) sends the stored body to `PUT /api/config/agent/{name}/{section}` with an `X-Hive-Chat-Proposal: ` header; under the config lock the proposal must be this user's, unexpired, not already in flight or applied, for that agent and section, with the same body and an unchanged section hash, or the PUT answers `409` and changes nothing. A seed-owned key (`github`, `hub`, `variables`, `acmm_level`, `hive_id`), a secret field or anything off the chat allowlist is refused with `403`. A 2xx consumes it and audits `chat_config_applied`; any other status returns it to pending and audits `chat_config_apply_failed`; an applied Undo audits `chat_config_undo`. The applied and undo lines carry value fingerprints (`before_fp`, `after_fp`), never the values | `pkg/dashboard/api.go:556` | -| `GET` | `/api/config/governor/threshold-scaling` | Owner only | Governor Threshold Scaling Get | `pkg/dashboard/api.go:214` | -| `PUT` | `/api/config/governor/threshold-scaling` | Owner only | Governor Threshold Scaling Set | `pkg/dashboard/api.go:215` | -| `PUT` | `/api/config/governor/coverage-target` | Owner only | Governor Coverage Target | `pkg/dashboard/api.go:216` | -| `POST` | `/api/config/governor/budget/reset` | Owner only | Governor Budget Reset | `pkg/dashboard/api.go:219` | -| `PUT` | `/api/config/governor/watchdog` | Owner only | Governor Watchdog | `pkg/dashboard/api.go:224` | -| `GET` | `/api/config/escalation` | Owner only | Escalation Config Get | `pkg/dashboard/api.go:227` | -| `PUT` | `/api/config/escalation` | Owner only | Escalation Config Set | `pkg/dashboard/api.go:228` | -| `GET` | `/api/config/write-surface` | Owner only | Lane write allowlist (`write_surface.allowlist`, [#9587](https://github.com/hivecommons/hive/issues/9587)): `allowlist`, `ops`, `warnings` | `pkg/dashboard/api.go:541` | -| `PUT` | `/api/config/write-surface` | Owner only | Replace the lane write allowlist; `{"allowlist": {}}` clears it; unknown operation or bad lane name is a 400 with nothing changed | `pkg/dashboard/api.go:542` | -| `GET` | `/api/config/reference-repos` | Owner only | `project.reference_repos` ([#18136](https://github.com/hivecommons/hive/issues/18136)): `reference_repos` (`{repo, write, write_token_file}` plus `derived_from` on a derived entry and, on every write entry, `credential_state`, `credential_reason` and `credential_login`, the GitHub account the writes appear under ([#18197](https://github.com/hivecommons/hive/issues/18197)), plus `credential_identity` (`bot`, `owner` or `token_file`) and `credential_note`, the one-line why ([#18516](https://github.com/hivecommons/hive/issues/18516)); always an array), `write_kinds`, `write_identity` (`project.remote_write_identity` with the default applied), `write_identities` and `bot_login` (the App bot login, when known) | `pkg/dashboard/api.go:580` | -| `PUT` | `/api/config/reference-repos` | Owner only | Replace `project.reference_repos`; `{"reference_repos": []}` clears it. Refused with a 400 and nothing changed when the config loader would reject the list (bare name, repo also in `project.repos`, duplicate, unknown write kind, token file without write) or when a write entry has no credential boot would accept — the same message boot exits 22 with — or when an entry carries a `write_token_file` the config file does not already hold for that repo (the path is operator-only; a dashboard write opt-in writes as the hive owner's connected GitHub account). Entries with `derived_from` ([#18139](https://github.com/hivecommons/hive/issues/18139)) are the request issue's grant: echo them back as served; changing one's write set, leaving one out, sending one the hive did not derive or adding a hand-written entry for the same repo is a 409 naming the issue to change instead ([#18161](https://github.com/hivecommons/hive/issues/18161)). They are never stored: the saved list holds the hand-written entries and the derived set is merged back in memory after the save. 500 when the file could not be written (proxy restored, nothing changed). On success the GitHub proxy's reference policies are replaced without a restart; audited as `config_reference_repos` | `pkg/dashboard/api.go:581` | -| `PUT` | `/api/config/reference-repos/write-identity` | Owner only | Set `project.remote_write_identity` ([#18516](https://github.com/hivecommons/hive/issues/18516)): body `{"write_identity": "bot"}`, one of `bot`, `bot_only`, `owner`. 400 on an unknown value, or when a hand-written write entry would have no credential under the new value (the message boot exits 22 with); nothing is stored then. 500 when the file could not be written. On success the reference repos are re-resolved before the response, which is the same body as `GET /api/config/reference-repos`; audited as `config_remote_write_identity` with `previous` and `write_identity` | `pkg/dashboard/api.go:591` | -| `GET` | `/api/config/repos/parent-autoclose` | Owner only | `repos..parent_autoclose` for every monitored repo: the effective value (`true`, `epics_too`, `trackers_too` or `false`), whether the repo carries its own, the default and the four options the Settings editor offers ([#19070](https://github.com/hivecommons/hive/issues/19070)) | `pkg/dashboard/api.go:583` | -| `PUT` | `/api/config/repos/parent-autoclose` | Owner only | Set one monitored repo's parent auto-close policy: `{"repo": "owner/name", "value": "true" \| "epics_too" \| "trackers_too" \| "false"}`. `true` is the default and clears the override. 400 for a missing repo or an invalid value, 404 for a repo that is not monitored, 500 when the file could not be written (previous value restored). Applies without a restart; audited as `config_repo_parent_autoclose`. Parents a person reopened and tracking issues are never auto-closed under any value | `pkg/dashboard/api.go:584` | -| `GET` | `/api/config/review-feedback/rules` | Owner only | Reviewer-stated rule capture settings ([#19135](https://github.com/hivecommons/hive/issues/19135)): `enabled`, `trusted_associations`, `extra_phrases` and `disabled_signals`, each with `saved`, `effective`, `source` (`settings`, `env` or `default`), `default`, `env_var` and `yaml_key`; plus `associations`, `signals` (built-in signal names with examples) and `max_phrases` | `pkg/dashboard/api.go:586` | -| `PUT` | `/api/config/review-feedback/rules` | Owner only | Replace `review_feedback.rules.*`: `{"enabled": bool, "trusted_associations": [], "extra_phrases": [], "disabled_signals": []}`; an absent or null field clears that saved value (back to its env var, then the default). 400 with nothing changed for an unknown association or signal, a phrase under 3 or over 80 characters, or more than 20 phrases; 500 when the file could not be written (previous values restored). Applies on the review-feedback sweep's next pass without a restart; audited as `config_review_feedback_rules` | `pkg/dashboard/api.go:587` | -| `GET` | `/api/config/review-feedback/retry` | Owner only | Stranded review-feedback retry settings ([#19320](https://github.com/hivecommons/hive/issues/19320)): `max_retries` and `backoff`, each with `saved`, `effective`, `source` (`settings`, `env` or `default`), `default`, `env_var` and `yaml_key`; plus `max_max_retries` and `min_backoff` | `pkg/dashboard/api.go:588` | -| `PUT` | `/api/config/review-feedback/retry` | Owner only | Replace `review_feedback.retry.*`: `{"max_retries": 2, "backoff": "1h"}`; an absent or null field clears that saved value (back to its env var, then the default). 400 with nothing changed for `max_retries` outside 0..10 or a `backoff` that is not a duration of at least 10m; 500 when the file could not be written (previous values restored). Applies on the review-feedback sweep's next pass; audited as `config_review_feedback_retry` | `pkg/dashboard/api.go:589` | -| `GET` | `/api/config/prompt-sources` | Owner only | Repo-sourced prompt and definition gate ([#18490](https://github.com/hivecommons/hive/issues/18490)): `repos` (one row per managed repo, then any owner approval whose repo is no longer managed, each `{repo, managed, owner_approved, seed_allowed, allowed, approved_by, approved_at}`), `seed_enabled`, `seed_allowlist`, `trust_notice`, `seed_only_note` | `pkg/dashboard/api.go:604` | -| `PUT` | `/api/config/prompt-sources/owner-repos` | Owner only | `{"repo": "org/name", "allowed": true, "acknowledge_trust": true}` approves one of the hive's managed repos as a `prompt_source` / `definition_source` repo; `"allowed": false` revokes. 400 with nothing changed for a repo outside `project.repos` (still needs the seed edit), a malformed slug, or an approval without `acknowledge_trust: true`. Persisted to `variables.security.owner_github_prompt_repos` in the running config; audited as `config_prompt_source_repo`. Responds with the GET body | `pkg/dashboard/api.go:605` | -| `GET` | `/api/config/review` | Dashboard auth/session | Review Config Get | `pkg/dashboard/api.go:231` | -| `PUT` | `/api/config/review` | Owner only | Review Config Set | `pkg/dashboard/api.go:234` | -| `PUT` | `/api/config/governor/features` | Owner only | Governor Features | `pkg/dashboard/api.go:240` | -| `GET` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Get | `pkg/dashboard/api.go:241` | -| `PUT` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Set | `pkg/dashboard/api.go:242` | -| `GET` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Get | `pkg/dashboard/api.go:246` | -| `PUT` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Set | `pkg/dashboard/api.go:247` | +| `GET` | `/api/config/governor/threshold-scaling` | Owner only | Governor Threshold Scaling Get | `pkg/dashboard/api.go:217` | +| `PUT` | `/api/config/governor/threshold-scaling` | Owner only | Governor Threshold Scaling Set | `pkg/dashboard/api.go:218` | +| `PUT` | `/api/config/governor/coverage-target` | Owner only | Governor Coverage Target | `pkg/dashboard/api.go:219` | +| `POST` | `/api/config/governor/budget/reset` | Owner only | Governor Budget Reset | `pkg/dashboard/api.go:222` | +| `PUT` | `/api/config/governor/watchdog` | Owner only | Governor Watchdog | `pkg/dashboard/api.go:227` | +| `GET` | `/api/config/escalation` | Owner only | Escalation Config Get | `pkg/dashboard/api.go:230` | +| `PUT` | `/api/config/escalation` | Owner only | Escalation Config Set | `pkg/dashboard/api.go:231` | +| `GET` | `/api/config/write-surface` | Owner only | Lane write allowlist (`write_surface.allowlist`, [#9587](https://github.com/hivecommons/hive/issues/9587)): `allowlist`, `ops`, `warnings` | `pkg/dashboard/api.go:544` | +| `PUT` | `/api/config/write-surface` | Owner only | Replace the lane write allowlist; `{"allowlist": {}}` clears it; unknown operation or bad lane name is a 400 with nothing changed | `pkg/dashboard/api.go:545` | +| `GET` | `/api/config/reference-repos` | Owner only | `project.reference_repos` ([#18136](https://github.com/hivecommons/hive/issues/18136)): `reference_repos` (`{repo, write, write_token_file}` plus `derived_from` on a derived entry and, on every write entry, `credential_state`, `credential_reason` and `credential_login`, the GitHub account the writes appear under ([#18197](https://github.com/hivecommons/hive/issues/18197)), plus `credential_identity` (`bot`, `owner` or `token_file`) and `credential_note`, the one-line why ([#18516](https://github.com/hivecommons/hive/issues/18516)); always an array), `write_kinds`, `write_identity` (`project.remote_write_identity` with the default applied), `write_identities` and `bot_login` (the App bot login, when known) | `pkg/dashboard/api.go:583` | +| `PUT` | `/api/config/reference-repos` | Owner only | Replace `project.reference_repos`; `{"reference_repos": []}` clears it. Refused with a 400 and nothing changed when the config loader would reject the list (bare name, repo also in `project.repos`, duplicate, unknown write kind, token file without write) or when a write entry has no credential boot would accept — the same message boot exits 22 with — or when an entry carries a `write_token_file` the config file does not already hold for that repo (the path is operator-only; a dashboard write opt-in writes as the hive owner's connected GitHub account). Entries with `derived_from` ([#18139](https://github.com/hivecommons/hive/issues/18139)) are the request issue's grant: echo them back as served; changing one's write set, leaving one out, sending one the hive did not derive or adding a hand-written entry for the same repo is a 409 naming the issue to change instead ([#18161](https://github.com/hivecommons/hive/issues/18161)). They are never stored: the saved list holds the hand-written entries and the derived set is merged back in memory after the save. 500 when the file could not be written (proxy restored, nothing changed). On success the GitHub proxy's reference policies are replaced without a restart; audited as `config_reference_repos` | `pkg/dashboard/api.go:584` | +| `PUT` | `/api/config/reference-repos/write-identity` | Owner only | Set `project.remote_write_identity` ([#18516](https://github.com/hivecommons/hive/issues/18516)): body `{"write_identity": "bot"}`, one of `bot`, `bot_only`, `owner`. 400 on an unknown value, or when a hand-written write entry would have no credential under the new value (the message boot exits 22 with); nothing is stored then. 500 when the file could not be written. On success the reference repos are re-resolved before the response, which is the same body as `GET /api/config/reference-repos`; audited as `config_remote_write_identity` with `previous` and `write_identity` | `pkg/dashboard/api.go:594` | +| `GET` | `/api/config/repos/parent-autoclose` | Owner only | `repos..parent_autoclose` for every monitored repo: the effective value (`true`, `epics_too`, `trackers_too` or `false`), whether the repo carries its own, the default and the four options the Settings editor offers ([#19070](https://github.com/hivecommons/hive/issues/19070)) | `pkg/dashboard/api.go:586` | +| `PUT` | `/api/config/repos/parent-autoclose` | Owner only | Set one monitored repo's parent auto-close policy: `{"repo": "owner/name", "value": "true" \| "epics_too" \| "trackers_too" \| "false"}`. `true` is the default and clears the override. 400 for a missing repo or an invalid value, 404 for a repo that is not monitored, 500 when the file could not be written (previous value restored). Applies without a restart; audited as `config_repo_parent_autoclose`. Parents a person reopened and tracking issues are never auto-closed under any value | `pkg/dashboard/api.go:587` | +| `GET` | `/api/config/review-feedback/rules` | Owner only | Reviewer-stated rule capture settings ([#19135](https://github.com/hivecommons/hive/issues/19135)): `enabled`, `trusted_associations`, `extra_phrases` and `disabled_signals`, each with `saved`, `effective`, `source` (`settings`, `env` or `default`), `default`, `env_var` and `yaml_key`; plus `associations`, `signals` (built-in signal names with examples) and `max_phrases` | `pkg/dashboard/api.go:589` | +| `PUT` | `/api/config/review-feedback/rules` | Owner only | Replace `review_feedback.rules.*`: `{"enabled": bool, "trusted_associations": [], "extra_phrases": [], "disabled_signals": []}`; an absent or null field clears that saved value (back to its env var, then the default). 400 with nothing changed for an unknown association or signal, a phrase under 3 or over 80 characters, or more than 20 phrases; 500 when the file could not be written (previous values restored). Applies on the review-feedback sweep's next pass without a restart; audited as `config_review_feedback_rules` | `pkg/dashboard/api.go:590` | +| `GET` | `/api/config/review-feedback/retry` | Owner only | Stranded review-feedback retry settings ([#19320](https://github.com/hivecommons/hive/issues/19320)): `max_retries` and `backoff`, each with `saved`, `effective`, `source` (`settings`, `env` or `default`), `default`, `env_var` and `yaml_key`; plus `max_max_retries` and `min_backoff` | `pkg/dashboard/api.go:591` | +| `PUT` | `/api/config/review-feedback/retry` | Owner only | Replace `review_feedback.retry.*`: `{"max_retries": 2, "backoff": "1h"}`; an absent or null field clears that saved value (back to its env var, then the default). 400 with nothing changed for `max_retries` outside 0..10 or a `backoff` that is not a duration of at least 10m; 500 when the file could not be written (previous values restored). Applies on the review-feedback sweep's next pass; audited as `config_review_feedback_retry` | `pkg/dashboard/api.go:592` | +| `GET` | `/api/config/prompt-sources` | Owner only | Repo-sourced prompt and definition gate ([#18490](https://github.com/hivecommons/hive/issues/18490)): `repos` (one row per managed repo, then any owner approval whose repo is no longer managed, each `{repo, managed, owner_approved, seed_allowed, allowed, approved_by, approved_at}`), `seed_enabled`, `seed_allowlist`, `trust_notice`, `seed_only_note` | `pkg/dashboard/api.go:607` | +| `PUT` | `/api/config/prompt-sources/owner-repos` | Owner only | `{"repo": "org/name", "allowed": true, "acknowledge_trust": true}` approves one of the hive's managed repos as a `prompt_source` / `definition_source` repo; `"allowed": false` revokes. 400 with nothing changed for a repo outside `project.repos` (still needs the seed edit), a malformed slug, or an approval without `acknowledge_trust: true`. Persisted to `variables.security.owner_github_prompt_repos` in the running config; audited as `config_prompt_source_repo`. Responds with the GET body | `pkg/dashboard/api.go:608` | +| `GET` | `/api/config/review` | Dashboard auth/session | Review Config Get | `pkg/dashboard/api.go:234` | +| `PUT` | `/api/config/review` | Owner only | Review Config Set | `pkg/dashboard/api.go:237` | +| `PUT` | `/api/config/governor/features` | Owner only | Governor Features | `pkg/dashboard/api.go:243` | +| `GET` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Get | `pkg/dashboard/api.go:244` | +| `PUT` | `/api/config/governor/general-advanced` | Owner only | Governor General Advanced Set | `pkg/dashboard/api.go:245` | +| `GET` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Get | `pkg/dashboard/api.go:249` | +| `PUT` | `/api/config/auto-merge` | Owner only | Auto-Merge Config Set | `pkg/dashboard/api.go:250` | | `PATCH` | `/api/config/auto-merge` | Owner only | Partially update auto-merge settings, including nested `merge_train`; omitted fields stay unchanged; returns effective settings and bot-author metadata | `pkg/dashboard/api_config_automerge.go` | -| `GET` | `/api/config/convergence` | Owner only | Convergence Config Get | `pkg/dashboard/api.go:253` | -| `PUT` | `/api/config/convergence` | Owner only | Convergence Config Set | `pkg/dashboard/api.go:255` | -| `GET` | `/api/config/governor/advisory` | Owner only | Governor Advisory Get | `pkg/dashboard/api.go:259` | -| `PUT` | `/api/config/governor/advisory` | Owner only | Governor Advisory Set | `pkg/dashboard/api.go:260` | -| `GET` | `/api/config/governor/replan` | Owner only | Governor Replan Get | `pkg/dashboard/api.go:261` | -| `PUT` | `/api/config/governor/replan` | Owner only | Governor Replan Set | `pkg/dashboard/api.go:262` | -| `GET` | `/api/config/governor/work-source` | Owner only | Governor Work Source Get (Jira secrets/TLS fields reported as set/unset only) | `pkg/dashboard/api.go:272` | -| `PUT` | `/api/config/governor/work-source` | Owner only | Governor Work Source Set (including Jira Data Center TLS settings) | `pkg/dashboard/api.go:273` | -| `PUT` | `/api/config/governor/security` | Owner only | Governor Security | `pkg/dashboard/api.go:274` | -| `GET` | `/api/config/governor/project-observability` | Owner only | Governor Project Observability Get | `pkg/dashboard/api.go:275` | -| `PUT` | `/api/config/governor/project-observability` | Owner only | Governor Project Observability Set | `pkg/dashboard/api.go:276` | -| `GET` | `/api/config/governor/inference-auth` | Owner only | Governor Inference Auth Get | `pkg/dashboard/api.go:291` | -| `PUT` | `/api/config/governor/inference-auth` | Owner only | Governor Inference Auth Set | `pkg/dashboard/api.go:292` | +| `GET` | `/api/config/convergence` | Owner only | Convergence Config Get | `pkg/dashboard/api.go:256` | +| `PUT` | `/api/config/convergence` | Owner only | Convergence Config Set | `pkg/dashboard/api.go:258` | +| `GET` | `/api/config/governor/advisory` | Owner only | Governor Advisory Get | `pkg/dashboard/api.go:262` | +| `PUT` | `/api/config/governor/advisory` | Owner only | Governor Advisory Set | `pkg/dashboard/api.go:263` | +| `GET` | `/api/config/governor/replan` | Owner only | Governor Replan Get | `pkg/dashboard/api.go:264` | +| `PUT` | `/api/config/governor/replan` | Owner only | Governor Replan Set | `pkg/dashboard/api.go:265` | +| `GET` | `/api/config/governor/work-source` | Owner only | Governor Work Source Get (Jira secrets/TLS fields reported as set/unset only) | `pkg/dashboard/api.go:275` | +| `PUT` | `/api/config/governor/work-source` | Owner only | Governor Work Source Set (including Jira Data Center TLS settings) | `pkg/dashboard/api.go:276` | +| `PUT` | `/api/config/governor/security` | Owner only | Governor Security | `pkg/dashboard/api.go:277` | +| `GET` | `/api/config/governor/project-observability` | Owner only | Governor Project Observability Get | `pkg/dashboard/api.go:278` | +| `PUT` | `/api/config/governor/project-observability` | Owner only | Governor Project Observability Set | `pkg/dashboard/api.go:279` | +| `GET` | `/api/config/governor/inference-auth` | Owner only | Governor Inference Auth Get | `pkg/dashboard/api.go:294` | +| `PUT` | `/api/config/governor/inference-auth` | Owner only | Governor Inference Auth Set | `pkg/dashboard/api.go:295` | ## Workflow models @@ -160,7 +160,7 @@ Workflow-model library, bindings, ingest, editor and marketplace routes ([#17620 | `POST` | `/api/workflows/dispatch` | Owner only | Send a model-owned item to its agent profile: the stage tracker's **Send to *profile*** on a row whose bound model hands its current state to a profile ([cncf/techdocs#395](https://github.com/cncf/techdocs/issues/395): Accepted → `techdocs-drafter`, Drafting → `techdocs-verifier`). Body `{repo, number}`. Reads the item fresh, resolves the agent (`workflow.dispatch.profiles..agent`, then the default order ending at the hive's issue worker or reviewer, at every step only an agent whose mode lets it do what the profile needs, [#18749](https://github.com/hivecommons/hive/issues/18749); a profile disabled for automatic dispatch still resolves), takes the agent claim on an issue first, kicks the agent, and records the hand-off as pending once the kick lands so the automatic pass does not repeat it; a later pass marks it not started if the agent declines or ends its turn without the deliverable. Returns `{status: "sent", ref, model, state, profile, agent, result}`. Audited `workflow_dispatch`; `404` when the model does not hand the state to a profile, `409` when no agent fills it (the message gives the reason, for example that no agent on the hive may open pull requests in the repository, and names the Settings → Repos picker), someone else holds the claim, or the agent is busy | `pkg/dashboard/api_workflows.go:30` | | `PUT` | `/api/workflows/dispatch/profiles` | Owner only | Pick the hive agent a bound model's profile is handed to ([#18690](https://github.com/hivecommons/hive/issues/18690)): the agent picker on a repository's workflow row in Settings → Repos. Body `{profile, agent}`; an empty `agent` clears the pin so the profile resolves by default again. Persists `workflow.dispatch.profiles..agent` in `hive.yaml` (the profile's `prompt_template` and `disabled` are kept); the next scheduler pass reads the live config, so no restart is needed. `agent` must be an enabled agent that is not a replica (`400` otherwise). Returns `{changed, profile, agent, dispatch, agents}`, where `dispatch` lists every bound repository's profiles as `{repo, profile, agent, source, mode, needs, pinned, disabled, problem, states, candidates, not_started}` (`problem` is why nothing fills the profile, including a pin to an agent whose mode does not let it do the profile's work; `candidates` lists each pinnable agent as `{agent, mode, qualifies, reason}`; `not_started` lists the hand-offs an agent declined or did not act on while their item still waits, as `{ref, repo, number, profile, state, agent, reason, at, attempts, retrying, next, reason_at, reason_age, reason_session, stale, max_attempts, last_output?, same_agent_retry_at?, parked_at?}` (`reason_at`, `reason_age` and `reason_session` say when and in which hand-off session the reason was decided, and `stale` is true once a newer hand-off of the item exists, so the reason is history and not the item's state now, [#18916](https://github.com/hivecommons/hive/issues/18916)), [#18749](https://github.com/hivecommons/hive/issues/18749)) and `agents` the agents that can be picked; `GET /api/workflows` and `PUT /api/workflows/bindings` carry the same two fields. Audited `workflow_dispatch_agent` | `pkg/dashboard/api_workflows.go:31` | | `PUT` | `/api/workflows/dispatch/retry` | Owner only | Set how often a workflow hand-off that was not started is made again ([#20877](https://github.com/hivecommons/hive/issues/20877)): the **Hand-off retries** row under the workflow dispatch profiles in Settings → Repos. Body `{max_attempts, cooldown_s, max_cooldown_s}`; a zero or missing field means the default (3 attempts in all, 1800 s, 14400 s). When no other agent qualifies, the item goes back to the same agent after `cooldown_s`, doubling per attempt up to `max_cooldown_s`, never while the agent is paused or the item carries a hold or `needs-human` label; after `max_attempts` the item is labeled `needs-human` with one comment. Persists `workflow.dispatch.handoff_retry` in `hive.yaml`; the next scheduler pass reads the live config. `400` when a value is out of bounds (`max_attempts` 0 to 10, waits 0 to 604800 s). Returns `{changed, handoff_retry, dispatch}`, where `handoff_retry` is `{max_attempts?, cooldown_s?, max_cooldown_s?, effective, defaults, limits}` (the last three each `{max_attempts, cooldown_s, max_cooldown_s}`); `GET /api/workflows` carries the same `handoff_retry`. Audited `workflow_handoff_retry` | `pkg/dashboard/api_workflows.go:40` | -| `PUT` | `/api/workflows/sticky-label-removal` | Owner only | Turn `workflow.sticky_label_removal` on or off ([#20979](https://github.com/hivecommons/hive/issues/20979)): whether a whose-turn label a person removes stays off until the item's state changes or a new commit lands. Body `{"enabled": true\|false}`; returns `{changed, sticky_label_removal}`. Saved to hive.yaml, audited as `workflow_sticky_label_removal`, applied on the next pass. | +| `PUT` | `/api/workflows/sticky-label-removal` | Owner only | Turn `workflow.sticky_label_removal` on or off ([#20979](https://github.com/hivecommons/hive/issues/20979)): whether a whose-turn label a person removes stays off until the item's state changes or a new commit lands, whichever comes first (the setting is a boolean with no mode). Body `{"enabled": true\|false}`; returns `{changed, sticky_label_removal}`. Saved to hive.yaml, audited as `workflow_sticky_label_removal`, applied on the next pass. | | `GET` | `/api/workflows/{name}/{version}` | Dashboard auth/session | One stored model. No body. Returns `{entry, model, profile?}`; `profile` is present when the model compiles. `404` unknown model or version | `pkg/dashboard/api_workflows.go:32` | | `PUT` | `/api/workflows/{name}/{version}` | Owner only | Save a model at an exact version. Body is a model whose `metadata.name` and `spec.meta.version` must match the path (`400` otherwise). Returns `201 {entry}`. Audited `workflow_save`; `403` on `hive-default` | `pkg/dashboard/api_workflows.go:33` | | `DELETE` | `/api/workflows/{name}/{version}` | Owner only | Delete a stored model version. No body. Returns `{ok: true}`. Audited `workflow_delete`; `409` while a repository is bound to it, `403` on `hive-default`, `404` unknown | `pkg/dashboard/api_workflows.go:34` | diff --git a/docs/content/hive/api-reference/cost-tokens-telemetry.md b/docs/content/hive/api-reference/cost-tokens-telemetry.md index c14210c4..ad52215e 100644 --- a/docs/content/hive/api-reference/cost-tokens-telemetry.md +++ b/docs/content/hive/api-reference/cost-tokens-telemetry.md @@ -11,12 +11,13 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | `GET` | `/api/token-access` | Dashboard auth/session | Token Access | `pkg/dashboard/api.go:153` | | `GET` | `/api/tokens` | Dashboard auth/session | Tokens | `pkg/dashboard/api.go:154` | | `GET` | `/api/cost` | Dashboard auth/session | Cost; `merged_prs` / `closed_issues` come from the webhook-incremented ForgeState counters reconciled hourly against search, with `count_stale`, `count_stale_since` and `count_source` (`forgestate` / `search`) when last-good counts are being served (#13376), `count_partial` when only some configured repos have an attributed baseline yet, and `count_error` naming why the latest attributed refresh failed or was partial (the reconcile asks GitHub about a budgeted slice of repos per pass so a many-repo hive stays inside search's rate limit); `daily_rollup` lists per-UTC-day estimated spend (`day`, `cost_usd`, `input_tokens`, `output_tokens`, `samples`) kept for ~2 years so the Cost chart can reach past the 30-day snapshot ring; `recording` reports `agent_models`, `unrecorded_models`, `recent_models`, `last_priced_growth_at`, `last_agent_model_growth_at`, `stale_after_ms` and `stale` so the card can flag stale live usage recording (#13485); every `estimated.by_model[]` row carries `canonical_model` (`modelfamily.Canonical` of its `name`, the id PRs-by-model and run stats group by), while spend stays one row per raw model because prices are per raw model (#18718) | `pkg/dashboard/api.go:155` | +| `GET` | `/api/cost/reconcile` | Dashboard auth/session | ADR-0027 P4 read-only wire-versus-transcript reconciliation report (#21096). Per agent and per model: `wire_tokens`, `transcript_tokens`, `delta_tokens` (wire minus transcript), the same three as list-price costs, `wire_requests`, `transcript_sessions`, `winners` per source and `buckets` per reason (`wire_only_no_transcript`, `transcript_only_no_wire`, `reconciled_request_id`, `window_overlap_transcript_wins`, `duplicate_request_id_dropped`, `unattributed`), plus `billing_basis: unknown`, `cost_basis: list_price_estimate` and `unknown_price_models`; an absent measurement is `null`, never zero. Diagnostic only: changes no total, gates nothing. 404 unless `tokens.wire_ledger.enabled` is on and the ledger exists | `pkg/dashboard/api.go:158` | | `GET` | `/api/repo-activity` | Dashboard auth/session | Per-repo audited activity | `pkg/dashboard/api.go` | -| `GET` | `/api/repo-cost` | Dashboard auth/session | Per-repo estimated token cost (interval join, cached) | `pkg/dashboard/api.go` | +| `GET` | `/api/repo-cost` | Dashboard auth/session | Per-repo estimated token cost (interval join, cached), with `unattributed`, `backend_unsupported` and `wire_only` (agent-level wire usage, no PR attribution) buckets | `pkg/dashboard/api.go` | | `GET` | `/api/launch-cost` | Dashboard auth/session | Per-issue / PR / head-SHA estimated token cost from kick launch attribution (cached; `?ref=owner/repo#N` narrows) | `pkg/dashboard/api.go` | | `GET` | `/api/launch-cost/history` | Dashboard auth/session | Daily per-ref rollup of launch attribution (`daily_rollup[]`: `day`, `by_ref[]` with `ref`, `kind`, `launches`, `share_usd`), kept ~2 years on the `/data` PVC so cost per PR can be measured past the `/api/launch-cost` window | `pkg/dashboard/api.go` | -| `GET` | `/api/cost/history` | Dashboard auth/session | Cost History | `pkg/dashboard/api.go:161` | -| `GET` | `/api/trend/history` | Dashboard auth/session | Trend History | `pkg/dashboard/api.go:164` | -| `GET` | `/api/timeseries` | Dashboard auth/session | Time Series | `pkg/dashboard/api.go:166` | -| `GET` | `/api/providers/headroom` | Owner only | Last stored per-provider usage readings (`providers[]` with `limits[]`, `captured_at`, `stale`, `probe_error_cause`, `plan_type` when a provider reports one, and for Claude `extra_usage` when reported: `enabled`, `used_minor`, `limit_minor`, `exponent`, `currency`, `spend_limit_reached`, each left out when unknown), from provider rotation or the default publish-only reading, plus `used_by`: per provider, the enabled agents whose backend spends its plan; serving it never triggers a new measurement. Feeds the Overview usage gauge and the rotation settings table | `pkg/dashboard/api.go:67` | -| `GET` | `/api/budget/history` | Dashboard auth/session | Budget History | `pkg/dashboard/api.go:163` | +| `GET` | `/api/cost/history` | Dashboard auth/session | Cost History | `pkg/dashboard/api.go:164` | +| `GET` | `/api/trend/history` | Dashboard auth/session | Trend History | `pkg/dashboard/api.go:167` | +| `GET` | `/api/timeseries` | Dashboard auth/session | Time Series | `pkg/dashboard/api.go:169` | +| `GET` | `/api/providers/headroom` | Write access (owner, merger, read-write) | Last stored per-provider usage readings (`providers[]` with `limits[]`, `captured_at`, `stale`, `probe_error_cause`, `plan_type` when a provider reports one, and for Claude `extra_usage` when reported: `enabled`, `used_minor`, `limit_minor`, `exponent`, `currency`, `spend_limit_reached`, each left out when unknown), from provider rotation or the default publish-only reading, plus `used_by`: per provider, the enabled agents whose backend spends its plan; serving it never triggers a new measurement. Feeds the Overview usage gauge and the rotation settings table | `pkg/dashboard/api.go:67` | +| `GET` | `/api/budget/history` | Dashboard auth/session | Budget History | `pkg/dashboard/api.go:166` | diff --git a/docs/content/hive/api-reference/dashboard-misc.md b/docs/content/hive/api-reference/dashboard-misc.md index 9e7b8d56..8a970f54 100644 --- a/docs/content/hive/api-reference/dashboard-misc.md +++ b/docs/content/hive/api-reference/dashboard-misc.md @@ -63,7 +63,7 @@ review are settled. | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| | `GET` | `/api/audit` | Read-write role | Audit Log — `{"entries": [...]}` envelope, newest first, capped at 200; response shape and the serve-time `user_name` field in [audit-log.md](https://github.com/hivecommons/hive/blob/v5/src/docs/audit-log.md#get-apiaudit) | `pkg/dashboard/api.go:66` | -| `GET` | `/api/watchdog/activity` | Read-write role | Watchdog activity readout for the Health tab (#7254): `watchdog-*` audit actions over `?days=` (default 30, clamped to 90) — total / taken / observed / `byAction`, a zero-filled per-day `daily` histogram, per-agent `agents` liveness, and the Observe → Heal `promotion` hint; see [agent-watchdog.md](/docs/hive/operations/agent-and-governor-controls/agent-watchdog#watchdog-activity-strip) | `pkg/dashboard/api.go:514` | +| `GET` | `/api/watchdog/activity` | Read-write role | Watchdog activity readout for the Health tab (#7254): `watchdog-*` audit actions over `?days=` (default 30, clamped to 90) — total / taken / observed / `byAction`, a zero-filled per-day `daily` histogram, per-agent `agents` liveness, and the Observe → Heal `promotion` hint; see [agent-watchdog.md](/docs/hive/operations/agent-and-governor-controls/agent-watchdog#watchdog-activity-strip) | `pkg/dashboard/api.go:517` | | `GET` | `/api/ioscan/classifier-outcomes` | Read-write role | Input classifier outcome counts for the Input Defense card (#20765): `ioscan_classifier` audit entries over `?hours=` (default 24, clamped to the audit log's 90 day retention; `400` for a non-positive value) as `total`, `scored` with `scoredByAction`, `skippedCallLimit` (`budget_exhausted`), `skippedDailyQuota`, `failed` with `failedClosed` and `failedByCause` (`timeout`, `http_`, `invalid_reply`, `no_endpoint`, `pass_stopped`, `error`, or `unrecorded` for entries older than the `error=` field), and `other`; see [ioscan.md](/docs/hive/security/ioscan) | `pkg/dashboard/api_ioscan_classifier_outcomes.go:65` | | `GET` | `/api/session-taint` | Owner only | Read-only view of the observe-only [session taint](https://github.com/hivecommons/hive/blob/v5/src/docs/design/session-taint.md) store (#20799): `sessions` (agent and labels, each with `kind`, `origin` id, `source` and `first_seen`, most recently touched first), `recent` would-act decisions (oldest first), `would_act` counts per rule and the observer counters. No clear or release action. With `session_taint.enabled` off it answers `{"enabled":false,"status":"disabled",...}` with empty lists. Never carries credential, body or file content. Also `hivectl observe session-taint` | `pkg/dashboard/api_session_taint.go:76` | | `GET` | `/api/ask/status` | Dashboard auth/session | Ask AI help status for the signed-in person (`enabled`, `text_version`, `disclosure`, `consented`, `docs_url`, `ai_label`); `404` unless `ask.enabled` is on and configured. See [Ask AI help](/docs/hive/ask-ai-help) | `pkg/dashboard/api.go:85` | @@ -85,35 +85,35 @@ review are settled. | `GET` | `/api/pr-throughput` | Dashboard auth/session | Throughput: pull/merge requests and issues across tracked forges. Counts hive-created PRs/issues, hive/observed reviews, observed PR merges/closures, and issue closes over `?hours=N` (default 24, capped at audit retention; `hours=0` = all time from durable counters in `/data/pr-throughput-counters.json`) with optional exact case-insensitive `?repo=owner/name` and `?role=created\|reviewed\|merged` for the actor trend. The response keeps legacy `opened`/`merged`/`closed`, `merged_by_path`, `buckets`, velocity metrics, previous-window trends, top agents/repos/reasons, and `recorded_since`, and adds `by_actor` (`pr`/`issue` × `created`/`reviewed`/`merged`/`closed` × `hive`/`human`/`other`) plus `series` points (`t`, `hive`, `human`, `other`) for the selected role. | `pkg/dashboard/api.go:101` | -| `GET` | `/api/convergence/soak` | Owner only | Convergence Soak Status | `pkg/dashboard/api.go:258` | -| `POST` | `/api/plan/from-issue` | Dashboard auth/session | Plan From Issue | `pkg/dashboard/api.go:465` | -| `GET` | `/api/plan/{epicID}` | Dashboard auth/session | Plan Tree | `pkg/dashboard/api.go:468` | -| `POST` | `/api/plan/{epicID}/approve` | Owner only | Plan Approve | `pkg/dashboard/api.go:469` | -| `POST` | `/api/plan/{epicID}/reject` | Owner only | Plan Reject | `pkg/dashboard/api.go:471` | -| `POST` | `/api/plan/{epicID}/child/{childID}` | Owner only | Plan Child Action | `pkg/dashboard/api.go:472` | +| `GET` | `/api/convergence/soak` | Owner only | Convergence Soak Status | `pkg/dashboard/api.go:261` | +| `POST` | `/api/plan/from-issue` | Dashboard auth/session | Plan From Issue | `pkg/dashboard/api.go:468` | +| `GET` | `/api/plan/{epicID}` | Dashboard auth/session | Plan Tree | `pkg/dashboard/api.go:471` | +| `POST` | `/api/plan/{epicID}/approve` | Owner only | Plan Approve | `pkg/dashboard/api.go:472` | +| `POST` | `/api/plan/{epicID}/reject` | Owner only | Plan Reject | `pkg/dashboard/api.go:474` | +| `POST` | `/api/plan/{epicID}/child/{childID}` | Owner only | Plan Child Action | `pkg/dashboard/api.go:475` | | `POST` | `/api/linear/agent/install` | Owner only | Linear Agent Install (OAuth start) | `pkg/dashboard/api_linear_agent.go:215` | | `GET` | `/api/linear/agent/status` | Owner only | Linear Agent Status | `pkg/dashboard/api_linear_agent.go:216` | | `POST` | `/api/linear/agent/disconnect` | Owner only | Linear Agent Disconnect | `pkg/dashboard/api_linear_agent.go:217` | -| `GET` | `/api/upstream-watch` | Owner only | Upstream-watch divergence: per watched fork the upstream followed, the watermark and last-run time, surfaced/ported/dismissed/skipped counts, and the recent upstream refs with their upstream URL, diff URL, fork issue number and state. Read-only — it reads the config and the watch state file, never GitHub. Also carries `interval`, `project_repos` and each repo's configured entry (`config`) for the editor. | `pkg/dashboard/api.go:301` | -| `PUT` | `/api/config/upstream-watch` | Owner only | Upstream Watch Config Update: edit `upstream_watch` from the Features tab. Body `{enabled?, interval?, repos?: {: {upstream?, sources?, pr_labels?, max_issues_per_run?, label?} \| null}}` — absent keys are unchanged, `null` removes a repo, keys are stored as the bare repo name. Validated with the loader's rules before the config changes (400 on failure), then persisted and audited as `config_upstream_watch`. | `pkg/dashboard/api.go:302` | +| `GET` | `/api/upstream-watch` | Owner only | Upstream-watch divergence: per watched fork the upstream followed, the watermark and last-run time, surfaced/ported/dismissed/skipped counts, and the recent upstream refs with their upstream URL, diff URL, fork issue number and state. Read-only — it reads the config and the watch state file, never GitHub. Also carries `interval`, `project_repos` and each repo's configured entry (`config`) for the editor. | `pkg/dashboard/api.go:304` | +| `PUT` | `/api/config/upstream-watch` | Owner only | Upstream Watch Config Update: edit `upstream_watch` from the Features tab. Body `{enabled?, interval?, repos?: {: {upstream?, sources?, pr_labels?, max_issues_per_run?, label?} \| null}}` — absent keys are unchanged, `null` removes a repo, keys are stored as the bare repo name. Validated with the loader's rules before the config changes (400 on failure), then persisted and audited as `config_upstream_watch`. | `pkg/dashboard/api.go:305` | -| `GET` | `/api/hotspots` | Dashboard auth/session | Merge-hotspot advisor report (`?repo=owner/name` optional): files repeatedly touched by concurrent PRs over the last `governor.hotspot_window_days`, each with `prs` (distinct PRs), `pr_numbers`, `overlaps` (PR pairs open at the same time), `conflicts` (rebase conflicts blamed on the file), `lines`, `kind` (`code`/`doc`/`lock`/`generated`/`data`), `score`, `symbol_groups`, `recommendation` (`split-code`/`split-doc`/`split-source`/`report-only`/`none`), `reason`, `generated_from`, `source_files` (files under `generated_from`, when known), `issue_number`/`issue_url` of the modularize issue filed, `last_updated`; top-level `count`/`actionable`/`filed`. Derived from the merge train's own PR file lists and the rebase follow-through's conflict records — never lists PRs or files from GitHub. See [operator-reference.md § Merge-hotspot advisor](https://github.com/hivecommons/hive/blob/v5/src/docs/operator-reference.md#merge-hotspot-advisor-governorhotspot_). | `pkg/dashboard/api.go:560` | +| `GET` | `/api/hotspots` | Dashboard auth/session | Merge-hotspot advisor report (`?repo=owner/name` optional): files repeatedly touched by concurrent PRs over the last `governor.hotspot_window_days`, each with `prs` (distinct PRs), `pr_numbers`, `overlaps` (PR pairs open at the same time), `conflicts` (rebase conflicts blamed on the file), `lines`, `kind` (`code`/`doc`/`lock`/`generated`/`data`), `score`, `symbol_groups`, `recommendation` (`split-code`/`split-doc`/`split-source`/`report-only`/`none`), `reason`, `generated_from`, `source_files` (files under `generated_from`, when known), `issue_number`/`issue_url` of the modularize issue filed, `last_updated`; top-level `count`/`actionable`/`filed`. Derived from the merge train's own PR file lists and the rebase follow-through's conflict records — never lists PRs or files from GitHub. See [operator-reference.md § Merge-hotspot advisor](https://github.com/hivecommons/hive/blob/v5/src/docs/operator-reference.md#merge-hotspot-advisor-governorhotspot_). | `pkg/dashboard/api.go:563` | | `GET` | `/api/widget` | Dashboard auth/session | Widget | `pkg/dashboard/api.go:110` | | `GET` | `/api/pane/{agent}` | Dashboard auth/session | Pane | `pkg/dashboard/api.go:115` | | `GET` | `/api/role` | Dashboard auth/session | Role | `pkg/dashboard/api.go:129` | | `POST` | `/api/reset-restarts/{agent}` | Owner only | Reset Restarts | `pkg/dashboard/api.go:151` | -| `GET` | `/api/budget-ignore` | Dashboard auth/session | Budget Ignore Get | `pkg/dashboard/api.go:169` | -| `POST` | `/api/budget-ignore` | Owner only | Budget Ignore Set | `pkg/dashboard/api.go:170` | -| `GET` | `/api/summaries` | Dashboard auth/session | Summaries | `pkg/dashboard/api.go:182` | -| `GET` | `/api/stage-tracker` | Dashboard auth/session | Stage Tracker: every open issue and pull request of the watched repos for the Hive activity monitor — actionable, held, claimed, in-progress, covered-by-PR, filtered (`needs-*`), draft and exempt-labelled items alike, each with `stage`, `stage_since`, `labels`, `created_at`, `author_kind`, `modifiers`, `claimant: {kind: hive-agent|clanker|person, login, agent, hive, since, source: claim-ledger|claim-comment|assignee|kick-history|author}` naming who holds a claimed / in-progress issue or a PR under review or rework (absent when nobody is named; mirrored onto `linked_prs[]`), (PRs) `sentinel_alert` / `sentinel_findings` / `sentinel_reason` when the sentinel flagged the PR, `decision_needed` on a row parked on a person (085 / 045 / 015, the needs-human pill; mirrored onto the issue's `linked_prs[]` entry): `{question, asked_by, since, blocker, blocker_reason, options: [{action, label, enabled, reason_if_disabled}]}` — the reviewer's own decision question when the verdict record has one, the blocker in plain words, and the applicable actions under the row context menu's action ids (`decide:delegate` first), (PRs) `lineage` on the hive's copy of an adopted PR — `{kind: adopted|superseded|rebased-by-hive, from_number, from_url, from_author, from_author_kind, to_number, to_url, at, reason}`, derived from the stage store's adoption record or the `hive/adopt-` head branch, mirrored onto the issue's `linked_prs[]` entry; absent on every other row — and (issues) `linked_prs`; items with no stage yet report stage `0` "Open"; `needs_human_why` `{source: filed-for-help|decision-pending|level-gate|hive-hold|needs-approval|triage|author|needs-human, reason}` on every row a person must move (with `needs_human: true`; `filed_for_help` names the agent whose marker is in an unclaimed issue's body); `needs_human_labels` is the "a person must act" label set behind the monitor's Needs human facet (the same list as `/api/status.labelPresets[needs-human]`); `recently_merged` lists the PRs (`repo`, `number`, `merged_at`) whose `pr_merged` audit entry is under 30 minutes old, so a client diffing two payloads can tell a merge from a close; a PR in a conflict-aware merge train carries `merge_train` `{id, state, front, position, size, attempt, max_attempts, overlap_files, ahead, length, head_number, head_state, head_reason, head_since, eta_s, eta_at, eta_basis, late, stalled, stalled_s}` — `head_state` one of `needs-human` / `ci` / `soaking` / `ready` / `merging` / `fixing` / `unknown` with `head_reason` in plain words; `eta_s` / `eta_at` the estimated wait for this member's own merge attempt (own remaining soak + each PR ahead's remaining soak or one sweep + the next sweep tick; absent while the head waits on a person or CI), `eta_at` anchored to the member's first estimate at its position so a countdown survives polls, `eta_basis` its short reading ("2 ahead · head soaking 12m · next sweep in 40s"), `late` once now has overrun the first estimate twice over, `stalled` / `stalled_s` once the head has sat longer than `governor.merge_train_stall_warn_s` ([#15395](https://github.com/hivecommons/hive/issues/15395)); a PR the queue holds because another open PR declares the same `Fixes #N` carries no `merge_train` and a `merge_gate` of `{state: "duplicate-of:", duplicate_of, duplicate_issue}` plus the `needs-decision` modifier (the queue keeps one PR per issue: green first, then the earlier-opened); a PR GitHub reports conflicting on its own, or one under repair (stage/070, 071, 072, 074, 085, or a red required check), carries no `merge_train` and is not counted in any member's `size` / `length` — a repaired member the view dropped carries `left_train: {why: fixing|needs-author|returned-to-contributor|adopted-by-hive|needs-decision|checks-failing, note}` instead (mirrored onto the issue's `linked_prs[]` entry), and a train left with one member reports no `merge_train` at all; a PR short of the merge queue (below stage/080) the planner ordered rides no train either — it carries `overlap: {behind, with, files, note}` ("overlaps #15637 (sidebar.html, index.html) — will queue behind it") and no `merge_train`, and counts in no member's `size` — the state slugs (`front`, `queued-behind`) are payload values only, the SPA renders ordinal places ("Queued for merge · 1st of 2", with the train's tag when more than one train is on the page). Served from a server-side cache rebuilt at most every `dashboard.stage_tracker.cache_ttl_s` (default `governor.eval_interval_s`) from the spoke's existing snapshot — a request never calls GitHub. Carries `generated_at`, `source` (`cache` or `fresh`), `cache_ttl_s`, an `ETag` and `Cache-Control: private, max-age=`; `If-None-Match` yields 304. Each hit is recorded under REST caller `dashboard:stage-tracker` so `/api/gh-rate-limits` shows it charged nothing. | `pkg/dashboard/api.go:183` | -| `GET` | `/api/matrix/lines` | Dashboard auth/session | Matrix Lines (deprecated name, see [Published-checkpoint regions](#published-checkpoint-regions)): serve bounded backlog of pushed lines behind dashboard.matrix with repo allowlist filtering. `max` counts only lines the repo allowlist admits, so a page is never emptied by filtered-out lines. A client paging with `max` should use the last returned line's `seq` as its next `since`, not the top-level `seq`, which is the source's latest sequence number and would skip lines still past the page. `more` is true only while another line the caller may see remains past the page; stop paging when it is false. | `pkg/dashboard/api.go:184` | -| `POST` | `/api/prs/{owner}/{repo}/{number}/queue-automerge` | Merger/owner role | Queue PRAuto Merge | `pkg/dashboard/api.go:185` | -| `GET` | `/api/inference/models/{backend}` | Dashboard auth/session | Inference Models | `pkg/dashboard/api.go:378` | -| `GET` | `/api/hive-id` | Dashboard auth/session | Hive IDGet | `pkg/dashboard/api.go:442` | -| `PUT` | `/api/hive-id` | Owner only | Hive IDSet | `pkg/dashboard/api.go:443` | -| `POST` | `/api/chat` | Dashboard auth/session | Chat | `pkg/dashboard/api.go:474` | -| `GET` | `/api/auth/token` | Public | Auth Token | `pkg/dashboard/api.go:508` | -| `POST` | `/api/auth/github-link/revoke` | Owner | Revoke GitHub Login Link (owner revokes an identity's hub-proven link; a body naming a login is refused, #19992) | `pkg/dashboard/api.go:509` | +| `GET` | `/api/budget-ignore` | Dashboard auth/session | Budget Ignore Get | `pkg/dashboard/api.go:172` | +| `POST` | `/api/budget-ignore` | Owner only | Budget Ignore Set | `pkg/dashboard/api.go:173` | +| `GET` | `/api/summaries` | Dashboard auth/session | Summaries | `pkg/dashboard/api.go:185` | +| `GET` | `/api/stage-tracker` | Dashboard auth/session | Stage Tracker: every open issue and pull request of the watched repos for the Hive activity monitor — actionable, held, claimed, in-progress, covered-by-PR, filtered (`needs-*`), draft and exempt-labelled items alike, each with `stage`, `stage_since`, `labels`, `created_at`, `author_kind`, `modifiers`, `claimant: {kind: hive-agent|clanker|person, login, agent, hive, since, source: claim-ledger|claim-comment|assignee|kick-history|author}` naming who holds a claimed / in-progress issue or a PR under review or rework (absent when nobody is named; mirrored onto `linked_prs[]`), (PRs) `sentinel_alert` / `sentinel_findings` / `sentinel_reason` when the sentinel flagged the PR, `decision_needed` on a row parked on a person (085 / 045 / 015, the needs-human pill; mirrored onto the issue's `linked_prs[]` entry): `{question, asked_by, since, blocker, blocker_reason, options: [{action, label, enabled, reason_if_disabled}]}` — the reviewer's own decision question when the verdict record has one, the blocker in plain words, and the applicable actions under the row context menu's action ids (`decide:delegate` first), (PRs) `lineage` on the hive's copy of an adopted PR — `{kind: adopted|superseded|rebased-by-hive, from_number, from_url, from_author, from_author_kind, to_number, to_url, at, reason}`, derived from the stage store's adoption record or the `hive/adopt-` head branch, mirrored onto the issue's `linked_prs[]` entry; absent on every other row — and (issues) `linked_prs`; items with no stage yet report stage `0` "Open"; `needs_human_why` `{source: filed-for-help|decision-pending|level-gate|hive-hold|needs-approval|triage|author|needs-human, reason}` on every row a person must move (with `needs_human: true`; `filed_for_help` names the agent whose marker is in an unclaimed issue's body); `needs_human_labels` is the "a person must act" label set behind the monitor's Needs human facet (the same list as `/api/status.labelPresets[needs-human]`); `recently_merged` lists the PRs (`repo`, `number`, `merged_at`) whose `pr_merged` audit entry is under 30 minutes old, so a client diffing two payloads can tell a merge from a close; a PR in a conflict-aware merge train carries `merge_train` `{id, state, front, position, size, attempt, max_attempts, overlap_files, ahead, length, head_number, head_state, head_reason, head_since, eta_s, eta_at, eta_basis, late, stalled, stalled_s}` — `head_state` one of `needs-human` / `ci` / `soaking` / `ready` / `merging` / `fixing` / `unknown` with `head_reason` in plain words; `eta_s` / `eta_at` the estimated wait for this member's own merge attempt (own remaining soak + each PR ahead's remaining soak or one sweep + the next sweep tick; absent while the head waits on a person or CI), `eta_at` anchored to the member's first estimate at its position so a countdown survives polls, `eta_basis` its short reading ("2 ahead · head soaking 12m · next sweep in 40s"), `late` once now has overrun the first estimate twice over, `stalled` / `stalled_s` once the head has sat longer than `governor.merge_train_stall_warn_s` ([#15395](https://github.com/hivecommons/hive/issues/15395)); a PR the queue holds because another open PR declares the same `Fixes #N` carries no `merge_train` and a `merge_gate` of `{state: "duplicate-of:", duplicate_of, duplicate_issue}` plus the `needs-decision` modifier (the queue keeps one PR per issue: green first, then the earlier-opened); a PR GitHub reports conflicting on its own, or one under repair (stage/070, 071, 072, 074, 085, or a red required check), carries no `merge_train` and is not counted in any member's `size` / `length` — a repaired member the view dropped carries `left_train: {why: fixing|needs-author|returned-to-contributor|adopted-by-hive|needs-decision|checks-failing, note}` instead (mirrored onto the issue's `linked_prs[]` entry), and a train left with one member reports no `merge_train` at all; a PR short of the merge queue (below stage/080) the planner ordered rides no train either — it carries `overlap: {behind, with, files, note}` ("overlaps #15637 (sidebar.html, index.html) — will queue behind it") and no `merge_train`, and counts in no member's `size` — the state slugs (`front`, `queued-behind`) are payload values only, the SPA renders ordinal places ("Queued for merge · 1st of 2", with the train's tag when more than one train is on the page). Served from a server-side cache rebuilt at most every `dashboard.stage_tracker.cache_ttl_s` (default `governor.eval_interval_s`) from the spoke's existing snapshot — a request never calls GitHub. Carries `generated_at`, `source` (`cache` or `fresh`), `cache_ttl_s`, an `ETag` and `Cache-Control: private, max-age=`; `If-None-Match` yields 304. Each hit is recorded under REST caller `dashboard:stage-tracker` so `/api/gh-rate-limits` shows it charged nothing. | `pkg/dashboard/api.go:186` | +| `GET` | `/api/matrix/lines` | Dashboard auth/session | Matrix Lines (deprecated name, see [Published-checkpoint regions](#published-checkpoint-regions)): serve bounded backlog of pushed lines behind dashboard.matrix with repo allowlist filtering. `max` counts only lines the repo allowlist admits, so a page is never emptied by filtered-out lines. A client paging with `max` should use the last returned line's `seq` as its next `since`, not the top-level `seq`, which is the source's latest sequence number and would skip lines still past the page. `more` is true only while another line the caller may see remains past the page; stop paging when it is false. | `pkg/dashboard/api.go:187` | +| `POST` | `/api/prs/{owner}/{repo}/{number}/queue-automerge` | Merger/owner role | Queue PRAuto Merge | `pkg/dashboard/api.go:188` | +| `GET` | `/api/inference/models/{backend}` | Dashboard auth/session | Inference Models | `pkg/dashboard/api.go:381` | +| `GET` | `/api/hive-id` | Dashboard auth/session | Hive IDGet | `pkg/dashboard/api.go:445` | +| `PUT` | `/api/hive-id` | Owner only | Hive IDSet | `pkg/dashboard/api.go:446` | +| `POST` | `/api/chat` | Dashboard auth/session | Chat | `pkg/dashboard/api.go:477` | +| `GET` | `/api/auth/token` | Public | Auth Token | `pkg/dashboard/api.go:511` | +| `POST` | `/api/auth/github-link/revoke` | Owner | Revoke GitHub Login Link (owner revokes an identity's hub-proven link; a body naming a login is refused, #19992) | `pkg/dashboard/api.go:512` | | `GET` | `/api/v1/` | GitHub token | Contributor v1 API dispatcher | `pkg/dashboard/api_contribute.go:351` | | `POST` | `/api/v1/` | GitHub token | Contributor v1 API dispatcher | `pkg/dashboard/api_contribute.go:352` | | `GET` | `/api/docs` | Dashboard auth/session | APIDocs | `pkg/dashboard/api_contribute.go:353` | @@ -131,7 +131,7 @@ review are settled. | `POST` | `/api/hives/{id}/heartbeat` | Dashboard auth/session | Hives Heartbeat | `pkg/dashboard/api_contribute.go:378` | | `DELETE` | `/api/hives/{id}` | Owner only | Hives Delete | `pkg/dashboard/api_contribute.go:379` | | `POST` | `/api/hives/onboard` | Dashboard auth/session | Hives Onboard | `pkg/dashboard/api_contribute.go:380` | -| `GET` | `/sso` | Public | SSO | `pkg/dashboard/server.go:1872` | +| `GET` | `/sso` | Public | SSO | `pkg/dashboard/server.go:1876` | ### Activity observation provenance The CI snapshot retains real check/node IDs, head, App ID and transition times. diff --git a/docs/content/hive/api-reference/health-status-events.md b/docs/content/hive/api-reference/health-status-events.md index a7be010f..598321ff 100644 --- a/docs/content/hive/api-reference/health-status-events.md +++ b/docs/content/hive/api-reference/health-status-events.md @@ -31,19 +31,19 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | `GET` | `/api/version/release-notes` | Dashboard auth/session | Changelog gap between two revisions: `?from=&to=` returns `{from:{sha,version?}, to:{sha,ref,version?}, sections:[{version,date,categories:{added,changed,fixed,security,deprecated}}], unreleased?, truncated, source, error?}` — the `CHANGELOG.md` release sections present at `to` and absent at `from`, newest first, plus (when `to` is not a release tag) the `changelog.d/` fragments new at `to` under an `Unreleased (in this build)` section. Fetch failures return `source: "unavailable"` with `error` rather than an error status; results are cached per (from, to) for an hour ([#11065](https://github.com/hivecommons/hive/issues/11065)) | `pkg/dashboard/api.go:49` | | `GET` | `/api/version/contains` | Dashboard auth/session | Does the running build contain a PR or commit ([#18915](https://github.com/hivecommons/hive/issues/18915)): `?q=` returns `{query, commit?, running?, channel?, contains, reason?}`. `contains` is `yes`, `no` or `unknown`, computed from the commit this hive reports running (`hash` on `/api/version`) and repository ancestry; `unknown` (with `reason`) when the commit cannot be resolved, the lookup failed or the hive has no GitHub access, never a guess. An unmerged PR is `no`. `400` when `q` is neither a PR number nor a SHA | `pkg/dashboard/api_version_contains.go:113` | | `POST` | `/api/release-channel` | Owner only | Hosted spoke self-service release-channel selector; relays `stable`/`candidate`/`edge` to the hub's existing switch-branch endpoint with the spoke dashboard-token proof, and reports the requested channel as pending until the Deployment image lands | `pkg/dashboard/api.go:74` | -| `GET` | `/api/health` | Public | Basic health probe | `pkg/dashboard/server.go:1841` | -| `GET` | `/api/health/deep` | Public | Deep health probe | `pkg/dashboard/server.go:1842` | -| `GET` | `/api/livez` | Public | Kubernetes liveness probe | `pkg/dashboard/server.go:1843` | -| `GET` | `/.well-known/openid-configuration` | Public only while `forgejo.integration.serve_key_list` is on; otherwise 404 to a signed-in caller and 401 to one who is not | Discovery document of the spoke-served Forgejo integration key list: `issuer`, `jwks_uri`, signing algorithms. GET only, rate limited per client address ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#let-the-spoke-serve-the-key-list)) | `pkg/dashboard/server.go:1846` | -| `GET` | `/jwks.json` | Public only while `forgejo.integration.serve_key_list` is on; otherwise 404 to a signed-in caller and 401 to one who is not | Forgejo integration key list (JWKS) from `key_file` and `previous_key_files`, public keys only. GET only, rate limited per client address ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#let-the-spoke-serve-the-key-list)) | `pkg/dashboard/server.go:1847` | -| `GET` | `/metrics` | Registered only when `HIVE_METRICS_ENABLED`; requires `Authorization: ****** (403 if the token is unset) | Prometheus metrics | `pkg/dashboard/server.go:1853` | -| `GET` | `/api/status` | Dashboard auth/session | Dashboard aggregate status; `labelPresets[]` (`{key,label,description,labels[],states[]}`) lists the built-in label-filter presets for the Projects cards, led by `needs-human` whose `labels[]` are the effective hard-suppress labels plus `needs-signal`, the hold labels, `stage/071-needs-author` and the reporter-trust awaiting label (#12172); accepts `?fields=a,b` for top-level selection and `?omit=repos` to drop heavy sections, and honors `Accept-Encoding: gzip`; `agents[]` includes busy-pane visibility fields (`kicksUndeliverable`, `busySince`, `lastTranscriptActivity`, `condition`, `conditionMessage`) when a Working pane cannot accept kicks; a working agent also carries `agents[].run` — the live per-run line (#14576): `{since, elapsedS, costUSD, tokens, priced, tests, filesChanged}`, the estimated spend/tokens since the kick was delivered (`lastKickAt`, falling back to `busySince`) (delta of the token collector's per-agent cumulative figure; `priced:false` when the agent has none yet), the last visible test-runner result (`pass`/`fail`/empty) and the last `N files changed` git summary (`-1` when none) parsed from the captured pane; top-level `fleetRun` `{running, hourUSD, hourPriced, dayUSD, weekUSD, monthUSD, windowsPriced}` is the governor strip's rotating `running N · $X this hour / today / this week / this month` figure (#15614) — the hour is the rise since the top of the clock hour, the wider windows are the daily cost ledger summed from 00:00 UTC today, Monday 00:00 UTC (ISO week) and the 1st 00:00 UTC plus the rise since the ledger's last snapshot, `windowsPriced:false` when there is no ledger yet; `sla` (fleet) and `repos[].sla` (per repo) carry the Delivery SLA block derived from the lifecycle timeline with no extra GitHub calls: `windows.{7d,30d}.{open_to_triage,triage_to_start,start_to_pr,pr_to_merge,open_to_merge}` as `{p50_h,p95_h,n}` (hours, nearest-rank), `history[]` of up to 30 daily buckets `{day,start_to_pr_p50,pr_to_merge_p50,open_to_merge_p50,n_started,n_pr,n_merged}` persisted under `/data/sla-history.json`, `stale_in_progress[]` (`{number,repo,started_at,age_h,agent}` — issues carrying `hive/in-progress` longer than the agent claim TTL with no linked PR), `stale_count`, `merged_7d`, `claim_ttl_s` and, on the fleet block, the effective `targets` (`start_to_pr_h`, `pr_to_merge_h`, `open_to_merge_h`); `staleSince` and `repos[].countsStale` / `countsStaleSince` mark totals served from last-good figures — the previous enumeration (#13382) or the ForgeState cache's last-good counts (#13376); `ci_failure_signals` `{count, last, kicks, unmatched}` is the webhook CI-failure signal store — distinct red (repo, head, check) signals retained, the most recent one `{repo, number, head_sha, check, conclusion, details_url, agent, at}`, webhook-triggered kicks/nudges since boot, and failure deliveries whose head matched no open PR; `workflow_approvals` `{approved, denied, permission_errors, last}` counts the hive's approvals of GitHub-gated workflow runs since boot (#16603) — runs approved, runs refused by the trust policy (once per head), `403`/`404` refusals for want of `actions: write`, and the most recent decision `{repo, number, head, run_id, outcome, at}`; `hotspots` `{count, actionable, filed}` is the merge-hotspot advisor's one-line summary (files at/above the thresholds, those with a split recommendation, those with a modularize issue filed), absent when the advisor is not wired — details on `GET /api/hotspots`; `writeback.dedupe` `{enabled, dedupe_same_item, dedupe_burst, rate_capped, hourly_cap, burst_items, burst_window_s, same_item_ttl_s}` is the write-back gate's content layer — the effective `writeback.dedupe.*` settings and the last-hour counts of writes held as `duplicate`, `burst` and `rate-capped` (each also listed under `GET /api/writeback/suppressed`); `referenceRepos[]` `{full, tier, reference_tier}` lists `project.reference_repos` apart from `repos[]` — `reference_tier` is `read-only`, `issues`, `prs` or `issues+prs` (`tier` is the same value, kept for older clients) and an entry carries no ACMM, work-item or pause fields, since a reference repo is studied, not worked (#18021); `config.gate_regressions[]` `{gate, previous, effective, source}` is the boot-time safety-gate regression list (#16438) — gates a previous runtime overlay on the PVC carried that the running config lacks or loosens (`review.require_labels`, `project.issue_filter.require_labels`, `project.paused_repos[]`, `writeback.per_repo[].mode`), empty on a healthy boot | `pkg/dashboard/server.go:1858` | -| `GET` | `/api/status/summary` | Dashboard auth/session | Compact agent/governor/budget status summary for pollers; honors `Accept-Encoding: gzip` | `pkg/dashboard/server.go:1859` | -| `GET` | `/api/overview/issues.csv` | Dashboard auth/session | Cached Overview issue-band export as browser-compatible CSV; filters `band`, `repo`/`repos`, `stale`, and `held` are ANDed. | `pkg/dashboard/server.go:1860` | -| `GET` | `/api/overview/issues.json` | Dashboard auth/session | Cached Overview issue-band export as typed JSON with `bands[]` metadata and row fields matching the CSV columns. | `pkg/dashboard/server.go:1861` | -| `GET` | `/api/overview/prs.csv` | Dashboard auth/session | Cached Overview PR-band export as browser-compatible CSV; filters `band`, `repo`/`repos`, `stale`, and `held` are ANDed. | `pkg/dashboard/server.go:1862` | -| `GET` | `/api/overview/prs.json` | Dashboard auth/session | Cached Overview PR-band export as typed JSON with `bands[]` metadata and row fields matching the CSV columns. | `pkg/dashboard/server.go:1863` | -| `GET` | `/api/events` | Dashboard auth/session | Server-sent event stream | `pkg/dashboard/server.go:1864` | +| `GET` | `/api/health` | Public | Basic health probe | `pkg/dashboard/server.go:1845` | +| `GET` | `/api/health/deep` | Public | Deep health probe | `pkg/dashboard/server.go:1846` | +| `GET` | `/api/livez` | Public | Kubernetes liveness probe | `pkg/dashboard/server.go:1847` | +| `GET` | `/.well-known/openid-configuration` | Public only while `forgejo.integration.serve_key_list` is on; otherwise 404 to a signed-in caller and 401 to one who is not | Discovery document of the spoke-served Forgejo integration key list: `issuer`, `jwks_uri`, signing algorithms. GET only, rate limited per client address ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#let-the-spoke-serve-the-key-list)) | `pkg/dashboard/server.go:1850` | +| `GET` | `/jwks.json` | Public only while `forgejo.integration.serve_key_list` is on; otherwise 404 to a signed-in caller and 401 to one who is not | Forgejo integration key list (JWKS) from `key_file` and `previous_key_files`, public keys only. GET only, rate limited per client address ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#let-the-spoke-serve-the-key-list)) | `pkg/dashboard/server.go:1851` | +| `GET` | `/metrics` | Registered only when `HIVE_METRICS_ENABLED`; requires `Authorization: ****** (403 if the token is unset) | Prometheus metrics | `pkg/dashboard/server.go:1857` | +| `GET` | `/api/status` | Dashboard auth/session | Dashboard aggregate status; `labelPresets[]` (`{key,label,description,labels[],states[]}`) lists the built-in label-filter presets for the Projects cards, led by `needs-human` whose `labels[]` are the effective hard-suppress labels plus `needs-signal`, the hold labels, `stage/071-needs-author` and the reporter-trust awaiting label (#12172); accepts `?fields=a,b` for top-level selection and `?omit=repos` to drop heavy sections, and honors `Accept-Encoding: gzip`; `agents[]` includes busy-pane visibility fields (`kicksUndeliverable`, `busySince`, `lastTranscriptActivity`, `condition`, `conditionMessage`) when a Working pane cannot accept kicks; a working agent also carries `agents[].run` — the live per-run line (#14576): `{since, elapsedS, costUSD, tokens, priced, tests, filesChanged}`, the estimated spend/tokens since the kick was delivered (`lastKickAt`, falling back to `busySince`) (delta of the token collector's per-agent cumulative figure; `priced:false` when the agent has none yet), the last visible test-runner result (`pass`/`fail`/empty) and the last `N files changed` git summary (`-1` when none) parsed from the captured pane; top-level `fleetRun` `{running, hourUSD, hourPriced, dayUSD, weekUSD, monthUSD, windowsPriced}` is the governor strip's rotating `running N · $X this hour / today / this week / this month` figure (#15614) — the hour is the rise since the top of the clock hour, the wider windows are the daily cost ledger summed from 00:00 UTC today, Monday 00:00 UTC (ISO week) and the 1st 00:00 UTC plus the rise since the ledger's last snapshot, `windowsPriced:false` when there is no ledger yet; `sla` (fleet) and `repos[].sla` (per repo) carry the Delivery SLA block derived from the lifecycle timeline with no extra GitHub calls: `windows.{7d,30d}.{open_to_triage,triage_to_start,start_to_pr,pr_to_merge,open_to_merge}` as `{p50_h,p95_h,n}` (hours, nearest-rank), `history[]` of up to 30 daily buckets `{day,start_to_pr_p50,pr_to_merge_p50,open_to_merge_p50,n_started,n_pr,n_merged}` persisted under `/data/sla-history.json`, `stale_in_progress[]` (`{number,repo,started_at,age_h,agent}` — issues carrying `hive/in-progress` longer than the agent claim TTL with no linked PR), `stale_count`, `merged_7d`, `claim_ttl_s` and, on the fleet block, the effective `targets` (`start_to_pr_h`, `pr_to_merge_h`, `open_to_merge_h`); `staleSince` and `repos[].countsStale` / `countsStaleSince` mark totals served from last-good figures — the previous enumeration (#13382) or the ForgeState cache's last-good counts (#13376); `ci_failure_signals` `{count, last, kicks, unmatched}` is the webhook CI-failure signal store — distinct red (repo, head, check) signals retained, the most recent one `{repo, number, head_sha, check, conclusion, details_url, agent, at}`, webhook-triggered kicks/nudges since boot, and failure deliveries whose head matched no open PR; `workflow_approvals` `{approved, denied, permission_errors, last}` counts the hive's approvals of GitHub-gated workflow runs since boot (#16603) — runs approved, runs refused by the trust policy (once per head), `403`/`404` refusals for want of `actions: write`, and the most recent decision `{repo, number, head, run_id, outcome, at}`; `hotspots` `{count, actionable, filed}` is the merge-hotspot advisor's one-line summary (files at/above the thresholds, those with a split recommendation, those with a modularize issue filed), absent when the advisor is not wired — details on `GET /api/hotspots`; `writeback.dedupe` `{enabled, dedupe_same_item, dedupe_burst, rate_capped, hourly_cap, burst_items, burst_window_s, same_item_ttl_s}` is the write-back gate's content layer — the effective `writeback.dedupe.*` settings and the last-hour counts of writes held as `duplicate`, `burst` and `rate-capped` (each also listed under `GET /api/writeback/suppressed`); `referenceRepos[]` `{full, tier, reference_tier}` lists `project.reference_repos` apart from `repos[]` — `reference_tier` is `read-only`, `issues`, `prs` or `issues+prs` (`tier` is the same value, kept for older clients) and an entry carries no ACMM, work-item or pause fields, since a reference repo is studied, not worked (#18021); `config.gate_regressions[]` `{gate, previous, effective, source}` is the boot-time safety-gate regression list (#16438) — gates a previous runtime overlay on the PVC carried that the running config lacks or loosens (`review.require_labels`, `project.issue_filter.require_labels`, `project.paused_repos[]`, `writeback.per_repo[].mode`), empty on a healthy boot | `pkg/dashboard/server.go:1862` | +| `GET` | `/api/status/summary` | Dashboard auth/session | Compact agent/governor/budget status summary for pollers; honors `Accept-Encoding: gzip` | `pkg/dashboard/server.go:1863` | +| `GET` | `/api/overview/issues.csv` | Dashboard auth/session | Cached Overview issue-band export as browser-compatible CSV; filters `band`, `repo`/`repos`, `stale`, and `held` are ANDed. | `pkg/dashboard/server.go:1864` | +| `GET` | `/api/overview/issues.json` | Dashboard auth/session | Cached Overview issue-band export as typed JSON with `bands[]` metadata and row fields matching the CSV columns. | `pkg/dashboard/server.go:1865` | +| `GET` | `/api/overview/prs.csv` | Dashboard auth/session | Cached Overview PR-band export as browser-compatible CSV; filters `band`, `repo`/`repos`, `stale`, and `held` are ANDed. | `pkg/dashboard/server.go:1866` | +| `GET` | `/api/overview/prs.json` | Dashboard auth/session | Cached Overview PR-band export as typed JSON with `bands[]` metadata and row fields matching the CSV columns. | `pkg/dashboard/server.go:1867` | +| `GET` | `/api/events` | Dashboard auth/session | Server-sent event stream | `pkg/dashboard/server.go:1868` | | `GET` | `/api/swarm` | Dashboard auth/session | Current swarm status: display name, duration, active repo, expiry, persisted prep metrics when available, and idle-unlock fields. | `pkg/dashboard/swarm.go:310` | | `POST` | `/api/swarm` | Owner only | Start a 24h repo swarm for a configured repo, returning 409 when another swarm is active and 423 when a previous swarm keeps the next swarm locked until enough agents are idle unless body `{"repo":"owner/name","force":true}` is used; saves the active record before repo prep, persists prep metrics, and announces the start to Discord when configured. | `pkg/dashboard/swarm.go:311` | | `DELETE` | `/api/swarm` | Owner only | End the active swarm, score issues closed and PRs merged in the window, append it to history, and announce the result to Discord when configured. | `pkg/dashboard/swarm.go:312` | diff --git a/docs/content/hive/api-reference/inception.md b/docs/content/hive/api-reference/inception.md index 3724a50d..91760654 100644 --- a/docs/content/hive/api-reference/inception.md +++ b/docs/content/hive/api-reference/inception.md @@ -9,17 +9,17 @@ The inception API was retired in favour of [Inception (spek) sessions](/docs/hiv | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| -| `POST` | `/api/inception/start` | Dashboard auth/session | Retired (was: Inception Start): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:447` | -| `POST` | `/api/inception/scan` | Dashboard auth/session | Retired (was: Inception Scan): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:448` | -| `GET` | `/api/inception/state` | Dashboard auth/session | Retired (was: Inception State): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:449` | -| `POST` | `/api/inception/questions` | Dashboard auth/session | Retired (was: Inception Set Questions): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:450` | -| `POST` | `/api/inception/answer` | Dashboard auth/session | Retired (was: Inception Answer): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:451` | -| `POST` | `/api/inception/facts` | Dashboard auth/session | Retired (was: Inception Record Facts): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:452` | -| `GET` | `/api/inception/scaffold` | Dashboard auth/session | Retired (was: Inception Scaffold): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:453` | -| `POST` | `/api/inception/approve` | Dashboard auth/session | Retired (was: Inception Approve): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:454` | -| `POST` | `/api/inception/reset` | Dashboard auth/session | Retired (was: Inception Reset): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:455` | -| `GET` | `/api/inception/ideation-facts` | Dashboard auth/session | Retired (was: Inception Ideation Facts): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:456` | -| `GET` | `/api/inception/download` | Dashboard auth/session | Retired (was: Inception Download): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:457` | -| `GET` | `/api/inception/has-files` | Dashboard auth/session | Retired (was: Inception Has Files): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:458` | -| `PUT` | `/api/inception/wiki-name` | Dashboard auth/session | Retired (was: Inception Rename Wiki): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:459` | -| `POST` | `/api/inception/import` | Dashboard auth/session | Retired (was: Inception Import): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:460` | +| `POST` | `/api/inception/start` | Dashboard auth/session | Retired (was: Inception Start): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:450` | +| `POST` | `/api/inception/scan` | Dashboard auth/session | Retired (was: Inception Scan): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:451` | +| `GET` | `/api/inception/state` | Dashboard auth/session | Retired (was: Inception State): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:452` | +| `POST` | `/api/inception/questions` | Dashboard auth/session | Retired (was: Inception Set Questions): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:453` | +| `POST` | `/api/inception/answer` | Dashboard auth/session | Retired (was: Inception Answer): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:454` | +| `POST` | `/api/inception/facts` | Dashboard auth/session | Retired (was: Inception Record Facts): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:455` | +| `GET` | `/api/inception/scaffold` | Dashboard auth/session | Retired (was: Inception Scaffold): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:456` | +| `POST` | `/api/inception/approve` | Dashboard auth/session | Retired (was: Inception Approve): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:457` | +| `POST` | `/api/inception/reset` | Dashboard auth/session | Retired (was: Inception Reset): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:458` | +| `GET` | `/api/inception/ideation-facts` | Dashboard auth/session | Retired (was: Inception Ideation Facts): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:459` | +| `GET` | `/api/inception/download` | Dashboard auth/session | Retired (was: Inception Download): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:460` | +| `GET` | `/api/inception/has-files` | Dashboard auth/session | Retired (was: Inception Has Files): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:461` | +| `PUT` | `/api/inception/wiki-name` | Dashboard auth/session | Retired (was: Inception Rename Wiki): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:462` | +| `POST` | `/api/inception/import` | Dashboard auth/session | Retired (was: Inception Import): answers `410 Gone` pointing to `/api/sessions` | `pkg/dashboard/api.go:463` | diff --git a/docs/content/hive/api-reference/knowledge.md b/docs/content/hive/api-reference/knowledge.md index 453dd466..45190443 100644 --- a/docs/content/hive/api-reference/knowledge.md +++ b/docs/content/hive/api-reference/knowledge.md @@ -7,39 +7,39 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| -| `GET` | `/api/knowledge` | Dashboard auth/session | Paginated knowledge facts: `type` filter, `limit` (default 50, max 200; invalid/non-positive values use the default), `offset` (default 0). Returns `enabled`, `facts`, `count` (this page), `total`, `limit`, `offset`, `has_more`; ordered by layer then slug. Offsets are not snapshot cursors: concurrent edits may shift pages. | `pkg/dashboard/api.go:380` | -| `GET` | `/api/knowledge/export` | Dashboard auth/session | Knowledge Export | `pkg/dashboard/api.go:381` | -| `POST` | `/mcp/knowledge` | Public (read-only) when the dashboard setting or `HIVE_PUBLIC_KNOWLEDGE` is on; otherwise 404 to a signed-in caller and 401 to one who is not | Public Knowledge MCP endpoint — `initialize`, `tools/list`, `tools/call` for `knowledge_search`/`knowledge_toc`/`knowledge_get`/`knowledge_export` ([docs](/docs/hive/public-knowledge-mcp)) | `pkg/dashboard/api.go:391` | -| `GET` | `/api/knowledge/search` | Dashboard auth/session | Knowledge Search | `pkg/dashboard/api.go:382` | -| `GET` | `/api/knowledge/toc` | Dashboard auth/session | Scoped knowledge table of contents: capped, body-free entries (`id`, `title`, `type`, `layer`, `repo`, `tags`, `status`, `confidence`, `updated`, `size_bytes`, `source`) plus `total`/`returned`/`truncated`. Query: `layers`, `repos`, `types`, `tags` (comma-separated), `limit` (default 50, max 200), `include_states` (operator opt-in for `draft`/`deprecated`/`superseded`/`all`), `format=prompt` with `max_chars` for a bounded markdown rendering, `agent` to apply that agent's `knowledge.agent_scopes` entry (the other parameters can only narrow it). Approved knowledge only by default ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-toc.md)) | `pkg/dashboard/api.go:383` | -| `GET` | `/api/knowledge/advisor/summary` | Dashboard auth/session (read or higher) | Read-only knowledge-advisor rank-versus-holdout summary: `window` (`since`, `first_decision`, `last_decision`, `rank_mode_start`, `decisions`), `settings` (`enabled`, `mode`, `model`, `holdout_percent`, `max_calls_per_day`, `max_calls_per_agent_hour`, `candidates`, `on_error`, `problem`; never the endpoint or key), `counts` (`by_mode`, `by_arm`, `by_outcome`, `by_verdict`, `by_budget`), `errors` (`by_class` and `top_reasons` of redacted HTTP status, provider error code and message), `arms` (per-arm closed-bead `beads` and mean fix attempts, CI failures and kicks over every closed work bead) with `mixed` and `none` listed separately, `coverage` (`closed_beads`, `with_closed_pr`, `no_ref`, `no_decision`), `cost` (mean latency and tokens where records carry them), and a `small_n`/`caveat` pair. Counts and means only: no slugs, refs, agents or content. Query: `since` (RFC 3339) narrows the decision counts and cost, not the bead means ([docs](/docs/hive/operations/automation-and-review/retro-lane#reading-the-comparison-from-the-dashboard)) | `pkg/dashboard/api.go:384` | -| `GET` | `/api/knowledge/effective` | Dashboard auth/session | Effective knowledge for one agent (`agent` required): the agent's `knowledge.agent_scopes` entry (unrestricted when it has none) intersected with the request scope (approved only unless `include_states` is set). Returns `scope` (resolved scope applied, with `configured`), `included` TOC entries, `excluded` entries each with a `reason` (`lifecycle`, `layer`, `repo`, `type` or `tag` — first failing check, in that order), `included_total`/`excluded_total`/`included_returned`/`excluded_returned` and `truncated`; `limit` caps each list (default 50, max 200) ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-toc.md#effective-knowledge)) | `pkg/dashboard/api.go:385` | -| `GET` | `/api/knowledge/entry/{id}` | Dashboard auth/session | Full read of one knowledge entry: `markdown` (front-matter plus body) and the fact. Takes the same scope, `include_states` and `agent` query as the table of contents and returns 404 for an entry outside it ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-toc.md)) | `pkg/dashboard/api.go:386` | -| `POST` | `/api/knowledge/cli-memory/drain-legacy` | Owner only | One-shot drain of the shared home's legacy Claude memory (`/data/home/.claude/projects/*/memory`) into `state: draft` entries in `bead-synth-wiki`, tagged `cli-memory` and `agent:shared`, deduplicated by content hash. Body `{"truncate": bool}` (default false) empties only files whose every fact is now stored. Returns `store`, `agent`, `sources`, `drained`, `dupes`, `skipped`, `truncate`, `truncated`, `kept`, `errors`; 409 when the vault is not connected. Audited as `knowledge_drain_legacy_memory` ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-lifecycle.md#auto-memory-drafts)) | `pkg/dashboard/api.go:388` | -| `GET` | `/api/knowledge/public` | Dashboard auth/session | Public Knowledge MCP sharing status (`enabled`, `tags`, `source`, endpoint URL) | `pkg/dashboard/api.go:392` | -| `PUT` | `/api/knowledge/public` | Owner only | Persist public Knowledge MCP sharing setting; overrides env vars until changed | `pkg/dashboard/api.go:393` | -| `GET` | `/api/knowledge/health` | Dashboard auth/session | Knowledge Health | `pkg/dashboard/api.go:394` | -| `GET` | `/api/knowledge/stats` | Dashboard auth/session | Knowledge Stats | `pkg/dashboard/api.go:395` | -| `GET` | `/api/knowledge/graph` | Dashboard auth/session | Knowledge Graph | `pkg/dashboard/api.go:396` | -| `GET` | `/api/knowledge/fact-history` | Dashboard auth/session | Fact History | `pkg/dashboard/api.go:397` | -| `POST` | `/api/knowledge/create` | Dashboard auth/session | Create one fact (`title`, `body`, `type`, `tags`, `layer`, `confidence`, `state`). `state` is `approved` (default) or `draft`; a draft is written with `state: draft` into the local channel named by `layer` (400 when there is none, 409 when its title already names an entry). A request tagged `cli-memory` must be a draft carrying only `cli-memory`, `agent:`, `cli:`, `memhash:` and `repo:/` tags (400 otherwise) | `pkg/dashboard/api.go:398` | -| `POST` | `/api/knowledge/import` | Dashboard auth/session | Knowledge Import | `pkg/dashboard/api.go:399` | -| `POST` | `/api/knowledge/promote` | Dashboard auth/session | Knowledge Promote | `pkg/dashboard/api.go:405` | -| `GET` | `/api/knowledge/subscriptions` | Dashboard auth/session | Knowledge Subs List | `pkg/dashboard/api.go:406` | -| `POST` | `/api/knowledge/subscriptions` | Dashboard auth/session | Knowledge Subs Add | `pkg/dashboard/api.go:407` | -| `DELETE` | `/api/knowledge/subscriptions` | Dashboard auth/session | Knowledge Subs Remove | `pkg/dashboard/api.go:408` | -| `PUT` | `/api/knowledge/{layer}/{slug}` | Dashboard auth/session | Knowledge Update | `pkg/dashboard/api.go:409` | -| `DELETE` | `/api/knowledge/{layer}/{slug}` | Dashboard auth/session | Knowledge Delete | `pkg/dashboard/api.go:410` | -| `GET` | `/api/knowledge/{layer}` | Dashboard auth/session | Knowledge Layer | `pkg/dashboard/api.go:411` | -| `GET` | `/api/knowledge/{layer}/{slug}` | Dashboard auth/session | Knowledge Fact | `pkg/dashboard/api.go:412` | -| `PUT` | `/api/knowledge/enabled` | Owner only | Knowledge Toggle | `pkg/dashboard/api.go:413` | -| `GET` | `/api/knowledge/bead-synthesizer` | Dashboard auth/session | Bead Synth Status | `pkg/dashboard/api.go:414` | -| `PUT` | `/api/knowledge/bead-synthesizer/enabled` | Owner only | Bead Synth Toggle | `pkg/dashboard/api.go:415` | -| `GET` | `/api/knowledge/vaults` | Dashboard auth/session | Vaults List | `pkg/dashboard/api.go:416` | -| `POST` | `/api/knowledge/vaults` | Owner only | Vaults Connect | `pkg/dashboard/api.go:417` | -| `DELETE` | `/api/knowledge/vaults` | Dashboard auth/session | Vaults Disconnect | `pkg/dashboard/api.go:418` | -| `POST` | `/api/knowledge/vaults/reindex` | Dashboard auth/session | Vaults Reindex | `pkg/dashboard/api.go:419` | -| `GET` | `/api/knowledge/vaults/{name}/facts` | Dashboard auth/session | Vault Facts | `pkg/dashboard/api.go:420` | +| `GET` | `/api/knowledge` | Dashboard auth/session | Paginated knowledge facts: `type` filter, `limit` (default 50, max 200; invalid/non-positive values use the default), `offset` (default 0). Returns `enabled`, `facts`, `count` (this page), `total`, `limit`, `offset`, `has_more`; ordered by layer then slug. Offsets are not snapshot cursors: concurrent edits may shift pages. | `pkg/dashboard/api.go:383` | +| `GET` | `/api/knowledge/export` | Dashboard auth/session | Knowledge Export | `pkg/dashboard/api.go:384` | +| `POST` | `/mcp/knowledge` | Public (read-only) when the dashboard setting or `HIVE_PUBLIC_KNOWLEDGE` is on; otherwise 404 to a signed-in caller and 401 to one who is not | Public Knowledge MCP endpoint — `initialize`, `tools/list`, `tools/call` for `knowledge_search`/`knowledge_toc`/`knowledge_get`/`knowledge_export` ([docs](/docs/hive/public-knowledge-mcp)) | `pkg/dashboard/api.go:394` | +| `GET` | `/api/knowledge/search` | Dashboard auth/session | Knowledge Search | `pkg/dashboard/api.go:385` | +| `GET` | `/api/knowledge/toc` | Dashboard auth/session | Scoped knowledge table of contents: capped, body-free entries (`id`, `title`, `type`, `layer`, `repo`, `tags`, `status`, `confidence`, `updated`, `size_bytes`, `source`) plus `total`/`returned`/`truncated`. Query: `layers`, `repos`, `types`, `tags` (comma-separated), `limit` (default 50, max 200), `include_states` (operator opt-in for `draft`/`deprecated`/`superseded`/`all`), `format=prompt` with `max_chars` for a bounded markdown rendering, `agent` to apply that agent's `knowledge.agent_scopes` entry (the other parameters can only narrow it). Approved knowledge only by default ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-toc.md)) | `pkg/dashboard/api.go:386` | +| `GET` | `/api/knowledge/advisor/summary` | Dashboard auth/session (read or higher) | Read-only knowledge-advisor rank-versus-holdout summary: `window` (`since`, `first_decision`, `last_decision`, `rank_mode_start`, `decisions`), `settings` (`enabled`, `mode`, `model`, `holdout_percent`, `max_calls_per_day`, `max_calls_per_agent_hour`, `candidates`, `on_error`, `problem`; never the endpoint or key), `counts` (`by_mode`, `by_arm`, `by_outcome`, `by_verdict`, `by_budget`), `errors` (`by_class` and `top_reasons` of redacted HTTP status, provider error code and message), `arms` (per-arm closed-bead `beads` and mean fix attempts, CI failures and kicks over every closed work bead) with `mixed` and `none` listed separately, `coverage` (`closed_beads`, `with_closed_pr`, `no_ref`, `no_decision`), `cost` (mean latency and tokens where records carry them), and a `small_n`/`caveat` pair. Counts and means only: no slugs, refs, agents or content. Query: `since` (RFC 3339) narrows the decision counts and cost, not the bead means ([docs](/docs/hive/operations/automation-and-review/retro-lane#reading-the-comparison-from-the-dashboard)) | `pkg/dashboard/api.go:387` | +| `GET` | `/api/knowledge/effective` | Dashboard auth/session | Effective knowledge for one agent (`agent` required): the agent's `knowledge.agent_scopes` entry (unrestricted when it has none) intersected with the request scope (approved only unless `include_states` is set). Returns `scope` (resolved scope applied, with `configured`), `included` TOC entries, `excluded` entries each with a `reason` (`lifecycle`, `layer`, `repo`, `type` or `tag` — first failing check, in that order), `included_total`/`excluded_total`/`included_returned`/`excluded_returned` and `truncated`; `limit` caps each list (default 50, max 200) ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-toc.md#effective-knowledge)) | `pkg/dashboard/api.go:388` | +| `GET` | `/api/knowledge/entry/{id}` | Dashboard auth/session | Full read of one knowledge entry: `markdown` (front-matter plus body) and the fact. Takes the same scope, `include_states` and `agent` query as the table of contents and returns 404 for an entry outside it ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-toc.md)) | `pkg/dashboard/api.go:389` | +| `POST` | `/api/knowledge/cli-memory/drain-legacy` | Owner only | One-shot drain of the shared home's legacy Claude memory (`/data/home/.claude/projects/*/memory`) into `state: draft` entries in `bead-synth-wiki`, tagged `cli-memory` and `agent:shared`, deduplicated by content hash. Body `{"truncate": bool}` (default false) empties only files whose every fact is now stored. Returns `store`, `agent`, `sources`, `drained`, `dupes`, `skipped`, `truncate`, `truncated`, `kept`, `errors`; 409 when the vault is not connected. Audited as `knowledge_drain_legacy_memory` ([docs](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-lifecycle.md#auto-memory-drafts)) | `pkg/dashboard/api.go:391` | +| `GET` | `/api/knowledge/public` | Dashboard auth/session | Public Knowledge MCP sharing status (`enabled`, `tags`, `source`, endpoint URL) | `pkg/dashboard/api.go:395` | +| `PUT` | `/api/knowledge/public` | Owner only | Persist public Knowledge MCP sharing setting; overrides env vars until changed | `pkg/dashboard/api.go:396` | +| `GET` | `/api/knowledge/health` | Dashboard auth/session | Knowledge Health | `pkg/dashboard/api.go:397` | +| `GET` | `/api/knowledge/stats` | Dashboard auth/session | Knowledge Stats | `pkg/dashboard/api.go:398` | +| `GET` | `/api/knowledge/graph` | Dashboard auth/session | Knowledge Graph | `pkg/dashboard/api.go:399` | +| `GET` | `/api/knowledge/fact-history` | Dashboard auth/session | Fact History | `pkg/dashboard/api.go:400` | +| `POST` | `/api/knowledge/create` | Dashboard auth/session | Create one fact (`title`, `body`, `type`, `tags`, `layer`, `confidence`, `state`). `state` is `approved` (default) or `draft`; a draft is written with `state: draft` into the local channel named by `layer` (400 when there is none, 409 when its title already names an entry). A request tagged `cli-memory` must be a draft carrying only `cli-memory`, `agent:`, `cli:`, `memhash:` and `repo:/` tags (400 otherwise) | `pkg/dashboard/api.go:401` | +| `POST` | `/api/knowledge/import` | Dashboard auth/session | Knowledge Import | `pkg/dashboard/api.go:402` | +| `POST` | `/api/knowledge/promote` | Dashboard auth/session | Knowledge Promote | `pkg/dashboard/api.go:408` | +| `GET` | `/api/knowledge/subscriptions` | Dashboard auth/session | Knowledge Subs List | `pkg/dashboard/api.go:409` | +| `POST` | `/api/knowledge/subscriptions` | Dashboard auth/session | Knowledge Subs Add | `pkg/dashboard/api.go:410` | +| `DELETE` | `/api/knowledge/subscriptions` | Dashboard auth/session | Knowledge Subs Remove | `pkg/dashboard/api.go:411` | +| `PUT` | `/api/knowledge/{layer}/{slug}` | Dashboard auth/session | Knowledge Update | `pkg/dashboard/api.go:412` | +| `DELETE` | `/api/knowledge/{layer}/{slug}` | Dashboard auth/session | Knowledge Delete | `pkg/dashboard/api.go:413` | +| `GET` | `/api/knowledge/{layer}` | Dashboard auth/session | Knowledge Layer | `pkg/dashboard/api.go:414` | +| `GET` | `/api/knowledge/{layer}/{slug}` | Dashboard auth/session | Knowledge Fact | `pkg/dashboard/api.go:415` | +| `PUT` | `/api/knowledge/enabled` | Owner only | Knowledge Toggle | `pkg/dashboard/api.go:416` | +| `GET` | `/api/knowledge/bead-synthesizer` | Dashboard auth/session | Bead Synth Status | `pkg/dashboard/api.go:417` | +| `PUT` | `/api/knowledge/bead-synthesizer/enabled` | Owner only | Bead Synth Toggle | `pkg/dashboard/api.go:418` | +| `GET` | `/api/knowledge/vaults` | Dashboard auth/session | Vaults List | `pkg/dashboard/api.go:419` | +| `POST` | `/api/knowledge/vaults` | Owner only | Vaults Connect | `pkg/dashboard/api.go:420` | +| `DELETE` | `/api/knowledge/vaults` | Dashboard auth/session | Vaults Disconnect | `pkg/dashboard/api.go:421` | +| `POST` | `/api/knowledge/vaults/reindex` | Dashboard auth/session | Vaults Reindex | `pkg/dashboard/api.go:422` | +| `GET` | `/api/knowledge/vaults/{name}/facts` | Dashboard auth/session | Vault Facts | `pkg/dashboard/api.go:423` | | `GET` | `/api/config/knowledge/connectors` | Dashboard auth/session | Knowledge connectors config (name, type, layer, scope, env/file auth reference) and registered types | `pkg/dashboard/api.go` | | `PUT` | `/api/config/knowledge/connectors` | Owner only | Replace `knowledge.connectors` after validation; inline secrets rejected | `pkg/dashboard/api.go` | | `GET` | `/api/config/knowledge/connectors/status` | Dashboard auth/session | Per-connector status pill, last sync, pages/facts, last error, `running` and the live `progress` block (phase, items_done/items_total, current item, started_at; see [knowledge-connectors.md](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-connectors.md#api)), plus the `publish` mirror status | `pkg/dashboard/api.go` | @@ -49,19 +49,19 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | `PUT` | `/api/config/knowledge/agent-scopes` | Owner only | Replace `knowledge.agent_scopes` after validating layer and state names; persisted and audited as `config_knowledge_agent_scopes` | `pkg/dashboard/api.go` | | `GET` | `/api/config/knowledge/pipeline` | Owner only | Scalar bead synthesizer, curator, code map and primer settings and `knowledge.sidecar_advise`, plus the read-only engine, advisor flag, vault paths and primer merge strategy ([docs](/docs/hive/dashboard/dashboard-settings-explained#knowledge)) | `pkg/dashboard/api.go` | | `PUT` | `/api/config/knowledge/pipeline` | Owner only | Update those settings after `config.ValidateKnowledgePipeline`; 0 or empty restores the default; the bead synthesizer switch and `sidecar_advise` apply at once, the rest after a restart; audited as `config_knowledge_pipeline` | `pkg/dashboard/api.go` | -| `GET` | `/api/knowledge/git-sources` | Dashboard auth/session | Git Sources List | `pkg/dashboard/api.go:430` | -| `POST` | `/api/knowledge/git-sources` | Owner only | Git Sources Connect | `pkg/dashboard/api.go:431` | -| `DELETE` | `/api/knowledge/git-sources` | Owner only | Git Sources Disconnect | `pkg/dashboard/api.go:432` | -| `POST` | `/api/knowledge/obsidian/sync` | Dashboard auth/session | Obsidian Sync | `pkg/dashboard/api.go:433` | -| `GET` | `/api/knowledge/documents` | Dashboard auth/session | Documents List | `pkg/dashboard/api.go:434` | -| `POST` | `/api/knowledge/documents` | Dashboard auth/session | Documents Import | `pkg/dashboard/api.go:435` | -| `GET` | `/api/knowledge/documents/{slug}` | Dashboard auth/session | Document Get | `pkg/dashboard/api.go:436` | -| `DELETE` | `/api/knowledge/documents/{slug}` | Dashboard auth/session | Document Delete | `pkg/dashboard/api.go:437` | -| `POST` | `/api/knowledge/documents/{slug}/reimport` | Dashboard auth/session | Document Reimport | `pkg/dashboard/api.go:438` | -| `GET` | `/api/knowledge/context7/search` | Dashboard auth/session | Context7 Search | `pkg/dashboard/api.go:439` | -| `POST` | `/api/knowledge/cleanup-orphans` | Dashboard auth/session | Cleanup Orphans | `pkg/dashboard/api.go:440` | -| `GET` | `/api/knowledge/channels` | Dashboard auth/session | Knowledge Channels List | `pkg/dashboard/api.go:403` | -| `POST` | `/api/knowledge/channels` | Dashboard auth/session | Knowledge Channel Create | `pkg/dashboard/api.go:404` | +| `GET` | `/api/knowledge/git-sources` | Dashboard auth/session | Git Sources List | `pkg/dashboard/api.go:433` | +| `POST` | `/api/knowledge/git-sources` | Owner only | Git Sources Connect | `pkg/dashboard/api.go:434` | +| `DELETE` | `/api/knowledge/git-sources` | Owner only | Git Sources Disconnect | `pkg/dashboard/api.go:435` | +| `POST` | `/api/knowledge/obsidian/sync` | Dashboard auth/session | Obsidian Sync | `pkg/dashboard/api.go:436` | +| `GET` | `/api/knowledge/documents` | Dashboard auth/session | Documents List | `pkg/dashboard/api.go:437` | +| `POST` | `/api/knowledge/documents` | Dashboard auth/session | Documents Import | `pkg/dashboard/api.go:438` | +| `GET` | `/api/knowledge/documents/{slug}` | Dashboard auth/session | Document Get | `pkg/dashboard/api.go:439` | +| `DELETE` | `/api/knowledge/documents/{slug}` | Dashboard auth/session | Document Delete | `pkg/dashboard/api.go:440` | +| `POST` | `/api/knowledge/documents/{slug}/reimport` | Dashboard auth/session | Document Reimport | `pkg/dashboard/api.go:441` | +| `GET` | `/api/knowledge/context7/search` | Dashboard auth/session | Context7 Search | `pkg/dashboard/api.go:442` | +| `POST` | `/api/knowledge/cleanup-orphans` | Dashboard auth/session | Cleanup Orphans | `pkg/dashboard/api.go:443` | +| `GET` | `/api/knowledge/channels` | Dashboard auth/session | Knowledge Channels List | `pkg/dashboard/api.go:406` | +| `POST` | `/api/knowledge/channels` | Dashboard auth/session | Knowledge Channel Create | `pkg/dashboard/api.go:407` | | `GET` | `/api/knowledge/connectors` | Dashboard auth/session | Knowledge connector statuses, each with a live `progress` block while a sync runs, and publish mirror status (`{"connectors": [...], "publish": {...}\|null}`, see [knowledge-connectors.md](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-connectors.md)) | `pkg/dashboard/api_knowledge_connectors.go:24` | | `POST` | `/api/knowledge/connectors/{name}/sync` | Owner only | Start one connector sync now (202; 404 unknown, 409 running) | `pkg/dashboard/api_knowledge_connectors.go:25` | | `POST` | `/api/knowledge/publish/sync` | Owner only | Run a publish mirror batch now (202 with publish status; 503 mirror not running, 409 batch in progress) | `pkg/dashboard/api_knowledge_connectors.go:26` | @@ -95,8 +95,8 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | `DELETE` | `/api/inbox/recordings/{id}` | The recorder, or an owner | Abort an in-progress recording and delete its chunks; audited as `inbox_recording_abort` (403, 404, 409 already ended) | `pkg/dashboard/api_inbox_recordings.go:23` | | `GET` | `/api/inbox/recordings/{id}/audio` | Owner or read-write | Play a finished recording from this hive's disk on the dashboard origin: `http.ServeContent` (Range, 206), `Content-Type` audio/webm or audio/mp4, `Cache-Control: no-store`, `Cross-Origin-Resource-Policy: same-origin`. Opening a playback is audited as `inbox_recording_audio` (seeks are not). `GET /api/inbox/hive-recording/{id}/audio/stream` serves the same file (404 unknown or not finished, 410 audio expired after `inbox.recording.retention_days`) | `pkg/dashboard/api_inbox_recordings.go:24` | | `DELETE` | `/api/inbox/hive-recording/{id}` | An owner, or the read-write member who recorded it | Delete a finished recording for good: its stored audio and chunks, the Inbox item and its state, and its Knowledge fact with the machine transcript. What was already shared from it (RFC, issues, DIBS ideas, spek seeds) is not touched. 200 `{id, deleted, fact_removed, shares_kept}`; audited as `inbox_recording_delete` (403 read role or someone else's recording, 404 unknown, 409 still in progress or being transcribed) | `pkg/dashboard/api_inbox_recordings.go:25` | -| `GET` | `/api/meetings/settings` | Owner only | Meetings settings: `enabled`, `enabled_env_override`, `running`, `vexa_url`, `vexa_key_set`, `discord_token_set`, `transcribe_token_set`, `tts_token_set` (secrets are never returned) and `effective` values of the other `meetings.*` keys ([env vars](/docs/hive/env-vars#meetings-quorum)) | `pkg/dashboard/api_meetings.go:129` | -| `POST` | `/api/meetings/settings` | Owner only | Update `meetings.enabled` and `meetings.vexa.url`, and write the Vexa tenant key, Discord bot token, transcription service token and TTS service token to keystore-sealed secret files (`""` clears one): `{enabled?, vexa_url?, vexa_api_key?, discord_token?, transcribe_token?, tts_token?}`. Returns the settings with `restart_required`; 400 on an invalid value. Audited as `meetings_settings` | `pkg/dashboard/api_meetings.go:130` | +| `GET` | `/api/meetings/settings` | Owner only | Meetings settings: `enabled`, `enabled_env_override`, `running`, `vexa_url`, `vexa_key_set`, `discord_token_set`, `transcribe_token_set`, `tts_token_set`, `docs_kapa_site_id`, `docs_kapa_integration_id`, `docs_kapa_url`, `docs_kapa_key_set` (secrets are never returned) and `effective` values of the other `meetings.*` keys ([env vars](/docs/hive/env-vars#meetings-quorum)) | `pkg/dashboard/api_meetings.go:129` | +| `POST` | `/api/meetings/settings` | Owner only | Update `meetings.enabled`, `meetings.vexa.url` and the project-docs workspace (`meetings.docs_kapa`), and write the Vexa tenant key, Discord bot token, transcription service token, TTS service token and kapa.ai API key to keystore-sealed secret files (`""` clears one): `{enabled?, vexa_url?, vexa_api_key?, discord_token?, transcribe_token?, tts_token?, docs_kapa_site_id?, docs_kapa_integration_id?, docs_kapa_url?, docs_kapa_api_key?}`. Returns the settings with `restart_required`; 400 on an invalid value. Audited as `meetings_settings` | `pkg/dashboard/api_meetings.go:130` | | `POST` | `/api/meetings` | Owner only | Send hive to a meeting: `{url}` for Google Meet, Teams or Zoom, or `{platform: "discord", guild_id, channel_id}`, plus `title?` and `voice?`. Returns the meeting record; 400 invalid request, 502 Quorum refused, 503 meetings off. Audited as `meeting_join` | `pkg/dashboard/api_meetings.go:131` | | `GET` | `/api/meetings` | Owner only | `{meetings: [...], email_in}`, newest first; `email_in` is the hive's email-in address as in `GET /api/inbox` | `pkg/dashboard/api_meetings.go:132` | | `GET` | `/api/meetings/{id}` | Owner only | `{meeting, transcript, live}`: the record, stored final segments and chat, and the live-loop state (notes, research, asks, budget, and `skipped`: the questions dropped because the budget ran out, with their text) plus `budget`, the meter; 404 unknown | `pkg/dashboard/api_meetings.go:133` | diff --git a/docs/content/hive/api-reference/nous.md b/docs/content/hive/api-reference/nous.md index cb5206ef..50375fe3 100644 --- a/docs/content/hive/api-reference/nous.md +++ b/docs/content/hive/api-reference/nous.md @@ -7,28 +7,28 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| -| `GET` | `/api/nous/status` | Dashboard auth/session | Nous Status — includes `experimentLoop` (`dir`, `lastWriteAt`, `running`, `idleAfterSeconds`): whether the external experiment loop, the only producer of proposals, has written under `/var/run/nous/governor` within 24 evaluation cycles; ready cards then carry `experimentLoopIdle` ([#12541](https://github.com/hivecommons/hive/issues/12541)) | `pkg/dashboard/api.go:476` | -| `GET` | `/api/nous/ledger` | Dashboard auth/session | Nous Ledger | `pkg/dashboard/api.go:477` | -| `GET` | `/api/nous/principles` | Dashboard auth/session | Nous Principles | `pkg/dashboard/api.go:478` | -| `POST` | `/api/nous/approve` | Owner only | Nous Approve | `pkg/dashboard/api.go:479` | -| `POST` | `/api/nous/abort` | Owner only | Nous Abort | `pkg/dashboard/api.go:480` | -| `PUT` | `/api/nous/mode` | Owner only | Nous Mode | `pkg/dashboard/api.go:481` | -| `PUT` | `/api/nous/scope` | Owner only | Nous Scope | `pkg/dashboard/api.go:482` | -| `GET` | `/api/nous/phase` | Dashboard auth/session | Nous Phase | `pkg/dashboard/api.go:483` | -| `PUT` | `/api/nous/gate-decision` | Owner only | Nous Gate Decision | `pkg/dashboard/api.go:484` | -| `GET` | `/api/nous/gate-pending` | Dashboard auth/session | Nous Gate Pending | `pkg/dashboard/api.go:485` | -| `POST` | `/api/nous/gate-respond` | Owner only | Nous Gate Respond | `pkg/dashboard/api.go:486` | -| `GET` | `/api/nous/gate-response` | Dashboard auth/session | Nous Gate Response | `pkg/dashboard/api.go:487` | -| `GET` | `/api/nous/config` | Dashboard auth/session | Nous Config Get | `pkg/dashboard/api.go:488` | -| `PUT` | `/api/nous/config/goals` | Owner only | Nous Config Goals — legacy; the dashboard no longer exposes the research question in the ⚙ dialog, use `PATCH /api/nous/campaigns/{id}` | `pkg/dashboard/api.go:489` | -| `PUT` | `/api/nous/config/repos` | Owner only | Nous Config Repos — the allow-list of repos experiments may target (empty = any) | `pkg/dashboard/api.go:490` | -| `PUT` | `/api/nous/config/output` | Owner only | Nous Config Output | `pkg/dashboard/api.go:491` | -| `PUT` | `/api/nous/config/fast-fail` | Owner only | Nous Config Fast Fail | `pkg/dashboard/api.go:492` | -| `PUT` | `/api/nous/config/schedule` | Owner only | Nous Config Schedule | `pkg/dashboard/api.go:493` | -| `PUT` | `/api/nous/config/controllables` | Owner only | Nous Config Controllables | `pkg/dashboard/api.go:494` | -| `PUT` | `/api/nous/config/principles` | Owner only | Nous Config Principles | `pkg/dashboard/api.go:495` | -| `DELETE` | `/api/nous/principles/{id}` | Owner only | Nous Delete Principle | `pkg/dashboard/api.go:496` | -| `POST` | `/api/nous/campaign/start` | Owner only | Nous Campaign Start — archives the active campaign and starts a new experiment whose baseline restarts at 0 ([#12501](https://github.com/hivecommons/hive/issues/12501)) | `pkg/dashboard/api.go:497` | -| `GET` | `/api/nous/campaigns` | Any | Nous Campaigns List — every experiment with its per-campaign baseline, scope, results and stage ([#12532](https://github.com/hivecommons/hive/issues/12532)) | `pkg/dashboard/api.go:498` | -| `POST` | `/api/nous/campaigns` | Owner only | Nous Campaigns Create — starts an experiment alongside the running ones; 409 `scope_conflict` when a running experiment shares a repo target or both are hive-wide ([#12532](https://github.com/hivecommons/hive/issues/12532)) | `pkg/dashboard/api.go:499` | -| `PATCH` | `/api/nous/campaigns/{id}` | Owner only | Nous Campaign Patch — pause / resume / archive, or edit question, hypothesis and scope. Hypothesis/tag edits save in place (`status: "updated"`); a changed question or repo set needs `restart: true` (else 409 `restart_required`) and archives the campaign as version N while creating version N+1 with `restartedFrom` (`status: "restarted", campaign, archived`); resume, scope widening and restarts re-run the conflict guard ([#12532](https://github.com/hivecommons/hive/issues/12532)) | `pkg/dashboard/api.go:500` | +| `GET` | `/api/nous/status` | Dashboard auth/session | Nous Status — includes `experimentLoop` (`dir`, `lastWriteAt`, `running`, `idleAfterSeconds`): whether the external experiment loop, the only producer of proposals, has written under `/var/run/nous/governor` within 24 evaluation cycles; ready cards then carry `experimentLoopIdle` ([#12541](https://github.com/hivecommons/hive/issues/12541)) | `pkg/dashboard/api.go:479` | +| `GET` | `/api/nous/ledger` | Dashboard auth/session | Nous Ledger | `pkg/dashboard/api.go:480` | +| `GET` | `/api/nous/principles` | Dashboard auth/session | Nous Principles | `pkg/dashboard/api.go:481` | +| `POST` | `/api/nous/approve` | Owner only | Nous Approve | `pkg/dashboard/api.go:482` | +| `POST` | `/api/nous/abort` | Owner only | Nous Abort | `pkg/dashboard/api.go:483` | +| `PUT` | `/api/nous/mode` | Owner only | Nous Mode | `pkg/dashboard/api.go:484` | +| `PUT` | `/api/nous/scope` | Owner only | Nous Scope | `pkg/dashboard/api.go:485` | +| `GET` | `/api/nous/phase` | Dashboard auth/session | Nous Phase | `pkg/dashboard/api.go:486` | +| `PUT` | `/api/nous/gate-decision` | Owner only | Nous Gate Decision | `pkg/dashboard/api.go:487` | +| `GET` | `/api/nous/gate-pending` | Dashboard auth/session | Nous Gate Pending | `pkg/dashboard/api.go:488` | +| `POST` | `/api/nous/gate-respond` | Owner only | Nous Gate Respond | `pkg/dashboard/api.go:489` | +| `GET` | `/api/nous/gate-response` | Dashboard auth/session | Nous Gate Response | `pkg/dashboard/api.go:490` | +| `GET` | `/api/nous/config` | Dashboard auth/session | Nous Config Get | `pkg/dashboard/api.go:491` | +| `PUT` | `/api/nous/config/goals` | Owner only | Nous Config Goals — legacy; the dashboard no longer exposes the research question in the ⚙ dialog, use `PATCH /api/nous/campaigns/{id}` | `pkg/dashboard/api.go:492` | +| `PUT` | `/api/nous/config/repos` | Owner only | Nous Config Repos — the allow-list of repos experiments may target (empty = any) | `pkg/dashboard/api.go:493` | +| `PUT` | `/api/nous/config/output` | Owner only | Nous Config Output | `pkg/dashboard/api.go:494` | +| `PUT` | `/api/nous/config/fast-fail` | Owner only | Nous Config Fast Fail | `pkg/dashboard/api.go:495` | +| `PUT` | `/api/nous/config/schedule` | Owner only | Nous Config Schedule | `pkg/dashboard/api.go:496` | +| `PUT` | `/api/nous/config/controllables` | Owner only | Nous Config Controllables | `pkg/dashboard/api.go:497` | +| `PUT` | `/api/nous/config/principles` | Owner only | Nous Config Principles | `pkg/dashboard/api.go:498` | +| `DELETE` | `/api/nous/principles/{id}` | Owner only | Nous Delete Principle | `pkg/dashboard/api.go:499` | +| `POST` | `/api/nous/campaign/start` | Owner only | Nous Campaign Start — archives the active campaign and starts a new experiment whose baseline restarts at 0 ([#12501](https://github.com/hivecommons/hive/issues/12501)) | `pkg/dashboard/api.go:500` | +| `GET` | `/api/nous/campaigns` | Any | Nous Campaigns List — every experiment with its per-campaign baseline, scope, results and stage ([#12532](https://github.com/hivecommons/hive/issues/12532)) | `pkg/dashboard/api.go:501` | +| `POST` | `/api/nous/campaigns` | Owner only | Nous Campaigns Create — starts an experiment alongside the running ones; 409 `scope_conflict` when a running experiment shares a repo target or both are hive-wide ([#12532](https://github.com/hivecommons/hive/issues/12532)) | `pkg/dashboard/api.go:502` | +| `PATCH` | `/api/nous/campaigns/{id}` | Owner only | Nous Campaign Patch — pause / resume / archive, or edit question, hypothesis and scope. Hypothesis/tag edits save in place (`status: "updated"`); a changed question or repo set needs `restart: true` (else 409 `restart_required`) and archives the campaign as version N while creating version N+1 with `restartedFrom` (`status: "restarted", campaign, archived`); resume, scope widening and restarts re-run the conflict guard ([#12532](https://github.com/hivecommons/hive/issues/12532)) | `pkg/dashboard/api.go:503` | diff --git a/docs/content/hive/api-reference/packs-and-acmm.md b/docs/content/hive/api-reference/packs-and-acmm.md index 50e5fbaa..df93d693 100644 --- a/docs/content/hive/api-reference/packs-and-acmm.md +++ b/docs/content/hive/api-reference/packs-and-acmm.md @@ -9,10 +9,10 @@ For a PR hold release, send `{"held": false, "type": "pr", "head": "` label (shortened with a hash suffix when the plain spelling would exceed GitHub's 50-character label cap, [#17037](https://github.com/hivecommons/hive/issues/17037)); `{"held": false}` removes exactly the labels causing the hold (`hive-pause/` and/or generic hold labels) and never removes `hive/` provenance. A GitHub failure answers `424` with the step and GitHub's reason — never `502`/`503`, which the hosted Ingress replaces with its generic "hive unavailable" page. Every toggle writes an audit-log entry; the #8851 upgrade migration writes `/data/hive-hold-migration-.json` with audit-backed, provenance-only, and ambiguous legacy `hive/` classifications. A hold added, or a release that removed a label, also records the dashboard user on the item in one App-authored comment under ``, edited in place (newest first, last 10) on the next hold action instead of repeated, because GitHub names the App as the label's actor ([#19852](https://github.com/hivecommons/hive/issues/19852)); `dashboard.attribute_label_actions: false` turns it off. A comment failure is logged and never fails the toggle. | `pkg/dashboard/api.go:345`, `pkg/dashboard/api_repo_hold.go` | -| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decision` | Owner or repo write/maintain/admin, signed-in GitHub user | Record an operator decision from the activity monitor's row menu / selection bar. Body `{"decision": "approve"|"direction"|"close-superseded"|"close-wontfix"|"close-read"|"close-issue"|"adopt"|"reroute"|"re-author"|"merge-now"|"queue-merge", "comment": "…", "type": "issue"|"pr", "superseded_by": "#458", "force": true, "to": ""|"any"}` (`force` only with `adopt`, `to` only with `reroute`; an unknown `decision` is a 400). On an issue parked at 045, `approve`/`direction` act exactly as a maintainer's `/hive approve` / `/hive decision ` comment would (labels, `approved-direction`, stage-engine Unparked fact, reply comment naming the operator). On a PR parked at 085 (`type: "pr"`), `approve` posts the `/lgtm` and `/approve` commands as two comments attributed to the operator, records the approval against the head as the human answer to a `requires_human` / decision-requested verdict (the lanes and the stage engine honour it like a trusted merger's Approve review), lifts `needs-human`, clears the sentinel label and acknowledges the bundle's sentinel findings for that head, re-derives the stage and drops the tracker cache — the response adds `released` (`approval-recorded`, `needs-human`, `sentinel-label`, `sentinel-acknowledged`) and `stage`; the merge gate decides from there (no review as the operator, no merge) — and `direction` records the text as a human change request against the head — the `/hive decision` fix lane — on a hive-authored PR, and on a contributor's clanker PR (`author/clanker` / hive attribution markers) where the text is posted to the contributor's hive and the PR moves to `stage/072-returned-to-contributor` (`status: "direction-returned-to-contributor"`); a person's PR, which no hive can carry direction to, answers 409. The close variants first post a required comment naming the operator (and the superseding PR when `superseded_by` is given); a failed comment prevents closure. `close-superseded` and `close-wontfix` close as **not planned**; `close-read` acknowledges an advisory issue and closes it **as completed**. `close-issue` (`type: "issue"` only) closes the single named open issue **as completed**, at any stage, leaving linked PRs and other issues untouched; it returns 400 for a PR (including one sent as an issue), 404 when the issue is not found, and 409 when already closed. It retains the existing permission and mutation gates, including the paused-repo `status: "refused"` result without writes. `adopt` and `re-author` require `type: "pr"` and queue adoption via the `adoption/supersede` label (409 unless `governor.labels.stage.adoption` is enabled). `adopt` with `"force": true` is *Adopt now* ([#15038](https://github.com/hivecommons/hive/issues/15038)): it bypasses the author's presence, the grace window and `maintainer_policy`, marks the stage record and nudges the automerge sweep so the adoption engine supersedes the head at once (responds `status: "already-adopted"` when nothing is left to do; 400 on the hive's own PR). `reroute` (`type: "pr"`, `"to": ""|"any"`) hands the PR's follow-up work to another online clanker through the contributor fix queue, posts a `` note and arms a pickup timer that falls back to Adopt now after `governor.reroute.pickup_timeout`; answers `status: "rerouted"`, 409 when no clanker is online or adoption is disabled. On a PR at 090, `queue-merge` (*Approve and let hive merge*, the lead action) records an approval attributed to the operator and applies the automerge label, returning `status: "queued-for-merge"` (on the hive's own PR, which the App cannot review, the queue note is a comment and the operator's approval is recorded as `approve` records it — `released` lists `approval-recorded`, `admitted`); hive's merge sweep merges on its next tick once CI is green and the head has soaked, and that recorded operator approval is the one thing that lets the sweep merge an untrusted-author PR (the merge comment names the operator). `merge-now` (*Merge now as maintainer*, secondary) posts an attributed comment and merges immediately through the hive's GitHub App, returning `status: "merged"`. Both require `type: "pr"` and a verified owner or `merger` role in addition to the route's repo permission check; both refuse closed/merged PRs and the operator's own PR. `merge-now` on a PR whose `mergeable_state` is `dirty`/`behind` instead answers `202` with `status: "rebase-queued"` (approval recorded, rebase kicked, merge follows via the follow-through once the hive's own rebase is green; a head pushed by anyone else fails the follow-through closed; `head-not-pushable` refusal on a fork without maintainer edits). `approve` on such a PR adds `rebase: {attempt, max, exhausted, head, text}` for the rebase episode it opened. `approve`, `merge-now` and `queue-merge` on a PR with an open change request from a reviewer with write access ([#20067](https://github.com/hivecommons/hive/issues/20067)) answer 409 with `status: "changes-requested"`, `needs_override_reason: true` and `change_requests: [{reviewer, review_id, commit_id, url}]`, and write nothing; resent with `"override_reason": "…"` and `"override_review_ids": [...]` naming every change request still open they proceed, the override covering exactly those change requests (`repo_item_decision_changes_requested_override` with the reason; the refusal is `repo_item_decision_changes_requested_blocked`). Every decision writes an audit-log entry (`repo_item_decision_*`, e.g. `repo_item_decision_adopt_now`, `repo_item_decision_reroute`). | `pkg/dashboard/api.go:347`, `pkg/dashboard/api_repo_item_decision.go` | -| `GET` | `/api/notes` | Signed-in GitHub user (or verified owner) | Maintainer notes — the private per-item notes maintainers leave each other on Activity Monitor rows ([#maintainer-notes](https://github.com/hivecommons/hive/blob/v5/src/docs/operator-reference.md#maintainer-notes)). `?repo=owner/name&number=N` lists one item's live notes oldest first; with no query, every live note in the hive (the SPA's count badges). `{notes: [{id, repo, number, author, text, created_at}]}`. Never read from or written to GitHub. | `pkg/dashboard/api.go:351`, `pkg/dashboard/api_maintainer_notes.go` | -| `POST` | `/api/notes` | Owner or repo write/maintain/admin, signed-in GitHub user | Append a maintainer note. Body `{repo, number, text}` — `text` is plain text up to 2000 characters; the author is the dashboard session's GitHub login, never a body field. `401` signed out, `403` without write on the repo, `400` for an empty/oversized note or a bad item. `201 {ok, note}`; appended to `/data/maintainer-notes.jsonl`, audited as `maintainer_note_add`, and broadcast as the `maintainer-notes` SSE event `{seq, repo, number, count, action}` so other maintainers' browsers refresh the row. | `pkg/dashboard/api.go:352`, `pkg/dashboard/api_maintainer_notes.go` | -| `DELETE` | `/api/notes/{id}` | The note's author, or a verified owner | Tombstone a maintainer note (append-only store: a `deleted_at` record, never a rewrite). `404` unknown or already deleted, `403` for anyone else. `{ok, note}`; audited as `maintainer_note_delete`, broadcast as `maintainer-notes`. | `pkg/dashboard/api.go:353`, `pkg/dashboard/api_maintainer_notes.go` | +| `POST` | `/api/repos/{owner}/{repo}/items/{number}/hold` | Owner or repo write/maintain/admin | Add or remove a dashboard hold chip for an issue or PR. Body `{"held": true}` adds the hive's exact-match canonical `hive-pause/` label (shortened with a hash suffix when the plain spelling would exceed GitHub's 50-character label cap, [#17037](https://github.com/hivecommons/hive/issues/17037)); `{"held": false}` removes exactly the labels causing the hold (`hive-pause/` and/or generic hold labels) and never removes `hive/` provenance. A GitHub failure answers `424` with the step and GitHub's reason — never `502`/`503`, which the hosted Ingress replaces with its generic "hive unavailable" page. Every toggle writes an audit-log entry; the #8851 upgrade migration writes `/data/hive-hold-migration-.json` with audit-backed, provenance-only, and ambiguous legacy `hive/` classifications. A hold added, or a release that removed a label, also records the dashboard user on the item in one App-authored comment under ``, edited in place (newest first, last 10) on the next hold action instead of repeated, because GitHub names the App as the label's actor ([#19852](https://github.com/hivecommons/hive/issues/19852)); `dashboard.attribute_label_actions: false` turns it off. A comment failure is logged and never fails the toggle. | `pkg/dashboard/api.go:348`, `pkg/dashboard/api_repo_hold.go` | +| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decision` | Owner or repo write/maintain/admin, signed-in GitHub user | Record an operator decision from the activity monitor's row menu / selection bar. Body `{"decision": "approve"|"direction"|"close-superseded"|"close-wontfix"|"close-read"|"close-issue"|"adopt"|"reroute"|"re-author"|"merge-now"|"queue-merge", "comment": "…", "type": "issue"|"pr", "superseded_by": "#458", "force": true, "to": ""|"any"}` (`force` only with `adopt`, `to` only with `reroute`; an unknown `decision` is a 400). On an issue parked at 045, `approve`/`direction` act exactly as a maintainer's `/hive approve` / `/hive decision ` comment would (labels, `approved-direction`, stage-engine Unparked fact, reply comment naming the operator). On a PR parked at 085 (`type: "pr"`), `approve` posts the `/lgtm` and `/approve` commands as two comments attributed to the operator, records the approval against the head as the human answer to a `requires_human` / decision-requested verdict (the lanes and the stage engine honour it like a trusted merger's Approve review), lifts `needs-human`, clears the sentinel label and acknowledges the bundle's sentinel findings for that head, re-derives the stage and drops the tracker cache — the response adds `released` (`approval-recorded`, `needs-human`, `sentinel-label`, `sentinel-acknowledged`) and `stage`; the merge gate decides from there (no review as the operator, no merge) — and `direction` records the text as a human change request against the head — the `/hive decision` fix lane — on a hive-authored PR, and on a contributor's clanker PR (`author/clanker` / hive attribution markers) where the text is posted to the contributor's hive and the PR moves to `stage/072-returned-to-contributor` (`status: "direction-returned-to-contributor"`); a person's PR, which no hive can carry direction to, answers 409. The close variants first post a required comment naming the operator (and the superseding PR when `superseded_by` is given); a failed comment prevents closure. `close-superseded` and `close-wontfix` close as **not planned**; `close-read` acknowledges an advisory issue and closes it **as completed**. `close-issue` (`type: "issue"` only) closes the single named open issue **as completed**, at any stage, leaving linked PRs and other issues untouched; it returns 400 for a PR (including one sent as an issue), 404 when the issue is not found, and 409 when already closed. It retains the existing permission and mutation gates, including the paused-repo `status: "refused"` result without writes. `adopt` and `re-author` require `type: "pr"` and queue adoption via the `adoption/supersede` label (409 unless `governor.labels.stage.adoption` is enabled). `adopt` with `"force": true` is *Adopt now* ([#15038](https://github.com/hivecommons/hive/issues/15038)): it bypasses the author's presence, the grace window and `maintainer_policy`, marks the stage record and nudges the automerge sweep so the adoption engine supersedes the head at once (responds `status: "already-adopted"` when nothing is left to do; 400 on the hive's own PR). `reroute` (`type: "pr"`, `"to": ""|"any"`) hands the PR's follow-up work to another online clanker through the contributor fix queue, posts a `` note and arms a pickup timer that falls back to Adopt now after `governor.reroute.pickup_timeout`; answers `status: "rerouted"`, 409 when no clanker is online or adoption is disabled. On a PR at 090, `queue-merge` (*Approve and let hive merge*, the lead action) records an approval attributed to the operator and applies the automerge label, returning `status: "queued-for-merge"` (on the hive's own PR, which the App cannot review, the queue note is a comment and the operator's approval is recorded as `approve` records it — `released` lists `approval-recorded`, `admitted`); hive's merge sweep merges on its next tick once CI is green and the head has soaked, and that recorded operator approval is the one thing that lets the sweep merge an untrusted-author PR (the merge comment names the operator). `merge-now` (*Merge now as maintainer*, secondary) posts an attributed comment and merges immediately through the hive's GitHub App, returning `status: "merged"`. Both require `type: "pr"` and a verified owner or `merger` role in addition to the route's repo permission check; both refuse closed/merged PRs and the operator's own PR. `merge-now` on a PR whose `mergeable_state` is `dirty`/`behind` instead answers `202` with `status: "rebase-queued"` (approval recorded, rebase kicked, merge follows via the follow-through once the hive's own rebase is green; a head pushed by anyone else fails the follow-through closed; `head-not-pushable` refusal on a fork without maintainer edits). `approve` on such a PR adds `rebase: {attempt, max, exhausted, head, text}` for the rebase episode it opened. `approve`, `merge-now` and `queue-merge` on a PR with an open change request from a reviewer with write access ([#20067](https://github.com/hivecommons/hive/issues/20067)) answer 409 with `status: "changes-requested"`, `needs_override_reason: true` and `change_requests: [{reviewer, review_id, commit_id, url}]`, and write nothing; resent with `"override_reason": "…"` and `"override_review_ids": [...]` naming every change request still open they proceed, the override covering exactly those change requests (`repo_item_decision_changes_requested_override` with the reason; the refusal is `repo_item_decision_changes_requested_blocked`). Every decision writes an audit-log entry (`repo_item_decision_*`, e.g. `repo_item_decision_adopt_now`, `repo_item_decision_reroute`). | `pkg/dashboard/api.go:350`, `pkg/dashboard/api_repo_item_decision.go` | +| `GET` | `/api/notes` | Signed-in GitHub user (or verified owner) | Maintainer notes — the private per-item notes maintainers leave each other on Activity Monitor rows ([#maintainer-notes](https://github.com/hivecommons/hive/blob/v5/src/docs/operator-reference.md#maintainer-notes)). `?repo=owner/name&number=N` lists one item's live notes oldest first; with no query, every live note in the hive (the SPA's count badges). `{notes: [{id, repo, number, author, text, created_at}]}`. Never read from or written to GitHub. | `pkg/dashboard/api.go:354`, `pkg/dashboard/api_maintainer_notes.go` | +| `POST` | `/api/notes` | Owner or repo write/maintain/admin, signed-in GitHub user | Append a maintainer note. Body `{repo, number, text}` — `text` is plain text up to 2000 characters; the author is the dashboard session's GitHub login, never a body field. `401` signed out, `403` without write on the repo, `400` for an empty/oversized note or a bad item. `201 {ok, note}`; appended to `/data/maintainer-notes.jsonl`, audited as `maintainer_note_add`, and broadcast as the `maintainer-notes` SSE event `{seq, repo, number, count, action}` so other maintainers' browsers refresh the row. | `pkg/dashboard/api.go:355`, `pkg/dashboard/api_maintainer_notes.go` | +| `DELETE` | `/api/notes/{id}` | The note's author, or a verified owner | Tombstone a maintainer note (append-only store: a `deleted_at` record, never a rewrite). `404` unknown or already deleted, `403` for anyone else. `{ok, note}`; audited as `maintainer_note_delete`, broadcast as `maintainer-notes`. | `pkg/dashboard/api.go:356`, `pkg/dashboard/api_maintainer_notes.go` | | `POST` / `GET` | `/api/repos/{owner}/{repo}/items/{number}/decide-delegated` | Same as `…/hold` (owner or repo write), signed-in GitHub user; `decisions.delegate.enabled` (403 when off) | *Let hive decide*: enqueue a delegated-decision job in which the hive decides the parked item itself as the owner's delegate under `pkg/delegatedecision.PolicyText` and records it as a human decision (`/hive decision` comment with the `` marker, park labels off, `triage/accepted`, queue approval on a PR head). Body `{"type": "issue"|"pr", "reason", "caption", "sentinel_reason"}`. `POST` answers 202 with the job (`{id, status: "running"|"done"|"failed", decision: {verdict, rule, text, rationale, actions, keeps_park, ladder?: {decision, reason, ruled_out[]}}, notes, error}`; `ladder` is set on contributor-PR decisions and names the rung that decided — `already-fixed` → `mergeable-as-is` → `rebase-then-merge` → `return-to-contributor` → `contributor-offline` — and why each rung above it did not apply); 409 with the running job while one is in flight; `GET` reads it. Rails: never merges, refuses items wearing `hold`, never grants secrets/permissions (`needs-owner` + `hold` instead), recommends only on hive policy/governance questions (keeps 085), and never decides a PR whose CI is running or whose review is incomplete on the current head — it answers `no-effect` (rule `mid-flight`, nothing written; fails closed, "review state not yet loaded", when the PR's review state cannot be read from the tracker; per PR in the `prs` fan-out, where the PR is skipped and counted as such), and the policy itself never releases (`default-release`, `small-low-risk`) a head whose checks are pending (rule `ci-pending`). Audited as `repo_item_decision_delegated[_failed]`. See [dashboard-sections.md](/docs/hive/dashboard-sections#let-hive-decide). | `pkg/dashboard/api.go:329`, `pkg/dashboard/api_repo_item_decide_delegated.go` | -| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decide-delegated/plan` | Same as `…/decide-delegated` | Preview for *Let hive decide*: runs the same owner-delegate policy with **no side effects** (nothing written, no job) and answers `{would, rule, acting, title, summary, why, consequences[], ladder, mergeable_as_is, alternatives[], writes: false, prior, notes}` — `summary` is one verb-first sentence with no "Hive would:" prefix (*Send #15332 back to its author with one instruction: make CI green, nothing else.*), `why` one short line (*CI is red.*), `consequences` at most two items, `ladder` the rung that decided with its `ruled_out` list, and `mergeable_as_is` whether an as-is merge is honest (the queue-merge and merge-now alternatives are dropped when it is not). The dialog shows **Cancel** / **Let hive do that**, plus **Approve and let hive merge** (or **Merge now as maintainer** when the hive would approve anyway) only when `mergeable_as_is`; only then does the SPA post `…/decide-delegated` with `chosen` naming the button. A transient GitHub failure (5xx, rate limit, timeout) is retried twice with backoff before the plan gives up. A failure answers `{ok: false, error, reason, retryable, attempts, elapsed_ms, hive, hint}` under **409** when the item is no longer open (`reason: not-open`) or **424** when a read it depends on failed (`github`), is not configured (`config`) or the plan itself failed (`plan`) — never 502/503, which the hosted Ingress intercepts and replaces with its generic *hive unavailable* page (hivecommons/hive#16776). See [dashboard-sections.md](/docs/hive/dashboard-sections#let-hive-decide). | `pkg/dashboard/api.go:356`, `pkg/dashboard/api_repo_item_decide_delegated_plan.go` | -| `POST` | `/api/repos/{owner}/{repo}/items/{number}/blocker/recheck` | Same as `…/hold` (owner or repo write), signed-in GitHub user | *Re-check permissions* on an issue parked on a capability blocker (#15099): probes the GitHub App installation's permissions; when the missing permission is granted, clears every ledger entry blocked on it and un-parks the item (`{result: {outcome: "released", …}}`), otherwise `{result: {outcome: "no-effect", reason: "blocker", options: [...]}}`; 404 when the item has no blocker, 409 when the blocker is not a capability gap | `pkg/dashboard/api.go:357` | -| `POST` | `/api/repos/{owner}/{repo}/items/{number}/blocker/close-partial` | Same as `…/hold` (owner or repo write), signed-in GitHub user | Option (c) on a capability blocker (#15099): labels the issue `hive/partially-addressed`, posts the operator's `{"comment"}` naming what remains and closes it; the ledger entry is cleared | `pkg/dashboard/api.go:358` | -| `POST` | `/api/repos/{owner}/{repo}/items/{number}/accept-triage` | Owner or repo write/maintain/admin | Accept triage on an issue from the activity monitor's row menu — what a maintainer accepting triage on GitHub does by hand: adds the reporter-trust triage label (`triage/accepted`, or the first of `issue_filter.reporter_trust.untrusted_require_labels`; the label is created in the repo if missing) and removes the awaiting label (`needs-triage` / `reporter_trust.awaiting_label`) and a Hive-written `stage/015-triage-needed`. Empty body. Returns `{ok, repo, number, acceptLabel, added, removed, alreadyAccepted, minStatusSeq}`; an issue already carrying the accept label with nothing left to remove is a no-op (`alreadyAccepted: true`, no write, no audit). 404 for a pull request or an unknown item. The status snapshot's labels are patched so the next reconcile reads 010 Actionable before the engine's own 015 → 010 derivation. Every write is audited as `repo_item_accept_triage` under the dashboard user and recorded on the issue in the `` comment naming that user and the labels changed (same rules as `…/hold`). A PR `approve` / `queue-merge` decision that lifts `needs-human` or the sentinel label records it the same way under `kind=approval`. | `pkg/dashboard/api.go:578`, `pkg/dashboard/api_repo_item_accept_triage.go` | +| `POST` | `/api/repos/{owner}/{repo}/items/{number}/decide-delegated/plan` | Same as `…/decide-delegated` | Preview for *Let hive decide*: runs the same owner-delegate policy with **no side effects** (nothing written, no job) and answers `{would, rule, acting, title, summary, why, consequences[], ladder, mergeable_as_is, alternatives[], writes: false, prior, notes}` — `summary` is one verb-first sentence with no "Hive would:" prefix (*Send #15332 back to its author with one instruction: make CI green, nothing else.*), `why` one short line (*CI is red.*), `consequences` at most two items, `ladder` the rung that decided with its `ruled_out` list, and `mergeable_as_is` whether an as-is merge is honest (the queue-merge and merge-now alternatives are dropped when it is not). The dialog shows **Cancel** / **Let hive do that**, plus **Approve and let hive merge** (or **Merge now as maintainer** when the hive would approve anyway) only when `mergeable_as_is`; only then does the SPA post `…/decide-delegated` with `chosen` naming the button. A transient GitHub failure (5xx, rate limit, timeout) is retried twice with backoff before the plan gives up. A failure answers `{ok: false, error, reason, retryable, attempts, elapsed_ms, hive, hint}` under **409** when the item is no longer open (`reason: not-open`) or **424** when a read it depends on failed (`github`), is not configured (`config`) or the plan itself failed (`plan`) — never 502/503, which the hosted Ingress intercepts and replaces with its generic *hive unavailable* page (hivecommons/hive#16776). See [dashboard-sections.md](/docs/hive/dashboard-sections#let-hive-decide). | `pkg/dashboard/api.go:359`, `pkg/dashboard/api_repo_item_decide_delegated_plan.go` | +| `POST` | `/api/repos/{owner}/{repo}/items/{number}/blocker/recheck` | Same as `…/hold` (owner or repo write), signed-in GitHub user | *Re-check permissions* on an issue parked on a capability blocker (#15099): probes the GitHub App installation's permissions; when the missing permission is granted, clears every ledger entry blocked on it and un-parks the item (`{result: {outcome: "released", …}}`), otherwise `{result: {outcome: "no-effect", reason: "blocker", options: [...]}}`; 404 when the item has no blocker, 409 when the blocker is not a capability gap | `pkg/dashboard/api.go:360` | +| `POST` | `/api/repos/{owner}/{repo}/items/{number}/blocker/close-partial` | Same as `…/hold` (owner or repo write), signed-in GitHub user | Option (c) on a capability blocker (#15099): labels the issue `hive/partially-addressed`, posts the operator's `{"comment"}` naming what remains and closes it; the ledger entry is cleared | `pkg/dashboard/api.go:361` | +| `POST` | `/api/repos/{owner}/{repo}/items/{number}/accept-triage` | Owner or repo write/maintain/admin | Accept triage on an issue from the activity monitor's row menu — what a maintainer accepting triage on GitHub does by hand: adds the reporter-trust triage label (`triage/accepted`, or the first of `issue_filter.reporter_trust.untrusted_require_labels`; the label is created in the repo if missing) and removes the awaiting label (`needs-triage` / `reporter_trust.awaiting_label`) and a Hive-written `stage/015-triage-needed`. Empty body. Returns `{ok, repo, number, acceptLabel, added, removed, alreadyAccepted, minStatusSeq}`; an issue already carrying the accept label with nothing left to remove is a no-op (`alreadyAccepted: true`, no write, no audit). 404 for a pull request or an unknown item. The status snapshot's labels are patched so the next reconcile reads 010 Actionable before the engine's own 015 → 010 derivation. Every write is audited as `repo_item_accept_triage` under the dashboard user and recorded on the issue in the `` comment naming that user and the labels changed (same rules as `…/hold`). A PR `approve` / `queue-merge` decision that lifts `needs-human` or the sentinel label records it the same way under `kind=approval`. | `pkg/dashboard/api.go:581`, `pkg/dashboard/api_repo_item_accept_triage.go` | | `POST` | `/api/repos/{owner}/{repo}/items/{number}/sha-waiver` | Owner or repo write/maintain/admin | Waive or restore the SHA-hold requirement on an issue from the activity monitor's row menu. Body `{"waived": true\|false}`. Waiving adds the persistent `sha-waived` label (created if missing), removes `needs-sha` at once and posts one App-authored comment with a `` marker; restoring removes `sha-waived`. A repeat is a no-op; pull requests are 404. Returns `{ok, repo, number, waived, added, removed, minStatusSeq, result}`. Audited as `repo_item_sha_waiver`. | -| `POST` | `/api/repos/{owner}/{repo}/items/{number}/sentinel-confirm` | Owner or repo write/maintain/admin | **Confirm safe** on the activity monitor's human-gate pill ([#17470](https://github.com/hivecommons/hive/issues/17470)): a person confirms a sentinel finding is intended. Body `{comment?, type?}` (`type` is `pr` or `issue`, comment ≤ 4000 characters). Posts the confirmation as a comment first — ``, `@user confirmed the sentinel finding safe from the dashboard.`, then the comment text — and removes every label matching the configured sentinel label (`sentinel.label`, default `sentinel-alert`, case-insensitive). Returns `{ok, repo, number, label, removed, alreadyClear, result}`; with no sentinel label on the item the comment is still posted and `alreadyClear` is true. 403 for a repository the hive does not watch. Audited as `repo_item_sentinel_confirm` under the dashboard user; the operator-action ledger records it as `confirm-sentinel`. | `pkg/dashboard/api.go:348`, `pkg/dashboard/api_repo_item_sentinel_confirm.go` | -| `GET` | `/api/acmm/evaluation` | Dashboard auth/session | ACMMEvaluation — combined codebase + operational result, cached server-side for 1 hour (`acmmEvalTTL`). `?refresh=1` (the dashboard's "🔄 Re-evaluate" button, #5877) bypasses the hourly TTL but is debounced server-side: requests within 1 minute of the last evaluation (`acmmRefreshDebounce`) still serve the cache, since a full refresh costs up to ~29 GitHub GetContents calls per repo. The response's `last_evaluated_at` timestamp reports when the cached evaluation was computed | `pkg/dashboard/api.go:360`, `pkg/dashboard/api_acmm_eval.go` | -| `POST` | `/api/acmm/issue` | Owner only | ACMMCreate Issue — files on GitHub or, with `governor.acmm.issue_tracker: work_source` / body `tracker: "work_source"` on a Linear-sourced hive, on Linear; response `tracker` says which. See [ACMM policy matrix](/docs/hive/acmm-policy-matrix#where-acmm-gap-issues-are-filed) | `pkg/dashboard/api.go:361` | -| `GET` | `/api/acmm-recommendation` | Dashboard auth/session | Advisory level-up recommendation (`acmmadvisor.Recommendation`, JSON): never changes the applied level — see [ACMM advisor](https://github.com/hivecommons/hive/blob/v5/src/docs/acmm-advisor.md) | `pkg/dashboard/api.go:362` | -| `GET` | `/api/hive-advice` | Dashboard auth/session | Weekly owner advice (`hiveadvisor.Result`, JSON) shared with the advisory digest: recommendations with `items`, `links` (Overview export paths) and `bands`; `bands[]` rule text; `counts` naming the governor actionable queue vs. the Overview total. Which recommendations show is frozen for 7 days; their numbers refresh every call — see [Owner advice](/docs/hive/operations/automation-and-review/advisory-digest#owner-advice) | `pkg/dashboard/api.go:364`, `pkg/dashboard/api_hive_advice.go` | +| `POST` | `/api/repos/{owner}/{repo}/items/{number}/sentinel-confirm` | Owner or repo write/maintain/admin | **Confirm safe** on the activity monitor's human-gate pill ([#17470](https://github.com/hivecommons/hive/issues/17470)): a person confirms a sentinel finding is intended. Body `{comment?, type?}` (`type` is `pr` or `issue`, comment ≤ 4000 characters). Posts the confirmation as a comment first — ``, `@user confirmed the sentinel finding safe from the dashboard.`, then the comment text — and removes every label matching the configured sentinel label (`sentinel.label`, default `sentinel-alert`, case-insensitive). Returns `{ok, repo, number, label, removed, alreadyClear, result}`; with no sentinel label on the item the comment is still posted and `alreadyClear` is true. 403 for a repository the hive does not watch. Audited as `repo_item_sentinel_confirm` under the dashboard user; the operator-action ledger records it as `confirm-sentinel`. | `pkg/dashboard/api.go:351`, `pkg/dashboard/api_repo_item_sentinel_confirm.go` | +| `GET` | `/api/acmm/evaluation` | Dashboard auth/session | ACMMEvaluation — combined codebase + operational result, cached server-side for 1 hour (`acmmEvalTTL`). `?refresh=1` (the dashboard's "🔄 Re-evaluate" button, #5877) bypasses the hourly TTL but is debounced server-side: requests within 1 minute of the last evaluation (`acmmRefreshDebounce`) still serve the cache, since a full refresh costs up to ~29 GitHub GetContents calls per repo. The response's `last_evaluated_at` timestamp reports when the cached evaluation was computed | `pkg/dashboard/api.go:363`, `pkg/dashboard/api_acmm_eval.go` | +| `POST` | `/api/acmm/issue` | Owner only | ACMMCreate Issue — files on GitHub or, with `governor.acmm.issue_tracker: work_source` / body `tracker: "work_source"` on a Linear-sourced hive, on Linear; response `tracker` says which. See [ACMM policy matrix](/docs/hive/acmm-policy-matrix#where-acmm-gap-issues-are-filed) | `pkg/dashboard/api.go:364` | +| `GET` | `/api/acmm-recommendation` | Dashboard auth/session | Advisory level-up recommendation (`acmmadvisor.Recommendation`, JSON): never changes the applied level — see [ACMM advisor](https://github.com/hivecommons/hive/blob/v5/src/docs/acmm-advisor.md) | `pkg/dashboard/api.go:365` | +| `GET` | `/api/hive-advice` | Dashboard auth/session | Weekly owner advice (`hiveadvisor.Result`, JSON) shared with the advisory digest: recommendations with `items`, `links` (Overview export paths) and `bands`; `bands[]` rule text; `counts` naming the governor actionable queue vs. the Overview total. Which recommendations show is frozen for 7 days; their numbers refresh every call — see [Owner advice](/docs/hive/operations/automation-and-review/advisory-digest#owner-advice) | `pkg/dashboard/api.go:367`, `pkg/dashboard/api_hive_advice.go` | diff --git a/docs/content/hive/api-reference/snapshots-and-style.md b/docs/content/hive/api-reference/snapshots-and-style.md index 77b18491..4f9ba4d8 100644 --- a/docs/content/hive/api-reference/snapshots-and-style.md +++ b/docs/content/hive/api-reference/snapshots-and-style.md @@ -8,7 +8,7 @@ Part of the [Dashboard REST API reference](https://github.com/hivecommons/hive/b | Method | Path | Auth | Purpose | Source | |---|---|---|---|---| | `GET` | `/api/style` | Public | Sanitized custom dashboard CSS | `pkg/dashboard/api.go:50` | -| `GET` | `/branding/custom.css` | Dashboard auth/session | Operator branding stylesheet override, read per request (see [branding](https://github.com/hivecommons/hive/blob/v5/src/docs/branding.md)) | `pkg/dashboard/server.go:1935` | +| `GET` | `/branding/custom.css` | Dashboard auth/session | Operator branding stylesheet override, read per request (see [branding](https://github.com/hivecommons/hive/blob/v5/src/docs/branding.md)) | `pkg/dashboard/server.go:1939` | | `GET` | `/api/snapshot/frame-ancestors` | Public | Snapshot framing allowlist | `pkg/dashboard/api.go:94` | | `GET` | `/api/snapshot` | Public | Snapshot data | `pkg/dashboard/api.go:95` | | `GET` | `/snapshot` | Public | Public read-only snapshot page | `pkg/dashboard/api.go:96` | diff --git a/docs/content/hive/cli-pins.md b/docs/content/hive/cli-pins.md index f88a0a9d..dd0afa0c 100644 --- a/docs/content/hive/cli-pins.md +++ b/docs/content/hive/cli-pins.md @@ -243,8 +243,19 @@ patch-only bump PR. - No fast lane from a "this model needs version X" runtime error ([#8418](https://github.com/hivecommons/hive/issues/8418)) to a dispatch of this workflow. Dispatching by hand with `cli=` is the interim path. -- `KILO_CLI_VERSION` and `COPILOT_SDK_VERSION` are pinned but not bumped by - this workflow. +- `KILO_CLI_VERSION`, `COPILOT_SDK_VERSION` and `COPILOT_SDK_V2_VERSION` are + pinned but not bumped by this workflow. +- The Copilot CLI and the model-discovery SDKs are **protocol-coupled** and + the workflow bumps only the CLI. The CLI negotiates a JSON-RPC protocol + version: 1.0.88 speaks 3, 1.0.118 speaks 4. `@github/copilot-sdk` (legacy, + pinned as `COPILOT_SDK_VERSION`) speaks 3 only; `@microsoft/copilot-sdk` + (pinned as `COPILOT_SDK_V2_VERSION`) speaks 4 only. Both are installed so + `bin/copilot-models.mjs` can pair with whichever CLI the image carries, but + a Copilot CLI bump that lands in a new protocol no installed SDK speaks + still degrades model discovery to the HTTP catalog and self-reports + `model_discovery_degraded` (#21106, caused by #21045). When bumping the + Copilot CLI, check the protocol version the new CLI reports and bump the + matching SDK pin in the same PR. - The Plaud knowledge connector's default MCP command is pinned to `npx -y @plaud-ai/mcp@0.3.14` by the `plaudMCPVersion` constant in `src/pkg/knowledge/connector/plaud.go` (not a Dockerfile `ARG`: npx fetches diff --git a/docs/content/hive/contributor-relay.md b/docs/content/hive/contributor-relay.md index 1b6f8afc..7feca752 100644 --- a/docs/content/hive/contributor-relay.md +++ b/docs/content/hive/contributor-relay.md @@ -8,7 +8,7 @@ For labels that make work eligible or ineligible for contributors, see [Hive Lab The hive operator chooses eligible repositories, labels, and models. You choose the coding tool, model, and machine. Your provider credentials stay local; Hive supplies short-lived forge access for each assigned task. -Contributor assignments support GitHub and Forgejo repositories. GitHub tasks use a GitHub App; Forgejo tasks require an HTTPS forge and an operator-configured integration scoped to the individual repository, acting as a dedicated Forgejo user (`contributor_login`) that is never the hive's own user. Before a Forgejo credential is handed out, the hub checks that it does not act as the hive and cannot write to the hive's other repositories; a credential that fails either check is never sent. A Forgejo task's PR must come from the branch `hive-task/`, which the relay names in the prompt, because every contributor on that repository shares the one Forgejo user. See [Forgejo contributor task credentials](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#contributor-task-credentials). GitLab and Gitea repositories remain excluded from the catalog and issue selection. +Contributor assignments support GitHub and Forgejo repositories. GitHub tasks use a GitHub App; Forgejo tasks require an HTTPS forge and an operator-configured integration scoped to the individual repository, acting as a dedicated Forgejo user (`contributor_login`) that is never the hive's own user. A contributor the operator maps in `forgejo.integration.contributor_identities` gets their own Forgejo user and per-repository integration audience; everyone else keeps the shared user. A mapped user's assignment or `/claim` counts in the claim gate, because it names one person; the shared user's is still ignored, and neither login is trusted for automerge or close-on-merge. Before a Forgejo credential is handed out, the hub checks that it acts as the expected user and does not act as the hive or write to the hive's other repositories; a credential that fails any check is never sent. A Forgejo task's PR must come from the branch `hive-task/`, which the relay names in the prompt, and is credited to the `forge_login` the assignment carries. See [Forgejo contributor task credentials](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#contributor-task-credentials). GitLab and Gitea repositories remain excluded from the catalog and issue selection. When actionable issues on unsupported forges are skipped, `task_unavailable.filtered` includes `unsupported_forge` with the number skipped. An unrestricted relay receives `no_matching_work`; a relay with a selected repository scope receives `no_selected_work` and only counts matching repositories. Forgejo repositories also match existing `gitea` scope IDs on the same host. The ready queue identifies unsupported repositories as `unsupported_forge` in withheld diagnostics. @@ -220,6 +220,10 @@ The first-task route ends above. The following sections cover custom launch sett Operators can publish a short **Help & community** list with `contribute.help_links` (Governor → Hub and `/contribute` Management). Onboarding and Operations show it, and `auth_ok` sends it for the relay to print once. Use joinable community links: Discord `https://discord.com/channels//` URLs require existing server membership; `https://hivecommons.dev/discord` lets newcomers join. +## Optional local spend and egress view + +Because the relay runs outside any hive's proxy, a contributor who wants their own per-request spend and egress view on that machine can follow [Cortex alongside a ClankeR](/docs/hive/integrations/clanker-cortex), a third-party tool Hive does not ship or require and that changes nothing about admission, task credentials or completion reporting. + ## Apple MLX local inference This optional **local contributor** route uses the existing **Pi coding agent** @@ -1288,7 +1292,7 @@ A contributor can narrow which of a hive's repositories it is offered work from - **Acknowledgement.** The hub answers `{"type":"repo_scope_ack","scope_version":N,"accepted":true,"mode":"selected","unknown":[…]}`. `unknown` lists well-formed ids this hive does not offer; they are kept but never match. A malformed scope (non-positive version, unknown mode, more than 1000 ids, or an id that is not four non-empty `/`-separated segments) is answered with `accepted:false` and a `reason` (`invalid_scope_version`, `invalid_mode`, `too_many_repositories`, `invalid_repository_id`). The hub then **fails closed**: the connection is served nothing — `task_unavailable` with reason `repo_scope_invalid` — until a valid scope is acknowledged. - **Version fencing.** `ready` may carry `scope_version`. The hub selects only when it equals the acknowledged version; otherwise it answers `task_unavailable` with reason `no_selected_work` and the relay waits for its `repo_scope_ack`. This closes the race where a relay reloads its scope while a `ready` is in flight. - **Filtering.** Repositories outside an acknowledged `selected` scope are skipped while candidates are collected — before any lease is taken or task token minted — so an out-of-scope item is never leased for this connection and stays available to other contributors. A restricted contributor is therefore served its selected lower-priority work instead of being offered the hive's top out-of-scope item. When nothing admissible remains inside the scope, the reason is `no_selected_work` rather than `no_matching_work`. Queued fix-pr tasks for the contributor's own red PRs are not scope-filtered. The hub owns offering fix-pr for the contributor's own PRs regardless of scope; the relay owns applying the contributor's current selection, and declines an out-of-scope fix-pr with `out_of_contributor_scope`, which the hub treats like any other scope decline. -- **Assignment identity.** Every `task_assign` (issue and fix-pr) carries `forge` and `host` beside `repo`, taken from the same source as the advertised ids (`github` with the hive's configured GitHub host, or `forgejo` with the repository's `forge_url` host), so a relay can build the full `forge/host/owner/name` id without inferring it from the URL. Forgejo assignments also carry `forge_url` (the HTTPS forge root) and `forge_login` (the `contributor_login` user the task credential acts as; the relay credits a PR to the task only when that user opened it from `hive-task/`). All are optional and omitted by older hubs. +- **Assignment identity.** Every `task_assign` (issue and fix-pr) carries `forge` and `host` beside `repo`, taken from the same source as the advertised ids (`github` with the hive's configured GitHub host, or `forgejo` with the repository's `forge_url` host), so a relay can build the full `forge/host/owner/name` id without inferring it from the URL. Forgejo assignments also carry `forge_url` (the HTTPS forge root) and `forge_login` (the Forgejo user the task credential acts as: the shared `contributor_login`, or the contributor's own login from `forgejo.integration.contributor_identities`; the relay credits a PR to the task only when that user opened it from `hive-task/`). All are optional and omitted by older hubs. - **Decline.** If an out-of-scope offer still arrives (for example a scope change racing an assignment), the relay sends `task_declined` with `reason: "out_of_contributor_scope"` before the credential is delivered. The hub revokes the lease, clears the release cooldown and hands back the hourly/daily rate-window slot, so the decline books no failure, streak or cooldown and consumes no allowance. Like the quota-preflight decline, it is honoured only while the credential is still withheld, i.e. when the relay also advertises `quota_preflight_v1` or the hive requires explicit acceptance. ### Protocol compatibility @@ -1997,8 +2001,10 @@ to a single `0600` file (`GH_TOKEN_CACHE`, overridable with A Forgejo task credential is kept apart from GitHub tooling, in `.forgejo` (also `0600`, replaced on refresh); the task prompt refers to it as `${HIVE_FORGEJO_TOKEN_CACHE}`. It carries -`write:repository`, `read:issue` and `read:user` only, so the relay writes -no issue comment or label on a Forgejo task. +`write:repository` and `read:issue` only, so the relay writes no issue +comment or label on a Forgejo task. A credential limited to its repository +cannot read `GET /user`, which is why `task_assign` names the user it acts as +in `forge_login`. **Refresh.** On every heartbeat the hub checks whether the active task's token was minted at least **50 minutes** ago (`wsTokenRefreshPeriod`) and, if so, diff --git a/docs/content/hive/dashboard-sections/overview-and-metrics.md b/docs/content/hive/dashboard-sections/overview-and-metrics.md index 7872eb85..76b7c11e 100644 --- a/docs/content/hive/dashboard-sections/overview-and-metrics.md +++ b/docs/content/hive/dashboard-sections/overview-and-metrics.md @@ -308,6 +308,8 @@ Beneath it, **of which $X is in the live token summary since the last reset on < The **usage by model** and **usage by sandbox** tables are built from the live token summary only (their window tag says so), so their totals match the "of which" line, not the headline. +**Wire-only rows.** With the wire usage ledger on (`tokens.wire_ledger.enabled`), an agent the proxy measured on the wire but whose transcript Hive cannot read shows in **usage by sandbox** and **cost per session** with the label **agent-level, no PR attribution**. Its spend is in the totals, but there is no per-message timing to tie it to a repo or pull request, so **cost by repo** lists it on a separate **wire-only** row rather than on a repo row or under **unattributed**, and **cost by work item** never places it on an issue or PR. On `/api/cost` these rows carry `measure_source: "wire"` and `pr_attribution: "none"`; agents with a transcript carry `pr_attribution: "inferred"`. See [Token tracking](https://github.com/hivecommons/hive/blob/v5/src/docs/token-tracking.md#dashboard-and-api) and [ADR-0027](/docs/hive/adr/0027-hybrid-wire-and-transcript-cost-accounting#5-coverage-limits-stated-plainly). + When your AI gateway reports its own spending, that figure appears too. ### Chart ranges and controls diff --git a/docs/content/hive/dashboard.md b/docs/content/hive/dashboard.md index 06395fd5..0badbcfb 100644 --- a/docs/content/hive/dashboard.md +++ b/docs/content/hive/dashboard.md @@ -200,7 +200,8 @@ Copilot CLI config), never with another GitHub token on the host. It is for display only: no relay or quota guard holds work on it. With provider rotation on, list `github` under `governor.rotation.providers` to measure Copilot. -Only the owner sees it. To hide it, untick **Show usage gauge** in the +Viewers with write access or higher (the owner, merger and read-write) see it; +read-only and anonymous viewers do not. To hide it, untick **Show usage gauge** in the Overview settings (remembered per browser). To also show it as a small chip in the header on every page, turn on **Also show the usage gauge in the header** (`dashboard.subscription_gauge_header`) under Settings → Dashboard. The chip's @@ -231,7 +232,7 @@ which accounts the hive's agents use: such as `hive-app[bot]`, or the account behind the hive's token) and the account the agent is signed in with at the provider whose plan its backend spends, each with its stable ID. -- For the owner, who is the only viewer of the usage gauges, each +- For those viewers, each **Overview** usage row also says "Signed in as" that provider's account, and the **mini usage gauges** show it only in the hover tooltip, next to the provider name and reset time, never on the gauge itself. @@ -245,17 +246,64 @@ Every provider hive measures is covered: - **Codex:** the ChatGPT account email and account ID. - **Antigravity (`agy`):** the Google account and its Google ID from agy's own sign-in. -- **Gemini CLI:** the active Google account and its Google ID. +- **Gemini CLI:** the sign-in the CLI actually uses: the auth type saved in + `.gemini/settings.json` (`security.auth.selectedType`), else the one its + environment selects (`GOOGLE_GENAI_USE_GCA`, `GOOGLE_GENAI_USE_VERTEXAI`, + `GOOGLE_GEMINI_BASE_URL`, `GEMINI_API_KEY`). A Google sign-in shows the + active Google account and its Google ID; a Gemini API key, or a Vertex AI + express-mode key (`GOOGLE_API_KEY`), shows "API key (no account login)". + Vertex AI through application default credentials, a gateway base URL and + Cloud Shell credentials have no local account record and show nothing, and + a Google account left over from an earlier login is never shown for an + agent that now runs on a key. - **Kiro, DeepSeek and any API-key sign-in:** "API key (no account login)", because a key has no account login. -Agents on a backend with no measured plan, such as a gateway (OpenRouter, -LiteLLM, vLLM) or a CLI hive does not measure, show only their GitHub account. - -Only a login and an ID are ever sent: never a token, key or other credential. +**Muse Code (`muse`)** shows the Meta account email (or display name) from +the saved login. `META_API_KEY` overrides the login; a key set that way or +saved with `muse auth set` shows "API key (no account login)". + +CLI backends hive does not measure show their own sign-in, read from the +shared CLI home without a network call: + +- **OpenCode, Kilo and Pi:** the `auth.json` entry for the provider the + agent's model names (`.local/share/opencode/auth.json`, + `.local/share/kilo/auth.json`, `.pi/agent/auth.json`). An OAuth sign-in + shows the account email and account ID the CLI records beside it, and + nothing when it records none; a key entry shows "API key (no account + login)". +- **Goose, Bob, Aider, OpenHands and Cline:** these authenticate only with a + key, so they show "API key (no account login)" when one is present: goose's + `secrets.yaml` or its provider's key variable (nothing for a local provider + such as Ollama), bob's key variable or managed key file, the key variable of + aider's model provider, `LLM_API_KEY` or OpenHands' saved key, and the Cline + worker's API-key provider in `providers.json`. +- **OMP (`omp`):** with `OMP_AUTH_BROKER_URL` set, OMP resolves its sign-ins + through the fleet's auth broker, so the card says the account is held by + the auth broker and names the broker's host (no userinfo, path or query). + The dashboard never contacts the broker or decrypts its credential cache. + Without a broker, OMP keeps its sign-ins in each agent's `agent.db` SQLite + store, which the dashboard does not read, so the card shows only the GitHub + account. + +**Omnigent (`omnigent`)** shows only its GitHub account. Hive launches it with +`--server local`, where the account is that of the harness Omnigent picks at +run time; a saved remote-server login (`~/.omnigent/auth_tokens.json`) is not +that account and is never shown. When the dashboard cannot identify an +account, the card shows only the GitHub identity. + +Agents on a gateway (a named gateway such as OpenRouter, or the built-in +litellm, vLLM, llm-d and watsonx backends) show the route instead of an +account: the gateway name and kind, the upstream model and endpoint host, and +the key label and watsonx project hive's config records for that gateway. The +endpoint is reduced to its host, so credentials in a URL are never shown. + +Only a login and an ID (and, for gateways, the route above) are ever sent: +never a token, key or other credential. A key is recognised by its presence, +never by its value. The check is made on the server: `GET /api/agents/identity` answers read-only and anonymous viewers with an empty object, and the `accounts` field of the -usage readings is sent only with the owner-only `GET /api/providers/headroom`. +usage readings is sent only with the write-tier `GET /api/providers/headroom`. The identities are refreshed every five minutes. ## Governor card @@ -647,6 +695,10 @@ page, so a download reflects the latest server state even between page updates. Automation can use the corresponding `.json` endpoints and optional `band`, `repo`, `stale`, and `held` filters. Cookie sessions work directly; token-authenticated pages include their API token in the download link's query string. +A link shared outside the dashboard (for example in an advisory digest on a +GitHub issue) carries no session, so an unauthenticated browser that opens it +gets the hive's sign-in page and is returned to the same export after signing +in; non-browser API clients still receive the `{"error":"unauthorized"}` JSON 401 (#21120). The Overview header's ⚙️ popover stores browser-local chart preferences under `hive-overview-charts`: which chart types are in rotation, whether the carousel diff --git a/docs/content/hive/data-janitor.md b/docs/content/hive/data-janitor.md index 5e1e80e6..72243fd2 100644 --- a/docs/content/hive/data-janitor.md +++ b/docs/content/hive/data-janitor.md @@ -24,8 +24,8 @@ item, so an item still being written to is never selected. | Rule | Selects | Default retention | |---|---|---| | `worktrees` | Linked git worktrees under `/data/home/*` and `/data/agents/*/*` clones. A worktree qualifies only when its branch is merged into `origin/HEAD` or its upstream branch was deleted (`[gone]`), it has no uncommitted work (no modified tracked files and no new untracked files; ignored build output does not count), and it is not locked or detached. Metadata for worktrees whose directory is already gone is cleared with `git worktree prune`. | 7 days | -| `caches` | Individual files in `/data/home/.cache/go-build`, `/data/home/.cache/pip`, `/data/home/.npm/_cacache` and `/data/home/go/pkg/mod/cache/download`, plus `extra_cache_dirs`. | 14 days | -| `tmp` | Files in `/data/tmp` and `/data/home/tmp`, plus `extra_tmp_dirs`, and the empty directories they leave. | 3 days | +| `caches` | Individual files (by their own age) in `/data/home/.cache/go-build`, `/data/home/.cache/pip`, `/data/home/.npm/_cacache` and `/data/home/go/pkg/mod/cache/download`, plus `extra_cache_dirs`. Also whole entries, removed only when nothing inside was written within the retention: uv's unpacked wheels and build dirs (`/data/home/.cache/uv/archive-v0/*`, `builds-v0/*`, which uv fetches again when missing), and old versions of the copilot CLI package cache (`/data/home/.cache/copilot/pkg/*/*`; the newest version is always kept). | 14 days (1 day in a guard-triggered run) | +| `tmp` | Files in `/data/tmp`, `/data/home/tmp` and `/data/home/.bob/tmp`, plus `extra_tmp_dirs`, and the empty directories they leave. | 3 days | | `logs` | Rotated logs only (`*.log.N`, `*.gz`, or a date in the name) in `data.logs_dir` and `/data/agents/*/.bob/.bob-errors`. The file a process is writing to is never selected. The retention is never shorter than `governor.logging.max_age_days`. | 14 days | | `transcripts` | CLI transcripts (`*.jsonl`) in `data.claude_sessions_dir`. The default matches the token scanners' 30-day window, so dashboard token history is not cut short. | 30 days | | `orphan_agents` | Workspace directories under `/data/agents` of agents the operator removed: names in `removed_agents` (replicas such as `guide-2` count as `guide`) that are not configured again. An unrecognised name alone is never treated as an orphan. Interactive homes under `/data/home/agents`, which hold CLI credentials and memory, are never swept. | 14 days | @@ -72,6 +72,20 @@ The orphan rule has two extra safety checks: holds anything named like a credential (`auth.json`, `.credentials.json`, `*.pem`, `*.key`) is never removed by the orphan rule. +Caches that are not listed stay. In particular `/data/home/.gemini` (settings and +CLI credentials, protected) and the Hugging Face cache are never swept by default: +model downloads are slow to redo and can be offline-only. Add a path to +`extra_cache_dirs` to opt in. + +## Throttled deletion + +Deleting on CephFS is a burst of unlinks against the metadata server (MDS), +which every tenant shares. After each `delete_batch_files` removed files (100) +the janitor sleeps `delete_pause_ms` (200 ms), about 500 files per second, so +even a run that prunes 100,000 files stays well below MDS saturation. A tree +removed in one call is repaid afterwards, so the average rate holds. Set +`delete_pause_ms: 0` to turn throttling off. Dry runs never pause. + ## Size guard Every `size_guard_check_minutes`, the janitor measures `/data`. On CephFS this @@ -82,14 +96,35 @@ reads. Elsewhere it uses statfs (used blocks and inodes of the volume holding Capacity comes from `capacity_bytes` if that is set. Otherwise it is the subvolume quota (`ceph.quota.max_bytes`), and failing that, statfs. -When usage reaches `size_guard_percent` (80% by default), the guard: +There are two limits. The guard trips when either is reached: + +- **Bytes:** usage reaches `size_guard_percent` (80% by default) of capacity. +- **File count:** `/data` holds `size_guard_files` files or more (150,000 by + default; `0` disables it; env `HIVE_DATA_JANITOR_SIZE_GUARD_FILES`). This is + the limit that protects pod starts: the relabel walks every file, so a + volume can be far from full by bytes and still be too big to start. -1. runs the janitor immediately, unless any run finished within `size_guard_cooldown_minutes`; +When the guard trips, it: + +1. runs the janitor immediately in **emergency** mode, unless any run finished + within `size_guard_cooldown_minutes`. Emergency mode shortens the cache + retention to `emergency_cache_retention_days` (1 day). The other rules keep + their retention. A hive that starts already over a guard runs its startup + pass in emergency mode; 2. raises a yellow dashboard banner (`data-janitor-size-guard`) until usage - falls back under the threshold; -3. reports `guard_tripped` to the hub in the heartbeat, which raises a + falls back under both limits; +3. reports `guard_tripped` (with `guard_files` and `guard_reason`: `bytes`, + `files` or `bytes+files`) to the hub in the heartbeat, which raises a `data-volume-full` warning in the hub's fleet alerts. +`/api/status` shows `usage.files_percent` (the file count as a share of +`size_guard_files`), `size_guard.threshold_files`, `size_guard.reason`, and +`last_run.emergency`. + +If the file count stays high after an emergency run, the remainder is data the +janitor does not own (agent workspaces, session state, `.gemini`). The banner +message gives the count; look at the largest trees with `find /data -xdev -type f | cut -d/ -f1-5 | sort | uniq -c | sort -rn | head`. + ## Where to see it `GET /api/status` has a `data_janitor` block: @@ -134,6 +169,10 @@ retention of `0` turns that rule off. | `orphan_agent_retention_days` | `14` | See `orphan_agents`. | | `orphan_max_fraction_percent` | `50` | Maximum share of one root's agent directories the orphan rule may remove in one run. | | `size_guard_percent` | `80` | Fill level that triggers an immediate run and the warnings. `0` disables the guard. | +| `size_guard_files` | `150000` | File count that trips the guard. `0` disables it. Env `HIVE_DATA_JANITOR_SIZE_GUARD_FILES` overrides. | +| `emergency_cache_retention_days` | `1` | Cache retention in a guard-triggered run (used when shorter than `cache_retention_days`). | +| `delete_batch_files` | `100` | Removed files between pauses. Env `HIVE_DATA_JANITOR_DELETE_BATCH_FILES` overrides. | +| `delete_pause_ms` | `200` | Pause between batches. `0` disables throttling. Env `HIVE_DATA_JANITOR_DELETE_PAUSE_MS` overrides. | | `size_guard_check_minutes` | `15` | How often the guard measures `/data`. | | `size_guard_cooldown_minutes` | `60` | Minimum time between guard-triggered runs. | | `capacity_bytes` | `0` | Capacity override. `0` reads the CephFS quota, then statfs. | diff --git a/docs/content/hive/design/workflow-models.md b/docs/content/hive/design/workflow-models.md index 321c22d8..5911f832 100644 --- a/docs/content/hive/design/workflow-models.md +++ b/docs/content/hive/design/workflow-models.md @@ -641,15 +641,25 @@ leaves it off. - **Detection.** After each pass the reconciler remembers which of the state's model labels were on the item and under which *fingerprint* (head SHA, model state, stage, open/merged/draft). A label that was there and is missing from a later read, with no hive write in between, was removed by - someone else, so it is recorded as a suppression keyed by (item, label). The record keeps the - fingerprint and the time but not who removed it: the removal is found by comparing reads, not by - the webhook actor. Facts read before the hive's own last write are ignored, and labels the hive - removes itself are never remembered as expected, so they never suppress. + someone else, so it is recorded as a suppression keyed by (item, label). Facts read before the + hive's own last write are ignored, and labels the hive removes itself are never remembered as + expected, so they never suppress. +- **Who, when, state, head.** Each record keeps the time (`removed_at`), the workflow state and + head SHA the removal was bound to (mirrored out of the fingerprint), and who took the label off. + The reconciler compares label reads, which cannot tell a maintainer's removal from a bot's, so + when it records a new removal it reads the item's timeline for the newest `unlabeled` event for + that label and stores its actor: `removed_by` is the login when a person removed the label, and + `removed_by_bot` marks an automation actor (a `[bot]` account, including the hive's own App) + with no `removed_by`. An unreadable timeline or an unresolved actor leaves the removal recorded + with neither field, never failing the pass. The read uses the sweeps' existing GitHub client and + permissions. - **Effect.** While the fingerprint is unchanged the label is left out of what the reconciler writes. Stage labels (`stage/*`), roles, gates and labels the model does not bind to a state are unaffected. A person putting the label back clears the suppression. - **Clears** when the head SHA or the model state changes, the item is merged, or the setting is - turned off (turning it off forgets every suppression). + turned off (turning it off forgets every suppression). `workflow.sticky_label_removal` is a + boolean with no mode: a state change and a new commit each clear the override, whichever happens + first. - **Persistence.** Suppressions live in `sticky-label-removals.json` under the workflows data root (`data.workflows_dir`, `HIVE_WORKFLOWS_DATA_DIR`), survive restarts, and an item untouched for 30 days is dropped. diff --git a/docs/content/hive/editing-hive-yaml.md b/docs/content/hive/editing-hive-yaml.md index 3084de58..637e3e3f 100644 --- a/docs/content/hive/editing-hive-yaml.md +++ b/docs/content/hive/editing-hive-yaml.md @@ -121,3 +121,81 @@ per-agent overrides, and `config.env` can pin certain values. See 5. Verify the effective value in a fresh JSON export (or the setting's runtime behavior) and check startup or reload logs. If the value did not change, check for an overriding layer before editing again. + +## Break-glass surgery: draining a hive with a guaranteed restore + +Some changes cannot be made while the hive process is running, and the edit +needs the data volume without a live hive writing it. The supported way to do +that on Kubernetes is `hive config-surgery`; do **not** scale the Deployment to +0 with `kubectl scale` and start a pod that sleeps. That older ad-hoc flow has +no owner for the restore, and it left two hives at `replicas=0` on +2026-12-02/03 ([#21167](https://github.com/hivecommons/hive/issues/21167)). + +Run the surgery from a temporary pod that mounts the hive's `hive-data` PVC and +uses the hive's service account (`hive-sa`). Its `hive-self-upgrade` Role +already grants `get`/`patch` on `deployments/scale`, so no new RBAC is needed. +Use the same image tag as the Deployment. + +Do **not** run `config-surgery begin`/`run` from inside the hive's own pod (for +example through `kubectl exec`): draining the Deployment deletes the pod that +owes the restore, and only the durable marker would remain. Use a separate +temporary pod. + +```yaml +apiVersion: v1 +kind: Pod +metadata: + generateName: hive-config-surgery- +spec: + restartPolicy: Never + serviceAccountName: hive-sa + containers: + - name: surgery + image: ghcr.io/hivecommons/hive: + command: + - hive + - config-surgery + - run + - -- + - sh + - -c + - | + sed -i 's/old-key:.*/new-key: value/' /data/hive.yaml.runtime + hive validate -config /data/hive.yaml.runtime + volumeMounts: + - {name: data, mountPath: /data} + volumes: + - name: data + persistentVolumeClaim: {claimName: hive-data} +``` + +`config-surgery run` guarantees the restore: + +- **Before draining**, it writes `/data/.config-surgery.json` with the current + replica count. `begin` refuses if the hive is already at 0, so 0 can never + become the recorded restore target. +- **It drains and runs the command**, then restores in a `defer`: a failed, + timed-out or interrupted command still scales the Deployment back. The + restore retries the scale (4 attempts, 2 seconds apart, bounded at 3 + minutes) and uses a fresh context, so cancelling the edit does not cancel + the restore. +- **It consumes the marker only after the scale succeeds.** If the process is + killed (SIGKILL, node loss, evicted pod), the marker survives on the PVC and + the next hive start restores and clears it; `hive config-surgery restore` + does the same explicitly and is idempotent. +- **A second surgery is refused** while a marker exists, so two drains cannot + overlap and lose the first restore target. +- **It never scales a running hive down**: if the Deployment is already at or + above the recorded count, the restore only clears the marker. + +Check state with `hive config-surgery status`. If the API is unreachable and +the tool cannot restore, the manual fallback is: + +```bash +kubectl -n scale deployment/hive --replicas= +``` + +The next hive start sees the marker with a running Deployment and clears it. +Delete `/data/.config-surgery.json` by hand only after confirming the +Deployment is running, since that marker is the only record of the prior +count. diff --git a/docs/content/hive/env-vars.md b/docs/content/hive/env-vars.md index c6840eb1..0a4d7d55 100644 --- a/docs/content/hive/env-vars.md +++ b/docs/content/hive/env-vars.md @@ -195,8 +195,18 @@ behavior. [Maintenance limitations](#keeping-this-reference-current) still apply | `HIVE_REFERENCE_REPOS_DERIVE_INTERVAL` | No | `10m` | How often the hive re-lists accepted request issues to derive `project.reference_repos` entries between config reloads (`src/cmd/hive/reference_repos_derive.go`, #18159). A closed request issue or a removed `triage/accepted` label drops the derived entry on the next pass. Go duration; unset, unparseable or non-positive values fall back to the default. | | `HIVE_WORKSPACE_CLEANUP_INTERVAL` | No | `1h` | How often the workspace cleanup sweep runs (Go duration, e.g. `30m`). Unset, unparseable, or non-positive values fall back to the default. | | `HIVE_WORKSPACE_CLEANUP_MAX_AGE` | No | `2h` | How old an entry under `/data/agents/*/` must be before the cleanup sweep removes it (Go duration, e.g. `6h`). Unset, unparseable, or non-positive values fall back to the default. | +| `HIVE_GITHUB_SECONDARY_DEFAULT_RETRY_AFTER` | No | `1m` | Backoff assumed for a GitHub secondary-limit 403 that carries no `Retry-After`. | +| `HIVE_GITHUB_SECONDARY_MAX_RETRY_AFTER` | No | `10m` | Upper bound on a secondary-limit `Retry-After` the pacer believes. | +| `HIVE_GITHUB_SECONDARY_CAUTION_TAIL` | No | `2m` | Paced tail after a secondary limit's backoff before full concurrency resumes. | +| `HIVE_GITHUB_SEARCH_MIN_GAP` | No | `2s` | Minimum spacing between GitHub `/search` requests (they run serially). `0` disables the spacing and its jitter. | +| `HIVE_GITHUB_LIST_MAX_CONCURRENCY` | No | `4` | Cap on concurrent in-flight repo issue/PR list reads. | +| `HIVE_GITHUB_MONITOR_LIST_MAX_QUEUE` | No | `30s` | How far ahead low-priority open PR / issue list reads may queue during a caution window before being shed. | +| `HIVE_METRICS_REPO_SPACING` | No | `1s` | Pause (plus jitter) between per-repo GitHub calls in the dashboard metrics collector. | | `HIVE_DATA_JANITOR_ENABLED` | No | `true` | Turns the `/data` janitor (`src/pkg/datajanitor`, [#20927](https://github.com/hivecommons/hive/issues/20927)) on or off, overriding `data.janitor.enabled`. The session-state prunes keep running either way. See [data-janitor.md](/docs/hive/data-janitor). | | `HIVE_DATA_JANITOR_DRY_RUN` | No | `false` | When `true`, the janitor selects and reports what it would free on `/api/status` but deletes nothing. Overrides `data.janitor.dry_run`. | +| `HIVE_DATA_JANITOR_SIZE_GUARD_FILES` | No | `150000` | File count on `/data` that trips the janitor's file-count guard (immediate run with the emergency cache retention, dashboard banner, hub `data-volume-full` alert). `0` disables it. Overrides `data.janitor.size_guard_files`. | +| `HIVE_DATA_JANITOR_DELETE_BATCH_FILES` | No | `100` | The janitor sleeps `HIVE_DATA_JANITOR_DELETE_PAUSE_MS` after each batch of this many removed files, so a mass prune does not saturate CephFS. Overrides `data.janitor.delete_batch_files`. | +| `HIVE_DATA_JANITOR_DELETE_PAUSE_MS` | No | `200` | Pause between deletion batches, in milliseconds. `0` turns throttling off. Overrides `data.janitor.delete_pause_ms`. | | `HIVE_FORGE_COUNT_CACHE_TTL` | No | `20m` | How long the dashboard metrics collector reuses its GitHub Search-API count queries (hive-attributed merged PRs / closed issues per repo for the Cost tiles, outreach PR counts) before re-asking (Go duration, e.g. `30m`). A failed refresh serves the last-good counts (marked stale), retries after 10 minutes and logs at most once per 15 minutes; refreshes are also deferred while the GitHub slow-start caution window is engaged. Unset, unparseable, or non-positive values fall back to the default. | | `HIVE_DOSSIER_CACHE_MAX_ENTRIES` | No | `512` | Caps each public dossier cache. Bounds username-spray memory while keeping normal contributor reuse hot. | | `HIVE_CONTRIBUTOR_KNOWLEDGE_EXPORT_MAX_FACTS` | No | `80` | Caps the number of facts returned by the contributor knowledge export API. Unset, non-numeric, or non-positive values fall back to the default. | @@ -475,6 +485,7 @@ and [network/credential controls](/docs/hive/security-model#5-network-and-creden | `HIVE_INFERENCE_STREAM_PING_INTERVAL` | No | `10s` | Go duration between the Anthropic `ping` events the inference translator writes to the Claude CLI on a streamed request while nothing else is sent, so the CLI's idle watchdogs do not abort a request that waits in a gateway queue (`src/crux/proxy/anthropic_stream.go`). Read once; invalid or non-positive values fall back to the default with a warning. See [Streamed responses and the Claude CLI's idle timers](/docs/hive/agent-configuration#streamed-responses-and-the-claude-clis-idle-timers). | | `HIVE_INFERENCE_PASS_CONTEXT_WINDOW` | No | on | Set to `0`, `false`, `no` or `off` to stop the agent manager from exporting `CLAUDE_CODE_MAX_CONTEXT_TOKENS` to inference-routed Claude CLI sessions (`src/crux/agent/inference_context_window.go`). Read at each agent launch. See [Context window for inference-routed agents](/docs/hive/agent-configuration#context-window-for-inference-routed-agents). | | `HIVE_INFERENCE_AUTO_COMPACT_PERCENT` | No | unset (off) | Opt in inference-routed Claude CLI agents to compaction at an integer percentage `1`–`100` of `(effective window - 20000)` tokens. Invalid or unset values are ignored. An agent's `auto_compact_window_tokens` takes priority. The percentage requires a known exported context window, so it is unavailable when context-window passing is disabled or the model ID contains `claude`; discovery limitations also apply. See [Earlier auto-compaction](/docs/hive/agent-configuration#earlier-auto-compaction-opt-in). | +| `HIVE_WIRE_USAGE_LEDGER` | No | unset (off) | `1`/`true`/`yes`/`on` enables, `0`/`false`/`no`/`off` disables, overriding `tokens.wire_ledger.enabled` (ADR-0027 phases P1-P2, #21093, #21094). Enables an append-only, metadata-only per-request usage ledger at `/wire-usage/ledger.jsonl`; it records no prompt, header, URL or credential, changes no policy decision, and a write failure never affects the proxied request. With the ledger present, the token collector counts each request once from either the wire or its transcript; transcript-only totals stay byte-identical. Read once at boot. See [Wire usage ledger](/docs/hive/operator-reference/runtime-and-quota#wire-usage-ledger-adr-0027-phase-p1) and [Merge and precedence](/docs/hive/operator-reference/runtime-and-quota#merge-and-precedence-phase-p2-21094). | | `HIVE_START_FAILURE_BLOCK_THRESHOLD` | No | `3` | Consecutive identical start failures (positive integer) before an agent is blocked from automatic relaunch (`pkg/agent/start_failure.go`). Backoff is applied from the first failure regardless; invalid values fall back to the default. | | `HIVE_START_FAILURE_BACKOFF_LADDER` | No | `1m,5m,15m,30m` | Comma-separated positive Go durations pacing the **automatic** relaunch loop after start failures, indexed by consecutive-failure count and capped at the last entry. Any invalid entry discards the whole override. Explicit relaunches (a saved key, the dashboard restart button) clear the backoff outright. | | `HIVE_COPILOT_SESSION_REFRESH_INTERVAL` | No | `10m` | Go duration overriding the Copilot session refresh interval. | @@ -522,6 +533,11 @@ Hive as a live meeting participant ([#18284](https://github.com/hivecommons/hive | `HIVE_MEETINGS_TTS_URL` | No | none | Text-to-speech service Quorum speaks Discord replies with (passed as `QUORUM_TTS_URL`). Overrides `meetings.tts_url`. In-cluster on hive-oke: `http://vexa-tts.meetings.svc.cluster.local:8880`. | | `HIVE_MEETINGS_TTS_TOKEN` | No | none | TTS service token. Secret. Wins over the secret file. Hive passes it to Quorum as `QUORUM_TTS_TOKEN_FILE`, with `QUORUM_TTS_VOICE` set to the persona's voice; without it Discord replies stay in chat. On hive-oke, copied by the operator from Secret `vexa-tts` in namespace `meetings`. | | `HIVE_MEETINGS_TTS_TOKEN_FILE` | No | `/data/secrets/meetings_tts_token` | Keystore-sealed secret file holding the TTS service token. Overrides `meetings.tts_token_file`. | +| `HIVE_MEETINGS_DOCS_KAPA_SITE_ID` | No | none | kapa.ai workspace (project) id whose docs answer the persona's documentation questions about the project. Overrides `meetings.docs_kapa.site_id`; with no site id the docs source is off. | +| `HIVE_MEETINGS_DOCS_KAPA_INTEGRATION_ID` | No | none | kapa.ai HTTP API integration id the persona's questions are attributed to. Overrides `meetings.docs_kapa.integration_id`; empty sends none. | +| `HIVE_MEETINGS_DOCS_KAPA_URL` | No | `https://api.kapa.ai` | Docs API base URL; any endpoint speaking the same chat request and answer works. Overrides `meetings.docs_kapa.url`. | +| `HIVE_MEETINGS_DOCS_KAPA_API_KEY` | No | none | kapa.ai API key. Secret. Wins over the keystore-sealed secret file; prefer the file, which the dashboard writes. | +| `HIVE_MEETINGS_DOCS_KAPA_API_KEY_FILE` | No | `/data/secrets/meetings_docs_kapa_api_key` | Keystore-sealed secret file holding the kapa.ai API key. Overrides `meetings.docs_kapa.api_key_file`. | | `HIVE_MEETINGS_DELIVERY` | No | `chat` | Default delivery for meeting output. Only `chat` is supported. | | `HIVE_MEETINGS_VOICE_ON_ADDRESS` | No | `true` | Lets hive speak when addressed by name in a meeting whose voice is enabled; otherwise it answers in chat. | | `HIVE_MEETINGS_LISTENING_TONE` | No | `true` | Betty plays a short, soft chime when she heard her name in a spoken request and is about to answer. Set `false` to turn it off. | diff --git a/docs/content/hive/github-app-setup.md b/docs/content/hive/github-app-setup.md index 1fba3ae0..c3e5fe6b 100644 --- a/docs/content/hive/github-app-setup.md +++ b/docs/content/hive/github-app-setup.md @@ -250,7 +250,7 @@ Do this before 2026-12-02 for every repository whose required `verify PR content 1. **Grant.** In the organization settings, GitHub Apps, open the Hive App and confirm **Commit statuses: Read and write** is granted (accept a pending permission request if there is one). The hive log line `github app credential verdict ... grants="... statuses=write ..."` confirms it. 2. **Shadow first.** Set `mode: shadow` with the repository listed, open or edit a few PRs (include a fork PR if the repository takes them), and check that `verify PR contents (hive)` appears on each head and the log shows `pr-gate: comparison with the workflow result agrees` with no `DISAGREES` line. -3. **Native-queue gate.** If the repository runs `native-queue-policy.yml`, set the repository variable `HIVE_PR_GATE_CREATOR_LOGIN` to the Hive App's bot login (for example `your-app[bot]`, the creator shown on the hive's statuses), so the `gate` job accepts the hive's `verify PR contents` status (see [native merge queue](/docs/hive/operations/automation-and-review/native-github-merge-queues)). +3. **Native-queue gate.** If the repository runs `native-queue-policy.yml`, set the repository variable `HIVE_PR_GATE_CREATOR_LOGIN` to the Hive App's bot login (for example `your-app[bot]`, the creator shown on the hive's statuses), so the `gate` job accepts the hive's `verify PR contents` status (see [native merge queue](/docs/hive/operations/automation-and-review/native-github-merge-queues)). Also commit the same login as `creator_login` in `.github/hive-pr-gate.json`: fork-originated `pull_request` runs are never given repository variables, so they read the login from that file in the trusted base checkout instead ([#21074](https://github.com/hivecommons/hive/issues/21074)). The variable wins when set; either way the login is matched exactly, never as a wildcard. 4. **Enforce.** Set `mode: enforce`. On the next event for a PR, its head shows `PR Type`, `PR Issue` and `verify PR contents` as commit statuses created by the Hive App, next to the workflow's check runs of the same names while the workflow still runs. `/api/status` shows `prGate.effective: enforce`; `shadow` there means the grant is not confirmed yet, `off` means it is missing (the banner names the installation). 5. **Pin the context to the App (recommended).** In the branch rule or ruleset, set the source of the required `verify PR contents` check to the Hive App instead of "any source". Only the Hive App's status then satisfies it. Do this only after step 4 shows the hive's status on new heads: from that moment the workflow's own check run no longer counts, and a repository whose hive is in `shadow` or `off` would block every merge. 6. **Roll back** by setting `mode: shadow` (or `off`) and, if step 5 was done, setting the check's source back to any source. diff --git a/docs/content/hive/integrations/clanker-cortex.md b/docs/content/hive/integrations/clanker-cortex.md new file mode 100644 index 00000000..e3df9bd1 --- /dev/null +++ b/docs/content/hive/integrations/clanker-cortex.md @@ -0,0 +1,104 @@ +> **Synced from Hive.** This page is pulled from [hivecommons/hive@v5](https://github.com/hivecommons/hive/blob/v5/src/docs/integrations/clanker-cortex.md) during the docs build. Edit the canonical source in the Hive repository. + +# Cortex and a ClankeR (Contributor Relay) + +## Audience and fit + +This page is for someone who already runs a ClankeR and wants their own per-request view of what the relay spends and where it sends traffic. The relay runs on your machine, outside any hive's proxy, so the hive has no wire visibility into that traffic and can neither show it to you nor account for it. + +Cortex is a third-party tool, maintained by its own project ([`rossoctl/cortex`](https://github.com/rossoctl/cortex)). It is not shipped by Hive, it is not required to run a relay, and Hive does not integrate with it. You install it, trust its CA, and read its output on your own terms. Nothing on this page asks a hive operator to change anything. + +## What it gives + +With Cortex as the relay's HTTPS proxy, its `agentop` viewer shows: + +- **Per-request tokens and cost.** The model, input, cache-read, cache-write, output and reasoning tokens, and a cost. A gateway's own reported cost is used when it sends one; otherwise the tokens are priced at the bundled provider rates. +- **A session and subagent timeline.** One time axis per session with the main agent and each subagent, model time, tool time, retries, and time spent waiting. +- **Egress the hive never sees.** The hosts each session called and their errors, including the relay's calls to your provider and the hosts it contacts at your forge and at the hive. + +## What it does not change + +Cortex does not: + +- change task admission: the same filters, trust tier, cooldown and quota checks apply; +- change task credentials: the hive still issues the same short-lived forge credential for each task; +- change what the hive allows, or which repositories and branches a task may touch; +- change the relay's completion reporting: the verdict and evidence reach the hive as before. + +It does not make the relay part of a hive's governed path. A hive's own proxy and credential handling remain the boundary the hive relies on; a local observer is yours, and its presence or absence is invisible to the hive. + +## Setup + +Cortex runs as one binary on macOS or Linux and needs no account or cluster. The install command and the viewer commands below are from its documentation; see [Getting started](https://github.com/rossoctl/cortex/blob/main/docs/getting-started.md) and [Any other agent](https://github.com/rossoctl/cortex/blob/main/docs/agents/any-agent.md). + +**These commands were not executed on the machine that wrote this page.** No Cortex binary was installed there. Treat them as the project's documented commands, not as verified output, and read that project's own troubleshooting page if a step fails. + +1. Install Cortex: + + ```sh + curl -fsSL https://www.rossoctl.dev/cortex/install.sh | sh + ``` + + Setup lists what it will change and asks once. It installs `agentop` and `cortex` under `~/.local/bin`, adds that directory to your shell profile, writes `~/.cortex/config.yaml`, and starts the proxy on `127.0.0.1:47600`. Open a new terminal afterwards so the updated `PATH` applies. + +2. Run the relay so its HTTPS traffic goes through the proxy. The documented way to do this for a process that has no settings file of its own is `agentop exec`, which sets `HTTP_PROXY`, `HTTPS_PROXY` and their lowercase spellings to the local proxy and adds the bridge CA to the child's trust settings. Everything after `--` passes through unchanged. From a Hive checkout, with `` replaced by the backend the relay drives, the native relay mode is: + + ```sh + agentop exec -- just contribute-hive local + ``` + + If you prefer to keep one long-lived shell for the relay, apply the same environment to that shell and start the relay normally: + + ```sh + eval "$(agentop exec --print)" + just contribute-hive local + ``` + + `agentop exec --print` prints the export lines derived from the running proxy, so its proxy address and CA paths match the proxy that is actually serving. Do not copy those values by hand. + + Alternatively, if the relay's backend is one Cortex connects directly, `agentop configure enable` (`claude-code`, `opencode`, `codex`, `bob` or `pi`) writes the proxy settings into that backend's own settings file, which the relay's launched CLI then reads. This routes every session of that backend on the machine through Cortex, not only relay tasks, so prefer `agentop exec` when you want the view scoped to the relay. + +3. Watch it: + + ```sh + agentop observe + ``` + + A relay task appears as a session row with its events, tokens and cost. Press `Enter` to open the events, `T` for the timeline, and `$` for spend by model, endpoint or agent. `agentop cost --window month --by agent` prints the same spend summary without the viewer. + + If no row appears, run `agentop doctor`, which names the failing piece and the command that repairs it. + +### Limits of the setup + +- **Container routes do not inherit this.** The Compose workflow, and the Homebrew `hive-contribute` wrapper around the pinned contributor image, run the relay inside a container. The proxy variables applied to the host shell, or to the `just` process, are not passed into that container by default, so the relay's traffic there would bypass Cortex. This page covers the native `local` relay mode, where the relay process inherits the environment. +- **Backend recognition.** Cortex parses and names sessions for the agents it supports. A backend it does not recognize still sends its traffic through the proxy, but its requests may be visible without that backend's own parser and session attribution. + +## Security: it can see the credentials the hive issues + +**Cortex is a local TLS-intercepting proxy.** It decrypts HTTPS with a CA generated on your machine (under `~/.cortex/ca`), passes the request through its pipeline, and re-encrypts it toward the origin. + +When you put it in front of the relay, it can observe every HTTPS request the relay makes. That includes the **short-lived forge credentials the hive hands out for a task**, and, if the relay's control connection to the hive is proxied as well, the token material on that connection. It also includes the relay's provider traffic, prompts, completions and tool results. Its session data is written to disk as described below. + +What to do about that: + +- **Keep non-provider hosts out of interception.** Cortex ships a default passthrough list (GitHub, the Go module proxy and checksum database, and package registries) that tunnels those hosts instead of decrypting them. Any host not on the list is intercepted. For a forge or control endpoint that is not on the default list, add it under `tls_bridge.passthrough_hosts_extra` in `~/.cortex/config.yaml`. Note that setting `tls_bridge.passthrough_hosts` yourself *replaces* the default list, `passthrough_hosts: []` intercepts everything, and `tls_bridge.fail_closed` drops the default list too. Changes to these keys need a restart. +- **Or accept the exposure explicitly.** If you would rather see the full request path, including the forge calls, enable it with that exposure understood. That is a deliberate choice, not a default anyone should drift into. +- **Trust its CA deliberately.** The relay's tools must trust the bridge CA, or their HTTPS calls fail. `agentop exec` and `agentop exec --print` add the CA to the child process; if you set the proxy variables by hand, you must also supply `NODE_EXTRA_CA_CERTS` and the replacing bundle variables, or the relay's CLI will not be able to verify the intercepted connections. `agentop doctor` lists programs that Cortex is passing through unread. +- **Know what is stored.** The session archive under `~/.cortex/sessions` keeps prompts, completions, tool arguments and tool results, and the request bodies and headers it saw. Credential-named headers and query parameters are removed; request bodies are not redacted. The cost ledger under `~/.cortex/cost` keeps per-minute totals for 31 days. Directories are `0700` and files `0600`, and the archive is readable by anyone who can read your home directory. The session API is unauthenticated but loopback-bound and rejects non-loopback `Host` headers. `agentop uninstall --purge` removes `~/.cortex`. +- **Know what leaves the machine.** The default configuration has `metrics_push` on: Cortex sends aggregate savings counters to a central collector every 60 seconds, and its documentation states that no prompt, path, host, session or key is included. Turn it off with `metrics_push.enabled: false` in `~/.cortex/config.yaml` and restart the proxy. + +A local observer is a convenience for you. It is not a security control, and it does not substitute for the hive's own checks, credential scoping or egress policy. + +## Unsupported + +Two placements are out of scope and are not supported: + +- **In front of a hive's own proxy.** A hive's proxy and credential handling are the path the hive governs. Placing a personal intercepting proxy in that path is not something Hive supports, and doing so would break the boundary the hive relies on rather than merely observe it. +- **Inside a hive pod.** Hive does not support running Cortex as part of a hive deployment or alongside a hive's own agents. Cortex documents a Kubernetes sidecar mode of its own, but that is its project's concern, not a Hive integration. + +## Further reading + +- [Cortex README](https://github.com/rossoctl/cortex) +- [Using agentop](https://github.com/rossoctl/cortex/blob/main/docs/using-agentop.md) +- [Running Cortex on a laptop](https://github.com/rossoctl/cortex/blob/main/docs/laptop-service.md) +- [ClankeR contributor relay](/docs/hive/contributor-relay) diff --git a/docs/content/hive/integrations/forgejo.md b/docs/content/hive/integrations/forgejo.md index b05368c3..fa51e51b 100644 --- a/docs/content/hive/integrations/forgejo.md +++ b/docs/content/hive/integrations/forgejo.md @@ -8,7 +8,7 @@ This page is for teams whose repositories live on [Forgejo](https://forgejo.org/ ## Status: partial, in progress -**A Forgejo-only hive finds work, clones, pushes and merges, with gaps.** Hive has a first-class `forgejo` forge kind, and a hive with every repository on Forgejo boots without GitHub credentials. The governor discovers issues and pull requests through the forge adapter ([#19673](https://github.com/hivecommons/hive/pull/19673)), sandbox Job kicks and dashboard Sessions clone from and push to the Forgejo host ([#19678](https://github.com/hivecommons/hive/pull/19678)), a pod-run agent (`sandbox.runtime` off) gets no credential for the Forgejo host and clones a private repository through the hive's clone relay, `hive-clone`, which needs `forgejo.integration` ([#19997](https://github.com/hivecommons/hive/issues/19997)), `hive-gh pr view`, `issue view` and `pr checks` on a Forgejo repository are answered by the hive's read relay with the same compact JSON key names as on GitHub (without `mergeStateStatus`, `reviewDecision`, the diff stats, `stateReason` or `milestone`), and the Forgejo-only kick tells agents to use them ([#20230](https://github.com/hivecommons/hive/issues/20230)), the same relay answers `hive-gh pr reviews` (reviewer, state, commit and inline comments), `pr comments` / `issue comments`, and `run view --log` / `--log-failed` / `run view --job --log` with the last 256 KiB of each job's log, at most 512 KiB a run; reading a job log needs a Forgejo token that may read the repository's Actions ([#20277](https://github.com/hivecommons/hive/issues/20277)), agent issue and pull request requests go through the forge ([#19681](https://github.com/hivecommons/hive/pull/19681)), the automerge and close-on-merge sweeps run on Forgejo repositories ([#19676](https://github.com/hivecommons/hive/pull/19676)), and contributor relays can take Forgejo issue tasks with a short-lived credential scoped to one repository and acting as a dedicated contributor user, never the hive's own ([#20413](https://github.com/hivecommons/hive/issues/20413), see [Contributor task credentials](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#contributor-task-credentials)). The gaps a live run against Forgejo 17 found are tracked in [#19909](https://github.com/hivecommons/hive/issues/19909). This page is updated as each piece merges. +**A Forgejo-only hive finds work, clones, pushes and merges, with gaps.** Hive has a first-class `forgejo` forge kind, and a hive with every repository on Forgejo boots without GitHub credentials. The governor discovers issues and pull requests through the forge adapter ([#19673](https://github.com/hivecommons/hive/pull/19673)), sandbox Job kicks and dashboard Sessions clone from and push to the Forgejo host ([#19678](https://github.com/hivecommons/hive/pull/19678)), a pod-run agent (`sandbox.runtime` off) gets no credential for the Forgejo host and clones a private repository through the hive's clone relay, `hive-clone`, which needs `forgejo.integration` ([#19997](https://github.com/hivecommons/hive/issues/19997)), `hive-gh pr view`, `issue view` and `pr checks` on a Forgejo repository are answered by the hive's read relay with the same compact JSON key names as on GitHub (without `mergeStateStatus`, `reviewDecision`, the diff stats, `stateReason` or `milestone`), and the Forgejo-only kick tells agents to use them ([#20230](https://github.com/hivecommons/hive/issues/20230)), the same relay answers `hive-gh pr reviews` (reviewer, state, commit and inline comments), `pr comments` / `issue comments`, and `run view --log` / `--log-failed` / `run view --job --log` with the last 256 KiB of each job's log, at most 512 KiB a run; reading a job log needs a Forgejo token that may read the repository's Actions ([#20277](https://github.com/hivecommons/hive/issues/20277)), agent issue and pull request requests go through the forge ([#19681](https://github.com/hivecommons/hive/pull/19681)), the automerge and close-on-merge sweeps run on Forgejo repositories ([#19676](https://github.com/hivecommons/hive/pull/19676)), and contributor relays can take Forgejo issue tasks with a short-lived credential scoped to one repository and acting as a dedicated contributor user, never the hive's own ([#20413](https://github.com/hivecommons/hive/issues/20413)); a contributor mapped in `forgejo.integration.contributor_identities` acts as their own Forgejo user so Forgejo distinguishes their push, pull request and comment from another contributor's, while unmapped contributors keep the shared user ([#20827](https://github.com/hivecommons/hive/issues/20827), see [Contributor task credentials](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#contributor-task-credentials)). A mapped user's assignment or `/claim` counts as a claim, but a contributor login, mapped or shared, never releases automerge, counts as an approving review, or is trusted for close-on-merge; unmapped behavior is unchanged ([#21125](https://github.com/hivecommons/hive/issues/21125)). The gaps a live run against Forgejo 17 found are tracked in [#19909](https://github.com/hivecommons/hive/issues/19909). This page is updated as each piece merges. ## What Forgejo is diff --git a/docs/content/hive/meetings.md b/docs/content/hive/meetings.md index 759c02b4..5be8e5b5 100644 --- a/docs/content/hive/meetings.md +++ b/docs/content/hive/meetings.md @@ -36,13 +36,14 @@ Hive attends meetings as a persona: **Betty** ("Betty Bee from the hive") by def - **Addressing her.** Start or end a line with one of her names (`meetings.persona.aliases`: "betty", "betty bee", "hive"), for example "Betty, when does the release ship?", "hey betty, any blockers on the deploy?" or "what do you think, Betty?". Common speech-to-text spellings ("Bettie", "Betty Bea") count. A sentence that merely mentions the name ("push it to the hive", "hive is slow today") does not. An alias that shares no word with her name, such as "hive", is an everyday word and is stricter: it addresses her only at the start of a line followed by a comma or colon ("hive, what's the status?", "Hive: any blockers?"), after "hey" or "ok" ("hey hive what's up"), or closing a question after a comma ("what do you think, hive?"). - **Intro.** "Betty, introduce yourself", "who are you, Betty?" or "who's the bot?" gets the intro (`meetings.persona.intro_template`), which says what she does and how to send her home. Asked in chat, the intro is posted in chat. Asked by voice in a meeting that can hear her, she says a short spoken intro (one or two sentences, at most 120 characters, so it starts quickly and fits the speech cache) and posts the full intro once in chat; it is never delivered in full twice. -- **What she answers.** When addressed she answers briefly from the hive's knowledge vaults, its beads (work items), its code maps (when `knowledge.code_maps.enabled` is on) and the web (when `meetings.persona.searxng_url` is set, see [Web answers](#web-answers)), plus the last three minutes of the meeting. If she does not know, she says so. A request that is not a question gets one clarifying question or one or two sentences on the recent discussion. +- **What she answers.** When addressed she answers briefly from the hive's knowledge vaults, its beads (work items), its code maps (when `knowledge.code_maps.enabled` is on) and the web (when `meetings.persona.searxng_url` is set, see [Web answers](#web-answers)), plus the last three minutes of the meeting. If she does not know, she says so. A request that is not a question gets one clarifying question or one or two sentences on the recent discussion. She converses rather than reads out: every reply opens with its substance, never with praise or filler ("great question"), and when something said in the meeting is wrong or its reasoning has a gap she can see, she says so plainly and first, with the reason. When a request could mean more than one thing, she answers the reading the context best supports, names the assumption in a few words ("assuming you mean the staging cluster") and asks the single question that would tell the readings apart, at most one question per reply; a room question nobody addressed to her is answered on its best reading with the assumption named, but never asked back. - **Voice.** She speaks only when the request was spoken (addressed in the meeting's audio) or asks for it ("say it", "out loud"). She answers directly, at most 2 sentences and 200 characters with no links or Markdown. An answer over 120 characters is said as its first sentence plus "The details are in chat.", and the whole answer is posted once in chat, so first audio and the say call stay short. A short acknowledgement ("Let me check on that.", rotating, in the persona's language, never with the speaker's name) is said only when the answer is still not ready 3 seconds after the request (6 seconds for a question about the hive's own state, which is normally answered well inside that), and one still waiting to be spoken when the answer arrives is skipped, so an acknowledgement never delays the answer behind it. The answer goes through the meeting's voice rules: it is spoken only when the meeting's voice is on and `meetings.voice_on_address` is true, and falls back to chat otherwise or when speaking fails; the acknowledgement is never posted to chat and is not charged to the budget. That gate is hive's, for every platform: Quorum v0.2.0 ignores `voice: false` on Discord, so hive never calls `say` for a meeting whose voice is off. A spoken "Betty?" with no question gets one clarifying question or one or two sentences on the last three minutes. When she heard her name in a spoken request and is about to answer, she first plays a short, soft chime (`meetings.listening_tone`, on by default; see Configuration). - **Several requests at once.** Each request is worked on as soon as it is heard and answered as soon as its answer is ready, so answers can arrive out of order. Whenever that could confuse the room (another request is in flight, someone else spoke since, or the answer took more than 8 s) the answer opens with a short topic phrase: "On open PRs: ...". The topic is the model's 2 to 5 word label for the question, else the request's own words. She does not use the speaker's name in acknowledgements or answers; a name is added only when two people asked about the same topic within a minute ("Andy (re: open PRs): ..." in chat, "Andy, about open PRs: ..." spoken, first name only), written plain, never as `@name`, so nobody is pinged. A single quick answer has no prefix. With two or more requests in hand she posts one short chat note ("I have 3 questions; answering each as it's ready."), at most once a minute, through the chat rate limit and never charged; -- **Questions about the hive itself.** "How many open issues are there?", "what PRs are open in the hive repo?", "which agents are working?" are answered from the hive's live dashboard state (the same open, actionable, held and blocked counts, agents and open PRs the Overview and the dashboard chat use), read in-process, so the answer comes in seconds and never goes to research. Such a question names the hive (or "the repo") or asks for open issues, open PRs, actionable items or recent merges. The numbers are the dashboard's own: every count states its scope the same way ("across 13 repos", or the one repo asked about); a count taken while some repos are still being read after a restart is worded "at least N, counted in 5 of 13 repos so far" and never given as a total; a snapshot older than three minutes says how old it is. Agents are counted as the sidebar counts them (each replica is one agent), the ones working are named (up to five, then "and N more") and a paused agent is never named as running. Asked about one issue or PR she gives a short summary of its description, its state (open, draft, merged, closed), the review and CI status the hive holds and what is blocking it, in at most three short sentences, with no extra GitHub call. -- **About hive itself.** "What is hive?", "which voice memo providers does hive support?", "tell me all you know about hive" are answered from a short product brief built from the project's own docs (what hive is and who it is for, the Inbox voice sources, the meeting platforms, and how the docs position it beside adjacent tools), plus the knowledge base, which for her now includes the ready git sources as well as the vaults. A broad question gets a three sentence overview and an offer to go deeper. These questions are never sent to the public web or to research. +- **Questions about the hive itself.** "How many open issues are there?", "what PRs are open in the hive repo?", "which agents are working?" are answered from the hive's live dashboard state (the same open, actionable, held and blocked counts, agents and open PRs the Overview and the dashboard chat use), read in-process, so the answer comes in seconds and never goes to research. Such a question names the hive (or "the repo") or asks for open issues, open PRs, actionable items or recent merges. The numbers are the dashboard's own: every count states its scope the same way ("across 13 repos", or the one repo asked about); a count taken while some repos are still being read after a restart is worded "at least N, counted in 5 of 13 repos so far" and never given as a total; a snapshot older than three minutes says how old it is. Agents are counted as the sidebar counts them (each replica is one agent), the ones working are named (up to five, then "and N more") and a paused agent is never named as running. Asked about one issue or PR she gives a short summary of its description, its state (open, draft, merged, closed), the review and CI status the hive holds and what is blocking it, in at most three short sentences, with no extra GitHub call. Asked which repositories the hive manages ("what repos does this hive manage?") she lists them, largest open backlog first, each with its open issues and PRs from the same canonical set, and says which counts are still syncing or last-good rather than fresh; reference repositories (studied, not worked) are counted separately, not listed. Asked about the merge pipeline ("what's ready to merge?", "what does the merge pipeline look like?") she names the PRs the merge sweep found eligible, then the ones held back with what stands in the way (the verdict's reason, CI, a requested review, conflicts, a draft), and counts apart the PRs no verdict is recorded for yet. Asked which issues are open ("what issues are open right now?", a list, not the count) she names the actionable issues, highest priority first then newest, each with its priority, age and assignees when the hive holds them, up to six then "and N more". +- **Meeting history** (opt-in). With `meetings.persona.meeting_history` set, "what happened in the last meeting?", "what did we decide about the rollout?", "which meetings have we had?" are answered from the hive's own meeting store, in-process: the meetings that have ended (a meeting still running, including the one she is in, is never "the last meeting"), each named by its title and day and worded by how it ended, and the notes of the most recent meetings - a question about decisions gets the notes' Decisions section. It is off by default, and stays off, because nothing of one meeting - not its notes, not even its title or outcome - is quoted to another meeting's participants (an operator whose meetings share one audience turns it on). These questions never go to the public web or to research. +- **About hive itself.** "What is hive?", "which voice memo providers does hive support?", "tell me all you know about hive" are answered from a short product brief built from the project's own docs (what hive is and who it is for, the Inbox voice sources, the meeting platforms, and how the docs position it beside adjacent tools), plus the knowledge base, which for her now includes the ready git sources as well as the vaults. A broad question gets a three sentence overview and an offer to go deeper. These questions are never sent to the public web or to research. With the project's docs workspace configured (`meetings.docs_kapa`, a per-hive setting), documentation questions like these — "how does hive work", "what is a spoke", "how do I configure the governor" — are answered first from the project's own docs by its docs assistant (kapa.ai), with the pages it cites linked in the meeting chat after the answer; that answer comes ahead of the product brief, and a question the workspace does not answer, or a docs service that is down, slow or answer-less, falls back to the brief and the knowledge base exactly as before. Only a request addressed to her is sent to the docs service, like the web search, and the answer is treated as untrusted data. - **What she heard.** Speech-to-text mishears product words ("hive queue" as "high school", "Kubernetes" as "Cuba needs"). For a line addressed to her, a small table of known mishearings gives the most likely reading; the model sees both ("Heard: ... Most likely meant: ..."). When the reading is a guess she asks one short question ("Did you mean the hive queue?") rather than answer about the wrong thing. Other people's lines and the stored transcript are never rewritten. -- **Deep dives.** When an addressed question needs research (the model sets `needs_research`, or its confidence is below `min_confidence`) and the meeting has a research path, she says "I'll dig into that and report back", starts a research item through the same pool, cap and approval as Spek's research (shown in the panel as `betty-N`, dispatched with `betty=1` in its meta), and gives exactly one follow-up in her own voice when it completes (the summary as is if restyling fails), in the channel she was asked in: spoken for a spoken question when the meeting can hear her, else in chat. She always closes the loop: if the research cannot start (for example "no research agent is available on this hive"), the agent reports an error, or it is still running after 45 seconds, she says "I couldn't look that up: ." and the reason is kept on the research item (`error`); one that runs past 20 seconds gets one "still looking" note first. When every research agent is busy the request waits its turn and she says "I'm busy with another question, yours is next."; its deadline starts when an agent picks it up. The research agents are warmed when a live meeting starts and kept warm while it runs. When an ack was already spoken, the "I'll dig into that" line goes to chat instead. A spoken request is acknowledged at most once, and only when its answer is late (see Voice). +- **Deep dives.** When an addressed question needs research (the model sets `needs_research`, or its confidence is below `min_confidence`) and the meeting has a research path, she says "I'll dig into that and report back", starts a research item through the same pool, cap and approval as Spek's research (shown in the panel as `betty-N`, dispatched with `betty=1` in its meta), and gives exactly one follow-up in her own voice when it completes (the summary as is if restyling fails), in the channel she was asked in: spoken for a spoken question when the meeting can hear her, else in chat. A request she asked a clarifying question about gets no deep dive: the answer waits on the reading the speaker picks, not on more research. She always closes the loop: if the research cannot start (for example "no research agent is available on this hive"), the agent reports an error, or it is still running after 45 seconds, she says "I couldn't look that up: ." and the reason is kept on the research item (`error`); one that runs past 20 seconds gets one "still looking" note first. When every research agent is busy the request waits its turn and she says "I'm busy with another question, yours is next."; its deadline starts when an agent picks it up. The research agents are warmed when a live meeting starts and kept warm while it runs. When an ack was already spoken, the "I'll dig into that" line goes to chat instead. A spoken request is acknowledged at most once, and only when its answer is late (see Voice). - **Room questions.** Betty also answers questions people ask the room (a line ending in "?" or starting with "what", "how", "who" and the like, four words or more), but only if nobody answers within `answer_wait_s` (8 seconds), the knowledge sources had a hit, the model is at least `min_confidence` (0.75) sure, and the topic was not already answered. She never posts general commentary. - **Caps.** Unprompted answers are capped at `per_10m` (2 per ten minutes), at least `min_gap_s` (90 seconds) apart and `per_meeting` (12) per meeting, with one reply per question, at most `queue_depth` (3) questions waiting and none older than `stale_s` (60 seconds). Addressed requests skip these caps but still go through the chat rate limit (`meetings.chat_posts_per_minute`) and the meeting budget; once that rate is spent, answers to addressed requests may take `meetings.chat_answer_burst` (3) more posts a minute, so answers worked on in parallel are not held for a minute. - **Several spoken answers.** Quorum queues each spoken clip and plays them in order, so she never talks over herself; hive estimates the queued speech (about 15 characters a second). Spoken answers that are ready together are said back to back, shortest first. An answer that would wait behind more than 20 s of queued speech is posted to chat instead, and she says "I've put the rest in chat." (at most once every 30 s). An acknowledgement that would play only after more than 8 s of earlier speech is skipped. Chat answers are at most 3 sentences and 300 characters. @@ -565,6 +566,10 @@ Every key has an environment override that wins over `hive.yaml`. The full list | `meetings.transcribe_token_file` | `/data/secrets/meetings_transcribe_token` | Keystore-sealed transcription service token file. | | `meetings.tts_url` | none | Text-to-speech service for Discord speech (`QUORUM_TTS_URL`). | | `meetings.tts_token_file` | `/data/secrets/meetings_tts_token` | Keystore-sealed TTS service token file. | +| `meetings.docs_kapa.site_id` | none | kapa.ai workspace (project) id whose docs answer the persona's documentation questions about the project (`HIVE_MEETINGS_DOCS_KAPA_SITE_ID`). Per hive, so every hive in a fleet can be configured with its own; with no site id the docs source is off and nothing changes. | +| `meetings.docs_kapa.integration_id` | none | kapa.ai HTTP API integration id the persona's questions are attributed to (`HIVE_MEETINGS_DOCS_KAPA_INTEGRATION_ID`); empty sends none. | +| `meetings.docs_kapa.url` | `https://api.kapa.ai` | Docs API base URL; any endpoint speaking the same chat request and answer works (`HIVE_MEETINGS_DOCS_KAPA_URL`). | +| `meetings.docs_kapa.api_key_file` | `/data/secrets/meetings_docs_kapa_api_key` | Keystore-sealed kapa.ai API key (`HIVE_MEETINGS_DOCS_KAPA_API_KEY`). | | `meetings.delivery` | `chat` | Where meeting output goes. | | `meetings.voice_on_address` | `true` | Allow speaking when addressed in a voice-enabled meeting. | | `meetings.listening_tone` | `true` | Betty plays a short, soft two-note chime when she heard her name in a spoken request and is about to answer, so the room knows she is listening (`HIVE_MEETINGS_LISTENING_TONE`). The only setting: no volume or sound options. It plays only when voice is on (a companion meeting plays it in the companion on the host's computer instead), never over speech, and is dropped silently if the audio path is busy. | @@ -619,5 +624,6 @@ Every key has an environment override that wins over `hive.yaml`. The full list | `meetings.persona.unprompted.queue_depth` | `3` | Room questions waiting at once. | | `meetings.persona.unprompted.stale_s` | `60` | Seconds before a waiting question is dropped. | | `meetings.persona.searxng_url` | none | SearXNG instance for web answers (for example `http://searxng.meetings.svc.cluster.local:8080`). | +| `meetings.persona.meeting_history` | `false` | Let Betty answer meeting-history questions from the hive's meeting store: the ended meetings' records (title, day, outcome) and their notes. Off by default: nothing of one meeting is quoted to another meeting's participants. | When the budget runs out, hive posts one notice in the meeting and keeps taking notes, but stops asking questions, starting research and speaking. See [The meeting budget](#the-meeting-budget) for how it is counted and what happens at 80, 90 and 100 percent. diff --git a/docs/content/hive/native-merge-queue.md b/docs/content/hive/native-merge-queue.md index 5d976463..1cab3f55 100644 --- a/docs/content/hive/native-merge-queue.md +++ b/docs/content/hive/native-merge-queue.md @@ -274,15 +274,24 @@ metadata, not a fabricated last-member PR event. and waits up to 22.5 minutes for the five existing policy checks on that exact PR head. No candidate code is executed; tokens are read-only. `verify PR contents` is accepted from either provider: a commit status of - that context created by the App bot named in the repository variable - `HIVE_PR_GATE_CREATOR_LOGIN`, or a check run of the retired `pr-verifier.yml` - (events `pull_request`, `pull_request_target` or `workflow_dispatch`) on a - head that already carries one. Since that workflow was retired + that context created by the configured App bot, or a check run of the + retired `pr-verifier.yml` (events `pull_request`, `pull_request_target` or + `workflow_dispatch`) on a head that already carries one. Since that + workflow was retired ([#19040](https://github.com/hivecommons/hive/issues/19040)) the hive's - status is the only evidence a new head gets, so the variable must be set: - with it unset the hive status provider is not configured and - `verify PR contents` stays missing. A status from any other creator is - always ignored. + status is the only evidence a new head gets, so a creator login must be + configured in one of two places. The gate resolves it in order: the + repository variable `HIVE_PR_GATE_CREATOR_LOGIN` when non-blank, then the + `creator_login` field of the checked-in `.github/hive-pr-gate.json` read + from the trusted base checkout (its path is overridable with + `HIVE_PR_GATE_CONFIG`). The file exists because fork-originated + `pull_request` runs never receive repository variables, so the variable is + empty for them + ([#21074](https://github.com/hivecommons/hive/issues/21074)) while the base + checkout is always available. With neither source naming a login the hive + status provider is not configured and `verify PR contents` stays missing. + The login is compared exactly (case-insensitive); there is no wildcard, and + a status from any other creator is always ignored. Label, edit, or unlabel events re-trigger this workflow and serialize behind any in-flight run (the concurrency group is per-PR and never cancels in-progress); the queued run re-reads mutable PR state after the prior run diff --git a/docs/content/hive/operator-reference/readme.md b/docs/content/hive/operator-reference/readme.md index 6fd7a3cf..bf576690 100644 --- a/docs/content/hive/operator-reference/readme.md +++ b/docs/content/hive/operator-reference/readme.md @@ -39,6 +39,38 @@ revoked profiles. `/api/contributors` exposes the underlying per-profile `abandoned` and `abandoned_prs` data. These counters are independent of Completed/Failed task counts and do not change contributor trust tiers. +## Forgejo contributor identities + +`hive forge contributor-identity` manages `forgejo.integration.contributor_identities` +([#21072](https://github.com/hivecommons/hive/issues/21072)). Forgejo has no API +that creates an authorized integration, so create the user and the +one-repository integration with `forgejo admin user create` and +`forgejo admin user create-authorized-integration` first, then run the command +where the hive runs (it needs the config, the signing key and the Forgejo +token): + +```sh +hive forge contributor-identity set -contributor alice -login alice-forgejo \ + -repo my-org/my-repo -audience # validate, then write the config +hive forge contributor-identity check # re-run the hub's checks +hive forge contributor-identity remove -contributor alice -repo my-org/my-repo +``` + +`set` mints a credential for the audience and runs the same `GET /user` +identity, one-repository and no-other-repository-push checks the hub runs; it +writes the config only when they pass. It never prints or stores the token, +and it does not edit the config for `check` (read-only) or until `set` is +given an audience. `remove` drops the mapping; revoke the integration in +Forgejo separately. To rotate, create a new integration, `set` its audience, +then delete the old integration. See +[Per-contributor Forgejo identities](https://github.com/hivecommons/hive/blob/v5/src/docs/forge-app-setup.md#per-contributor-forgejo-identities). + +A mapped per-contributor login now counts for claim and assignment, because it +names one person ([#21125](https://github.com/hivecommons/hive/issues/21125)). +It never counts for approvals, `lgtm`, automerge release or close-on-merge +trust, including on its own authored PR. The shared `contributor_login` stays +ignored for claims, exactly as before. + ## Clanker MTTR and rework Two stats describe how ClankeR (Contributor Relay) clankers finish their work @@ -419,7 +451,7 @@ Go callers keep reading `cfg.Agents`, `cfg.Governor.Gateways` and so on through | `dashboard.authorized_users` | Empty means no per-user direct-route allowlist. | Entries can be `user` or `user:role`; roles are `read`, `read-write`, `merger`, `owner`. | | `dashboard.public_url` | Empty means OAuth redirect URIs (Linear agent install, OpenRouter funding) fall back to `hub.dashboard_url`, then the request's forwarded/`Host` origin. | Set to this dashboard's externally reachable origin (`https://hive.example.com`, no path/query) on a standalone hive whose callback is published on a different hostname or whose ingress rewrites `Host`. Must be an absolute `http(s)://` origin; a trailing slash is trimmed and anything else fails config load. See [linear-agent.md](/docs/hive/integrating-with-hive/linear-agent-integration#setup). | | `dashboard.experiment_lab` | Off by default. | Hides the Experiment Lab (formerly Strategy Lab) while that surface is being reworked. Set `dashboard.experiment_lab: true` to show the Experiment Lab section, sidebar nav entry, and Nous status controls. | -| `dashboard.subscription_gauge_header` | Off by default. | Also shows the owner-only usage fuel gauge as a chip in the dashboard header on every page, with the needle on the limit closest to empty across the providers the agents use. The gauge is on the Overview by default whenever the agents spend a measured plan (Claude, Copilot and others) and needs no setting; this key only adds the header chip. Display only: it reads the existing usage readings and changes nothing about measurement or rotation. See [Usage gauge](/docs/hive/dashboard/dashboard-page-reference#usage-gauge). | +| `dashboard.subscription_gauge_header` | Off by default. | Also shows the write-tier usage fuel gauge as a chip in the dashboard header on every page, with the needle on the limit closest to empty across the providers the agents use. The gauge is on the Overview by default whenever the agents spend a measured plan (Claude, Copilot and others) and needs no setting; this key only adds the header chip. Display only: it reads the existing usage readings and changes nothing about measurement or rotation. See [Usage gauge](/docs/hive/dashboard/dashboard-page-reference#usage-gauge). | | `dashboard.attribute_label_actions` | On by default. | When the dashboard changes labels for a person — hold added or released, triage accepted, `needs-human` or the sentinel label lifted by an approval — GitHub records the Hive App as the actor. With this on, the hive also leaves one comment per item and kind (hidden `` marker) naming the signed-in dashboard user, edited in place on the next action instead of repeated. The audit-log entry is written either way. Set `false` to stop the comments ([#19852](https://github.com/hivecommons/hive/issues/19852)). | | `dashboard.strategy_lab` | Off by default. **Deprecated** alias of `dashboard.experiment_lab`, kept for one release (#11695). | `true` still enables the Experiment Lab and logs a one-line deprecation at config load; the value is folded into `dashboard.experiment_lab` so the next config save writes the documented key. | | `dashboard.matrix` | Off by default (`enabled: false`, `repos: []`, `exclude_paths: []`). **Experimental.** | Code activity source; see [Code activity reader](/docs/hive/dashboard/dashboard-page-reference#code-activity-reader) for presentation, compatibility, capture and access policies. When active, pushed lines from allow-listed repos are served to authenticated read-role viewers via `GET /api/matrix/lines?since=&max=` (bounded backlog, `Cache-Control: no-store`; `404` when inactive) and `/api/events` emits a content-free `code-lines` nudge (`{"seq":N}`, ≤1/s) telling browsers to pull. `repos` is an explicit exact `owner/name` allowlist (no wildcards, URLs or bare names) and an empty list captures nothing, so `enabled: true` alone stays inactive. `exclude_paths` adds non-empty path globs to the built-in deny-list. There is no `authors` or `private_repos` key: authors are fixed and private repos are always excluded. | diff --git a/docs/content/hive/operator-reference/runtime-and-quota.md b/docs/content/hive/operator-reference/runtime-and-quota.md index 4a195713..15a3c103 100644 --- a/docs/content/hive/operator-reference/runtime-and-quota.md +++ b/docs/content/hive/operator-reference/runtime-and-quota.md @@ -655,6 +655,16 @@ only the two list calls per repo move behind it. ##### Rate-limit pacing priority +The caution window follows what GitHub asked for: a secondary-limit `Retry-After` +(capped at `HIVE_GITHUB_SECONDARY_MAX_RETRY_AFTER`, default `10m`; `1m` assumed +via `HIVE_GITHUB_SECONDARY_DEFAULT_RETRY_AFTER` when absent) plus a paced tail of +`HIVE_GITHUB_SECONDARY_CAUTION_TAIL` (default `2m`). Independently of any window, +`/search` calls are serial with at least `HIVE_GITHUB_SEARCH_MIN_GAP` (default +`2s`) between them, in-flight issue/PR list reads are capped at +`HIVE_GITHUB_LIST_MAX_CONCURRENCY` (default `4`), and the dashboard collector +pauses `HIVE_METRICS_REPO_SPACING` (default `1s`, plus jitter) between per-repo +calls so a pod start with many watched repos does not burst. + After a GitHub rate-limit refusal (a secondary-limit 403 or a primary-limit reset) the shared transport enters a slow-start caution window and paces requests about 2s apart. Pacing is prioritised so periodic housekeeping cannot @@ -670,6 +680,10 @@ starve the governor: taking a slot, and a tick whose first slot is already further out than the tick could wait is skipped outright (`low-priority work shed`, logged at most once a minute per caller) and retried on its next tick; +- the dashboard's open PR / issue list reads (`GET /repos/{o}/{r}/pulls|issues`) + stay served at low priority with spacing, queueing up to + `HIVE_GITHUB_MONITOR_LIST_MAX_QUEUE` (default `30s`) instead of being shed, so + the Activity Monitor keeps its data through a caution window; - the self-authored automerge sweep backs its tick off to at least 60s while the window is engaged and resumes its adaptive interval when it ends; - GitHub App installation-token mints (and the other App-JWT endpoints) do @@ -894,6 +908,127 @@ fall back to the default. The kick primer's own byte cap is the yaml key `knowledge.primer.max_bytes` (default `4096`); see [knowledge-curator.md](https://github.com/hivecommons/hive/blob/v5/src/docs/knowledge-curator.md#kick-primer-size-cap-knowledgeprimermax_bytes). +### Wire usage ledger (ADR-0027 phase P1) + +`tokens.wire_ledger.enabled` (default `false`) makes the GitHub proxy append +one metadata-only row per inference request it carries. It is the phase P1 +observation ledger from +[ADR-0027](/docs/hive/adr/0027-hybrid-wire-and-transcript-cost-accounting); it +changes no policy decision and no usage total. Phase P1 only writes the ledger; +phase P2 (below) makes the token collector read it when the knob is on. + +```yaml +tokens: + wire_ledger: + enabled: true +``` + +| Setting | Default | Purpose | +|---|---|---| +| `tokens.wire_ledger.enabled` | `false` | Build the append-only wire usage ledger. Off means nothing is minted or written and the cumulative inference sink path is byte-identical. | +| `HIVE_WIRE_USAGE_LEDGER` | unset | Environment override; `1`/`true`/`yes`/`on` enables and `0`/`false`/`no`/`off` disables, winning over the YAML value. An unrecognized value is ignored. Read once at boot. | + +Rows are written to `/wire-usage/ledger.jsonl`, one JSON +object per line, appended. The `wire-usage/` subdirectory is deliberate: the +token collector globs only `*.jsonl` directly under the metrics dir, so it +never scans this file as a session transcript. Each row carries the ledger's +own `request_id`, `agent`, `backend`, `provider`, `model`, `input_tokens`, +`output_tokens`, `cache_read_tokens`, `cache_creation_tokens`, `started_at`, +`ended_at`, `outcome` (`ok`/`error`), `attempts`, `measure_source` (`wire`), +`billing_basis` (`unknown` in P1) and, when the upstream supplied one, +`provider_request_id`. It carries no prompt, completion, tool content, header, +URL or credential. + +A streaming request emits one row at completion, never one per chunk. Retries +fold into the same row and increment `attempts`. A cancelled or failed request +emits one row with `outcome: error` and the tokens observed before it stopped. +A ledger write failure (full queue, unreadable directory, disk error) is logged +locally and never delays or fails the proxied request. Set the knob and restart +the hive to take effect; deleting the file is safe because the next scan falls +back to the cumulative sink read. + +#### Merge and precedence (phase P2, #21094) + +When the knob is on and the ledger file exists, the token collector uses the +ledger as its wire source instead of the cumulative `inference-*.jsonl` and +`copilot-live-*.jsonl` sink files, and skips those sink sessions for that scan +so the same request is never counted twice. If the knob is off, the ledger file +is absent, or the file cannot be read, the sink path is unchanged; a corrupt +line is skipped and logged at debug and never fails collection. + +Two observations of one request are never summed. The collector applies this +order: + +1. A wire row and a transcript row that share a request id become one + `reconciled` row: the transcript row keeps the tokens and is marked + reconciled, and the wire row adds nothing. Transcript rows usually carry no + request id, so this join is best effort. +2. With no shared id, a transcript session for the same agent whose active time + window covers the request wins: the wire row adds nothing. +3. Otherwise the wire row is the only observation and is counted as `wire`. + +Wire rows carry no session id, so step 2 matches on the session's time window. +That is coarser than per request but preserves the Copilot live-capture rule: a +session observed from its start is counted once from the wire, and a session +that predates capture is counted once from its shutdown transcript. + +Every row and bucket a wire-aware scan produces carries `measure_source` +(`wire`, `transcript` or `reconciled`) and `billing_basis` (`unknown` in P2); a +total spanning both sources is marked `measure_source: mixed` with +`measure_mixed: true` and a per-source `by_measure_source` split. A scan with no +wire rows emits none of these fields, so transcript-only totals and +per-agent/per-model buckets are byte-identical. `price_source` is unchanged: +`unknown`-priced models stay excluded from USD and are shown as price unknown, +never $0. + +#### Reconciliation report (phase P4, #21096) + +When the knob is on and the ledger file exists, the dashboard serves a +read-only report at `GET /api/cost/reconcile`. It shows, per agent and per +model, what the wire observed versus what the transcripts recorded, the +delta, and the reason each observation took the source it did. With the knob +off, or before any ledger file exists, the route returns 404: an operator who +has not opted in sees nothing new. + +The report is **diagnostic only**. It changes no total, gates nothing, and +mutates neither the ledger nor the token aggregate. A row is never a budget +input; the P2 merge remains the only code that decides a total. + +Each row carries `wire_tokens`, `transcript_tokens`, `delta_tokens` (wire minus +transcript), the same three as list-price costs, the count of wire requests and +transcript sessions, and two count maps: + +- `winners` counts, per source (`wire`, `transcript`, `reconciled`), the + observations the P2 rule takes from that source. +- `buckets` counts, per reason, why each observation took its source. + +| Bucket | Meaning | +|---|---| +| `wire_only_no_transcript` | The wire saw the request; no transcript session covers it and no request id matches. The wire row is the only observation. | +| `transcript_only_no_wire` | A transcript session exists but the wire saw no request that covers or reconciles with it (transcript-only, or a suspected proxy bypass). | +| `reconciled_request_id` | A wire row and a transcript row share a request id and describe one request. | +| `window_overlap_transcript_wins` | The wire saw the request and a transcript session for the agent covers its time window, but the rows share no request id; the transcript wins. | +| `duplicate_request_id_dropped` | A repeated ledger line for a request id already counted; the P2 dedupe drops it so a copied or rewritten ledger cannot double count. | +| `unattributed` | A ledger row or transcript session that cannot be assigned to an agent or model. Counted as a stated coverage gap, never as zero. | + +The ADR-0027 §8 phase table names some of these differently. The report's +names are the ones above, and they map as: `wire_only` → +`wire_only_no_transcript`; `transcript_preferred` → +`window_overlap_transcript_wins`; `reconciled` → `reconciled_request_id`; +`transcript_extra` and `bypass_suspected` → `transcript_only_no_wire`. The +buckets partition observations, so an alias is never a second count. + +An absent measurement is reported as absent (a JSON `null`), never as zero: +"the wire saw nothing" and "the wire saw zero tokens" are different statements. +`unattributed` rows appear in their own count with a note, not folded into an +agent row. + +Costs are list-price estimates, not spend. `billing_basis` stays `unknown` +because P4 cannot observe whether a request was metered or subscription +covered, `cost_basis` is `list_price_estimate`, and a model with no price has +no cost figure rather than `$0` (it is named in `unknown_price_models`). The +`caveat` field says the same thing in the payload. + ### Inference endpoint fallbacks | Name | Default | Purpose | diff --git a/docs/content/hive/roadmap.md b/docs/content/hive/roadmap.md index 556c7cd2..62da7777 100644 --- a/docs/content/hive/roadmap.md +++ b/docs/content/hive/roadmap.md @@ -62,7 +62,7 @@ the historical item dates below are not a fresh audit of every linked issue. |---|---|---|---| | v5 readiness and channel cutover | Completed 2026-09-21 | v5 is the stable line; migrate v4 before 2026-12-21. | [#6016](https://github.com/hivecommons/hive/issues/6016) | | Documentation publication | Live; v5 sync cutover resolved | Read v5 docs at [docs.hivecommons.dev](https://docs.hivecommons.dev); Hive remains the canonical source for synced pages. | [#7814](https://github.com/hivecommons/hive/issues/7814) | -| HiveCommons org migration | Tracker closed 2026-09-03 | Native org/package names changed; mirror tags and redirects remain compatibility surfaces pending dated deprecation. | [Migration tracker](https://github.com/hivecommons/hive/blob/v5/src/docs/hivecommons-migration.md) | +| HiveCommons org migration | Tracker closed 2026-09-03 | Native org/package names changed; the `ghcr.io/kubestellar/*` mirror stopped updating on 2026-12-01, so repoint pinned hosts to `ghcr.io/hivecommons/*`. Redirects remain. | [Migration tracker](https://github.com/hivecommons/hive/blob/v5/src/docs/hivecommons-migration.md) | | Architecture decision records | Back-fill completed | Knowledge, skills, triggers, and hub/spoke choices have an auditable record. | [ADR index](/docs/hive/adr/readme) | | Stable promotion gate | Available; originally introduced on v4 | Current v5 stable promotion waits for age, evidence, blocker, smoke, and generation gates. | [Stable policy](/docs/hive/operations/stable-soak-and-promotion-policy) | | Repo-scoped controls | Pause/custom-agent decisions recorded 2026-09-09; current code also supports narrower ACMM overrides | A repository override cannot raise authority above the hive-wide ACMM ceiling. | [Per-repo agents](https://github.com/hivecommons/hive/blob/v5/src/docs/per-repo-agents.md) | @@ -111,7 +111,7 @@ and linked current guides for operator decisions. | Retrospective learning lane | Build from deterministic post-completion advisory beads toward LLM-assisted retro summaries and knowledge extraction. | [#2809](https://github.com/hivecommons/hive/issues/2809), [retro lane](/docs/hive/operations/automation-and-review/retro-lane) | | Large-spoke scale envelope | State how a **single** spoke behaves as its backlog grows, rather than discovering it one bug at a time. The [scale envelope](https://github.com/hivecommons/hive/blob/v5/src/docs/scale-envelope.md) page now records the design rule (overflow must paginate, prioritize, or shed load — never fail closed on the work that would drain the backlog), the fact that caps are render-side while issue/PR enumeration is uncapped, and an inventory of every cap with its overflow behaviour and tunability. Evidence base: the 2026-09-17 projectbluefin cluster (~304 open PRs across 16 repos) — uncapped kick PR list (#7368, fixed by #7379/#7395), restart/kick loop on a long delivery (#7363, fixed by #7378), stand-down on render-cap overflow (#7385, scoped per repo by #7391), fork-unaware repair queue (#7386). Remaining: decide one policy for which caps are operator-tunable vs hardcoded-and-narrowly-scoped, and measure enumeration cost against API rate limits at this shape. | [#7392](https://github.com/hivecommons/hive/issues/7392), [scale envelope](https://github.com/hivecommons/hive/blob/v5/src/docs/scale-envelope.md), [#7385](https://github.com/hivecommons/hive/issues/7385) | | ADR back-fill for remaining subsystems | **Done.** Back-filled accepted ADRs capture the knowledge system, skill registry, CEL/channel triggers, and hub/spoke mechanics, so architecture decisions stay auditable. | [ADR-0011](/docs/hive/adr/0011-knowledge-system), [ADR-0012](/docs/hive/adr/0012-skill-registry), [ADR-0013](/docs/hive/adr/0013-cel-triggers), [ADR-0014](/docs/hive/adr/0014-hub-spoke) | -| HiveCommons org migration | **Tracker closed 2026-09-03 (#5686).** The hivecommons→hivecommons move is auditable in the [migration tracker](https://github.com/hivecommons/hive/blob/v5/src/docs/hivecommons-migration.md): repo transfer, Go module rename, GHCR namespace and the `hive.hivecommons.dev` hub cutover are done; the `ghcr.io/kubestellar/*` mirror tags and `hive.hivecommons.dev` redirect stay as compatibility surfaces until the dated package deprecation (P6) is announced. | [migration tracker](https://github.com/hivecommons/hive/blob/v5/src/docs/hivecommons-migration.md), [#5686](https://github.com/hivecommons/hive/issues/5686) | +| HiveCommons org migration | **Tracker closed 2026-09-03 (#5686).** The hivecommons→hivecommons move is auditable in the [migration tracker](https://github.com/hivecommons/hive/blob/v5/src/docs/hivecommons-migration.md): repo transfer, Go module rename, GHCR namespace and the `hive.hivecommons.dev` hub cutover are done; the `hive.hivecommons.dev` redirect remains, while the `ghcr.io/kubestellar/*` mirror stopped updating on 2026-12-01 ([#20944](https://github.com/hivecommons/hive/issues/20944)). | [migration tracker](https://github.com/hivecommons/hive/blob/v5/src/docs/hivecommons-migration.md), [#5686](https://github.com/hivecommons/hive/issues/5686) | | v4 stable soak gate | **Done.** CI now keeps `candidate` moving on every green v4 image build and promotes `stable` later by digest only after the soak, evidence, blocker, smoke, and monotonic guards pass. | [stable soak policy](/docs/hive/operations/stable-soak-and-promotion-policy), [#5974](https://github.com/hivecommons/hive/issues/5974) | ### Prior Next records diff --git a/docs/content/hive/security-model.md b/docs/content/hive/security-model.md index e61ffcdf..b65b5c84 100644 --- a/docs/content/hive/security-model.md +++ b/docs/content/hive/security-model.md @@ -414,6 +414,20 @@ on the same evidence as a literal IP. Set destination is intended; it lifts the guard for all three legs at once, and the proxy warns at boot when it is set. +**Tunnel egress audit (observation only).** Every uninspected egress connection +the proxy opens is recorded in the hash-chained audit log +([#21080](https://github.com/hivecommons/hive/issues/21080)): one row per +tunnelled CONNECT and per plain-HTTP forward, with the calling agent, the host +and port the agent named, the address the proxy actually dialled, payload bytes +up and down, start and end times, and whether the destination was allowed or +refused. No URL path or query string, header, body or credential is recorded. +The audit is always on; there is no flag to enable it. It is strictly +observation: it never refuses, delays or changes a connection, and a failed or +slow audit write is logged locally and otherwise ignored. It adds no policy: +the destination guard above is the only thing on these paths that can refuse +traffic, and an opt-in allowlist remains a separate proposal. See +[audit-log.md](https://github.com/hivecommons/hive/blob/v5/src/docs/audit-log.md#tunnel-egress-rows). + **HTTP relay header boundary.** Plain HTTP, inspected agent HTTP, and the sandbox read relay remove `Proxy-Authorization`, `X-Forwarded-*`, `X-Hive-*`, standard hop-by-hop fields, and fields nominated by `Connection` @@ -637,6 +651,19 @@ starts every session clean. It is a measurement step toward the design in it adds no protection yet and must not be read as a control. Reads Hive cannot see (local files, shell output, direct provider traffic) produce no label. +**Wire usage ledger (observe only, off by default, ADR-0027 phase P1).** +An operator can set `tokens.wire_ledger.enabled` to turn on a usage ledger. +The proxy then appends one row per inference request it carries. The file is +`/wire-usage/ledger.jsonl`. A **ledger** is an append-only list of +rows. Wire usage rows are **metadata-only and observation-only**. A row holds +the agent, backend, provider, model, token counts, start and end time, outcome, +attempt count and a request id. It never holds a prompt, a completion, a +header, a URL or a credential. The ledger only observes. It cannot allow or +deny a request. A cancelled request still writes one row, marked error. A +failed write never changes the response. The collector does not read this file +yet, so usage totals do not change. Shell access to the data directory can +therefore show per-request metadata, but not message content. + **Audit trails.** The dashboard audit log records every dashboard and API mutation, merge decision, sentinel finding and watchdog action to `/data/audit.jsonl`, rotated at 5 MB with three backups and a 90-day diff --git a/docs/content/hive/settings.md b/docs/content/hive/settings.md index 27706424..b97f5715 100644 --- a/docs/content/hive/settings.md +++ b/docs/content/hive/settings.md @@ -210,7 +210,7 @@ Settings for the dashboard itself (`dashboard.*`): its port and agent poll inter **Inception (spek) sessions** (`dashboard.sessions.enabled`, on by default) turns on the [Inception (spek)](/docs/hive/dashboard-sections#inception-spek) section, named shared CLI-agent terminals inside the dashboard that open in the hive's shared spek workspace, which replaced the removed Inception wizard. Set it to false to hide the section. The `HIVE_SESSIONS_ENABLED` environment variable, when set, overrides the switch, and the dialog says so. Beside it are the three limits, `dashboard.sessions.max_sessions`, `dashboard.sessions.max_per_user` and `dashboard.sessions.idle_ttl_hours`; 0 keeps the built-in default (12, 4 and 72), and `HIVE_SESSIONS_MAX`, `HIVE_SESSIONS_MAX_PER_USER` and `HIVE_SESSIONS_IDLE_TTL_HOURS` override them. **Answer the CLI startup screens** (`dashboard.sessions.autostart`, on by default) lets the hive take a starting session's CLI through its startup screens (first-run notice, trust for the session's folder, onboarding) to its input prompt, so the first request runs without a person; it never answers a permission prompt and never signs in, and `HIVE_SESSIONS_AUTOSTART` overrides the switch. See the [Sessions API](/docs/hive/api-reference/sessions). -**Also show the usage gauge in the header** (`dashboard.subscription_gauge_header`, off by default) adds a small fuel-dial chip to the header on every page, showing how much is left in the limit closest to running out across the plans the hive's agents spend (Claude, Copilot and others). The full gauge, with a row per provider, is on the Overview by default for the owner and can be hidden there from the Overview settings. Both show the measurements hive already makes; only the owner sees them; and they show the providers' plans, not the hive's token budget. See [Usage gauge](/docs/hive/dashboard/dashboard-page-reference#usage-gauge). +**Also show the usage gauge in the header** (`dashboard.subscription_gauge_header`, off by default) adds a small fuel-dial chip to the header on every page, showing how much is left in the limit closest to running out across the plans the hive's agents spend (Claude, Copilot and others). The full gauge, with a row per provider, is on the Overview by default for write-tier viewers (the owner, merger and read-write) and can be hidden there from the Overview settings. Both show the measurements hive already makes; only write-tier viewers see them; and they show the providers' plans, not the hive's token budget. See [Usage gauge](/docs/hive/dashboard/dashboard-page-reference#usage-gauge). ## Compliance diff --git a/docs/content/hive/troubleshooting.md b/docs/content/hive/troubleshooting.md index 693f4381..14be1e0c 100644 --- a/docs/content/hive/troubleshooting.md +++ b/docs/content/hive/troubleshooting.md @@ -207,6 +207,30 @@ Hosted hives that never complete setup or go inactive are **reaped on a timer**: On GitHub Enterprise, a 404 from the install link usually means the hive is pointed at github.com instead of your GHE host (or vice versa) — check which source control host is configured under Governor Config → Forge App. +## A hive Deployment is stuck at 0 replicas after config surgery + +A break-glass config edit drained the Deployment and the restore did not fire +([#21167](https://github.com/hivecommons/hive/issues/21167)). The surgery flow +records its restore target on the data volume at +`/data/.config-surgery.json`, so recovery is deterministic: + +1. Read the marker: `kubectl -n exec -- cat /data/.config-surgery.json` + (or run `hive config-surgery status` in a pod that mounts the volume). It + names the Deployment and the `prior_replicas` to restore. +2. Let the tool restore: `hive config-surgery restore` from a pod with the + hive image, `hive-sa`, and the `hive-data` volume. It is idempotent and + clears the marker after the scale succeeds. +3. If the API is unreachable, scale manually: + `kubectl -n scale deployment/hive --replicas=`. + The next hive start consumes the marker and clears it without touching the + running replica count. + +A hive that starts while a marker is pending will also consume it. If the +marker is unreadable or from a newer schema, Hive logs +`config surgery marker unreadable` and leaves it in place rather than guessing. +The surgery itself is documented in +[Editing `hive.yaml`](/docs/hive/editing-hive-yaml#break-glass-surgery-draining-a-hive-with-a-guaranteed-restore). + ## Agents are stuck, paused, or need CLI login ### Start on the agent card, not in tmux diff --git a/docs/content/hive/upstream-watch.md b/docs/content/hive/upstream-watch.md index 515e49ac..06fc6903 100644 --- a/docs/content/hive/upstream-watch.md +++ b/docs/content/hive/upstream-watch.md @@ -48,7 +48,8 @@ repo under `upstream_watch.repos`, in key order, one pass: 1. Lists upstream PRs merged (`merged_at`) and non-draft releases published (`published_at`) strictly after the repo's watermark, filtered by - `sources` and `pr_labels`, oldest first. + `sources` and `pr_labels`, oldest first. PRs whose head repository is the + watching fork itself are skipped, since the fork already has the change. 2. Classifies each item as `security`, `bugfix`, `feature` or `chore` from its labels and conventional-commit title prefix, and estimates the port difficulty (`easy`, `moderate`, `hard`) from files and lines changed. diff --git a/scripts/sync-hive-docs.files.json b/scripts/sync-hive-docs.files.json index 114c3cfb..e6124020 100644 --- a/scripts/sync-hive-docs.files.json +++ b/scripts/sync-hive-docs.files.json @@ -664,5 +664,11 @@ }, { "source": "hosted-hive-upgrade-gate.md" + }, + { + "source": "adr/0027-hybrid-wire-and-transcript-cost-accounting.md" + }, + { + "source": "integrations/clanker-cortex.md" } ] diff --git a/src/app/docs/page-map.ts b/src/app/docs/page-map.ts index b9fbeafa..afc917d2 100644 --- a/src/app/docs/page-map.ts +++ b/src/app/docs/page-map.ts @@ -350,6 +350,8 @@ const NAV_STRUCTURE_HIVE: Array<{ title: string; items: NavItem[] }> = [ { 'AI contribution policy template': 'ai-contribution-policy.md' }, { 'Data janitor': 'data-janitor.md' }, { 'Opening a hive that is down or upgrading': 'hosted-hive-upgrade-gate.md' }, + { 'ADR-0027: Hybrid wire and transcript cost accounting': 'adr/0027-hybrid-wire-and-transcript-cost-accounting.md' }, + { 'Cortex and a ClankeR (Contributor Relay)': 'integrations/clanker-cortex.md' }, ] } ]