Skip to content
Merged
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-retire-campaigns-tab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Inception (spek): the **Campaigns** tab is removed from the Inception (spek) section, which now lists only sessions. Nothing has created inception campaigns since the wizard was removed, **Continue** had no wizard to return to, and the Spektacular rows repeated what the Runs view already shows. Start a session for new inception work and use Runs for Spektacular runs. The `/api/campaigns` endpoints, campaign Jam and campaign recheck still answer API callers for now and are retired in a follow-up change. Archived campaign files under `/data/inception/campaigns/` are not touched.
2 changes: 1 addition & 1 deletion src/docs/api-reference/health-status-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f
| `POST` | `/api/runs/{key}/checkpoint` | Owner only | Resolve a compact checkpoint decision. Body `{"action":"approve"|"reject","gen":<lease generation>}`; refuses stale generations with 409 and non-owner callers with 403 before mutating the plan. | `pkg/dashboard/api.go:96` |
| `GET` | `/api/runs/{key}` | Dashboard auth/session | One run by URL-escaped canonical run key (`owner/repo%23number`); early lease-shaped keys (`repo!run-key:stage`) and queued Wavefront run-stage keys (`owner/repo!graph:node`) are also accepted. Includes timeline-derived stage history in the same `Run` shape as `/api/runs` when a lease/timeline exists. History entries that came from an owner reset carry the owner's `reason`. When the key belongs to a wired convergence campaign, the detail response also includes an optional `burndown` block with `source`, `satisfied`, `remaining`, `unknown`, and `scope`; the list endpoint omits this block. | `pkg/dashboard/api.go:97` |
| `POST` | `/api/runs/{key}/reset` | Owner only | Move a run's lease back to an earlier stage (for example `implement` to `plan` after a rejected plan). Body `{"to": "<stage>", "reason": "<why>"}`, both required. Mints a new generation so the relay holding the old one can no longer resume, persists before answering, and records the reason on the agent audit sink, the lifecycle timeline, and the `stage_completed` hook payload (`attrs.reset = "true"`). Returns `{ok, key, stage_from, stage, gen, reason}`. 400 for the same or a later stage or a missing reason, 404 when no live staged lease holds the key, 409 when the lease expired, 500 when the registry could not be written. | `pkg/dashboard/api.go:98` |
| `GET` | `/api/campaigns` | Dashboard auth/session | List resumable campaigns from archived Inception sessions and retained Spektacular (Spek) runs. Query `search`/`q`, `repo`, `stage`, `status`, and `owner`; each campaign is keyed by stable spec/session id and includes title, source, repos, current stage/step, artifact links, linked issues/PRs, contributors, last activity, status, engine, type, run link when applicable, `superseded_by` when a newer Revise revision exists, and recheck status (`enabled`, `interval`, `last_at`, `next_at`, `in_flight`, `last_delta_count`, `external_count`, `sources_failed`). | `pkg/dashboard/api.go:99` |
| `GET` | `/api/campaigns` | Dashboard auth/session | List resumable campaigns from archived Inception sessions and retained Spektacular (Spek) runs. API only: the dashboard's Campaigns tab was retired in favour of Inception (spek) sessions, and this endpoint is being retired. Query `search`/`q`, `repo`, `stage`, `status`, and `owner`; each campaign is keyed by stable spec/session id and includes title, source, repos, current stage/step, artifact links, linked issues/PRs, contributors, last activity, status, engine, type, run link when applicable, `superseded_by` when a newer Revise revision exists, and recheck status (`enabled`, `interval`, `last_at`, `next_at`, `in_flight`, `last_delta_count`, `external_count`, `sources_failed`). | `pkg/dashboard/api.go:99` |
| `GET` | `/api/campaigns/{id}` | Dashboard auth/session | Return one campaign by URL-escaped stable campaign id or run key, using the same campaign shape as `/api/campaigns`; recheck revisions may include a `drift` block with `codebase_changed`, `prior_revision`, `delta_count`, `recheck_reason`, `external[]` (`source`, `kind`, `title`, `url`, `published_at`, `summary`), `external_count`, and `sources_failed`. | `pkg/dashboard/api.go:100` |
| `POST` | `/api/campaigns/{id}/resume` | Owner only | Resume or pick up a campaign. Archived Inception campaigns take a durable campaign lease, restore their saved state and wiki working files; Spek campaigns return the retained run detail plus a CLI status command that reloads state from Spek artifacts. Body may include `{ "surface": "chat"|"contributor"|"cli"|"dashboard" }`; 409 means another user holds the lease. | `pkg/dashboard/api.go:101` |
| `POST` | `/api/campaigns/{id}/release` | Owner only | Release the caller's Inception campaign lease and write a `campaign_release` audit entry so another user can continue it. Run-backed Spektacular campaigns return `409 Conflict`; this endpoint never revokes their run-lifecycle stage leases. | `pkg/dashboard/api.go:102` |
Expand Down
2 changes: 1 addition & 1 deletion src/docs/dashboard-sections/workflow-and-agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ There is no lab-wide progress bar. The whole-Hive snapshot count is a total, not

