diff --git a/AUDIT_OPEN.md b/AUDIT_OPEN.md index 8aee967..5171aad 100644 --- a/AUDIT_OPEN.md +++ b/AUDIT_OPEN.md @@ -633,6 +633,32 @@ detail is in the programme's wave-2 status table. Items that matter for audit: outlives its timeout is cancelled") failed once in a loaded full-suite run and passed alone and on retry. Timing sensitivity; a robustness fix is owed. +## 2026-11-03 — undici, vite and zod advisories (CI audit red) + +CI `audit` failed on new advisories. **undici** (direct, root tree: four high, +four moderate, `>=8.0.0 <8.12.2`) moves to `^8.12.3`, and the deployed pin in +`deploy/package.ship.json` to 8.12.3. **vite** (web devDependency, one high +plus moderate/low, `<=6.4.3`) moves to `^6.4.4`, resolving 6.4.5, and the +deployed SSR pin in `deploy/package.web.json` to 6.4.5. Both lockfile pairs were +regenerated with pnpm and npm, not by hand. + +**zod GHSA-mrhx-c7xc-m3w5 (high), EXCEPTED, not fixed.** zod 3.25.76 is reached +only through `@neutron-build/core` 0.3.2's content-collection module. Ship +defines no collections and validates no request input with zod, so the memory +exhaustion path is unreachable. The fix is zod 4.6.6+, which core 0.3.2 cannot +load: its `dist/index.js` re-exports `content/index.js`, which imports zod 3 +names (`ZodEffects`, ...) that zod 4 removed, so an override would break boot. +The exception lives in `deploy/audit-exceptions.json` (reason + removal +condition) and in `web/package.json` `pnpm.auditConfig.ignoreGhsas`; +`scripts/audit-deployment.mjs` now parses `npm audit --json`, fails on any +other high/critical advisory, and fails if the two lists disagree (negative +control run: emptying both lists makes the deployment audit fail on zod). +**Remove the exception when Ship moves to `@neutron-build/core` 0.5.x**, which +depends on zod ^4.6.7. + +Not addressed (moderate, below the CI gate): `@hono/node-server` +GHSA-rmxm-3fg6-px4f (`>=1.19.10 <2.1.3`, fix is a major bump). + ## 2026-10-03 — devalue advisories (web dependency, re-triage) CI `audit` began failing on three new high-severity `devalue` advisories diff --git a/CHANGELOG.md b/CHANGELOG.md index 908a2eb..7ebf544 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,164 @@ All notable changes to Teploy Ship are recorded here. +## [0.4.0] - 2026-11-03 + +Upgrade notes: read `docs/UPGRADING.md` before deploying. The image now +compiles `dist/` and `web/dist/` itself, so there is nothing to build on the +host first. Many feature flags changed default (see Changed); set the flag to +`0`, `false`, `no` or `off` to keep the old behaviour. The regenerated flag +reference is `docs/FLAGS.md`, with the rationale in +`docs/FLAG_AUDIT_2026-10-18.md`. + +### Added +- **Generic ACP harness.** One adapter drives any agent that speaks the Agent + Client Protocol, through an in-sandbox driver (`ship-acp`) with a + fail-closed permission policy: reads and writes only inside the workspace, + `allow_always` is never granted. Profiles cover gemini, grok, + cursor-agent and qwen. It stays opt-in behind `SHIP_ACP_HARNESS`; the + agent images are an opt-in bake. +- **More external harnesses and per-harness models.** A codex adapter + (`codex exec --json`) and an OpenCode v2 adapter were added, with + session-resume steering for opencode and claude-code. `SHIP_HARNESS_MODEL_` + overrides the model per harness, and `SHIP_HARNESS_BROWSER` gives every + external harness a browser. +- **Sealed harness credentials.** Behind `SHIP_HARNESS_CRED=on`, credentials + for external harnesses are stored sealed per project and profile (needs + `SHIP_CONFIG_KEY`; storing is refused while sealing is off), and are + delivered through the exec environment, never argv or workspace files. Run + enqueue now refuses an external harness whose provider host the model + routing policy does not allow for the data class. +- **Delegation and delegate targets.** The coordinator gains a `delegate` + action that runs bounded child runs and feeds their results back as context. + Children are read-only, open a single parent PR, cap cost at the lesser of + the per-run cap and the parent's remaining budget, can use a per-child + model with a data-class gate, and relay needs-input to the parent. +- **Stacked pull requests and run forks.** `SHIP_STACKED_PRS` supports stacked + PRs with `--onto` rebase after the base merge, with the stack lineage shown + on the run page and over HTTP. `SHIP_FORK` forks a run to a new branch from + the recorded push with its own PR. +- **Browser perception: the `look` action.** A text-first browser action + (`SHIP_LOOK`) with an optional image mode, a baked `ship-browser` helper, + per-run resource classes so a look run is admitted at its real footprint, and + screencast recordings (`SHIP_LOOK_RECORD`) that withhold secrets seen on + screen. Recordings are linked to the run and revision, not attached. +- **Skills registry.** Version-pinned enablement with native progressive + loading behind `SHIP_SKILLS`, and an import form in the dashboard. +- **MCP client, steering and live view.** The native loop can call MCP servers + (`SHIP_MCP`), accept two-way steering replies (`SHIP_STEER_REPLY`), and show + a read-only terminal stream and running diff on the run page + (`SHIP_LIVE_VIEW`). Run pages also show the follow-up thread with steer and + ask history (`SHIP_THREAD_VIEW`). +- **Event rules and signed intake.** A rule engine with generic signed intake + sits in front of `intake.propose`, with vendor webhook adapters. The + built-in intake sources also run as default rules in shadow mode + (`SHIP_EVENT_RULES=shadow`); the built-in path always wins and `doctor` gains + an `event-rules-shadow` check that fails on any divergence. +- **PR watch.** Ship watches its own PRs for conflicts and failing checks with + bounded polling (`SHIP_PR_WATCH`). Discovery is bounded by PR age and the + first enable does not adopt history. +- **Reproducing-test gate and incident evidence.** Authorised incident + remediation can require a reproducing test, and incident evidence now feeds + diagnosis, with deploy correlation offered as a hypothesis only. +- **Warm follow-ups.** Follow-up runs on a PR thread boot from a snapshot of + the previous run's workspace (`SHIP_WARM_THREAD`, which needs + `SHIP_WARM_PARKS`), and merge-parked runs reuse the park's own image. + Expired or mismatched snapshots fall back to a cold run. Snapshot images are + swept once their run is terminal. +- **Initial admin bootstrap.** Set `SHIP_BOOTSTRAP_ADMIN_USER` and + `SHIP_BOOTSTRAP_ADMIN_PASSWORD` (as teploy secrets) and the web process + creates the first admin at boot, once, never overwriting an existing local + account. Previously a fresh deployment could only log in with the + break-glass `SHIP_WEB_TOKEN`. +- **Sandbox user setting.** `teploy-ship project set --sandbox-user + root|default` (or `sandbox_user` on Akiroo's project row) opts a project + into running its sandbox as root. +- **Mobile dashboard and run cards.** The nav collapses behind a Menu button + below desktop, controls are touch-sized, form tables stack, and run cards + show each run's repository. +- **Generated flag reference.** `docs/FLAGS.md` is generated from the source + with a CI drift check, and the claim ledger check now runs in CI. + +### Changed +- **Dashboard navigation regrouped from eight tabs to five.** The tabs are now + Inbox, Runs, Projects, Fleet and Settings. +- **The Attention queue is now the Inbox's "Needs you" section.** `/attention` + redirects to it. +- **Incidents and Coordinated changes moved under Runs.** They sit beside All + runs and PR reviews, and their URLs are unchanged. +- **Setup and Workflows are tabs under Projects.** Launch recovery is a tab + under Fleet. +- **Settings opens on Team & access.** The Overview tab is gone, and + `?view=overview` still works and lands there. Approval rules and Skills now + share the Settings header. +- **First-run Inbox.** With no projects, the Inbox shows a single "Connect your + first repository" step instead of a disabled task form. +- **Run page decision controls.** On a run waiting for a decision, Approve and + Deny sit directly under the status banner. Cancel run is set apart and no + longer styled like Deny. "Not recorded" task-state detail and the Fork and + Stack forms are collapsed by default. +- **Copy and consistency fixes.** Runs table headers and the search + placeholder were cleaned up, the debug "store:" text was removed from PR + reviews, and "Policies" links are renamed "Approval rules". +- **Browser sessions slide.** A dashboard login now stays valid for 30 days of + inactivity and renews on use. Renewal re-checks every revocation rule + (signature, expiry, the master-credential pin, the SSO window, and that a + password account still exists with its current role). +- **Flag defaults flipped on.** Twenty-one proven flags are now on when unset, + including `SHIP_THREAD_VIEW`, `SHIP_LIVE_VIEW`, `SHIP_PR_WATCH`, + `SHIP_STEER_REPLY`, `SHIP_LOOK`, `SHIP_SKILLS`, `SHIP_DELEGATE`, + `SHIP_WARM_THREAD`, `SHIP_FORK` and `SHIP_STACKED_PRS`. `0`, `false`, `no` + and `off` all disable. `SHIP_ACP_HARNESS` stays opt-in. +- **Git credentials default to env delivery.** Tokens no longer appear in argv, + git config, remote URLs or sandbox files. `SHIP_GIT_CREDENTIAL=argv` opts + back out. +- **Sandboxes run as a non-root user by default.** The go, node and rust + images define a `ship` user (uid 1000); use the per-project root opt-in + where a toolchain needs root. Images also gain poppler-utils and ffmpeg + (node) and Go 1.27. +- **Provider rate limits park and retry instead of failing the run.** Runs + sleep with bounded exponential backoff (60s up to 10m steps, 60m total, + `SHIP_RATE_LIMIT_MAX_WAIT_MIN`) and fail only past the ceiling. A provider + `Retry-After` is honoured. This was the cause of 34 of 100 SWE-bench Verified + instances erroring in the 2026-10-19 run. +- **Image builds compile in the image.** `dist/` and `web/dist/` are built from + the checkout inside the Docker build, so the host build is never shipped and + `scripts/check-image-sources.mjs` guards against regression. Four earlier + deploys had shipped stale build output. +- **Akiroo integration.** Project rows carry the environment, evidence targets + must be repos, project slugs match repo URLs case-insensitively, and the + address is now `app.akiroo.com`. +- **Deployment store.** The `ship-nucleus` accessory was retired after the + PostgreSQL move; a pre-migration tarball is the rollback path (see + `docs/MIGRATE_STORE.md`). + +### Fixed +- **Credential-scan hardening (H2).** The scan now judges what actually ships: + trusted push base, home-directory leak sites, needle sweep including offset + base64, needle cleanup on every exit, and scan failures held rather than + refused. +- **ACP and harness secret handling.** The ACP agent runs under a per-exec home + that is deleted afterwards, path-like fields are gated by the workspace check, + streamed text is redacted before truncation, and the agent process tree is + always killed on `maxSteps` or exit. +- **undici and vite advisories.** undici moves to 8.12.3 (four high-severity + advisories) and the web build's vite to 6.4.5. A zod advisory reachable only + through Neutron core's unused content collections is recorded as an audit + exception until Ship moves to Neutron core 0.5 (`AUDIT_OPEN.md`). +- **Dependency advisories.** `source-map-js` (GHSA-68fv-2mgg-jv7q, high) and + `hono` (GHSA-hxh3-vqpv-xpqv) are overridden to patched versions, which turns + the CI audit gate green again. +- **Sandbox leaks and placement.** Workspaces are released on every run exit, + unowned containers are reaped, a sandbox pool placement race is fixed, and + launches are no longer held on the worker host's load when every sandbox is + remote. +- **Backups and store probes.** `ship-backup.sh` supports the PostgreSQL store, + and `doctor` store probes work against it. Shadow write failures are now loud + and counted, with data-dir probes. +- **Intake and follow-up correctness.** Linear replay is closed, intake dedupes + by body hash, an unresolved project identity is logged once per task, and + follow-ups carry a structured digest of the prior run. + ## [0.3.0] - 2026-10-15 ### Added diff --git a/deploy/audit-exceptions.json b/deploy/audit-exceptions.json new file mode 100644 index 0000000..544e41f --- /dev/null +++ b/deploy/audit-exceptions.json @@ -0,0 +1,9 @@ +[ + { + "ghsa": "GHSA-mrhx-c7xc-m3w5", + "package": "zod", + "reason": "zod 3.25.76 is reached only through @neutron-build/core 0.3.2's content-collection module, which Ship never uses: no collections are defined and no request input is validated with zod. The patched release is zod 4.6.6+, a major version core 0.3.2 cannot load (it imports zod 3 exports such as ZodEffects).", + "dropWhen": "Ship moves to @neutron-build/core 0.5.x, which depends on zod ^4.6.7.", + "recorded": "2026-11-03" + } +] diff --git a/deploy/package-lock.ship.json b/deploy/package-lock.ship.json index ddeed7b..727a38b 100644 --- a/deploy/package-lock.ship.json +++ b/deploy/package-lock.ship.json @@ -14,7 +14,7 @@ "pg": "8.22.0", "pixelmatch": "7.2.0", "pngjs": "7.0.0", - "undici": "8.10.2" + "undici": "8.12.3" }, "bin": { "teploy-ship": "dist/cli.js" @@ -231,9 +231,9 @@ } }, "node_modules/undici": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-8.10.2.tgz", - "integrity": "sha512-/y4/bH9YNU5hi9NIrpOuvGXFcxrj3CMrV+/AYpowAYTpHn8gX/XPFjNy766FPoYY0miQhdW977JFWKGNhBdwyQ==", + "version": "8.12.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-8.12.3.tgz", + "integrity": "sha512-+fdndUTwBP86cVjihTp21hZHo7d6oj1c/47XPA3lL8mM0XHs+C4EkcjmgRsFnFk2f/UONGDy9ItBItmXsLOQHw==", "license": "MIT", "engines": { "node": ">=22.19.0" diff --git a/deploy/package-lock.web.json b/deploy/package-lock.web.json index 7fbff86..c5244ab 100644 --- a/deploy/package-lock.web.json +++ b/deploy/package-lock.web.json @@ -14,7 +14,7 @@ "openid-client": "6.8.4", "preact": "10.25.4", "teploy-ship": "file:..", - "vite": "6.4.3" + "vite": "6.4.5" } }, "..": { @@ -4943,9 +4943,9 @@ } }, "node_modules/vite": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", - "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", + "version": "6.4.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.5.tgz", + "integrity": "sha512-4enwjFfi4IwtEh0w+jPzpLVOFQiPHmmzPxcHXQOyEur47o6u0jE573DmGpjA+7irXoMLYRZD5ZaFUEneS3abPg==", "license": "MIT", "dependencies": { "esbuild": "^0.25.0", diff --git a/deploy/package.ship.json b/deploy/package.ship.json index 0f9b946..6aa3221 100644 --- a/deploy/package.ship.json +++ b/deploy/package.ship.json @@ -13,7 +13,7 @@ "pg": "8.22.0", "pixelmatch": "7.2.0", "pngjs": "7.0.0", - "undici": "8.10.2" + "undici": "8.12.3" }, "exports": { ".": { diff --git a/deploy/package.web.json b/deploy/package.web.json index ae0b3d7..8f72bc4 100644 --- a/deploy/package.web.json +++ b/deploy/package.web.json @@ -10,7 +10,7 @@ "openid-client": "6.8.4", "preact": "10.25.4", "teploy-ship": "file:..", - "vite": "6.4.3" + "vite": "6.4.5" }, "overrides": { "nanoid@<4": ">=3.3.18", diff --git a/docs/RETENTION.md b/docs/RETENTION.md index 979b066..df83373 100644 --- a/docs/RETENTION.md +++ b/docs/RETENTION.md @@ -32,7 +32,7 @@ runs and events stay in the store. |---|---|---|---| | Incident index | 200 records | The `/incidents` list. Older incident records stay in the store but leave the list. | `src/incidents.ts:81` (`INCIDENTS_LIMIT`) | | Schedule digest history | 10 entries shown, 20 stored | Digest entries per schedule (one per settled occurrence). Oldest stored entries are dropped when the store cap is exceeded — these are derived records, not run logs. | `src/workflow-schedules.ts:128` (`DIGEST_LIMIT`), `:131` (`DIGEST_STORE_LIMIT`) | -| Attention queue | 50 rows | The `/attention` page (one row per item needing a human). The page says when it truncated; the underlying decisions live on their own pages. | `web/src/lib/attention.server.ts:52` (`ATTENTION_CAP`) | +| Attention queue | 50 rows | The Inbox "Needs you" section (one row per item needing a human; `/attention` redirects there). The page says when it truncated; the underlying decisions live on their own pages. | `web/src/lib/attention.server.ts:52` (`ATTENTION_CAP`) | | Fleet registry prune | workers unseen for 24 h | Worker rows in the fleet registry. A worker that stopped heartbeating is retired from the registry after a day — the registry is live state, not history, and would otherwise grow forever on a replaced-container fleet. | `src/worker.ts:1786` (`retentionMs = 24 * 60 * 60 * 1000`) | ## Supported history scale diff --git a/package.json b/package.json index a79bdff..7c56658 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "pg": "^8.16.0", "pixelmatch": "^7.2.0", "pngjs": "^7.0.0", - "undici": "^8.10.2" + "undici": "^8.12.3" }, "devDependencies": { "@types/node": "^22.10.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a5e98c7..9be6a4c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,8 +32,8 @@ importers: specifier: ^7.0.0 version: 7.0.0 undici: - specifier: ^8.10.2 - version: 8.10.2 + specifier: ^8.12.3 + version: 8.12.3 devDependencies: '@types/node': specifier: ^22.10.7 @@ -429,8 +429,8 @@ packages: undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - undici@8.10.2: - resolution: {integrity: sha512-/y4/bH9YNU5hi9NIrpOuvGXFcxrj3CMrV+/AYpowAYTpHn8gX/XPFjNy766FPoYY0miQhdW977JFWKGNhBdwyQ==} + undici@8.12.3: + resolution: {integrity: sha512-+fdndUTwBP86cVjihTp21hZHo7d6oj1c/47XPA3lL8mM0XHs+C4EkcjmgRsFnFk2f/UONGDy9ItBItmXsLOQHw==} engines: {node: '>=22.19.0'} util-deprecate@1.0.2: @@ -838,7 +838,7 @@ snapshots: undici-types@6.21.0: {} - undici@8.10.2: {} + undici@8.12.3: {} util-deprecate@1.0.2: {} diff --git a/scripts/audit-deployment.mjs b/scripts/audit-deployment.mjs index 87cd6b1..68df946 100644 --- a/scripts/audit-deployment.mjs +++ b/scripts/audit-deployment.mjs @@ -1,11 +1,22 @@ #!/usr/bin/env node -/** Audit exactly the lockfiles Docker installs, including its SSR toolchain. */ -import { copyFileSync, mkdtempSync, mkdirSync, rmSync } from 'node:fs'; +/** Audit exactly the lockfiles Docker installs, including its SSR toolchain. + * Advisories listed in deploy/audit-exceptions.json (each with its reason and + * the condition that removes it) are reported but do not fail the audit; the + * web tree's pnpm auditConfig.ignoreGhsas must list exactly the same ids. */ +import { copyFileSync, mkdtempSync, mkdirSync, readFileSync, rmSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; import { spawnSync } from 'node:child_process'; const source = join(dirname(fileURLToPath(import.meta.url)), '..', 'deploy'); +const exceptions = JSON.parse(readFileSync(join(source, 'audit-exceptions.json'), 'utf8')); +const excepted = new Set(exceptions.map((e) => e.ghsa)); +const webIgnores = JSON.parse(readFileSync(join(source, '..', 'web', 'package.json'), 'utf8')).pnpm?.auditConfig?.ignoreGhsas ?? []; +if ([...excepted].sort().join() !== [...webIgnores].sort().join()) { + console.error('deploy/audit-exceptions.json and web/package.json pnpm.auditConfig.ignoreGhsas disagree'); + process.exitCode = 1; +} +const SEVERE = new Set(['high', 'critical']); const stage = mkdtempSync(join(tmpdir(), 'ship-deployment-audit-')); try { mkdirSync(join(stage, 'web')); @@ -13,9 +24,20 @@ try { copyFileSync(join(source, `package.${name}.json`), join(cwd, 'package.json')); copyFileSync(join(source, `package-lock.${name}.json`), join(cwd, 'package-lock.json')); console.log(`Auditing deployed ${name} dependency tree`); - const result = spawnSync('npm', ['audit', '--audit-level=high'], { cwd, stdio: 'inherit', timeout: 120000 }); + const result = spawnSync('npm', ['audit', '--json'], { cwd, encoding: 'utf8', timeout: 120000, maxBuffer: 64 * 1024 * 1024 }); if (result.error) throw result.error; - if (result.status !== 0) process.exitCode = 1; + let report; + try { report = JSON.parse(result.stdout); } catch { console.error(result.stdout, result.stderr); process.exitCode = 1; continue; } + if (report.error) { console.error(report.error); process.exitCode = 1; continue; } + for (const vuln of Object.values(report.vulnerabilities ?? {})) { + for (const via of vuln.via) { + if (typeof via !== 'object' || !SEVERE.has(via.severity)) continue; + const ghsa = String(via.url ?? '').split('/').pop(); + if (excepted.has(ghsa)) { console.log(` excepted ${via.severity} ${via.name} ${ghsa} (deploy/audit-exceptions.json)`); continue; } + console.error(` ${via.severity} ${via.name} ${ghsa}: ${via.title}`); + process.exitCode = 1; + } + } } } finally { rmSync(stage, { recursive: true, force: true }); diff --git a/web/package.json b/web/package.json index 36ad9e9..fa80383 100644 --- a/web/package.json +++ b/web/package.json @@ -20,9 +20,12 @@ "@preact/preset-vite": "^2.9.4", "tsx": "^4.23.1", "typescript": "^5.7.2", - "vite": "^6.0.7" + "vite": "^6.4.4" }, "pnpm": { + "auditConfig": { + "ignoreGhsas": ["GHSA-mrhx-c7xc-m3w5"] + }, "overrides": { "nanoid@<4": ">=3.3.18", "postcss": ">=8.5.23", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 235d592..035050d 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -39,7 +39,7 @@ importers: devDependencies: '@preact/preset-vite': specifier: ^2.9.4 - version: 2.10.5(@babel/core@7.29.7)(preact@10.25.4)(rollup@4.62.2)(vite@6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)) + version: 2.10.5(@babel/core@7.29.7)(preact@10.25.4)(rollup@4.62.2)(vite@6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)) tsx: specifier: ^4.23.1 version: 4.23.1 @@ -47,8 +47,8 @@ importers: specifier: ^5.7.2 version: 5.9.3 vite: - specifier: ^6.0.7 - version: 6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) + specifier: ^6.4.4 + version: 6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) packages: @@ -1467,8 +1467,8 @@ packages: peerDependencies: vite: 5.x || 6.x || 7.x || 8.x - vite@6.4.3: - resolution: {integrity: sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==} + vite@6.4.5: + resolution: {integrity: sha512-4enwjFfi4IwtEh0w+jPzpLVOFQiPHmmzPxcHXQOyEur47o6u0jE573DmGpjA+7irXoMLYRZD5ZaFUEneS3abPg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: @@ -1973,19 +1973,19 @@ snapshots: '@oxc-project/types@0.153.0': {} - '@preact/preset-vite@2.10.5(@babel/core@7.29.7)(preact@10.25.4)(rollup@4.62.2)(vite@6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0))': + '@preact/preset-vite@2.10.5(@babel/core@7.29.7)(preact@10.25.4)(rollup@4.62.2)(vite@6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0))': dependencies: '@babel/core': 7.29.7 '@babel/plugin-transform-react-jsx': 7.29.7(@babel/core@7.29.7) '@babel/plugin-transform-react-jsx-development': 7.29.7(@babel/core@7.29.7) - '@prefresh/vite': 2.4.12(preact@10.25.4)(vite@6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)) + '@prefresh/vite': 2.4.12(preact@10.25.4)(vite@6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)) '@rollup/pluginutils': 5.4.0(rollup@4.62.2) babel-plugin-transform-hook-names: 1.0.2(@babel/core@7.29.7) debug: 4.4.3 magic-string: 0.30.21 picocolors: 1.1.1 - vite: 6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) - vite-prerender-plugin: 0.5.13(vite@6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)) + vite: 6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) + vite-prerender-plugin: 0.5.13(vite@6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)) zimmerframe: 1.1.4 transitivePeerDependencies: - preact @@ -2002,7 +2002,7 @@ snapshots: '@prefresh/utils@1.2.1': {} - '@prefresh/vite@2.4.12(preact@10.25.4)(vite@6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0))': + '@prefresh/vite@2.4.12(preact@10.25.4)(vite@6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0))': dependencies: '@babel/core': 7.29.7 '@prefresh/babel-plugin': 0.5.3 @@ -2010,7 +2010,7 @@ snapshots: '@prefresh/utils': 1.2.1 '@rollup/pluginutils': 4.2.1 preact: 10.25.4 - vite: 6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) + vite: 6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) transitivePeerDependencies: - supports-color @@ -2406,6 +2406,10 @@ snapshots: optionalDependencies: picomatch: 4.0.5 + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + fsevents@2.3.3: optional: true @@ -3144,7 +3148,7 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite-prerender-plugin@0.5.13(vite@6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)): + vite-prerender-plugin@0.5.13(vite@6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0)): dependencies: kolorist: 1.8.0 magic-string: 0.30.21 @@ -3152,13 +3156,13 @@ snapshots: simple-code-frame: 1.3.0 source-map: 0.7.6 stack-trace: 1.0.0 - vite: 6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) + vite: 6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0) - vite@6.4.3(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0): + vite@6.4.5(@types/node@26.6.4)(lightningcss@1.33.0)(tsx@4.23.1)(yaml@2.9.0): dependencies: esbuild: 0.25.12 - fdir: 6.5.0(picomatch@4.0.5) - picomatch: 4.0.5 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 postcss: 8.5.26 rollup: 4.62.2 tinyglobby: 0.2.17 diff --git a/web/src/lib/attention-row.ts b/web/src/lib/attention-row.ts new file mode 100644 index 0000000..d306fa0 --- /dev/null +++ b/web/src/lib/attention-row.ts @@ -0,0 +1,23 @@ +// Client-safe: the attention row shape, shared by the loader and the Inbox view. + +/** The kinds of attention, in the order the page shows them. */ +export type AttentionKind = "decision" | "failure" | "delivery" | "schedule" | "takeover" | "aging"; + +export interface AttentionRow { + id: string; + kind: AttentionKind; + /** What the thing is, in the operator's terms (task, schedule, repo). */ + title: string; + /** The outcome or blocker, one line. */ + detail: string; + /** The human's move. */ + nextAction: string; + /** Where to make it. */ + href: string; + /** Repository the row's run works on (owner/name slug), when meta has one. */ + repo?: string; + /** When the blocking state landed / began, for the age column. */ + at?: string; + /** Waiting longer than 72h — age is now itself the blocker. */ + aging?: boolean; +} diff --git a/web/src/lib/attention.server.ts b/web/src/lib/attention.server.ts index 676c312..ae177c6 100644 --- a/web/src/lib/attention.server.ts +++ b/web/src/lib/attention.server.ts @@ -28,27 +28,8 @@ import { MERGE_EVENT } from "teploy-ship/plan"; import { UPGRADE_HOLD_EVENT } from "teploy-ship/fence"; import type { RunMeta, IntakeTask } from "teploy-ship/runtime"; -/** The kinds of attention, in the order the page shows them. */ -export type AttentionKind = "decision" | "failure" | "delivery" | "schedule" | "takeover" | "aging"; - -export interface AttentionRow { - id: string; - kind: AttentionKind; - /** What the thing is, in the operator's terms (task, schedule, repo). */ - title: string; - /** The outcome or blocker, one line. */ - detail: string; - /** The human's move. */ - nextAction: string; - /** Where to make it. */ - href: string; - /** Repository the row's run works on (owner/name slug), when meta has one. */ - repo?: string; - /** When the blocking state landed / began, for the age column. */ - at?: string; - /** Waiting longer than 72h — age is now itself the blocker. */ - aging?: boolean; -} +export type { AttentionKind, AttentionRow } from "./attention-row.js"; +import type { AttentionKind, AttentionRow } from "./attention-row.js"; /** Hard ceiling on rows: bounded by design, and honest about cutting off. */ export const ATTENTION_CAP = 50; diff --git a/web/src/lib/mobile-source.test.ts b/web/src/lib/mobile-source.test.ts index 01b3da3..6ecb9c8 100644 --- a/web/src/lib/mobile-source.test.ts +++ b/web/src/lib/mobile-source.test.ts @@ -65,9 +65,8 @@ test("the runs list renders as cards below desktop", () => { test("run rows show the run's repository when meta carries one", () => { const runs = readFileSync(join(root, "routes/runs/index.tsx"), "utf8"); assert.match(runs, /run\.repo !== undefined && \{r\.repo\}<\/span>/); - const attention = readFileSync(join(root, "routes/attention.tsx"), "utf8"); + // The Inbox's "Needs you" table (formerly /attention). + const attention = readFileSync(join(root, "views/attention-table.tsx"), "utf8"); assert.match(attention, /r\.repo !== undefined && { - assert.equal(settingsView(null), 'overview'); - assert.equal(settingsView('invalid'), 'overview'); +test('settings defaults to team (the old overview) and preserves existing deep links', () => { + assert.equal(settingsView(null), 'team'); + assert.equal(settingsView('overview'), 'team'); + assert.equal(settingsView('invalid'), 'team'); assert.equal(settingsView('team'), 'team'); assert.equal(settingsView('system'), 'system'); }); -test('team and overview never leak the full configuration table into their content', () => { +test('team never leaks the full configuration table into their content', () => { for (const group of ['Harness', 'Runtime', 'Sandbox', 'Git & access']) { assert.equal(groupVisible('team', group), false); - assert.equal(groupVisible('overview', group), false); assert.equal(groupVisible('system', group), true); } assert.equal(groupVisible('models', 'Sandbox'), true); diff --git a/web/src/routes/_layout.tsx b/web/src/routes/_layout.tsx index 03d68ec..fda3046 100644 --- a/web/src/routes/_layout.tsx +++ b/web/src/routes/_layout.tsx @@ -28,21 +28,19 @@ export async function loader({ request }: { request: Request }): Promise<{ nav: // changelog). `/policies` keeps its own path because its RBAC exemption is // path-based. const NAV_LINKS = [ - { href: "/", label: "Inbox", match: [] as string[] }, - { href: "/runs", label: "Runs", match: ["/reviews"] }, - // The attention queue: what needs a human, nothing that merely happened. - { href: "/attention", label: "Attention", match: [] as string[] }, - { href: "/incidents", label: "Incidents", match: [] as string[] }, - { href: "/coordination", label: "Coordination", match: [] as string[] }, + // The Inbox carries the attention queue (what needs a human) and the task + // composer; /attention redirects here. + { href: "/", label: "Inbox", match: ["/attention"] }, + { href: "/runs", label: "Runs", match: ["/reviews", "/incidents", "/coordination"] }, { href: "/projects", label: "Projects", match: ["/sources", "/knowledge", "/bulletin-admin", "/workflows", "/setup"] }, - { href: "/fleet", label: "Fleet", match: ["/spend"] }, - { href: "/settings", label: "Settings", match: ["/policies", "/users"] }, + { href: "/fleet", label: "Fleet", match: ["/spend", "/recovery"] }, + { href: "/settings", label: "Settings", match: ["/policies", "/users", "/skills", "/account"] }, ]; function activeHref(path: string): string | null { let best: string | null = null; for (const l of NAV_LINKS) { - const hit = l.href === "/" ? path === "/" : [l.href, ...l.match].some((h) => path === h || path.startsWith(h + "/")); + const hit = l.href === "/" ? path === "/" || l.match.includes(path) : [l.href, ...l.match].some((h) => path === h || path.startsWith(h + "/")); if (hit && (best === null || l.href.length > best.length)) best = l.href; } return best; @@ -314,7 +312,7 @@ select option { background: var(--panel); color: var(--text); } header.top .nav-toggle { display: none; } header.top nav.nav .nav-account { display: none; } @media (max-width: 920px) { - /* Below desktop the nine-link nav no longer fits one row. It collapses + /* Below desktop the nav no longer fits one row. It collapses behind a Menu button (toggled by NAV_PROGRESS below) and opens as a full-width list of 44px rows under the header. */ header.top { flex-wrap: wrap; } diff --git a/web/src/routes/attention.tsx b/web/src/routes/attention.tsx index 6e5f4f7..1b1e0b5 100644 --- a/web/src/routes/attention.tsx +++ b/web/src/routes/attention.tsx @@ -1,100 +1,12 @@ -import { attentionRows } from "../lib/attention.server.js"; -import type { AttentionRow } from "../lib/attention.server.js"; -import { shipRuntime } from "../lib/store.server.js"; +import { redirect } from "../lib/http.server.js"; export const config = { mode: "app" }; -interface Data { - rows: AttentionRow[]; - truncated: boolean; +/** Old path: the attention queue is the Inbox's "Needs you" section. */ +export async function loader(): Promise { + return redirect("/#needs-you"); } -export async function loader(): Promise { - const runtime = await shipRuntime(); - return attentionRows(runtime); -} - -/** Kind to the shared status-chip styling: each kind reads at a glance. */ -function kindClass(kind: AttentionRow["kind"]): string { - switch (kind) { - case "decision": - return "waiting"; - case "failure": - return "failed"; - case "delivery": - return "waiting"; - case "schedule": - return "cancelled"; - case "takeover": - return "waiting"; - case "aging": - return "cancelled"; - } -} - -export default function Attention({ data }: { data: Data }) { - return ( - <> -
-
-

