Skip to content

Commit 7fb3610

Browse files
committed
specs: Fixes in the CLI and Configuration specs
1 parent 9a1378f commit 7fb3610

File tree

9 files changed

+74
-77
lines changed

9 files changed

+74
-77
lines changed

.agents/codebase-insights.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
- Local state uses a canonical SQLite DB; there is no local daemon. See docs/state-persistence.md for selection rules and SQL schema.
3838

3939
## Config Mapping Notes
40-
- TOML preserves dashes in keys (e.g., `network.api-url`, `tui.default-mode`, `repo.task-runner`).
41-
- ENV/JSON use underscores for those keys (e.g., `AGENTS_WORKFLOW_NETWORK_API_URL`). See specs/configuration.md.
40+
- CLI flags are kebab-case (e.g., `--task-runner`, `--browser-automation`, `--browser-profile`, `--chatgpt-username`).
41+
- TOML preserves dashes in keys and matches CLI names unless it’s a subcommand section (e.g., `repo.task-runner`, `network-api-url` → now `service-base-url`, `browser-automation`, `browser-profile`, `chatgpt-username`).
42+
- ENV/JSON replace dashes with underscores: `AGENTS_WORKFLOW_REPO_TASK_RUNNER`, `AGENTS_WORKFLOW_BROWSER_AUTOMATION`, etc. See specs/Public/Configuration.md.
4243

4344
## 2025-08-28 — Spec TODOs addressed
44-
- Added `ui.default` config key (schema + docs) to control whether bare `aw` launches TUI or WebUI (default: `tui`).
45-
- Fixed CLI config mapping examples to follow mechanical rules (camelCase in nested keys like `apiUrl`, `chatgptUsername`).
45+
- Replaced `ui.default` with a single `ui` key (schema + docs). Bare `aw` reads `ui` to pick TUI/WebUI (default: `tui`).
46+
- Fixed CLIconfig↔ENV mapping to kebab-case ↔ lowerCamelCase ↔ UPPER_SNAKE.
4647
- Clarified snapshot selection semantics in CLI spec: strategy is chosen by the executing host; leader-only snapshots in fleets.
4748
- Expanded `sandbox-profiles` with motivations, predefined types, and OS guidance.
4849
- WebUI tech note now picks React + Vite + TypeScript as the non-binding default.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ test/logs/
55

66
# Debugger temp files
77
.rdbgrc.breakpoints
8+
9+
# linter cache
10+
.rubocop-cache/

.obsidian/workspace.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"state": {
1414
"type": "markdown",
1515
"state": {
16-
"file": "specs/Public/3rd-Party Agents/3rd-Party Agent Description Template.md",
16+
"file": "specs/Public/CLI.md",
1717
"mode": "source",
1818
"source": false
1919
},
2020
"icon": "lucide-file",
21-
"title": "3rd-Party Agent Description Template"
21+
"title": "CLI"
2222
}
2323
},
2424
{
@@ -102,7 +102,7 @@
102102
}
103103
],
104104
"direction": "horizontal",
105-
"width": 384.5
105+
"width": 266.5
106106
},
107107
"right": {
108108
"id": "6bab4bb451c2c34d",
@@ -194,6 +194,10 @@
194194
},
195195
"active": "01bf72509d2b5652",
196196
"lastOpenFiles": [
197+
"scripts/md-mermaid-validate.sh",
198+
"specs/Public/Configuration.md",
199+
"specs/Public/CLI.md",
200+
"specs/Public/3rd-Party Agents/3rd-Party Agent Description Template.md",
197201
"specs/Public/Nix Devcontainer/Devcontainer User Setup.md",
198202
"specs/Public/Nix Devcontainer/Devcontainer Design.md",
199203
"specs/Public/Nix Devcontainer/Devcontainer Test Suite.md",
@@ -205,8 +209,6 @@
205209
"specs/Public/Lima VM Images.md",
206210
"specs/Public/AGENTS.md",
207211
"specs/Public/Agent Time Travel.md",
208-
"specs/Public/Configuration.md",
209-
"specs/Public/CLI.md",
210212
"specs/Public/WebUI PRD.md",
211213
"specs/Public/TUI PRD.md",
212214
"specs/Initial Developer Input/WebUI, TUI, REST Service.md",
@@ -224,8 +226,6 @@
224226
"test/logs/test_run_20250828_001209.log",
225227
"specs/Initial Developer Input/Configuration.md",
226228
"specs/Initial Developer Input",
227-
"specs/Public/FS Snapshots/milestone_5.md",
228-
"specs/Public/FS Snapshots/milestone_4.md",
229229
"specs/Research"
230230
]
231231
}