Named terminal sessions where a command-line AI agent runs inside Hive; everyone who can see a session watches it live, one person at a time holds the keyboard, and people with write access can join in.

**What it tells you.** A tab strip lists each session, grouped under headings you choose, with the CLI it runs and how many browsers are attached; a tab's tooltip names who holds the keyboard and who is watching, and the workspace (the hive's shared checkout of the project repo, with its spek skills) the session runs in. A **Campaigns** tab keeps the campaigns and Jam view that used to live in the removed Inception wizard. The selected tab shows a live terminal; its header reads `keyboard: andy · watching: bob, carol` and offers **Take keyboard** or **Release keyboard**; a viewer without the keyboard sees `watching`. Ended sessions show their last output and a **Resume** button.
**What it tells you.** A tab strip lists each session, grouped under headings you choose, with the CLI it runs and how many browsers are attached; a tab's tooltip names who holds the keyboard and who is watching, and the workspace (the hive's shared checkout of the project repo, with its spek skills) the session runs in. The tab strip holds sessions only: the **Campaigns** tab (the campaigns and Jam view carried over from the removed Inception wizard) was retired; start a session for new inception work and use [Runs](../runs.md) for Spektacular runs. The selected tab shows a live terminal; its header reads `keyboard: andy · watching: bob, carol` and offers **Take keyboard** or **Release keyboard**; a viewer without the keyboard sees `watching`. Ended sessions show their last output and a **Resume** button.

**How the numbers are worked out.** The attached count is the number of browsers currently attached to that terminal. Only the keyboard holder's terminal accepts typing (everyone else is attached read-only), so typing is attributed to the holder of record; the creator holds the keyboard first, owners and the creator can take it at any time, and another writer can take it once it is released or the holder has been idle for a minute. Text from the input bar under the terminal (Send, Send and run, Attach file) is **queued** and typed only when the CLI prompt is idle, so two people's sends never interleave; the button reads `Send · queued behind N`, the list under the bar shows whose turn it is with Cancel on your own items, and each delivery is attributed to whoever queued it in the audit log.

Expand Down
34 changes: 19 additions & 15 deletions src/docs/inception.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ see a session watches it live, one person at a time holds the keyboard, and
and the [Sessions API](api-reference/sessions.md).

The dashboard's old step-by-step Inception wizard was removed; Inception (spek)
replaces it. Its Campaigns and Jam view is the **Campaigns** tab of the
Inception (spek) section.
replaces it. The **Campaigns** tab that carried the wizard's campaigns and Jam
view over into Inception (spek) has been retired too: start a session for new
inception work, and find Spektacular runs in [Runs](runs.md). The
`/api/campaigns` endpoints, campaign Jam and campaign recheck are being retired
in follow-up changes.

