@thebackstoryis/engineering-with-ai 0.3.1-beta.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/Docs/context-management-and-token-efficiency.md +1 -1
  2. package/Docs/maintainers/contributing.md +8 -0
  3. package/Docs/operations/dashboard-configuration.md +22 -0
  4. package/Docs/operations/installation-updating-and-entitlements.md +42 -4
  5. package/Docs/reference/capabilities-and-project-layout.md +11 -6
  6. package/Docs/reference/cli-and-configuration.md +32 -0
  7. package/README.md +22 -7
  8. package/config/autonomy.schema.json +76 -11
  9. package/config/project.schema.json +29 -1
  10. package/package.json +14 -4
  11. package/public/autonomy.js +10 -4
  12. package/public/coding-providers.js +72 -0
  13. package/public/grok-credentials.js +42 -0
  14. package/public/index.html +36 -1
  15. package/public/styles.css +25 -0
  16. package/skills-src/ewai-context/SKILL.md +1 -0
  17. package/skills-src/ewai-deliver/SKILL.md +3 -1
  18. package/skills-src/ewai-pipeline/SKILL.md +1 -0
  19. package/src/autonomy.mjs +1 -1
  20. package/src/cli.mjs +69 -9
  21. package/src/coding-providers.mjs +81 -0
  22. package/src/companion.mjs +19 -4
  23. package/src/config-document.mjs +49 -0
  24. package/src/dashboard-preferences.mjs +7 -48
  25. package/src/delivery.mjs +8 -2
  26. package/src/discovery.mjs +5 -4
  27. package/src/grok-credentials.mjs +95 -0
  28. package/src/install.mjs +10 -4
  29. package/src/project.mjs +10 -2
  30. package/src/runtime/afk-conductor.mjs +84 -18
  31. package/src/runtime/autonomy-supervisor.mjs +23 -5
  32. package/src/runtime/autonomy-workers.mjs +11 -2
  33. package/src/runtime/dashboard-actions.mjs +1 -1
  34. package/src/runtime/dashboard-server.mjs +29 -0
  35. package/src/runtime/grok-provider.mjs +269 -0
  36. package/src/runtime/mcp-config.mjs +34 -2
  37. package/src/runtime/mcp-server.mjs +6 -6
  38. package/src/runtime/provider-adapters.mjs +207 -31
  39. package/src/validation-config.mjs +18 -7
  40. package/templates/SPECS/pipeline.yaml +3 -0
@@ -8,7 +8,7 @@ Context preparation doesn't approve Build or Manual QA, accept risk, certify qua
8
8
 
9
9
  ## Concise answers and guided decisions
10
10
 