- Attention{" "} - {data.rows.length > 0 && ( - ({data.rows.length}) - )} -

-

- Only what needs a human: decisions, fresh failures, held - promotions, stopped or failing schedules, lapsed takeovers, work - going stale. Everything else lives on the page that owns it. -

-
-
- {data.rows.length === 0 ? ( -

Nothing needs a human right now.

- ) : ( -
- - - - - - - - - - - - {data.rows.map((r) => ( - - - - - - - - ))} - -
WhatKindWhy it needs youNextSince
- {r.title} - {r.repo !== undefined && {r.repo}} - - {r.kind} - {r.aging && ( - <> - {" "} - aging - - )} - {r.detail}{r.nextAction}{r.at !== undefined ? new Date(r.at).toISOString().slice(0, 16).replace("T", " ") : "—"}
-
- )} - {data.truncated && ( -

- Showing the first {data.rows.length} items — older or lower-priority - rows exist on the pages they link to. -

- )} - - ); +export default function Moved() { + return

Moved to the Inbox.

; } diff --git a/web/src/routes/coordination.tsx b/web/src/routes/coordination.tsx index 264816b..972e58f 100644 --- a/web/src/routes/coordination.tsx +++ b/web/src/routes/coordination.tsx @@ -1,4 +1,6 @@ import { randomUUID } from "node:crypto"; +import { SubNav } from "../lib/subnav.js"; +import { RUN_VIEWS } from "../views/run-views.js"; import { actorFromPrincipal } from "../lib/ship.server.js"; import { defaultModel, shipRuntime } from "../lib/store.server.js"; @@ -259,13 +261,9 @@ function MissionPanel({ mission }: { mission: { view: MissionView } | { error: s export default function Coordination({ data }: { data: CoordinationData }) { return ( <> -
-
-

Coordination

-

One parent intent across two repositories: the API change first, the client change against its merged commit.

-
- View all runs → -
+

Runs

+ +

One change across two repositories: the API change lands first, then the client change is built against it.

{data.created && (

Coordination started — the API-side run is queued. The client side will start only after it merges. @@ -279,7 +277,7 @@ export default function Coordination({ data }: { data: CoordinationData }) { {data.error &&

} {data.denied && ( )} {data.coordinations.length === 0 && ( diff --git a/web/src/routes/incidents.tsx b/web/src/routes/incidents.tsx index 7919b3a..38e8707 100644 --- a/web/src/routes/incidents.tsx +++ b/web/src/routes/incidents.tsx @@ -1,4 +1,6 @@ import { redirect } from "../lib/http.server.js"; +import { SubNav } from "../lib/subnav.js"; +import { RUN_VIEWS } from "../views/run-views.js"; // The incidents module is imported DIRECTLY from dist (no lib/*.server.ts // re-export exists for it) — safe because src/incidents.ts is self-contained // by construction: no value imports at all, so the client bundler never @@ -398,13 +400,9 @@ function IncidentActions({ incident, canSteer }: { incident: IncidentRecord; can export default function Incidents({ data }: { data: IncidentsData }) { return ( <> -
-
-

Incidents

-

Alert, attributed repository, read-only diagnosis with a bounded fix proposal. Remediation only by an explicit authorize; observed recovery closes the loop on its own evidence.

-
- Back to Inbox -
+

Runs

+ +

Paste an alert and Ship finds the repository, diagnoses it read-only and proposes a fix. Nothing changes until someone authorizes the fix.

{data.error !== null && } {data.notice !== null &&

{data.notice}

} diff --git a/web/src/routes/index.tsx b/web/src/routes/index.tsx index d598a78..7146a4f 100644 --- a/web/src/routes/index.tsx +++ b/web/src/routes/index.tsx @@ -1,4 +1,7 @@ import { submissionIdentity } from "../lib/submission.server.js"; +import { attentionRows } from "../lib/attention.server.js"; +import { AttentionTable } from "../views/attention-table.js"; +import type { AttentionRow } from "../lib/attention.server.js"; import { TaskComposer, type TaskProject } from "../views/task-composer.js"; import { JOURNEYS, intakeJourney, parseJourney, journeyOptions, type Journey } from "teploy-ship/journeys"; import { workflows } from "../lib/workflows.server.js"; @@ -10,7 +13,6 @@ import { deliverEvent, enqueueRun, actorFromPrincipal, intakeActor } from "../li // recovery the worker's auto-launch performs, kept identical here so a manual // launch records exactly what an automatic one would. import { akirooRefFrom } from "../../../dist/akiroo.js"; -import type { RunMeta } from "teploy-ship/runtime"; import type { IntakeTask } from "teploy-ship/runtime"; import { defaultModel, shipRuntime } from "../lib/store.server.js"; @@ -23,8 +25,9 @@ export const config = { mode: "app" }; interface InboxData { template?: WorkflowTemplate; selectedRepo: string; - /** Runs parked on an approval — the top priority. */ - parked: RunMeta[]; + /** Everything that needs a person: decisions, failures, holds, stale work. */ + attention: AttentionRow[]; + attentionTruncated: boolean; recentRequests: Array; pendingLaunches: IntakeTask[]; /** Proposed intake tasks awaiting a launch/dismiss decision. */ @@ -34,6 +37,8 @@ interface InboxData { projects: TaskProject[]; canLaunch: boolean; canRequest: boolean; + /** May connect and configure projects (the `policies` grant). */ + canSetup: boolean; requestId: string; submitted: string | null; error: string | null; @@ -65,8 +70,9 @@ export async function loader({ request }: { request: Request }): Promise runPresence.get(t.runId!) === false) : []; const recentRequests = allTasks.filter(t => t.source === "team-request" && t.state !== "proposed" && (canLaunch || t.requestedBy === me?.user)).sort((a,b) => b.updatedAt.localeCompare(a.updatedAt)).slice(0, 12).map(t => ({...t,runVisible: !!t.runId && runPresence.get(t.runId) === true})); - const parked = runs.filter((r) => r.status === "waiting" && r.eventName !== undefined); - return { template: (await workflows(runtime)).find(t=>t.id===query.get("workflow")), selectedRepo: query.get("repo") ?? "", canLaunch, canRequest: me?.role === "admin" || me?.role === "editor", requestId: randomUUID(), submitted: query.get("submitted"), error: query.get("error"), projects: projects.filter(p => !!p.url).map(p => ({ url: p.url ?? p.repo, label: `${p.label ?? p.repo}${p.url ? " · " + new URL(p.url).host : ""}`, requirePlanReview: p.requirePlanReview === true, planSupported: (p.harness ?? process.env.SHIP_HARNESS ?? "native") === "native" })), parked, recentRequests, pendingLaunches, proposed, store: runtime.kind, model: defaultModel(), decisionTaken, denied }; + const attention = await attentionRows(runtime); + const canSetup = await may("policies", me); + return { attention: attention.rows, attentionTruncated: attention.truncated, canSetup, template: (await workflows(runtime)).find(t=>t.id===query.get("workflow")), selectedRepo: query.get("repo") ?? "", canLaunch, canRequest: me?.role === "admin" || me?.role === "editor", requestId: randomUUID(), submitted: query.get("submitted"), error: query.get("error"), projects: projects.filter(p => !!p.url).map(p => ({ url: p.url ?? p.repo, label: `${p.label ?? p.repo}${p.url ? " · " + new URL(p.url).host : ""}`, requirePlanReview: p.requirePlanReview === true, planSupported: (p.harness ?? process.env.SHIP_HARNESS ?? "native") === "native" })), recentRequests, pendingLaunches, proposed, store: runtime.kind, model: defaultModel(), decisionTaken, denied }; } export async function action({ request }: { request: Request }): Promise { @@ -215,16 +221,13 @@ export async function action({ request }: { request: Request }): Promise n ? `${s.slice(0, n)}…` : s; -} // Live updates via the shared SSE helper (see _layout __shipLive): the server // pushes on any state change and this re-checks the inbox's own loader data. const POLL = `__shipLive("route:index.tsx");`; export default function Inbox({ data }: { data: InboxData }) { - const nothing = data.parked.length === 0 && data.proposed.length === 0; + const noProjects = data.projects.length === 0; return ( <> {data.decisionTaken && ( @@ -234,55 +237,55 @@ export default function Inbox({ data }: { data: InboxData }) { )} {data.denied && (

- Not applied — your account may not approve, deny or launch runs. An admin can grant it on Policies. + Not applied — your account may not approve, deny or launch runs. An admin can grant it in Approval rules.

)} -

Inbox

Tasks and runs waiting for your decision.

View all runs →
+

Inbox

What needs you, and where new work starts.

View all runs →
-

Choose a workflowSet up a project

- {data.template &&

Workflow: {data.template.name}. Fill in the details below before starting.

} - {data.submitted &&

Your request was sent for approval. It has not started yet. Find it in Proposed tasks below.

} - {data.error && } - + {noProjects ? ( +
+

Connect your first repository

+ {data.canSetup ? ( + <> +

Ship works on repositories you connect. Setup takes a clone URL, checks the environment, then runs a read-only review to prove it works.

+ Connect a repository + + ) : ( +

Ship works on repositories an administrator connects. Ask one to add a project; you can describe tasks here once it exists.

+ )} +
+ ) : ( + <> +

Start from a workflowOpen an incident from an alertChange two repositories together

+ {data.template &&

Workflow: {data.template.name}. Fill in the details below before starting.

} + {data.submitted &&

Your request was sent for approval. It has not started yet. Find it in Proposed tasks below.

} + {data.error && } + + + )} -

- Needs your decision ({data.parked.length}) +

+ Needs you ({data.attention.length})

- {data.parked.length === 0 ? ( -

You’re caught up

Plans, approval requests, and agent questions will appear here.

+ {data.attention.length === 0 ? ( +

You’re caught up

Decisions, failures and work going stale will appear here.

) : ( - data.parked.map((r) => ( -
-
- waiting - {r.runId} - {r.repo !== undefined && {r.repo}} - -
- - {/* Binds the decision to the park this card was rendered from. */} - - Review and respond -
-
-
{short(r.task, 140)}
-
- )) + )} {data.pendingLaunches.length > 0 &&

Starting or awaiting recovery

-

These requests have a reserved task identity but no visible run yet. Retrying resumes the same request.

+

These requests have a reserved task identity but no visible run yet. Retrying resumes the same request. Launch recovery →

{data.pendingLaunches.map(t =>
{t.title}
)}
}

Proposed tasks ({data.proposed.length})

{data.proposed.length === 0 ? ( -

No proposed tasks. Label a Forgejo/GitHub issue ship to see it here.

+

No proposed tasks. Label a Forgejo or GitHub issue ship to see it here.

) : ( data.proposed.map((t) => (
@@ -300,9 +303,7 @@ export default function Inbox({ data }: { data: InboxData }) { )) )} - {data.canLaunch &&

Inspect pending launch recovery →

} {data.recentRequests.length > 0 &&

Recent requests

{data.recentRequests.map(t => )}
} - {nothing && data.pendingLaunches.length === 0 &&

Inbox zero. See all runs →

}