The rest of this guide covers the ACMM **L1 ("Inception")** workflow behind
`/api/inception/*`, which is unchanged and still available to API callers. It
Expand Down Expand Up @@ -113,8 +116,9 @@ owner role for state-changing calls) drives them:
completion remains a no-op for run admission.
7. If anything goes wrong, `POST /api/inception/reset` first archives the
current state and wiki files as an Inception campaign, then clears the
active state and state file. The Campaigns tab lists that archived
session, so a reset does not discard completed work.
active state and state file under `inception/campaigns/<id>/`, so a reset
does not discard completed work. The dashboard no longer lists these
archives.

Optional wiki-management calls, usable at any point once an inception has
produced wiki files:
Expand Down Expand Up @@ -180,15 +184,19 @@ recorded as advisory beads, unrelated to any specific inception run.

## Campaigns and resume

The **Campaigns** tab of the Inception (spek) section lists campaigns. Each
row is a resumable unit of work keyed by its stable session/spec id:
The dashboard no longer shows campaigns: the **Campaigns** tab of the
Inception (spek) section was retired in favour of
[Inception (spek) sessions](dashboard-sections/workflow-and-agents.md#inception-spek).
Until the endpoints are retired, `GET /api/campaigns` still lists them for API
callers. Each entry is a unit of work keyed by its stable session/spec id:

- Archived L1 sessions have type `inception` and engine `Spec Kit`. Pressing
**Continue** calls `POST /api/campaigns/{id}/resume`, takes a durable
- Archived L1 sessions have type `inception` and engine `Spec Kit`.
`POST /api/campaigns/{id}/resume` takes a durable
campaign lease and restores the saved inception state and wiki working
files, so the API workflow above continues from the archived phase (the
dashboard has no wizard to reopen). A second operator gets
a 409 until the holder presses **Release** or the lease expires.
a 409 until the holder calls `POST /api/campaigns/{id}/release` or the lease
expires.
- Spektacular (Spek)-backed runs have type `spektacular`, engine `Spektacular`, and a
`/api/runs/{key}` link. Resume returns the retained run detail and a CLI
status command; Spek itself reloads state from its working files and
Expand All @@ -198,12 +206,8 @@ row is a resumable unit of work keyed by its stable session/spec id:
- **Revise** calls `POST /api/campaigns/{id}/revise` and creates a new
campaign linked with `revision_of`/`revision`, so changed requirements branch
from the shipped campaign instead of erasing its trail. The list marks the
older campaign with `superseded_by`, and the dashboard shows one row per
Revise chain — the newest revision, with a `rev N` pill and an
"N earlier revisions" disclosure that can still continue or delete each
older revision — instead of one identical row per click.
- **🗑 Delete** (icon button at the end of each row) calls
`DELETE /api/campaigns/{id}` after an in-app confirmation. It removes only
older campaign with `superseded_by`.
- `DELETE /api/campaigns/{id}` (owner only) removes only
the campaign record: the saved Inception state and the archived wiki
snapshot under `inception/campaigns/<id>/`. Knowledge-base facts, Jam
threads, scaffolded repo files and the other revisions in the chain are
Expand Down
27 changes: 16 additions & 11 deletions src/docs/spektacular.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ The runner is OFF by default. With `runs.spektacular.enabled` unset or `false`
Hive never starts a Spek process and every existing lease behaviour is
unchanged.

Every retained Spek run is also projected as a dashboard campaign under
`GET /api/campaigns`. The campaign id is the stable run/spec key (the same bare
Every retained Spek run is also projected as a campaign under
`GET /api/campaigns` (API only: the dashboard's Campaigns tab was retired in
favour of Inception (spek) sessions, and the run itself is listed in
[Runs](runs.md); the endpoint is being retired in a follow-up change). The campaign id is the stable run/spec key (the same bare
artifact name the status verbs use), the engine is `Spektacular`, and the row
links back to `/api/runs/{key}` when run detail is available. Picking up a
Spek campaign does not copy spek contents into Hive; `POST
Expand All @@ -21,10 +23,12 @@ spek backend.

## Jam Sessions

Each campaign also has a Jam workspace for team interaction around the spec.
The dashboard Campaigns list exposes a **Jam** action, backed by
`/api/campaigns/{id}/jam` and the `/threads`, `/suggestions`, and `/polls`
subroutes. Phase 1 is async: participants with read-write access can anchor
Each campaign also has a Jam workspace for team interaction around the spec,
backed by `/api/campaigns/{id}/jam` and the `/threads`, `/suggestions`, and
`/polls` subroutes. The dashboard no longer has a Jam view (it lived in the
retired Campaigns tab); use a shared
[Inception (spek) session](dashboard-sections/workflow-and-agents.md#inception-spek)
to work on a spec together. Phase 1 is async: participants with read-write access can anchor
threads and suggestions to spec sections, vote in advisory polls, and resume
the workspace after a restart. Maintainers record poll decisions with a
rationale; accepted suggestions and decisions create attributed spec revisions
Expand All @@ -36,11 +40,13 @@ Live spec edits carry the sender's last seen spec revision; stale edits are
rejected with a conflict message instead of overwriting newer work, so
reconnecting clients can refresh and merge intentionally.

Maintainers can opt a campaign into GitHub Projects sync from the Jam tab. The
Maintainers can opt a campaign into GitHub Projects sync through
`POST /api/campaigns/{id}/jam/project-sync`. The
sync publishes the current spec, recorded decisions, and derived suggestion
items to the linked project; inbound project status updates are recorded on the
campaign without rewriting local Jam decisions. Sync failures are kept with
retry guidance so the dashboard shows what to fix before trying again.
retry guidance in the `project-sync` response so a caller can see what to fix
before trying again.

Sync posts to `https://api.github.com/graphql` with the hive's `GITHUB_TOKEN`.
`HIVE_JAM_PROJECT_SYNC_URL` overrides the endpoint; an override must use
Expand Down Expand Up @@ -508,9 +514,8 @@ invoke `upstreamwatch`'s multi-page PR and release scanner.
Campaign list/detail JSON includes
`recheck: {enabled, interval, last_at, next_at, in_flight, last_delta_count,
external_count, sources_failed}`; recheck revisions also include the `drift`
block above. The dashboard Campaigns panel renders the cadence, shows
`N external signals` with an expandable list, and provides an owner-only
Recheck action.
block above. The dashboard no longer renders campaigns (the Campaigns tab was
retired), so read the cadence and signals from the JSON.

## Defensive handling of the open questions

Expand Down
32 changes: 0 additions & 32 deletions src/pkg/dashboard/api_campaigns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,35 +472,3 @@ func TestCampaignDeleteRejectsRunBackedSpektacular(t *testing.T) {
t.Fatalf("run-backed delete = %d body=%s, want 409", del.Code, del.Body.String())
}
}

// TestCampaignDeleteUI pins the dashboard side of hivecommons/hive#12698: an
// icon-only 🗑 button in the nous-exp-icon style with aria-label/title
// "Delete campaign", an in-app hiveConfirm (never window.confirm) that spells
// out what is removed and what is kept, and Revise chains folded to one row.
func TestCampaignDeleteUI(t *testing.T) {
html := indexHTML(t)
for _, want := range []string{
`nousExpIconButton('deleteCampaign', escapeHtml(c.id), '', 'Delete campaign', '🗑', 'nous-exp-icon-delete campaign-delete')`,
"async function deleteCampaign(id) {",
"const CAMPAIGN_DELETE_CONFIRM_TITLE = 'Delete this campaign?';",
"await hiveConfirm({ title: CAMPAIGN_DELETE_CONFIRM_TITLE, message: campaignDeleteConfirmMessage(c), confirmLabel: 'Delete campaign', cancelLabel: 'Keep', danger: true });",
"Kept: knowledge-base facts, Jam threads, and anything already scaffolded or pushed to the repo.",
"fetch('/api/campaigns/' + encodeURIComponent(id), { method: 'DELETE', headers: _inceptionAuthHeaders() })",
"function campaignRevisionChains(campaigns) {",
`<details class="campaign-row-meta campaign-history"><summary>${hist.length} earlier ${hist.length === 1 ? 'revision' : 'revisions'}</summary>`,
`class="campaign-pill campaign-revision-pill"`,
".nous-exp-icon-delete:hover, .nous-exp-icon-delete:focus-visible { color: var(--red); }",
} {
if !strings.Contains(html, want) {
t.Errorf("index.html missing %q", want)
}
}
start := strings.Index(html, "async function deleteCampaign(id) {")
end := strings.Index(html[start:], "let _campaignJamSocket = null;")
if start < 0 || end < 0 {
t.Fatalf("could not isolate deleteCampaign block")
}
if body := html[start : start+end]; strings.Contains(body, "window.confirm(") || strings.Contains(body, " confirm(") || strings.Contains(body, "alert(") {
t.Fatalf("deleteCampaign must use the in-app dialog, not native confirm/alert")
}
}
6 changes: 0 additions & 6 deletions src/pkg/dashboard/dashboard_history_cap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,4 @@ func TestDashboardLiveConnectionsCloseBeforeReconnect(t *testing.T) {
t.Fatalf("connect() missing %q", want)
}
}
jam := jsFunctionBody(t, html, "function connectCampaignJamLive(id)")
for _, want := range []string{"prev.onclose = null", "prev.close()"} {
if !strings.Contains(jam, want) {
t.Fatalf("connectCampaignJamLive missing %q", want)
}
}
}
17 changes: 9 additions & 8 deletions src/pkg/dashboard/sessions_ui.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,24 @@ test('sessions are grouped alphabetically with the ungrouped bucket last', () =>
assert.deepStrictEqual(h.sessionsGroupSessions(undefined), []);
});

