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
5 changes: 4 additions & 1 deletion .github/workflows/codebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ name: CodeBuild CI
workflow_dispatch:

concurrency:
group: codebuild-${{ github.workflow }}-${{ github.ref }}
# pull_request and pull_request_target share github.ref (the PR). If they
# share a group, one cancels the other and the cancelled job shows up as
# `matrix.context` because the name expression never expands.
group: codebuild-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true

permissions:
Expand Down
19 changes: 14 additions & 5 deletions design/cli-lock-board-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Generated from the id lists in the tree at `3035361` (`v0.1.10`):
`lock_scene_ids()` in `src/cortex-tui/src/lock_proof.rs:53-131`,
`is_lock_board()` in `src/cortex-tui/src/lock_boards.rs:44-99`,
`LOCK_V2_WIDE_IDS` / `LOCK_V2_NARROW_IDS` in `src/cortex-tui/src/lock_v2.rs:33-147`.
`LOCK_V2_WIDE_IDS` / `LOCK_V2_NARROW_IDS` in `src/cortex-tui/src/lock_v2_ids.rs`.

Current Designer lock: **v2** (77 wide / 31 narrow), green focus `#1F4945`.
Current Designer lock: **v2** (89 wide / 43 narrow), green focus `#1F4945`.
Committed PNGs under `docs/media/tui-lock/` and `docs/media/tui-lock-v2/`
still include historical violet `#A78BFA` pixels (see those READMEs). The
ids and tests below are the source of truth:
Expand Down Expand Up @@ -57,7 +57,7 @@ shows those chords; cover those boards with `lock.render`,
| `lock_proof::tests::distinct_states_render_distinct_frames` | v1 | only the 4 documented aliases share a frame |
| `lock_proof::tests::no_smashed_tokens_anywhere` | v1 | wrapped copy never breaks tokens |
| `lock_proof::tests::no_rounded_frame_glyphs_anywhere` | v1 | currently a no-op (no glyph assertions); TUI bleeds to terminal edges — see `docs/media/tui-lock/README.md` |
| `lock_v2::tests::lock_v2_wide_count_is_spec` | v2 | 77 / 31 ids |
| `lock_v2::tests::lock_v2_wide_count_is_spec` | v2 | 89 / 43 ids |
| `lock_v2::tests::lock_v2_wide_frames_are_unique`, `lock_v2_narrow_frames_are_unique` | v2 | every id is a distinct frame |
| `lock_v2::tests::slash_hover_is_not_banner_green_wash` | v2 | hover `#1A1A1A`; `#221A38` banned |
| `style::tests::gray_chrome_palette_is_locked` (`cortex-core`) | palette | `ACCENT == #1F4945`, grays neutral, mint/cyan banned, gold retired |
Expand Down Expand Up @@ -145,7 +145,7 @@ Kinds: **painted** = `lock_boards.rs` painter (not the runtime view);
| `sandbox_deny` | painted | `red_and_amber_stay_on_diagnostics` | flow *Permission* (deny) |
| `mcp_drop` | painted | `red_and_amber_stay_on_diagnostics`; runtime path: `runner::event_loop::tests::mcp_disconnect_without_user_stop_is_a_drop` | flow *MCP* (kill peer) |

## Lock v2 — 77 ids (`docs/media/tui-lock-v2/`), 31 also at 40×12
## Lock v2 — 86 ids (`docs/media/tui-lock-v2/`), 40 also at 40×12