specs/Public/Browser Automation/Codex.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Automate the Codex WebUI to initiate a coding session for a repository/branch us
1616
6. Launch Playwright with a persistent context in headless mode.
1717
7. If the expected login is not present, relaunch in visible mode to let the user authenticate, then continue.
1818
8. Navigate to Codex, select workspace and branch, enter the task description, and press "Code":
19-
- Workspace comes from `--codex-workspace` or `config: codex.workspace` (see `docs/configuration.md`).
19+
- Workspace comes from `--codex-workspace` or `config: codex-workspace` (see `docs/configuration.md`).
2020
- Branch comes from the `aw task --branch` value.
2121
9. Record success.
2222

@@ -32,11 +32,10 @@ Controlled via AW configuration (see `docs/cli-spec.md` and `docs/configuration.
3232

3333
- Enable/disable automation for `aw task`.
3434
- Select or override the agent browser profile name.
35-
- Set default Codex workspace: `codex.workspace`.
35+
- Set default Codex workspace: `codex-workspace`.
3636

3737
### Notes
3838

3939
- Playwright selectors should prefer role/aria/test id attributes to resist UI text changes.
4040
- Use stable navigation points inside Codex (workspace and branch selectors) and fail fast with helpful error messages when not found; optionally open DevTools in headful mode for investigation.
4141

42-

specs/Public/CLI.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ The CLI honors the layered configuration model in [Configuration](Configuration.
2525
- **Sandbox profiles (orthogonal):** When launching locally, sandbox profiles define the isolation level (container, VM, bwrap/firejail, or unsandboxed per policy). See [Sandbox Profiles](Sandbox%20Profiles.md) and configuration mapping below.
2626

2727
### Global Behavior and Flags
28-
TODO: we don't use config values like `ui.default`. See our naming convention in [Mapping Rules (Flags ↔ Config ↔ ENV/JSON)](Configuration.md#Mapping%20Rules%20(Flags%20↔%20Config%20↔%20ENV/JSON)). This should be renamed to something like `ui`
28+
Naming consistency: the config key controlling UI selection is `ui`, not `ui.default`.
2929

30-
- `aw` (no args): Launches the default UI (TUI by default). Config key `ui.default` controls TUI vs WebUI; built‑in default is `tui`.
30+
- `aw` (no args): Launches the default UI (TUI by default). Config key `ui` controls TUI vs WebUI; built‑in default is `tui`.
3131
- Common global flags (apply to all subcommands unless noted):
3232
- `--remote-server <NAME|URL>`: If provided, use the REST API at this server (by name lookup in config or raw URL). Otherwise use local SQLite state.
3333
- `--repo <PATH|URL>`: Target repository (filesystem path in local runs; git URL may be used by some servers). If omitted, AW auto-detects a VCS root by walking parent directories and checking all supported VCS.
@@ -56,20 +56,21 @@ Behavior overview:
5656
- Sandbox/runtime: Local runs honor `--runtime`: `devcontainer` (default when available), `local` (process sandbox/profile), or `unsandboxed` (policy‑gated). See [Sandbox Profiles](Sandbox%20Profiles.md) and [FS Snapshots/FS Snapshots Overview](FS%20Snapshots/FS%20Snapshots%20Overview.md).
5757

5858
Flow (high‑level):
59-
TODO: the following mermaid diagram has a syntax issues. Please install tools in you nix flake, so you can debug them and fix them (you'll have to use `nix develop --command` when launching the tools)
6059

6160
```mermaid
6261
flowchart TD
6362
A[aw task ...] --> B{remote-server?}
64-
B -- yes --> C[REST: POST /tasks]
65-
C --> D{agent on server or 3rd-party cloud?}
66-
D -- server --> E[Provision runtime + snapshot]
67-
D -- 3rd-party --> F[Call provider API (capability‑gated flags)]
68-
B -- no --> G{runtime}
69-
G -- devcontainer --> H[Devcontainer: mount snapshot workspace]
70-
G -- local --> I[Process sandbox profile]
71-
G -- unsandboxed --> J[Host process (policy‑gated)]
72-
H & I & J --> K[Run agent + record session]
63+
B -->|yes| C[REST POST /tasks]
64+
C --> D{agent runs where?}
65+
D -->|server| E[Provision runtime and snapshot]
66+
D -->|third party| F[Call provider API capability gated flags]
67+
B -->|no| G{runtime}
68+
G -->|devcontainer| H[Devcontainer mount snapshot workspace]
69+
G -->|local| I[Process sandbox profile]
70+
G -->|unsandboxed| J[Host process policy gated]
71+
H --> K[Run agent + record session]
72+
I --> K
73+
J --> K
7374
```
7475

7576
Behavior:
@@ -230,14 +231,7 @@ Mirrors `docs/configuration.md` including provenance, precedence, and Windows be
230231
- `aw webui [--bind (default=127.0.0.1)] [--port <P>] [--rest <URL>]`
231232
- Serves the WebUI for local use; in `--local` it binds to `127.0.0.1` and hides admin features.
232233

233-
#### 9) Utilities
234-
#### 10) Followers and Multi‑OS
235-
236-
- `aw followers list` — List configured follower hosts and tags (used for diagnostic purposes).
237-
- `aw followers sync-fence [--timeout <sec>] [--tag <k=v>]... [--host <name>]... [--all]` — Perform a synchronization fence, ensuring followers match the leader workspace state.
238-
- `aw run-everywhere [--tag <k=v>]... [--host <name>]... [--all] [--] <command> [args...]` — Invoke run‑everywhere on selected followers.
239-
240-
#### 11) Connectivity (Overlay/Relay)
234+
#### 9) Connectivity (Overlay/Relay)
241235

242236
- `aw connect keys [--provider netbird|tailscale|auto] [--tag <name>]...` — Request session connectivity credentials.
243237
- `aw connect handshake --session <id> [--hosts <list>] [--timeout <sec>]` — Initiate and wait for follower acks; prints per‑host status.
@@ -250,11 +244,13 @@ Mirrors `docs/configuration.md` including provenance, precedence, and Windows be
250244
- `aw doctor` — Environment diagnostics (snapshot providers, multiplexer availability, docker/devcontainer, git).
251245
- `aw completion [bash|zsh|fish|pwsh]` — Shell completions.
252246

253-
Agent-only utilities and startup performance:
254-
255-
- Subcommands used only in agent dev environments move under `aw agent ...` (e.g., the legacy `get-task` and `start-work` helpers, and the `followers` command). This keeps end‑user command space clean while still scriptable for agents.
256-
257-
TODO: You must update the document above, so it matches the intention here. `get-task` and `start-work` should be defined in the spec with their existing functionality and semantics. The `followers` command just need to be moved under the new `agent` sub-command section. Once this is done, you can remove the above bullet point.
247+
#### 10) Agent Utilities (`aw agent ...`)
248+
* Subcommands used only in agent dev environments live under `aw agent ...`. This keeps end‑user command space clean while still scriptable for agents.
249+
- `aw agent get-task` — Helper used by terminal‑style agents to fetch the next task payload (prompt, repo, settings) from the local state or configured REST service and print it as JSON. Honors the same `--remote-server` and `--repo` resolution as `aw task`.
250+
- `aw agent start-work` — Helper to mark the current task as started (transition status, open logs) and emit initial SessionMoment metadata so timeline recording aligns with agent startup. Prints the session id.
251+
- `aw agent followers list` — List configured follower hosts and tags (diagnostics; same data as `GET /api/v1/followers` when in REST mode).
252+
- `aw agent followers sync-fence [--timeout <sec>] [--tag <k=v>]... [--host <name>]... [--all]` — Perform a synchronization fence ensuring followers match the leader snapshot before execution; emits per‑host status.
253+
- `aw agent run-everywhere [--tag <k=v>]... [--host <name>]... [--all] [--] <command> [args...]` — Invoke run‑everywhere on selected followers.
258254

259255
### Subcommand Implementation Strategy
260256

@@ -268,7 +264,7 @@ Local enumeration and management of running sessions is backed by the canonical
268264

269265
Selection:
270266

271-
- `--multiplexer` flag or `terminal.multiplexer` config determines which tool is used. Autodetect if unset (tmux > zellij > screen if found in PATH).
267+
- `--multiplexer` flag or `terminal-multiplexer` config determines which tool is used. Autodetect if unset (tmux > zellij > screen if found in PATH).
272268

273269
Layout on launch:
274270

@@ -309,14 +305,22 @@ aw task \
309305
--instances 2
310306
```
311307

312-
TODO: This example is potentially confusing. The browser profile will be used only when the automation is enabled. The labels suggest codex is used, but this is not specified on the command-line with --agent codex
313-
314-
Specify a browser profile and disable automation explicitly:
308+
Specify Codex with automation enabled and a specific browser profile:
315309

316310
```bash
317311
aw task \
318312
--prompt "Kick off Codex" \
313+
--agent codex \
319314
--browser-profile work-codex \
315+
--browser-automation true
316+
```
317+
318+
Run without web automation (browser profile is ignored when automation is disabled):
319+
320+
```bash
321+
aw task \
322+
--prompt "Run without web automation" \
323+
--agent openhands \
320324
--browser-automation false
321325
```
322326

specs/Public/Configuration.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Paths are illustrative; the CLI prints the exact search order in `aw config --ex
3030

3131
Enterprise deployments may enforce specific keys at the System scope. Enforced values are read‑only to lower scopes. The CLI surfaces enforcement in `aw config get --explain <key>` output and prevents writes with a clear error. See the initial rationale in [Configuration](../Initial%20Developer%20Input/Configuration.md).
3232

33-
TODO: In other documents, there are still suggested options that don't match the convention below (for example, `ui.default`). Per this convention, the option can be named just `ui`, because this would read best on the command line `aw --ui web`. Look for other similar violations and fix them.
33+
Use a single key `ui` (not `ui.default`) to control the default UI.
3434

3535
### Mapping Rules (Flags ↔ Config ↔ ENV/JSON)
3636
To keep things mechanical and predictable:
@@ -44,16 +44,16 @@ Examples:
4444

4545
- Flag `--remote-server` ↔ TOML `remote-server` ↔ ENV `AGENTS_WORKFLOW_REMOTE_SERVER`
4646
- Per-server URLs are defined under `[[server]]` entries; `remote-server` may refer to a server `name` or be a raw URL.
47-
- Flag `--network-api-url` (rarely needed) maps to a specific server entry’s `url`.
47+
- WebUI-only: key `service-base-url` selects the REST base URL used by the browser client when the WebUI is hosted persistently at a fixed origin.
4848
- Flag `--task-runner` ↔ TOML `repo.task-runner` ↔ ENV `AGENTS_WORKFLOW_REPO_TASK_RUNNER`
4949

5050
### Keys
5151

52-
- ui.default: string — default UI to launch with bare `aw` (`"tui"` | `"webui"`).
53-
- browserAutomation.enabled: boolean — enable/disable site automation.
54-
- browserAutomation.profile: string — preferred agent browser profile name.
55-
- browserAutomation.chatgptUsername: string — optional default ChatGPT username used for profile discovery.
56-
- codex.workspace: string — default Codex workspace to select before pressing "Code".
52+
- ui: string — default UI to launch with bare `aw` (`"tui"` | `"webui"`).
53+
- browser-automation: boolean — enable/disable site automation.
54+
- browser-profile: string — preferred agent browser profile name.
55+
- chatgpt-username: string — optional default ChatGPT username used for profile discovery.
56+
- codex-workspace: string — default Codex workspace to select before pressing "Code".
5757
- remote-server: string — either a known server `name` (from `[[server]]`) or a raw URL. If set, AW uses REST; otherwise it uses local SQLite state.
5858

5959
### Behavior
@@ -142,29 +142,26 @@ type = "container" # predefined types with their own options
142142
Flags and mapping:
143143
- `--remote-server <NAME|URL>` selects a server (overrides `remote-server` in config).
144144
- `--fleet <NAME>` selects a fleet; default is the fleet named `default`.
145-
- Bare `aw` uses `ui.default` to decide between TUI and WebUI (defaults to `tui`).
145+
- Bare `aw` uses `ui` to decide between TUI and WebUI (defaults to `tui`).
146146

147147
### Example TOML (partial)
148148

149149
```toml
150-
logLevel = "info"
150+
log-level = "info"
151151

152-
[terminal]
153-
multiplexer = "tmux"
152+
terminal-multiplexer = "tmux"
154153

155-
[editor]
156-
default = "nvim"
154+
editor = "nvim"
157155

158-
[network]
159-
api-url = "https://deprecated.example.invalid" # prefer [[server]] + remote-server
156+
service-base-url = "https://aw.office-1.corp/api" # WebUI fetch base; browser calls this URL
160157

161-
[browserAutomation]
162-
enabled = true
163-
profile = "work-codex"
158+
# Browser automation (no subcommand section; single keys match CLI flags)
159+
browser-automation = true
160+
browser-profile = "work-codex"
164161
chatgpt-username = "[email protected]"
165162

166-
[codex]
167-
workspace = "main"
163+
# Codex workspace (single key)
164+
codex-workspace = "main"
168165

169166
[repo]
170167
supported-agents = "all" # or ["codex","claude","cursor"]
@@ -178,7 +175,7 @@ supported-agents = "all" # or ["codex","claude","cursor"]
178175
```
179176

180177
Notes:
181-
- `supported-agents` accepts "all" or an explicit array of agent names; the CLI may normalize this value internally.
178+
- `supportedAgents` accepts "all" or an explicit array of agent names; the CLI may normalize this value internally.
182179
- `devenv` accepts values like `nix`, `spack`, `bazel`, `none`/`no`, or `custom`.
183180

184181
ENV examples:

specs/Public/Multi-OS Testing.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ run-everywhere --host win-12 -- lint
103103

104104
### CLI Additions (high‑level)
105105

106-
- `aw followers list` — show followers and status.
107-
- `aw followers sync-fence [--timeout s] [--tag ... | --host ... | --all]`
108-
- `aw run-everywhere <action> [args...] [--tag ... | --host ... | --all]`
106+
- `aw agent followers list` — show followers and status.
107+
- `aw agent followers sync-fence [--timeout s] [--tag ... | --host ... | --all]`
108+
- `aw agent run-everywhere <action> [args...] [--tag ... | --host ... | --all]`
109109

110110
### Time‑Travel Integration
111111

@@ -137,4 +137,3 @@ See `docs/connectivity-layer.md` for overlay options (Tailscale/Headscale, NetBi
137137

138138
Fallback relay: If overlays are unavailable, the coordinator can act as a relay by subscribing to per-host SSE logs and forwarding messages (pub/sub) between leader and followers. This preserves basic run‑everywhere semantics at higher latency.
139139

140-

specs/Public/Schemas/config.schema.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,7 @@
3939
"UiDefault": { "type": "string", "enum": ["tui", "webui"] }
4040
},
4141
"properties": {
42-
"ui": {
43-
"type": "object",
44-
"additionalProperties": false,
45-
"properties": {
46-
"default": { "$ref": "#/$defs/UiDefault" }
47-
}
48-
},
42+
"ui": { "$ref": "#/$defs/UiDefault" },
4943
"tui": {
5044
"type": "object",
5145
"additionalProperties": false,

specs/Public/WebUI PRD.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ The WebUI provides a browser-based experience for creating, monitoring, and mana
176176
- Invocation: `webui --local [--port <port>]` (command name illustrative). In this mode:
177177
- Network binding: HTTP server listens on localhost only.
178178
- Auth and tenancy: No RBAC/tenants; implicit single user. Admin pages are hidden (Agents/Runtimes/Hosts/Settings for multi-tenant ops).
179-
- Config discovery: API base URL resolved from config key `network.apiUrl` or env `AGENTS_WORKFLOW_NETWORK_API_URL`; otherwise defaults to `http://127.0.0.1:<default-port>`.
179+
- Config discovery: API base URL resolved from config key `service-base-url` or env `AGENTS_WORKFLOW_SERVICE_BASE_URL`; otherwise defaults to `http://127.0.0.1:<default-port>`.
180+
- Intention: `service-base-url` is primarily for deployments hosting a persistent WebUI at a fixed URL (e.g., behind an ingress/LB) so the browser knows which REST origin to call. In local development, leave it unset and the WebUI will target localhost by default.
180181
- IDE integration: Unchanged; IDE launch helpers assume local filesystem access to the workspace mount.
181182
- Persistence: Uses browser local storage for UI preferences. No external DB required.
182183
- Security: No TLS in local mode; not intended for remote access.
@@ -187,4 +188,3 @@ The WebUI provides a browser-based experience for creating, monitoring, and mana
187188
- Hidden sections: Agents, Runtimes, Hosts, multi-tenant Settings.
188189
- Sessions, Create Task, and basic Settings (local) remain.
189190
- Delivery flows (PR/branch/patch) are available; features gated by what the local service advertises via `/api/v1/*` capability endpoints.
190-

0 commit comments

Comments
 (0)