11
- **Availability:** This guidance is included in `0.3.1-beta.0`. Follow [beta installation](operations/installation-updating-and-entitlements.md#try-the-beta-channel), then initialise the project or run its normal EWAI check-in to refresh the managed instructions in `AGENTS.md` and `CLAUDE.md`. Start a fresh host conversation after the refresh. Project-authored guidance outside the managed block is preserved. npm `0.3.0` does not include these new instructions. Tool-result compaction remains planned, and no incremental token or cost saving has been measured for this update.
11
+ **Availability:** This guidance is included from `0.3.1`. [Update EWAI](operations/installation-updating-and-entitlements.md), then initialise the project or run its normal EWAI check-in to refresh the managed instructions in `AGENTS.md` and `CLAUDE.md`. Start a fresh host conversation after the refresh. Project-authored guidance outside the managed block is preserved. Versions `0.3.0` and earlier don't include these instructions. Tool-result compaction remains planned, and no incremental token or cost saving has been measured for this update.
12
12
 
13
13
  ### Get a useful short answer
14
14
 
@@ -14,6 +14,14 @@ npm run check
14
14
 
15
15
  Read the repository instructions and inspect your branch and uncommitted changes before editing. Keep test projects disposable and separate from active customer work. Don't install local changes over a global release as an incidental verification step.
16
16
 
17
+ ## Public development and release communication
18
+
19
+ Commit messages, pull-request discussions, GitHub comments and release notes are externally visible. Describe the product behaviour, scope and verified checks. Keep credentials, customer information, private deliberations, internal correspondence and conversation-only research out of those records. Review staged files and the exact public text before committing or publishing. Release notes must distinguish shipped capability from planned work and report limitations without claiming unobserved acceptance or savings.
20
+
21
+ ## Native provider changes
22
+
23
+ Bind unattended capability to the reviewed native CLI identity and verify coding, read-only review and restricted proposal modes separately. Grok fixtures use a synthetic loopback model and kernel confinement; they must never call paid model endpoints or load personal credentials. A passing fixture proves its boundary, not authentication, model quality or Manual QA. A version change requires renewed conformance evidence. Preserve default native model choice and stop when a requested restriction cannot be enforced.
24
+
17
25
  ## Development commands
18
26
 
19
27
  ```bash
@@ -2,6 +2,28 @@
2
2
 
3
3
  The dashboard starts with its everyday tools. Extra views are off by default, so you don't have to navigate portfolio management, policy controls or integration tools when your project doesn't need them.
4
4
 
5
+ ## Coding provider settings
6
+
7
+ Open **Configuration → Coding providers** to choose which coding CLIs EWAI uses. These settings govern host selection and AFK/autonomy dispatch; saving them does not start a delivery or approve execution.
8
+
9
+ Choose the primary coding provider, secondary and tertiary reviewers, and an eligible pool. **Existing behaviour** preserves normal host selection and checkpoint policy. **Choose automatically** creates a draft with automatic roles; it does not run anything or approve a grant. Required review capacity cannot be weakened, and reviewers must differ from the actual coding agent.
10
+
11
+ Leave optional model fields blank to let each CLI decide. A suggestion supplies advisory guidance without forcing a model. A permitted-model list is a strict boundary: unsupported enforcement stops invocation. The current adapters do not have verified permitted-list enforcement. Recommended: leave this list blank for native selection unless a verified adapter is available. This is not a token or spending cap, and no savings have been measured.
12
+
13
+ Use **Save provider settings** to apply the draft. **Cancel changes** restores the last saved policy in the form; **Restore existing behaviour** removes only the additive provider policy when saved. If another editor changes configuration, the draft is retained. Compare the latest settings, then explicitly keep the draft against those settings before saving again. That replaces the provider policy, while preserving other project configuration.
14
+
15
+ For automatic unattended work, save an eligible pool, then choose **Automatic from saved pool** in the autonomy controls. Preview and review the exact providers, intents, actions, expiry and limits before approving a grant. Selection uses only providers inside both the saved pool and approved grant that can perform the requested action and enforce any configured model restriction. Automatic roles skip ineligible providers; explicitly selected or inherited required providers stop instead of changing your choice. Changing settings invalidates the old grant: review a fresh one.
16
+
17
+ Installed CLI status does not prove authentication or unattended capability. Grok coding, review and proposal modes each run an offline conformance check before dispatch. See [Grok setup and limitations](installation-updating-and-entitlements.md#grok-build). A failed check stops the run; inspect its reason before retrying.
18
+
19
+ ## Grok Build credentials
20
+
21
+ Open **Configuration → Grok Build credentials** to enter an xAI API key in a password field, then choose **Check and save key**. This performs an authentication-only check and saves a key for your account on this computer, across EWAI projects. It does not start work or select a model. The owner-only local credential file is outside the project and is not encrypted.
22
+
23
+ The status distinguishes a saved key from `XAI_API_KEY` in the launching environment, which takes precedence. **Check connection** checks the active credential without generating output; it does not prove available credit or coding readiness. **Remove saved key** removes only EWAI's saved copy; it does not revoke the key or clear an environment override. **Cancel key entry** clears the input while retaining the previous saved key.
24
+
25
+ The password is cleared after every submission, including a failed check, and is never put in browser storage. Failed replacement retains the previous saved key. If a saved revision changed, refresh status before retrying. For storage, CLI alternatives and recovery, see [private Grok setup](installation-updating-and-entitlements.md#private-grok-key-setup-and-recovery).
26
+
5
27
  ## Show an extra view
6
28
 
7
29
  1. Open your project's dashboard.
@@ -6,7 +6,7 @@ This guide covers the harness installation. For a persona licence, use [Set up a
6
6
 
7
7
  ## Before you start
8
8
 
9
- You'll need Node.js 22.5 or newer, npm, Git for project version control, and a supported host: Codex, Claude Code or Google Antigravity's `agy` CLI. Technology packs can have further requirements.
9
+ You'll need Node.js 22.5 or newer, npm, Git for project version control, and a supported host: Codex, Claude Code, Google Antigravity's `agy` CLI or Grok Build. Technology packs can have further requirements.
10
10
 
11
11
  EWAI includes its own parsers. Don't add Tree-sitter dependencies to your application just to use the harness.
12
12
 
@@ -20,7 +20,7 @@ ewai install --host auto
20
20
  ewai
21
21
  ```
22
22
 
23
- The installation command makes the host skills and MCP connection available. You can choose one host explicitly with `--host codex`, `--host claude` or `--host antigravity`.
23
+ The installation command makes the host skills and MCP connection available. You can choose one host explicitly with `--host codex`, `--host claude`, `--host antigravity` or `--host grok`. For Grok Build, see [Grok Build](#grok-build) for authentication and unattended worker setup.
24
24
 
25
25
  If npm returns `E404`, check the exact package name and configured registry first. That response alone doesn't tell you whether the package is unpublished, unavailable to your account or missing its requested version. If the intended package still isn't available, contact the publisher; don't install a similarly named package as a substitute.
26
26
 
@@ -48,7 +48,7 @@ This asks npm to obtain and run the package. It doesn't create a standing global
48
48
 
49
49
  ## Try the beta channel
50
50
 
51
- The beta channel is an opt-in prerelease. Version `0.3.1-beta.0` adds [concise answers and guided decisions](../context-management-and-token-efficiency.md#concise-answers-and-guided-decisions); production remains `0.3.0`.
51
+ The beta channel is an opt-in prerelease for trying changes before they reach production. Check what each channel currently points to with `npm view @thebackstoryis/engineering-with-ai dist-tags`.
52
52
 
53
53
  For one project:
54
54
 
@@ -57,7 +57,7 @@ npm install --save-dev @thebackstoryis/engineering-with-ai@beta
57
57
  npx ewai
58
58
  ```
59
59
 
60
- To pin this specific beta instead of following the beta channel, replace `@beta` with `@0.3.1-beta.0`. For a global beta installation, use `npm install --global @thebackstoryis/engineering-with-ai@beta`, then start EWAI in your project folder.
60
+ To pin a specific beta instead of following the beta channel, replace `@beta` with that exact version, for example `@0.3.1-beta.0`. For a global beta installation, use `npm install --global @thebackstoryis/engineering-with-ai@beta`, then start EWAI in your project folder.
61
61
 
62
62
  Initialisation or normal check-in refreshes the EWAI-managed block in `AGENTS.md` and `CLAUDE.md`. Guidance outside that block is preserved. In an existing project, you can refresh explicitly with `npx ewai checkin --project . --json` for a project dependency, or `ewai checkin --project . --json` for a global installation. Start a fresh host conversation after refreshing so it reads the new instructions. Review changes to your project's package, lockfile and instruction files before committing them.
63
63
 
@@ -125,9 +125,47 @@ Check-in can start or reuse the dashboard, refresh derived state and check the p
125
125
  | Codex | `.agents/skills/` | `.codex/config.toml` |
126
126
  | Claude Code | `.claude/skills/` | `.mcp.json` |
127
127
  | Google Antigravity | `.agents/skills/` | `.agents/mcp_config.json` |
128
+ | Grok Build | `.grok/skills/` | `.grok/config.toml` |
128
129
 
129
130
  EWAI merges its entries with unrelated host configuration. Don't replace the entire file to update one entry. After an update, check that your other MCP servers are still present.
130
131
 
132
+ From `0.3.1`, `EWAI_HOST=grok ewai` opens the native Grok companion without a model override. Install and authenticate the CLI through the [official Grok Build instructions](https://docs.x.ai/build/overview). CLI installation alone does not prove account access or project trust.
133
+
134
+ For explicitly selected global skill installation, EWAI respects `GROK_HOME`; project installation uses `.grok/skills/`. Malformed, conflicting or unsafe TOML configuration stops MCP setup without rewriting that file. Resolve the reported configuration issue and retry; keep other MCP entries.
135
+
136
+ ### Grok Build
137
+
138
+ 1. Install and authenticate Grok Build using its official instructions. For isolated unattended workers, the supported identity is `grok 1.0.44 (5b807183dd79) [stable]` on macOS. Other identities stop until their conformance contract is reviewed.
139
+ 2. Enable Grok with `ewai validation set grok available --enabled --project .`. For a new project, `ewai init --grok` records the same explicit availability choice.
140
+ 3. Choose providers in **Configuration → Coding providers**, or use `ewai providers set --primary grok --secondary codex --tertiary claude --pool grok,codex,claude --project .`. Enable and authenticate the selected reviewers too. Leave model fields blank for native selection.
141
+ 4. Before unattended work, open **Configuration → Grok Build credentials** and use **Check and save key**, or run `ewai providers credentials grok configure` in an interactive terminal for hidden input. The key is saved for your account on this computer, outside the project, in an owner-only local file. `XAI_API_KEY` in the launching environment takes precedence. Interactive OAuth sessions can still use the native companion; isolated workers do not copy your personal authentication files. Never put keys in project YAML, command arguments, chat, commits or release notes.
142
+ 5. Run the usual AFK preflight or preview and approve an autonomy grant. Full automatic selection stays inside the approved scope and preserves Build approval, required review and Manual QA checkpoints.
143
+
144
+ Grok coding, review and restricted proposal modes each verify the installed binary and their own offline confinement contract. The worker has a fresh private home and no inherited project instructions, hooks, skills, MCP servers or personal model configuration. EWAI supplies approved task context; Grok retains native model choice without a model override. Its bounded session-title metadata request is separate from the coding/proposal tools. Offline conformance makes no paid model requests and does not prove your account access or the quality of a real response.
145
+
146
+ Coding copies declared task files into a disposable workspace. The worker may edit only that copy; EWAI checks scope, unchanged source predecessors and current authority before accepting changes. Review is read-only. EWAI's conductor runs approved commands and owns commits and integration. Snapshots accept regular files only, up to 900 KB per file, 256 files and 16 MiB overall. Root-wide globs and copied CLI/credential configuration are unsupported: narrow the task's file sets instead.
147
+
148
+ For coding and review, the conductor includes the complete cited standards and recorded check outputs in mandatory task context. Review also receives the exact implementation commit diff. Git history and canonical SPECS remain outside the worker's filesystem. Evidence is bound to its task, source contents and revision, then checked again before dispatch and acceptance. Missing, changed or oversized evidence stops the run; restore the required evidence or narrow the approved task and prepare fresh context. Mandatory evidence is never silently truncated to fit a prompt.
149
+
150
+ If a version, isolation check, unsupported system configuration, credential or model restriction blocks the run, inspect the recorded reason. Recommended: use the supported CLI identity, configure the private key, or remove an unsupported permitted-model restriction for native selection, as applicable, then repeat preflight. If source files changed, prepare a fresh task snapshot. Preserve partial edits and uncertain execution for recovery; do not blindly retry. No model setting is a token or spending cap.
151
+
152
+ #### Private Grok key setup and recovery
153
+
154
+ ```bash
155
+ ewai providers credentials grok configure
156
+ ewai providers credentials grok status --json
157
+ ewai providers credentials grok check
158
+ ewai providers credentials grok remove --yes
159
+ ```
160
+
161
+ Configure requires a real interactive terminal; keys cannot be passed through flags or input files. The local dashboard password form is the alternative. Both routes share validation and recovery. Submitting a key authenticates against xAI's [model-list endpoint](https://docs.x.ai/developers/rest-api-reference/inference/models) without requesting generated output. Success proves that endpoint accepted the key, not available credit, permission to every model, or coding readiness. The check does not select a model or start a delivery.
162
+
163
+ On supported POSIX systems, explicit setup stores plaintext in `~/.ewai/credentials/grok.json` with owner-only file permissions (`0600`) in a private directory (`0700`). It is not encrypted or an OS keychain; processes running as your account can read it. The key applies across EWAI projects for that account. EWAI rejects insecure permissions, links, shared files and storage inside the project. On Windows, use a privately supplied launching environment; this file-storage route is unavailable.
164
+
165
+ Status shows only the credential source and whether a saved key exists. It never returns the key. Connection checks run only when explicitly requested. Failed or stale replacement keeps the previous saved key; refresh status, correct the problem and submit again. The dashboard clears the password after success, failure or cancellation and does not store it in browser storage. Removing a saved key does not revoke it at xAI, and does not clear an environment override. Remove `XAI_API_KEY` from the launching environment and restart EWAI if you want the saved key to become active. Use xAI's own account controls to revoke a key.
166
+
167
+ Saved keys are resolved at each isolated-worker invocation. The worker receives only the credential in its private environment; no personal authentication/configuration files are copied. Native model selection and conformance requirements remain unchanged.
168
+
131
169
  ## Premium personas
132
170
 
133
171
  Enter your licence through **Configuration → Premium personas → Manage licence** in the dashboard, or use the hidden terminal prompt:
@@ -73,11 +73,12 @@ project/
73
73
 
74
74
  Initialisation preserves existing files unless `--force` is explicitly supplied.
75
75
 
76
- It also safely merges project MCP entries for the three supported hosts:
76
+ It also safely merges project MCP entries for the supported hosts:
77
77
 
78
78
  ```text
79
79
  .mcp.json Claude Code
80
80
  .codex/config.toml Codex
81
+ .grok/config.toml Grok Build
81
82
  .agents/mcp_config.json Google Antigravity / AGY CLI
82
83
  ```
83
84
 
@@ -85,7 +86,11 @@ Each host launches the same project-bound `ewai mcp --project .` stdio server. E
85
86
 
86
87
  Before creating EWAI artefacts, initialization checks for existing source files, manifests, and project definitions. The conversational companion first captures a human project briefing, then optionally asks whether the user has a folder of emails, meeting transcripts, documentation, research, requirements, or other project material that could enrich the project. For an existing codebase, EWAI offers optional Archaeology. If the owner accepts, it compares the confirmed purpose and reviewed imported context with repository evidence before deeper reconstruction. A fresh project uses the same context to make discovery more specific.
87
88
 
88
- `--claude`, `--codex`, and `--antigravity` record validation CLIs that the user has explicitly confirmed are available and initially enabled. Antigravity access uses the `agy` executable. These flags do not install or authenticate those services. At delivery time EWAI excludes the active orchestrator from the independent reviewer set.
89
+ `--claude`, `--codex`, `--grok`, and `--antigravity` record validation CLIs that the user has explicitly confirmed are available and initially enabled. Antigravity access uses the `agy` executable. These flags do not install or authenticate those services. At delivery time EWAI excludes the active orchestrator from the independent reviewer set.
90
+
91
+ ## Coding provider and model preferences
92
+
93
+ Choose a primary coding CLI and distinct secondary/tertiary reviewers in the dashboard or through `ewai providers`. Without this optional policy, existing selection and native models remain unchanged. Suggestions are advisory; unsupported permitted-model restrictions stop invocation. Automatic selection remains inside configured and approved provider pools and does not bypass human checkpoints. Grok unattended modes require their separately verified native identity and private environment authentication. See [provider controls](cli-and-configuration.md#coding-provider-settings) and [Grok setup](../operations/installation-updating-and-entitlements.md#grok-build).
89
94
 
90
95
  ## Enrich a project from supplied context
91
96
 
@@ -259,7 +264,7 @@ ewai validation checkpoint implementation-plan --cycles 2 \
259
264
 
260
265
  Availability records what the project can access; `enabled` records what the project chooses to spend. Each implementation-plan, test-plan, and code checkpoint independently controls its reviewers, maximum review/fix cycles, breadth, analysis depth, and output size. The active orchestrator is excluded from independent validation. Unsupported stages remain visible in delivery state and must not be marked passed.
261
266
 
262
- The EWAI method is provider-neutral. One capable AI can run the workflow without pretending self-review is independent; additional Claude CLI, Codex CLI, or Antigravity (`agy`) systems can provide independent perspectives where available and proportionate. Standards compliance is always required, even when no external validator is configured.
267
+ The EWAI method is provider-neutral. One capable AI can run the workflow without pretending self-review is independent; additional Claude CLI, Codex CLI, Grok Build, or Antigravity (`agy`) systems can provide independent perspectives where available and proportionate. Standards compliance is always required, even when no external validator is configured.
263
268
 
264
269
  ## Create an intent
265
270
 
@@ -453,7 +458,7 @@ ewai afk resume <run-id>
453
458
  ewai afk cancel <run-id>
454
459
  ```
455
460
 
456
- Each task runs on a real task branch in an isolated Git worktree using an enabled local Claude, Codex, or Antigravity CLI. Concurrency never exceeds the validated task graph. Workers cannot own central delivery state or merges; the conductor enforces write sets, captures structured evidence, obtains a fresh-context review, merges in declared order, and runs post-merge verification before committing. Runtime state and raw provider logs live under ignored `.ewai-pipeline/afk/`; task reports and hashed evidence remain under `6.Build/<slug>/tasks/` in the configured SPECS repository.
461
+ Each task runs on a real task branch in an isolated Git worktree using an enabled local Claude, Codex, Grok Build, or Antigravity CLI. Concurrency never exceeds the validated task graph. Workers cannot own central delivery state or merges; the conductor enforces write sets, captures structured evidence, obtains a fresh-context review, merges in declared order, and runs post-merge verification before committing. Runtime state and raw provider logs live under ignored `.ewai-pipeline/afk/`; task reports and hashed evidence remain under `6.Build/<slug>/tasks/` in the configured SPECS repository.
457
462
 
458
463
  AFK detects topology from the configured `pipeline.yaml`. A simple project maps tasks to its single repository. A multi-repository project maps each task's `repo` to a named configured repository, creates and integrates its task branch there, and commits canonical evidence in the repository containing the configured SPECS root. The workspace itself does not need to be a Git repository. `task-graph.json.repository_branches` can declare different integration branches per repository; its scalar `parent_branch` remains the backwards-compatible default. When a declared integration branch does not exist, `afk start` creates it from that repository's clean current branch. Preflight blocks missing mappings, ambiguous SPECS ownership, nested non-root repository paths, dirty repositories, detached heads, or drift from an integration branch that already exists instead of guessing. A completed AFK run means eligible Build tasks were integrated; the canonical Build gate, Standards Sweep, Test Execute, external code validation, Delivery, Manual QA, and Retro still run normally.
459
464
 
@@ -497,7 +502,7 @@ Without existing work, [6] is absent. With available premium access and a verifi
497
502
 
498
503
  Conversational actions use the same guarded project-local operations as the dashboard and optional commands. Before moving work forward, EWAI checks the current stage, required documents, evidence, approvals, tests and configured external validators, then explains the proposed next step.
499
504
 
500
- Running `ewai` refreshes the selected host's managed EWAI skills and launches the conversational companion in an available Claude Code, Codex or Google Antigravity host. Initialization adds a small managed instruction block so directly opened agent sessions use the same check-in. The lower-level commands remain available for scripts and integrations; you don't need to learn them to work conversationally.
505
+ Running `ewai` refreshes the selected host's managed EWAI skills and launches the conversational companion in an available Claude Code, Codex, Grok Build or Google Antigravity host. Initialization adds a small managed instruction block so directly opened agent sessions use the same check-in. The lower-level commands remain available for scripts and integrations; you don't need to learn them to work conversationally.
501
506
 
502
507
  ## Technology and stack packs
503
508
 
@@ -614,7 +619,7 @@ If check-in confirms unavailable premium access and no installed premium pack, t
614
619
 
615
620
  ### MCP access
616
621
 
617
- The MCP server uses stdio and is started by Codex, Claude Code, or Antigravity from the project configuration written during initialization. It exposes intent and work-item reads, guarded intent creation, operational updates, phase and material registration, runtime status, and active-work events. It does not require the HTTP dashboard to be running.
622
+ The MCP server uses stdio and is started by Codex, Claude Code, Grok Build, or Antigravity from the project configuration written during initialization. It exposes intent and work-item reads, guarded intent creation, operational updates, phase and material registration, runtime status, and active-work events. It does not require the HTTP dashboard to be running.
618
623
 
619
624
  ### Current runtime scope
620
625
 
@@ -230,6 +230,38 @@ These commands support a prepared Archaeology bundle. The human purpose briefing
230
230
 
231
231
  Technology and hosting preparation requires a fresh Repository Source Map and a valid, user-reviewed persona-routing gate. It writes an evidence briefing and answer template into the bundle. Recording distinguishes repository-observed, owner-declared and individually human-confirmed claims; it does not rewrite canonical stack strategy. Status reports drift without refreshing or mutating the index. See [Archaeology technology and hosting discovery](../archaeology-technology-and-hosting-discovery.md).
232
232
 
233
+ ## Coding provider settings
234
+
235
+ Available from `0.3.1`. CLI and dashboard share the same provider policy. A successful save changes preferences; it does not authorise execution.
236
+
237
+ ```bash
238
+ ewai providers show --project . --json
239
+ ewai providers set --primary grok --secondary codex --tertiary claude --pool grok,codex,claude --project .
240
+ ewai providers auto --pool claude,codex,grok --project .
241
+ ewai providers model grok --suggest <exact-model-id> --project .
242
+ ewai providers model grok --allow-model <exact-model-id> --project .
243
+ ewai providers model grok --clear-suggestion --clear-restriction --project .
244
+ ewai providers defaults --project .
245
+ ```
246
+
247
+ `set` also accepts a complete policy JSON file through `--input <file>`. `--expected-digest <digest>` guards against stale writes. Without that argument, the CLI compares the configuration it just read before saving. Dashboard and CLI use the same validator and atomic settings writer.
248
+
249
+ The optional `coding_providers` section has an ordered, distinct `pool`; `primary` (`existing`, `auto` or a provider); `secondary`/`tertiary` (also allowing `off`); and per-provider `models` with optional `suggestion` and exact `permitted_models`. Providers are `claude`, `codex`, `grok` and `antigravity`. No executable paths, flags, credentials, wildcard IDs or inferred model ranking are accepted. The absent section preserves existing behaviour; `defaults` removes only this section.
250
+
251
+ Native model choice is the default. Suggestions are advisory. Permitted-model lists prevent a provider from running where enforcement is unverified; they do not cap tokens or spending. All current adapters lack verified permitted-list enforcement. Automatic roles skip a provider with such a restriction and select an eligible alternative; explicitly selected or inherited required providers stop. If none remain, EWAI explains the unsupported restriction. Recommended: leave it blank unless an enforcing adapter becomes available.
252
+
253
+ Enable installed providers separately with `ewai validation set <provider> available --enabled --project .`. `ewai providers auto --pool codex,claude,grok --project .` sets automatic coding and review roles; the pool needs enough available, independent providers to satisfy those roles and required checkpoints. Automatic does not mean that missing reviewers are skipped. `existing` retains inherited selection; `off` cannot reduce required review capacity. An explicit AFK `--provider` conflicting with a saved explicit primary stops preflight: update the settings or use `--provider auto`.
254
+
255
+ For unattended Build, run `ewai afk preflight <slug> --provider auto --project .` after canonical Build approval. Autonomy's `--provider auto` selects inside the intersection of saved settings, installed/configured capabilities and the approved grant. The dashboard previews the exact saved pool before grant approval. A settings or CLI-identity change stops stale dispatch/results and requires a fresh check; changing settings also requires a new autonomy grant. Full auto preserves all human checkpoints.
256
+
257
+ Grok supports interactive launch, skills and MCP setup, plus separately checked coding, read-only review and restricted proposal modes. Availability of the CLI does not prove mode capability or authentication. See [Grok worker setup](../operations/installation-updating-and-entitlements.md#grok-build) for the supported version, private credentials, snapshot bounds and recovery.
258
+
259
+ ### Grok credentials
260
+
261
+ `ewai providers credentials grok configure` uses a hidden interactive terminal prompt, authenticates the submitted key without requesting generated output, and saves it outside the project for the current account. Noninteractive setup and key arguments are rejected; use the local dashboard password form instead.
262
+
263
+ `ewai providers credentials grok status --json` returns safe source/presence/revision metadata. `check` explicitly authenticates the active credential. `remove --yes` removes only the saved copy; optional `--expected-revision` protects a previously inspected revision. Failed or stale replacement preserves the predecessor. `XAI_API_KEY` overrides saved credentials. Keys are never project YAML or provider-policy fields, and connection checks do not grant execution authority. See [storage and recovery](../operations/installation-updating-and-entitlements.md#private-grok-key-setup-and-recovery).
264
+
233
265
  ## Validation configuration
234
266
 
235
267
  ```bash
package/README.md CHANGED
@@ -2,20 +2,33 @@
2
2
 
3
3
  Engineering With AI (EWAI) helps you plan, build and review software with an AI assistant. It gives the assistant a shared record of the project, a delivery workflow and checks against your engineering standards. You keep control of the decisions and approve implementation before it starts.
4
4
 
5
- ## Beta: concise answers and useful decision guidance
5
+ [![Intent Studio in the EWAI dashboard: describing a feature, agreeing its acceptance criteria and engaging specialist personas before any code is written](https://www.conversationalcoding.dev/wp-content/uploads/sites/5/2026/09/intent-studio-full-be7758ffd224-1536x704.webp)](https://www.conversationalcoding.dev/engineering-with-ai-harness/?utm_source=readme&utm_medium=referral&utm_campaign=ewai)
6
6
 
7
- Version `0.3.1-beta.0` adds communication guidance that prioritises correctness and usefulness, then brevity. Decision requests include action details, supporting guidance, a recommendation with its reason and a suggested response when useful. Query refinement leads with a recommended interpretation and explains consequential assumptions.
7
+ **Website, guides and books:** [conversationalcoding.dev](https://www.conversationalcoding.dev/engineering-with-ai-harness/?utm_source=readme&utm_medium=referral&utm_campaign=ewai) · [Online documentation](https://www.conversationalcoding.dev/engineering-with-ai-harness/docs/?utm_source=readme&utm_medium=referral&utm_campaign=ewai) · [Persona library](https://www.conversationalcoding.dev/personas/?utm_source=readme&utm_medium=referral&utm_campaign=ewai)
8
8
 
9
- To try this beta in one project:
9
+ ## Quick start
10
+
11
+ EWAI is free and works with Claude Code, Codex, Google Antigravity and Grok Build. You'll need Node.js 22.5 or newer and one of those assistants, installed and signed in.
10
12
 
11
13
  ```bash
12
- npm install --save-dev @thebackstoryis/engineering-with-ai@beta
13
- npx ewai
14
+ npm install --global @thebackstoryis/engineering-with-ai
15
+ cd /path/to/your/project
16
+ ewai
14
17
  ```
15
18
 
16
- Initialisation or the next check-in refreshes EWAI's managed instructions in `AGENTS.md` and `CLAUDE.md`, preserving project-authored guidance outside that block. Start a fresh host conversation after the refresh. See [the user guide](Docs/context-management-and-token-efficiency.md#concise-answers-and-guided-decisions) for examples and [beta installation and recovery](Docs/operations/installation-updating-and-entitlements.md#try-the-beta-channel) for other installation choices.
19
+ `ewai` opens your assistant and walks you through setting up the project. See [Install and start](#install-and-start) for details.
20
+
21
+ Version `0.3.2` updates the package's links and documentation. The features below arrived in `0.3.1`.
22
+
23
+ ## New in 0.3.1: concise answers and Grok Build
24
+
25
+ Version `0.3.1` makes EWAI's guidance more concise and adds Grok Build as a coding provider.
26
+
27
+ **Concise answers and guided decisions.** EWAI's managed instructions now prioritise correctness and usefulness, then brevity. Expect the result or recommendation first, with less repetition and routine narration. Decision requests explain the action, options and consequences, then give a recommendation with its reason and a suggested response when useful. When a request is unclear, EWAI leads with its recommended interpretation and states the assumptions that matter. The guidance is designed to cut unnecessary output; tool-result compaction is still planned, and token or cost savings haven't been measured yet. See [concise answers and guided decisions](Docs/context-management-and-token-efficiency.md#concise-answers-and-guided-decisions).
28
+
29
+ **Grok Build and coding provider settings.** EWAI can open Grok Build as a native companion, install its skills and set up project MCP. **Configuration → Coding providers** in the dashboard, or `ewai providers` in a terminal, lets you choose a primary coding CLI, independent reviewers and an eligible pool for unattended work. Each CLI keeps its own model choice by default. Grok can run isolated coding, read-only review and restricted proposal workers. Each mode passes an offline conformance check before dispatch, and your xAI key is saved privately outside the project. Build approval, required review and Manual QA stay with you. See [provider settings](Docs/reference/cli-and-configuration.md#coding-provider-settings) and [Grok Build setup](Docs/operations/installation-updating-and-entitlements.md#grok-build).
17
30
 
18
- This beta adds communication instructions and documentation. Tool-result compaction remains planned, and incremental token or cost savings have not been measured. Mandatory workflow and human approvals still apply. The production npm channel remains on `0.3.0`.
31
+ After updating, initialisation or the next check-in refreshes EWAI's managed instructions in `AGENTS.md` and `CLAUDE.md`, preserving project-authored guidance outside that block. Start a fresh host conversation after the refresh.
19
32
 
20
33
  ## EWAI can now pick up the next ready piece of work
21
34
 
@@ -122,6 +135,8 @@ Premium personas are optional specialist perspectives. If you have a subscriptio
122
135
  - [Capabilities and project layout](Docs/reference/capabilities-and-project-layout.md)
123
136
  - [Commands and configuration](Docs/reference/cli-and-configuration.md)
124
137
  - [Troubleshooting and recovery](Docs/operations/troubleshooting-and-recovery.md)
138
+ - [EWAI on the web: harness overview, online docs and changelog](https://www.conversationalcoding.dev/engineering-with-ai-harness/?utm_source=readme&utm_medium=referral&utm_campaign=ewai)
139
+ - [Engineering With AI, the book behind the method](https://www.conversationalcoding.dev/books/?utm_source=readme&utm_medium=referral&utm_campaign=ewai)
125
140
 
126
141
  ## Contributing to EWAI
127
142
 
@@ -4,20 +4,85 @@
4
4
  "title": "Explicit autonomous intent delegation scope",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
- "required": ["intentIds", "actions", "providers", "expiresAt", "limits"],
7
+ "required": [
8
+ "intentIds",
9
+ "actions",
10
+ "providers",
11
+ "expiresAt",
12
+ "limits"
13
+ ],
8
14
  "properties": {
9
- "intentIds": { "type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": { "type": "string", "maxLength": 160, "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*/[a-z0-9]+(?:-[a-z0-9]+)*$" } },
10
- "actions": { "type": "array", "minItems": 1, "maxItems": 3, "uniqueItems": true, "items": { "enum": ["begin-harness", "prepare-phase", "afk-build"] } },
11
- "providers": { "type": "array", "minItems": 1, "maxItems": 3, "uniqueItems": true, "items": { "enum": ["codex", "claude", "antigravity"] } },
12
- "expiresAt": { "type": "string", "format": "date-time", "pattern": "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d{3}Z$" },
15
+ "intentIds": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "maxItems": 100,
19
+ "uniqueItems": true,
20
+ "items": {
21
+ "type": "string",
22
+ "maxLength": 160,
23
+ "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*/[a-z0-9]+(?:-[a-z0-9]+)*$"
24
+ }
25
+ },
26
+ "actions": {
27
+ "type": "array",
28
+ "minItems": 1,
29
+ "maxItems": 3,
30
+ "uniqueItems": true,
31
+ "items": {
32
+ "enum": [
33
+ "begin-harness",
34
+ "prepare-phase",
35
+ "afk-build"
36
+ ]
37
+ }
38
+ },
39
+ "providers": {
40
+ "type": "array",
41
+ "minItems": 1,
42
+ "maxItems": 4,
43
+ "uniqueItems": true,
44
+ "items": {
45
+ "enum": [
46
+ "codex",
47
+ "claude",
48
+ "antigravity",
49
+ "grok"
50
+ ]
51
+ }
52
+ },
53
+ "expiresAt": {
54
+ "type": "string",
55
+ "format": "date-time",
56
+ "pattern": "^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d{3}Z$"
57
+ },
13
58
  "limits": {
14
- "type": "object", "additionalProperties": false,
15
- "required": ["maxConcurrentIntents", "maxRuntimeMs", "maxOperationMs", "maxAttempts"],
59
+ "type": "object",
60
+ "additionalProperties": false,
61
+ "required": [
62
+ "maxConcurrentIntents",
63
+ "maxRuntimeMs",
64
+ "maxOperationMs",
65
+ "maxAttempts"
66
+ ],
16
67
  "properties": {
17
- "maxConcurrentIntents": { "const": 1 },
18
- "maxRuntimeMs": { "type": "integer", "minimum": 1, "maximum": 86400000 },
19
- "maxOperationMs": { "type": "integer", "minimum": 1, "maximum": 86400000 },
20
- "maxAttempts": { "type": "integer", "minimum": 1, "maximum": 100 }
68
+ "maxConcurrentIntents": {
69
+ "const": 1
70
+ },
71
+ "maxRuntimeMs": {
72
+ "type": "integer",
73
+ "minimum": 1,
74
+ "maximum": 86400000
75
+ },
76
+ "maxOperationMs": {
77
+ "type": "integer",
78
+ "minimum": 1,
79
+ "maximum": 86400000
80
+ },
81
+ "maxAttempts": {
82
+ "type": "integer",
83
+ "minimum": 1,
84
+ "maximum": 100
85
+ }
21
86
  },
22
87
  "$comment": "The domain additionally requires maxOperationMs <= maxRuntimeMs. No hard money or token cap is promised."
23
88
  }
@@ -5,6 +5,24 @@
5
5
  "required": ["schema", "project", "specs", "repositories", "approvals", "validation"],
6
6
  "properties": {
7
7
  "schema": { "const": "ewai.project/v1" },
8
+ "coding_providers": {
9
+ "type": "object", "additionalProperties": false,
10
+ "properties": {
11
+ "pool": { "type": "array", "minItems": 1, "maxItems": 4, "uniqueItems": true, "items": { "enum": ["claude", "codex", "grok", "antigravity"] } },
12
+ "primary": { "enum": ["existing", "auto", "claude", "codex", "grok", "antigravity"] },
13
+ "secondary": { "enum": ["existing", "auto", "off", "claude", "codex", "grok", "antigravity"] },
14
+ "tertiary": { "enum": ["existing", "auto", "off", "claude", "codex", "grok", "antigravity"] },
15
+ "models": {
16
+ "type": "object", "additionalProperties": false,
17
+ "properties": {
18
+ "claude": { "$ref": "#/$defs/codingModelPolicy" },
19
+ "codex": { "$ref": "#/$defs/codingModelPolicy" },
20
+ "grok": { "$ref": "#/$defs/codingModelPolicy" },
21
+ "antigravity": { "$ref": "#/$defs/codingModelPolicy" }
22
+ }
23
+ }
24
+ }
25
+ },
8
26
  "dashboard": {
9
27
  "type": "object",
10
28
  "additionalProperties": false,
@@ -165,6 +183,7 @@
165
183
  "properties": {
166
184
  "claude": { "$ref": "#/$defs/provider" },
167
185
  "codex": { "$ref": "#/$defs/provider" },
186
+ "grok": { "$ref": "#/$defs/provider" },
168
187
  "antigravity": { "$ref": "#/$defs/provider" }
169
188
  },
170
189
  "additionalProperties": false
@@ -284,7 +303,7 @@
284
303
  {
285
304
  "type": "array",
286
305
  "uniqueItems": true,
287
- "items": { "enum": ["claude", "codex", "antigravity"] }
306
+ "items": { "enum": ["claude", "codex", "antigravity", "grok"] }
288
307
  }
289
308
  ]
290
309
  },
@@ -308,6 +327,15 @@
308
327
  }
309
328
  },
310
329
  "additionalProperties": false
330
+ },
331
+ "codingModelPolicy": {
332
+ "type": "object", "additionalProperties": false,
333
+ "properties": {
334
+ "suggestion": { "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$" },
335
+ "permitted_models": { "type": "array", "minItems": 1, "maxItems": 64, "uniqueItems": true,
336
+ "items": { "type": "string", "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._:/+-]{0,127}$" }
337
+ }
338
+ }
311
339
  }
312
340
  }
313
341
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thebackstoryis/engineering-with-ai",
3
- "version": "0.3.1-beta.0",
3
+ "version": "0.3.2",
4
4
  "description": "A human-centred, AI-augmented engineering pipeline",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "The Backstory Is",
@@ -10,13 +10,22 @@
10
10
  "specifications",
11
11
  "delivery-pipeline",
12
12
  "personas",
13
- "mcp"
13
+ "mcp",
14
+ "ai-coding",
15
+ "claude-code",
16
+ "codex",
17
+ "grok",
18
+ "ai-agents",
19
+ "code-review",
20
+ "developer-tools",
21
+ "spec-driven-development",
22
+ "cli"
14
23
  ],
15
24
  "repository": {
16
25
  "type": "git",
17
26
  "url": "git+https://github.com/TheBackstoryIs/EngineeringWithAIHarness.git"
18
27
  },
19
- "homepage": "https://github.com/TheBackstoryIs/EngineeringWithAIHarness#readme",
28
+ "homepage": "https://www.conversationalcoding.dev/engineering-with-ai-harness/?utm_source=npm&utm_medium=referral&utm_campaign=ewai",
20
29
  "bugs": {
21
30
  "url": "https://github.com/TheBackstoryIs/EngineeringWithAIHarness/issues"
22
31
  },
@@ -50,7 +59,7 @@
50
59
  },
51
60
  "scripts": {
52
61
  "build": "npm run check",
53
- "precheck": "node scripts/publication-check.mjs --source-only && node --check src/runtime/tree-sitter-index.mjs && node --check src/design-system-application.mjs && node --check src/team-hub-resources.mjs && node --check src/dashboard-preferences.mjs && node --check public/dashboard-navigation.js",
62
+ "precheck": "node scripts/publication-check.mjs --source-only && node --check src/runtime/tree-sitter-index.mjs && node --check src/design-system-application.mjs && node --check src/team-hub-resources.mjs && node --check src/dashboard-preferences.mjs && node --check public/dashboard-navigation.js && node --check src/config-document.mjs && node --check src/coding-providers.mjs && node --check src/runtime/grok-provider.mjs && node --check public/coding-providers.js && node --check src/grok-credentials.mjs && node --check public/grok-credentials.js",
54
63
  "publication:check": "node scripts/publication-check.mjs",
55
64
  "prepack": "node scripts/publication-check.mjs --quiet",
56
65
  "check": "node --check src/error-reporting.mjs && node --check src/team-hub.mjs && node --check src/runtime/team-hub-client.mjs && node --check src/runtime/team-hub-database.mjs && node --check src/runtime/team-hub-server.mjs && node --check src/runtime/team-hub.mjs && node --check src/runtime/error-reporting.mjs && node --check src/launcher.mjs && node --check src/afk-worker.mjs && node --check src/companion-opening.mjs && node --check src/companion.mjs && node --check src/cli.mjs && node --check src/checkin.mjs && node --check src/persona-licence-config.mjs && node --check src/persona-website-provider.mjs && node --check src/persona-zip.mjs && node --check src/persona-entitlements.mjs && node --check src/context.mjs && node --check src/archaeology.mjs && node --check src/evidence-depth.mjs && node --check src/prototype-iterations.mjs && node --check src/solution-readiness.mjs && node --check src/delivery-artifacts.mjs && node --check src/delivery-documents.mjs && node --check src/delivery-gates.mjs && node --check src/delivery.mjs && node --check src/design-systems.mjs && node --check src/design-system-authoring.mjs && node --check src/execution-state.mjs && node --check src/intent-dependencies.mjs && node --check src/task-graph.mjs && node --check src/test-scenarios.mjs && node --check src/security-validation-config.mjs && node --check src/starter-materialisation-contract.mjs && node --check src/validation-config.mjs && node --check src/project.mjs && node --check src/install.mjs && node --check src/intents.mjs && node --check src/intent-maps.mjs && node --check src/discovery.mjs && node --check src/packs.mjs && node --check src/organisation-blueprints.mjs && node --check src/organisation-policies.mjs && node --check src/policy-design-gates.mjs && node --check src/policy-gate-integration.mjs && node --check src/personas.mjs && node --check src/platform-metadata-analysis.mjs && node --check src/power-platform-source-map.mjs && node --check src/salesforce-source-map.mjs && node --check src/repository-source-map.mjs && node --check src/runtime/context-assembly.mjs && node --check src/runtime/context-benchmarks.mjs && node --check src/runtime/database.mjs && node --check src/runtime/execution-leases.mjs && node --check src/runtime/provider-adapters.mjs && node --check src/runtime/security-validation.mjs && node --check src/runtime/starter-materialisation.mjs && node --check src/runtime/policy-workspace.mjs && node --check src/runtime/lifecycle-hooks.mjs && node --check src/runtime/afk-conductor.mjs && node --check src/runtime/dashboard-actions.mjs && node --check src/runtime/dashboard-handoffs.mjs && node --check src/runtime/persona-engagement.mjs && node --check src/runtime/evidence-depth-workspace.mjs && node --check src/runtime/prototype-iterations.mjs && node --check src/runtime/guided-discovery.mjs && node --check src/runtime/guided-intents.mjs && node --check src/runtime/phase-contributions.mjs && node --check src/runtime/impact-analysis.mjs && node --check src/runtime/paths.mjs && node --check src/runtime/intents.mjs && node --check src/runtime/knowledge.mjs && node --check src/runtime/palace.mjs && node --check src/runtime/repository-index.mjs && node --check src/runtime/runs.mjs && node --check src/runtime/work.mjs && node --check src/runtime/version.mjs && node --check src/runtime/dashboard.mjs && node --check src/runtime/dashboard-server.mjs && node --check src/runtime/mcp-config.mjs && node --check src/runtime/mcp-server.mjs && node --check src/autonomy.mjs && node --check src/autonomy-phase-contracts.mjs && node --check src/autonomy-worker.mjs && node --check src/runtime/autonomy-supervisor.mjs && node --check src/runtime/autonomy-operations.mjs && node --check src/runtime/autonomy-workers.mjs && node --check src/runtime/autonomy-workspace.mjs && node --check public/autonomy.js && node --check public/app.js && node --check public/team-hub/app.js && node --check scripts/setup.mjs",
@@ -64,6 +73,7 @@
64
73
  },
65
74
  "dependencies": {
66
75
  "@modelcontextprotocol/sdk": "^1.29.0",
76
+ "smol-toml": "^1.9.0",
67
77
  "tree-sitter": "^0.21.1",
68
78
  "tree-sitter-javascript": "^0.21.4",
69
79
  "tree-sitter-php": "^0.23.12",
@@ -3,7 +3,7 @@
3
3
  const $ = id => document.getElementById(id);
4
4
  const view = { status: null, preview: null, draftPreview: null, draftIds: new Set(), poolSignature: '',
5
5
  draftTouched: false, draftHydrated: false, loading: false, busy: false, dispatching: false,
6
- resuming: new Set(), error: '', notice: '', requestRevision: 0, control: null, answer: null, runIntentId: '' };
6
+ resuming: new Set(), error: '', notice: '', requestRevision: 0, control: null, answer: null, runIntentId: '', codingPolicy:null };
7
7
  let host = null;
8
8
 
9
9
  function node(tag, content = '', className = '') {
@@ -40,6 +40,8 @@ function safeError(error) {
40
40
  || code === 'autonomy-policy-stale') return 'The evidence changed. Refresh and review the current state before trying again.';
41
41
  if (code === 'autonomy-repository-dirty') return 'The repository has uncommitted work. Resolve it before dispatch.';
42
42
  if (code === 'autonomy-canonical-decision-required') return 'A named human decision is required before this run can continue.';
43
+ if (code === 'autonomy-model-restriction-unsupported') return 'This CLI cannot enforce the permitted-model list. Recommended: clear that restriction for native model selection, or use a verified enforcing adapter, then review a fresh grant.';
44
+ if (code === 'autonomy-provider-unavailable') return 'No eligible provider can perform this action. Recommended: enable an installed provider inside the saved and approved pools, then repeat preflight. Grok requires its supported native version and mode conformance.';
43
45
  return /^autonomy-[a-z0-9-]+$/.test(code ?? '') ? `EWAI stopped at ${humanReason(code)}. Refresh and inspect the recorded prerequisite.`
44
46
  : 'Autonomy is unavailable. Refresh the dashboard and inspect the project checks.';
45
47
  }
@@ -77,6 +79,7 @@ function selectedProposal() {
77
79
  const intents = [...view.draftIds].sort();
78
80
  const actions = [...document.querySelectorAll('[name="autonomyAction"][aria-checked="true"]')].map(input => input.value);
79
81
  const provider = $('autonomyProvider').value;
82
+ if(provider==='auto'&&!view.codingPolicy?.pool?.length)throw new Error('Save a coding provider pool first, then preview the exact providers for this grant.');
80
83
  const hours = Number($('autonomyExpiryHours').value), runtimeMinutes = Number($('autonomyRuntimeMinutes').value);
81
84
  const operationSeconds = Number($('autonomyOperationSeconds').value), attempts = Number($('autonomyAttempts').value);
82
85
  if (!intents.length || !actions.length || !Number.isSafeInteger(hours) || hours < 1 || hours > 24
@@ -85,7 +88,7 @@ function selectedProposal() {
85
88
  || operationSeconds > runtimeMinutes * 60 || !Number.isSafeInteger(attempts) || attempts < 1 || attempts > 100) {
86
89
  throw new Error('Choose at least one exact intent and action, then enter valid expiry and limits.');
87
90
  }
88
- return { intentIds: intents, actions, providers: [provider], expiresAt: new Date(Date.now() + hours * 3600000).toISOString(),
91
+ return { intentIds: intents, actions, providers: provider==='auto'?[...view.codingPolicy.pool]:[provider], expiresAt: new Date(Date.now() + hours * 3600000).toISOString(),
89
92
  limits: { maxConcurrentIntents: 1, maxRuntimeMs: runtimeMinutes * 60000, maxOperationMs: operationSeconds * 1000, maxAttempts: attempts } };
90
93
  }
91
94
  function grantSummary(scope) {
@@ -243,7 +246,7 @@ function openDialog(id, opener, focusId) {
243
246
  function openDispatch(intentId, opener) {
244
247
  if (view.status?.status !== 'current' || view.preview?.executable[0]?.intentId !== intentId) return;
245
248
  view.runIntentId = intentId;
246
- view.dispatch = { intentId, grantDigest: view.status.grant.digest, provider: view.status.grant.scope.providers[0] };
249
+ view.dispatch = { intentId, grantDigest: view.status.grant.digest, provider: view.status.grant.scope.providers.length>1?'auto':view.status.grant.scope.providers[0] };
247
250
  set('autonomyDispatchSummary', `${titleFor(intentId)} is next by recorded priority. ${grantSummary(view.status.grant.scope)}`);
248
251
  openDialog('autonomyDispatchDialog', opener, 'autonomyDispatchMode');
249
252
  }
@@ -308,7 +311,7 @@ export async function loadAutonomyState() {
308
311
  button.setAttribute('aria-checked', String(scope.actions.includes(button.value)));
309
312
  }
310
313
  if ([...$('autonomyProvider').options].some(option => option.value === scope.providers[0])) {
311
- $('autonomyProvider').value = scope.providers[0];
314
+ $('autonomyProvider').value = scope.providers.length>1?'auto':scope.providers[0];
312
315
  }
313
316
  $('autonomyRuntimeMinutes').value = String(Math.round(scope.limits.maxRuntimeMs / 60000));
314
317
  $('autonomyOperationSeconds').value = String(Math.round(scope.limits.maxOperationMs / 1000));
@@ -339,6 +342,9 @@ export async function loadAutonomyState() {
339
342
  export function configureAutonomyDashboard(options) {
340
343
  host = options;
341
344
  $('autonomyPreviewButton').addEventListener('click', () => perform(async () => {
345
+ // Provider settings can be saved in the same dashboard without a reload.
346
+ // Review the current exact pool, never an earlier form-load snapshot.
347
+ view.codingPolicy = (await host.api('/api/coding-providers')).policy;
342
348
  const proposal = selectedProposal();
343
349
  view.draftPreview = await mutation('preview', { proposal, record: false, confirmed: false });
344
350
  view.notice = 'Preview only. No grant or provider has started.';