test('selected tab falls back to the first session, then to Campaigns', () => {
test('selected tab falls back to the first session, then to none', () => {
const list = [S('a', ''), S('b', '')];
assert.strictEqual(h.sessionsPickSelected(list, 'b'), 'b');
assert.strictEqual(h.sessionsPickSelected(list, 'gone'), 'a');
assert.strictEqual(h.sessionsPickSelected(list, 'campaigns'), 'campaigns');
assert.strictEqual(h.sessionsPickSelected([], 'gone'), 'campaigns');
assert.strictEqual(h.sessionsPickSelected(null, ''), 'campaigns');
// The retired Campaigns tab id, still remembered in some browsers, falls through.
assert.strictEqual(h.sessionsPickSelected(list, 'campaigns'), 'a');
assert.strictEqual(h.sessionsPickSelected([], 'gone'), '');
assert.strictEqual(h.sessionsPickSelected(null, ''), '');
});

test('arrow keys walk the visible tabs and wrap; collapsed groups keep only the selected tab', () => {
const list = [S('a', 'g1'), S('b', 'g1'), S('c', 'g2')];
const order = h.sessionsTabOrder(list, { g1: true }, 'b');
assert.deepStrictEqual(order, ['b', 'c', 'campaigns']);
assert.strictEqual(h.sessionsNextTab(order, 'campaigns', 'ArrowRight'), 'b');
assert.strictEqual(h.sessionsNextTab(order, 'b', 'ArrowLeft'), 'campaigns');
assert.deepStrictEqual(order, ['b', 'c']);
assert.strictEqual(h.sessionsNextTab(order, 'c', 'ArrowRight'), 'b');
assert.strictEqual(h.sessionsNextTab(order, 'b', 'ArrowLeft'), 'c');
assert.strictEqual(h.sessionsNextTab(order, 'c', 'Home'), 'b');
assert.strictEqual(h.sessionsNextTab(order, 'b', 'End'), 'campaigns');
assert.strictEqual(h.sessionsNextTab(order, 'b', 'End'), 'c');
assert.strictEqual(h.sessionsNextTab(order, 'b', 'x'), '');
assert.strictEqual(h.sessionsNextTab([], 'b', 'ArrowRight'), '');
});
Expand Down
Loading
Loading