Kinds: **real** = production view/builder with a real `AppState`;
**seed** = real view but the runtime-emitted line is inserted as
Expand Down Expand Up @@ -181,6 +181,11 @@ Every v2 id is covered by `lock_v2_wide_frames_are_unique` (and
| `tokens-topright-warn` | — | real | uniqueness | fixture usage ≥ 90 % |
| `compact-chat` | yes | real | uniqueness | `tui.type "/compact"` |
| `slash-palette` | yes | real | `slash_hover_is_not_banner_green_wash` | flow *Slash* |
| `goal-chip-active` | yes | real | uniqueness | `lock.render` (`/goal` chip) |
| `goal-chip-paused` | yes | real | uniqueness | `lock.render` |
| `goal-chip-done` | yes | real | uniqueness | `lock.render` |
| `goal-chip-budget` | yes | real | uniqueness | `lock.render` |
| `goal-chip-blocked` | yes | real | uniqueness | `lock.render` |
| `slash-model-typed` | yes | real | uniqueness | flow *Slash* (`/mod`) |
| `model-list` | yes | real (`build_model_selector`) | uniqueness | flow *Model* + `api.models` |
| `model-list-hover` | — | real | uniqueness | mouse fixture |
Expand Down Expand Up @@ -208,6 +213,10 @@ Every v2 id is covered by `lock_v2_wide_frames_are_unique` (and
| `sandbox` | — | **synthetic** | uniqueness | `tui.type "/sandbox"` (`build_sandbox_selector`) |
| `sandbox-deny` | — | **synthetic** | uniqueness | flow *Permission* (deny) via `CortexError::SandboxDenied` |
| `cloud-handoff` | — | seed | uniqueness | `tui.type "& …"` |
| `offline` | yes | seed | `lock_v2_network::tests::*` | Network unreachable — no API-down copy |
| `rate-limit` | yes | seed | `lock_v2_network::tests::*` | HTTP 429 — distinct from quota |
| `computer-disconnected` | yes | seed | `lock_v2_computer::tests::*` | This PC/SSH fail-closed — no substitute runtime |
| `computer-cloud-default` | yes | seed | `lock_v2_computer::tests::*` | Computer · Cloud welcome default |
| `diagnostics` | yes | seed | uniqueness | flow *Errors* (diagnostics tool) |
| `interrupt-stopped` | yes | seed | runtime path `interrupt_records_stopped_once` | flow *Cancel* |
| `error-unavailable` | — | real | uniqueness | flow *Errors* (503) |
Expand Down Expand Up @@ -241,7 +250,7 @@ Every v2 id is covered by `lock_v2_wide_frames_are_unique` (and
| Pack | Ids | Sizes | Frames | Live / real | Painted or synthetic | PNGs in repo (all violet) |
|---|---|---|---|---|---|---|
| v1 | 72 | 40×12, 120×40 | 144 (+144 macOS composites) | 17 | 51 painted + 4 aliases | 65/72 files carry `#A78BFA` at each size |
| v2 | 77 wide / 31 narrow | 120×40 / 40×12 | 108 | 63 (5 seeded) | 14 synthetic | runtime 73/77 + 30/31; designer boards 68/77 + 29/31 |
| v2 | 89 wide / 43 narrow | 120×40 / 40×12 | 132 | 72 (7 seeded) | 14 synthetic | runtime 89/89 + 43/43; designer boards 89/89 + 43/43 |

Regenerate captures: `./scripts/render-tui-lock.sh`,
`./scripts/render-tui-lock-v2.sh`, `python3 docs/media/tui-lock-v2/tools/render_lock_v2.py --index`.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions docs/media/tui-lock-v2/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ Design-only deliverable for the full TUI redesign. Layout language is taken
composer with the model chip in the bottom border, Settings modal with search +
categorised rows + tip/nav footer, slash autocomplete above the composer, effort
radios under `/model`, token counter top-right, footer shortcut strip) and
re-skinned to the Cortex chrome. **No runtime code changes ship with this pack.**
re-skinned to the Cortex chrome. Designer boards stay design-only; runtime
captures use `MinimalSessionView` plus lock flags (`computer_held`,
`show_computer_default`, `offline_held`, `rate_limit_held`) so MockTerminal
matches live chrome.

- Boards: [`index.md`](index.md) — 87 boards at 120×40, 41 of them also at 40×12 (128 PNGs).
- Boards: [`index.md`](index.md) — 89 boards at 120×40, 43 of them also at 40×12 (132 PNGs).
- Grids: `txt/<size>/<board>.txt` — the exact character grid of every board (diff a
`MockTerminal` capture against these).
- Renderer: `tools/render_lock_v2.py` + `tools/boards.py` (Python 3 + Pillow, IBM Plex Mono
Expand Down Expand Up @@ -413,7 +416,7 @@ Narrow: no bars, `used / total pct%`.
| model-effort-low·medium·high / model-list-hover | `model-list`, `model-list-hover`, `model-effort-high`, `model-effort-medium`, `model-effort-low`, `model-effort-hover` |
| settings-appearance / mouse / row-hover / search / theme-submenu | `settings-appearance`, `settings-mouse`, `settings-row-hover`, `settings-search`, `settings-theme-submenu` |
| mode chips (Shift+Tab) | `mode-agent`, `mode-plan`, `mode-ask`, `mode-bash` |
| permissions / mcp / plugins / usage-quota / sandbox / cloud | `permission-prompt`, `permission-prompt-hover`, `permissions-picker`, `mcp-servers`, `mcp-drop`, `plugins`, `usage`, `quota-exhausted`, `sandbox`, `sandbox-deny`, `cloud-handoff` |
| permissions / mcp / plugins / usage-quota / sandbox / cloud | `permission-prompt`, `permission-prompt-hover`, `permissions-picker`, `mcp-servers`, `mcp-drop`, `plugins`, `usage`, `quota-exhausted`, `sandbox`, `sandbox-deny`, `cloud-handoff`, `computer-disconnected`, `computer-cloud-default` |
| diagnostics red/amber · interrupt/stopped | `diagnostics`, `interrupt-stopped`, `error-unavailable`, `offline`, `rate-limit` |
| markdown table · diff hunk · code fence | `md-table`, `diff-hunk`, `edit-collapsed`, `code-fence`, `tool-tiles`, `tool-tiles-collapsed`, `shell-running` |
| login / first-run | `login`, `login-waiting`, `login-success`, `login-error`, `first-run-tips` |
Expand All @@ -426,7 +429,7 @@ Narrow (40×12) set: `welcome-cortex`, `welcome-agent`, `first-run-tips`, `sessi
`tokens-topright`, `compact-chat`, `slash-palette`, `goal-chip-active`, `goal-chip-paused`, `goal-chip-done`,
`goal-chip-budget`, `goal-chip-blocked`, `slash-model-typed`, `model-list`, `model-effort-high`,
`settings-appearance`, `settings-mouse`, `settings-row-hover`, `settings-theme-submenu`, `mode-plan`, `mode-ask`,
`permission-prompt`, `mcp-servers`, `usage`, `diagnostics`, `interrupt-stopped`, `offline`, `rate-limit`, `diff-hunk`, `login`, `shortcuts-overlay`,
`permission-prompt`, `mcp-servers`, `usage`, `diagnostics`, `interrupt-stopped`, `offline`, `rate-limit`, `computer-disconnected`, `computer-cloud-default`, `diff-hunk`, `login`, `shortcuts-overlay`,
`consent-local-tools`, `composer-file-chip`, `undo-sheet`.

---
Expand Down
6 changes: 5 additions & 1 deletion docs/media/tui-lock-v2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Regenerate: `python3 tools/render_lock_v2.py --index` (fetches IBM Plex Mono on
| `error-unavailable` | API down — product-facing error | [120x40](120x40/error-unavailable.png) | — |
| `offline` | Network unreachable — held composer, distinct from API-down | [120x40](120x40/offline.png) | [40x12](40x12/offline.png) |
| `rate-limit` | HTTP 429 rate limited — retry-after, distinct from quota | [120x40](120x40/rate-limit.png) | [40x12](40x12/rate-limit.png) |
| `computer-disconnected` | This PC/SSH fail-closed — no connected Code session | [120x40](120x40/computer-disconnected.png) · [runtime](runtime/120x40/computer-disconnected.png) | [40x12](40x12/computer-disconnected.png) · [runtime](runtime/40x12/computer-disconnected.png) |
| `computer-cloud-default` | Computer · Cloud shipped default (welcome info card) | [120x40](120x40/computer-cloud-default.png) · [runtime](runtime/120x40/computer-cloud-default.png) | [40x12](40x12/computer-cloud-default.png) · [runtime](runtime/40x12/computer-cloud-default.png) |
| `tool-tiles` | Grouped tool calls expanded — Read / Grep / Shell | [120x40](120x40/tool-tiles.png) | — |
| `tool-tiles-collapsed` | Grouped tool calls collapsed | [120x40](120x40/tool-tiles-collapsed.png) | — |
| `shell-running` | Live Shell tile with output | [120x40](120x40/shell-running.png) | — |
Expand Down Expand Up @@ -118,4 +120,6 @@ Regenerate: `python3 tools/render_lock_v2.py --index` (fetches IBM Plex Mono on
| `composer-file-chip` | Composer with attached @file chip in prompt | [120x40](120x40/composer-file-chip.png) | [40x12](40x12/composer-file-chip.png) |
| `undo-sheet` | /undo /redo /rewind sheet | [120x40](120x40/undo-sheet.png) | [40x12](40x12/undo-sheet.png) |

**87** boards at 120x40 · **41** at 40x12 · 128 PNGs.
**89** boards at 120x40 · **43** at 40x12 · 132 PNGs.

Runtime MockTerminal pack (same ids): [`runtime/120x40`](runtime/120x40/) (89) · [`runtime/40x12`](runtime/40x12/) (43).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/media/tui-lock-v2/runtime/40x12/jobs.png
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/media/tui-lock-v2/runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ is banner green `#1F4945`; historical violet `#A78BFA` is not the lock.
Designer boards (pixel target) live in `docs/media/tui-lock-v2/{40x12,120x40}/`.
These runtime frames are what Designer cli signs off against.

SPEC §7: **87** boards at 120×40 and **41** at 40×12. Each filename is one
SPEC §7: **89** boards at 120×40 and **43** at 40×12. Each filename is one
distinct live state — no two PNGs share a sha256. Includes `/goal` composer
chips (`goal-chip-*`), distinct `offline` and `rate-limit` diagnostics,
Computer lock boards (`computer-disconnected`, `computer-cloud-default`),
local-tools consent, composer `@file` chip, and `/undo` `/redo` `/rewind` sheet.
51 changes: 51 additions & 0 deletions docs/media/tui-lock-v2/tools/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,55 @@ def board_rate_limit(s, c):
footer(s, c, [("Enter", "retry"), ("/usage", "details")])


# Exact engine constant (`src/cortex-engine/src/client/computer.rs`).
DISCONNECTED_RUNTIME = (
"This PC and SSH Code execution require an already connected Code session. "
"Connect a host and resume that session, or leave CORTEX_COMPUTER unset to use Cloud. "
"No runtime was substituted."
)
DISCONNECTED_RUNTIME_NARROW = (
"This PC and SSH need a connected Code session. No runtime was substituted."
)


def board_computer_disconnected(s, c):
"""This PC/SSH fail-closed — no connected Code session; no Cloud substitute."""
header(s, c)
placeholder = (
"Connect a host — or unset for Cloud"
if c.narrow
else "Connect a host — or unset CORTEX_COMPUTER for Cloud"
)
top = composer(s, c, placeholder=placeholder, focused=False, caret=False)
f = Flow(s, c, y=1 if c.narrow else 2, limit=top if c.narrow else top - 1)
f.user("run the local cargo tests" if not c.narrow else "run local tests", "09:18 AM")
f.line([("×", S_ERR), (" This PC disconnected", S_ERR)])
body = DISCONNECTED_RUNTIME_NARROW if c.narrow else DISCONNECTED_RUNTIME
width = max(8, f.x1 - 1 - f.tx - 2)
for line in textwrap.wrap(body, width=width):
f.dim(line, indent=2)
footer(s, c, [("Enter", "retry"), ("Ctrl+x", "shortcuts")])


def board_computer_cloud_default(s, c):
"""Welcome frame with Computer · Cloud as the shipped default (not a handoff)."""
header(s, c, "0 / 500K")
title = [("Welcome to ", S), ("Cortex", S_BOLD)] + (
[] if c.narrow else [(", the coding agent CLI", S_DIM)]
)
welcome_lines(s, c, title)
y = 4
if c.narrow:
s.spans(c.x0 + 2, y, [("Computer", S_DIM), (" ", S), ("Cloud", S)], max_x=c.x1)
else:
s.spans(c.x0 + 2, y, [("Directory", S_DIM), (" ", S), ("~/cortex", S)], max_x=c.x1)
s.spans(c.x0 + 2, y + 1, [("Org", S_DIM), (" ", S), ("Personal", S)], max_x=c.x1)
s.spans(c.x0 + 2, y + 2, [("Plan", S_DIM), (" ", S), ("Pro", S)], max_x=c.x1)
s.spans(c.x0 + 2, y + 3, [("Computer", S_DIM), (" ", S), ("Cloud", S)], max_x=c.x1)
composer(s, c)
footer(s, c)


def board_tool_tiles(s, c):
header(s, c)
top = composer(s, c)
Expand Down Expand Up @@ -1960,6 +2009,8 @@ def board_undo_sheet(s, c):
("error-unavailable", board_error_unavailable, False, "E", "API down — product-facing error"),
("offline", board_offline, True, "E", "Network unreachable — held composer, distinct from API-down"),
("rate-limit", board_rate_limit, True, "E", "HTTP 429 rate limited — retry-after, distinct from quota"),
("computer-disconnected", board_computer_disconnected, True, "E", "This PC/SSH fail-closed — no connected Code session"),
("computer-cloud-default", board_computer_cloud_default, True, "E", "Computer · Cloud shipped default (welcome info card)"),
("tool-tiles", board_tool_tiles, False, "E", "Grouped tool calls expanded — Read / Grep / Shell"),
("tool-tiles-collapsed", board_tool_tiles_collapsed, False, "E", "Grouped tool calls collapsed"),
("shell-running", board_shell_running, False, "E", "Live Shell tile with output"),
Expand Down
40 changes: 40 additions & 0 deletions docs/media/tui-lock-v2/txt/120x40/computer-cloud-default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
0 / 500K

Welcome to Cortex, the coding agent CLI
v0.1.7 · / commands · @ files · ! shell · & cloud
Directory ~/cortex
Org Personal
Plan Pro
Computer Cloud



























╭─ Agent ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > Plan, search, build anything │
╰─────────────────────────────────────────────────────────────────────────────────────────── Cortex Mini 1 (medium) ─╯

Shift+Tab:mode | Ctrl+x:shortcuts
40 changes: 40 additions & 0 deletions docs/media/tui-lock-v2/txt/120x40/computer-disconnected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
14K / 500K

> run the local cargo tests 09:18 AM

× This PC disconnected
This PC and SSH Code execution require an already connected Code session. Connect a host and resume that session,
or leave CORTEX_COMPUTER unset to use Cloud. No runtime was substituted.




























╭─ Agent ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > Connect a host — or unset CORTEX_COMPUTER for Cloud │
╰─────────────────────────────────────────────────────────────────────────────────────────── Cortex Mini 1 (medium) ─╯

Enter:retry | Ctrl+x:shortcuts
12 changes: 12 additions & 0 deletions docs/media/tui-lock-v2/txt/40x12/computer-cloud-default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
0 / 500K

Welcome to Cortex
v0.1.7 · / commands · @ files
Computer Cloud


╭─ Agent ────────────────────────────╮
│ > Plan, search, build anything │
╰─────────── Cortex Mini 1 (medium) ─╯

Shift+Tab:mode | Ctrl+x:shortcuts
12 changes: 12 additions & 0 deletions docs/media/tui-lock-v2/txt/40x12/computer-disconnected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
14K / 500K
> run local tests

× This PC disconnected
This PC and SSH need a connected
Code session. No runtime was
substituted.
╭─ Agent ────────────────────────────╮
│ > Connect a host — or unset for C… │
╰─────────── Cortex Mini 1 (medium) ─╯

Enter:retry | Ctrl+x:shortcuts
3 changes: 3 additions & 0 deletions scripts/readiness/test_codebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def test_pull_requests_use_trusted_buildspec_and_uncached_projects(self):
self.assertIn("github.event_name != 'pull_request'", text)
self.assertIn("github.event_name == 'pull_request_target'", text)
self.assertIn("github.event_name == 'push'", text)
group = self.workflow["concurrency"]["group"]
self.assertIn("github.event_name", group)
self.assertIn("github.ref", group)
self.assertIn("logs-only", text)

def test_start_build_is_skipped_without_role_variable(self):
Expand Down
7 changes: 4 additions & 3 deletions scripts/render-tui-lock-v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ for spec in 40x12 120x40; do
python3 scripts/ansi-frames-to-gif.py --frames "$frames" --png-only "$pngs"
done

unique_pngs "$output_dir/40x12" 41
unique_pngs "$output_dir/120x40" 87
unique_pngs "$output_dir/40x12" 43
unique_pngs "$output_dir/120x40" 89

python3 - "$output_dir" <<'PY'
from pathlib import Path
Expand Down Expand Up @@ -100,9 +100,10 @@ is banner green `#1F4945`; historical violet `#A78BFA` is not the lock.
Designer boards (pixel target) live in `docs/media/tui-lock-v2/{40x12,120x40}/`.
These runtime frames are what Designer cli signs off against.

SPEC §7: **87** boards at 120×40 and **41** at 40×12. Each filename is one
SPEC §7: **89** boards at 120×40 and **43** at 40×12. Each filename is one
distinct live state — no two PNGs share a sha256. Includes `/goal` composer
chips (`goal-chip-*`), distinct `offline` and `rate-limit` diagnostics,
Computer lock boards (`computer-disconnected`, `computer-cloud-default`),
local-tools consent, composer `@file` chip, and `/undo` `/redo` `/rewind` sheet.
EOF

Expand Down
Loading