Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/changed-16477-code-activity-cutover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Code activity supersedes the Matrix code view with one topbar entry opening the published-checkpoint reader in a new tab; decorative renderers and settings are retired, display links are updated, and deprecated internal Matrix API/config names remain supported with capture and broadcasting still off by default.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ patches:
value: http://hive.hive-hosted-hosted-available-oke-11-placeholder-r05x.svc.cluster.local:3002
- op: replace
path: /data/DASHBOARD_PATH
value: /?kiosk=1&view=matrix&sound=off
value: /?kiosk=1&view=reader&sound=off
- op: replace
path: /data/STREAM_AUDIO
value: silent
Expand Down
7 changes: 7 additions & 0 deletions src/docs/api-reference/dashboard-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,10 @@ eligible region is always returned whole, even if larger than the budget.
Code buffers are bounded and memory-only, so this is not an audit history.
Clear retained browser code on epoch changes and failed/disabled/unauthorized
pulls. An empty response says nothing about work outside the admitted source.

The internal `/api/matrix/lines` and `dashboard.matrix.*` names are deprecated
but remain supported for compatibility. The sole code display is now **Code activity**
at `?kiosk=1&view=reader`; the Matrix renderers and their `mx.*`
settings are retired. Activation remains explicitly opt-in and default-off;
only pushed, published PR checkpoints are admitted, never workspace or pre-push
content. The cutover grants no anonymous access or broadcast authorization.
24 changes: 15 additions & 9 deletions src/docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,15 +607,21 @@ The endpoint returns `stages` (the stage table with `short`, `branch_from`, conf
## Code activity reader

The code activity reader is a kiosk view at `?kiosk=1&view=reader` that shows
pushed changes as readable paragraphs. It is the planned successor to the
Matrix code view ([#16137](https://github.com/hivecommons/hive/issues/16137)).
Until the cutover, both views are available. The reader uses the same opt-in
setting and authorized `GET /api/matrix/lines` endpoint as Matrix, so it has
the same `dashboard.matrix` repository allowlist, author restriction and
scrub/path filters. When `dashboard.matrix.enabled` is set, the header shows a
**Reader** tab next to **Matrix**. Without that setting, the endpoint answers
404 and the view says it is not enabled. The reader adds no permission and no
anonymous access.
pushed changes as readable paragraphs. It supersedes the Matrix code view
([#16137](https://github.com/hivecommons/hive/issues/16137)). The Activity Monitor
topbar has one **Code activity** entry, opening the reader in a new tab when
`dashboard.matrix.enabled` is set. The decorative Matrix view and its rain,
cascade, ghost and terminal effects are retired; saved display URLs must use
`?kiosk=1&view=reader`. The old `view=matrix`, `mx.*` URL options and
`hive.matrix.*` browser preferences no longer select or configure a code view.

The internal `dashboard.matrix.*` configuration names and `/api/matrix/lines`
endpoint are deprecated names retained for compatibility; do not rename existing
configuration. They continue to enforce the same public repository allowlist,
author restriction, dashboard read authorization and scrub/path filters. Code
activity stays **off by default**: this cutover enables no capture or broadcast.
When inactive, the content endpoint answers 404 and the reader says it is not
enabled. There is no anonymous access or workspace/pre-push capture.

- **Cards.** Each card is a complete contiguous add/remove region from a
validated unified-diff hunk at an actual published PR head. Indentation, blank lines
Expand Down
2 changes: 1 addition & 1 deletion src/docs/operator-reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ Go callers keep reading `cfg.Agents`, `cfg.Governor.Gateways` and so on through
| `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](../linear-agent.md#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.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.** | Opt-in Activity Monitor Matrix display block (#15862). 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. |
| `dashboard.matrix` | Off by default (`enabled: false`, `repos: []`, `exclude_paths: []`). **Experimental.** | Opt-in Code activity source. The `dashboard.matrix.*` names are deprecated but retained for compatibility; the Code activity entry opens `?kiosk=1&view=reader` in a new tab. No automatic enablement or workspace capture. 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. |
| `hub.contribute_announcement` | Empty/off by default. | Operator notice for contributors. Set from Governor → Hub or `/contribute` Management (owner/read-write): `text` is server-sanitised plain text capped at 500 characters and rendered only through text-safe sinks (empty clears), `level` is `info`/`warning`, `expires_at` is optional RFC3339, and the server rotates `id` whenever text changes so dismissed Operations/Profile banners reappear. Active notices show on `/contribute` Operations/Profile, above the Onboarding command block, and in connected relay terminals. |
| `hub.contribute_repo_filters` | Empty map means repos inherit the hive-wide contributor title, author, and label filters exactly as before. | Optional full `owner/repo` keys that narrow one repository's `/contribute` queue without widening the hive. Hive-wide skip labels and hive-wide filters always run first; a repo filter can only add deny matches or require an allow-mode title/author/label match for that repo. Edit from `/contribute` → Management → Repos for Contribute → Filters or Governor → Hub. Operations lists configured overrides and withheld diagnostics name repo matches, e.g. `Repo filter label "2-discussing" denied for projectbluefin/common`. |
| `hub.contribute_wall_enabled` | Off by default. | Opts the hive into the public contributor wall on `/contribute` Operations. The Management tab and Governor Hub settings mirror this switch. When off, the panel is hidden and write endpoints refuse posts. |
Expand Down
70 changes: 25 additions & 45 deletions src/docs/streaming-the-activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ apply the overlay — the steps below are all yours to run.

### Call-to-action overlay

Every kiosk view — this stream's Activity Monitor, the [Matrix](#matrix-mode-separate-channel)
Every kiosk view — this stream's Activity Monitor, [Code activity](#code-activity-separate-channel)
and the hub's [public fleet page](#the-hivecommonsfleet-broadcast) — carries a
small pill bottom-right: "🐝 Want this for your repos?", the URL
`hive.hivecommons.dev/get-started` in 24px amber, and a 110px QR code of it, so
Expand All @@ -107,8 +107,8 @@ spoke the destination and the copy are `dashboard.kiosk_cta_url` and
are `HIVE_HUB_KIOSK_CTA_URL` and `HIVE_HUB_KIOSK_CTA_TEXT`. The QR code is
rendered server-side (`src/pkg/webassets/kioskcta`) as an inline `data:` PNG, so
nothing external is loaded and the pages' Content-Security-Policy is unchanged.
In Matrix mode the pill sits above the canvas at 85 % opacity so it does not
fight the effect.
In Code activity the pill sits above the reader at 85 % opacity so it does not
obscure the code.

### Channel title, category, tags

Expand Down Expand Up @@ -291,51 +291,31 @@ with the same ↑/↓ delta cue), enlarged in kiosk, pop-out, display and full-s
views so it reads at 1920×1080. Do not point the streamer at a hive tracking private
repositories without reviewing what the tracker would show.

The main `twitch.tv/hivecommons` stream never shows Matrix; it remains the
The main `twitch.tv/hivecommons` stream never shows Code activity; it remains the
full-screen Activity Monitor.

## Matrix mode (separate channel)

When `dashboard.matrix.enabled` is set, the Activity Monitor header also shows a **Matrix** tab that opens `?kiosk=1&view=matrix` in the same window. It also shows a **Reader** tab that opens the [code activity reader](dashboard.md#code-activity-reader) at `?kiosk=1&view=reader`. The reader uses the same lines, shown as readable paragraphs.

Matrix is an experimental, default-off code display for a separate channel,
[`twitch.tv/hivecommonsmatrix`](https://www.twitch.tv/hivecommonsmatrix).
It depends on the Matrix display renderer (`/?kiosk=1&view=matrix`,
[#15936](https://github.com/hivecommons/hive/issues/15936)); without that
renderer the dashboard ignores `view=matrix` and the kiosk serves the ordinary
Activity Monitor. When active it shows pushed added lines only, from positively
identified hive identities, on public repositories explicitly allowlisted in
`dashboard.matrix.repos`.
Private patches, unverified authors and excluded paths are never shown. Lines
touched by scrubbing are dropped entirely rather than displayed with redactions;
the built-in secret/path filters and `dashboard.matrix.exclude_paths` apply.
Dashboard authentication alone does not make a code stream safe for public
Twitch broadcasting: the public allowlist, author restriction and scrub/drop
rules are required.

The display's look is chosen with `mx.*` URL parameters; each value is also
remembered in the browser (`hive.matrix.*` in local storage) for later visits.
Every effect renders only lines already delivered by `/api/matrix/lines`.

| `mx.effect` | Display |
|---|---|
| `rain` (default) | Falling columns built from the characters of the latest lines. Unknown values fall back to `rain`. |
| `cascade` | Whole lines drift down the screen, each with its `repo#PR · path` caption. |
| `ghost` | Ghost coder: a fake editor with one tab per PR (`repo#PR`), titled with the file path; at most six tabs, the oldest closes first. Lines are typed character by character behind a blinking cursor, with light keyword/string/comment/number colouring by file extension. |
| `terminal` | An endless `git log -p`-style scroll: each line printed as a green `+ <line>`, with a `repo#PR · path` header whenever the PR or file changes. |

`mx.speed` (0.1–5, default 1) and `mx.fps` (1–60, default 30) set the
animation and typing speed, `mx.palette` is `green` (default), `amber` or
`gold`, and `mx.captions=off` hides the `repo#PR · path` captions and headers
on the canvas. `p` or Space pauses; a hidden tab pauses too. With the
operating system's *reduce motion* setting on, every effect is replaced by
static pages of the latest lines with their captions.
## Code activity (separate channel)

The Activity Monitor topbar shows one **Code activity** entry when
`dashboard.matrix.enabled` is set. It opens the [reader](dashboard.md#code-activity-reader)
at `?kiosk=1&view=reader` in a new tab. Code activity supersedes the Matrix
code view: rain, cascade, ghost, terminal and all `mx.*` presentation settings
are retired. Update saved Matrix display URLs to the reader URL.

The source remains default-off and limited to pushed published PR checkpoints
from positively identified Hive/clanker authors in explicitly allowlisted public
repositories. Complete admitted add/remove regions are shown with `Pushed PR`
provenance and observed time; opening backlog is labelled a buffered snapshot.
There is no workspace or pre-push capture. The internal `dashboard.matrix.*`
configuration and `/api/matrix/lines` names are deprecated but remain supported.
Existing read authorization, path exclusions and whole-region scrub/drop filters
still apply. Dashboard authentication alone does not authorize broadcasting.

[`overlays/hive-hosted-matrix/`](../deploy/stream/overlays/hive-hosted-matrix/kustomization.yaml)
reuses the streamer image and base as a separate instance. It renders Deployment,
ConfigMap and NetworkPolicy `matrix-hive-stream` in namespace `hive-stream-matrix`,
with separate pod selectors and secret references scoped to that namespace.
It opens `/?kiosk=1&view=matrix&sound=off` and sets `STREAM_AUDIO=silent`.
It opens `/?kiosk=1&view=reader&sound=off` and sets `STREAM_AUDIO=silent`.
Its independent process and deployment isolate restarts and failures from the
existing stream. The `hive-hosted` overlay and `twitch.tv/hivecommons` are
unaffected.
Expand All @@ -344,11 +324,11 @@ unaffected.
channel.** The overlay has `replicas: 0`; applying it starts no streamer.
Channel availability alone does not authorize activation. The owner must:

1. Confirm the deployed dashboard build serves the Matrix display for
`view=matrix` (#15936). A build without it broadcasts the ordinary kiosk
Activity Monitor on the Matrix channel, not code lines.
1. Confirm the deployed dashboard build serves Code activity for
`view=reader`. A build without it broadcasts the ordinary kiosk
Activity Monitor on the separate channel, not code changes.
2. Enable `dashboard.matrix` with an explicit, reviewed public repo allowlist
and verify the Matrix display and its author restriction and scrub/drop rules
and verify Code activity and its author restriction and scrub/drop rules
before any broadcast. An empty allowlist captures nothing.
3. Provision `hivecommonsmatrix` independently, create namespace
`hive-stream-matrix`, and create the out-of-band
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4939,8 +4939,8 @@ type DashboardConfig struct {
//
// Deprecated: set dashboard.experiment_lab instead.
StrategyLab bool `yaml:"strategy_lab,omitempty" json:"strategy_lab,omitempty"`
// Matrix is the experimental, default-off Activity Monitor Matrix block
// (#15862). Nothing reads it yet; see dashboard_matrix.go.
// Matrix is the default-off Code activity source configuration.
// The dashboard.matrix name is deprecated but retained for compatibility.
Matrix MatrixConfig `yaml:"matrix,omitempty" json:"matrix,omitempty"`
// SnapshotFrameAncestors is the explicit set of HTTPS origins allowed to
// embed the public, read-only /snapshot document. Empty keeps the historical
Expand Down
5 changes: 3 additions & 2 deletions src/pkg/config/dashboard_matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"strings"
)

// MatrixConfig is the experimental, default-off dashboard.matrix block
// MatrixConfig is the default-off Code activity source configuration
// (#15862). Repos is the single explicit public-repo allowlist gating every
// Matrix output; empty means nothing is captured. ExcludePaths adds globs to
// Code activity output; empty means nothing is captured. ExcludePaths adds globs to
// the built-in deny-list. There are deliberately no authors or private_repos
// keys.
// The dashboard.matrix names are deprecated but retained for configuration compatibility.
type MatrixConfig struct {
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
Repos []string `yaml:"repos,omitempty" json:"repos,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions src/pkg/dashboard/kiosk_cta.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ test('hiveKioskCTAOn: kiosk=1 only, cta=off opts out', () => {
new Function('window', m[0])(window);
const on = window.hiveKioskCTAOn;
assert.strictEqual(on('https://hive.example/?kiosk=1#section-activity-monitor-section'), true);
assert.strictEqual(on('https://hive.example/?kiosk=1&view=matrix&sound=off'), true);
assert.strictEqual(on('https://hive.example/?kiosk=1&view=reader&sound=off'), true);
assert.strictEqual(on('https://hive.example/?kiosk=1&cta=off'), false);
assert.strictEqual(on('https://hive.example/'), false);
assert.strictEqual(on('https://hive.example/?display=1'), false);
assert.strictEqual(on('https://hive.example/?popout=1'), false);
assert.strictEqual(on('not a url'), false);
});

test('badge wiring: placeholder outside the root, hidden without the body class, lifted and dimmed in matrix', () => {
test('badge wiring: placeholder outside the root, hidden without the body class, lifted and dimmed in Code activity', () => {
assert.ok(html.includes("if(window.hiveKioskCTAOn(window.location.href)) document.body.classList.add('kiosk-cta-on');"));
const root = html.indexOf('<!-- /#hive-dashboard-root -->');
const ph = html.indexOf('<!-- hive-kiosk-cta -->');
assert.ok(root > 0 && ph > root, 'placeholder must follow the dashboard root');
assert.ok(html.includes('#kiosk-cta { display: none; }'));
assert.ok(html.includes('body.kiosk-cta-on #kiosk-cta {'));
assert.ok(html.includes('body.matrix-mode #kiosk-cta { position: fixed; right: var(--sp-6); bottom: var(--sp-6); z-index: 100001; opacity: .85; }'));
assert.ok(html.includes('body.reader-mode #kiosk-cta { position: fixed; right: var(--sp-6); bottom: var(--sp-6); z-index: 100001; opacity: .85; }'));
});
18 changes: 12 additions & 6 deletions src/pkg/dashboard/matrix_header_tab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,31 @@ import (
"github.com/hivecommons/hive/pkg/config"
)

func TestDashboardMatrixHeaderTabHiddenByDefault(t *testing.T) {
func TestDashboardCodeActivityHeaderTabHiddenByDefault(t *testing.T) {
raw, err := staticFS.ReadFile("static/index.html")
if err != nil {
t.Fatalf("reading embedded static/index.html: %v", err)
}
html := string(raw)
start := strings.Index(html, `id="oc-matrix-tab"`)
start := strings.Index(html, `id="oc-reader-tab"`)
if start < 0 {
t.Fatal("static/index.html missing the Matrix header tab")
t.Fatal("static/index.html missing the Code activity header tab")
}
open := html[strings.LastIndex(html[:start], "<a "):]
open = open[:strings.Index(open, ">")]
for _, want := range []string{`href="?kiosk=1&amp;view=matrix"`, ` hidden`, `nav-chip`} {
for _, want := range []string{`href="?kiosk=1&amp;view=reader"`, `target="_blank"`, `rel="noopener"`, ` hidden`, `nav-chip`} {
if !strings.Contains(open, want) {
t.Fatalf("Matrix header tab %q missing %q", open, want)
t.Fatalf("Code activity header tab %q missing %q", open, want)
}
}
if !strings.Contains(html[start:], `>Code activity</span></a>`) {
t.Fatal("toolbar entry must be labelled Code activity")
}
if strings.Contains(html, `id="oc-matrix-tab"`) {
t.Fatal("legacy Matrix toolbar entry remains")
}
if !strings.Contains(html, "data.matrixEnabled") {
t.Fatal("static/index.html never toggles the Matrix tab from the status payload")
t.Fatal("static/index.html never toggles the Code activity tab from the status payload")
}
}

Expand Down
Loading
Loading