ai-consultants 4.0.4 → 5.1.0

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.
package/.env.example CHANGED
@@ -130,8 +130,8 @@ GEMINI_API_MODEL=gemini-3.1-pro-preview
130
130
  # GEMINI_REASONING_EFFORT=
131
131
 
132
132
  # Codex - The Pragmatist
133
- CODEX_MODEL=gpt-5.6-sol
134
- CODEX_API_MAX_TOKENS=4096
133
+ CODEX_MODEL=gpt-6-astra
134
+ CODEX_API_MAX_TOKENS=16384
135
135
  CODEX_TIMEOUT=180
136
136
  CODEX_CMD=codex
137
137
  # Reasoning effort for the codex CLI (and API mode). Passed as
@@ -158,9 +158,9 @@ KIMI_TIMEOUT=180
158
158
  KIMI_CMD=kimi
159
159
 
160
160
  # Claude - The Synthesizer
161
- CLAUDE_MODEL=claude-opus-5 # ai-consultants:default
162
- # Fable 5 is catalogued and priced but remains an explicit CLAUDE_MODEL opt-in
163
- # after its local smoke timed out.
161
+ CLAUDE_MODEL=claude-fable-5-1 # ai-consultants:default
162
+ # For the lower-cost standard/medium Claude tier, set CLAUDE_MODEL to
163
+ # claude-opus-5 (or apply_model_tier standard for a single run).
164
164
  CLAUDE_TIMEOUT=240
165
165
  CLAUDE_CMD=claude
166
166
  CLAUDE_API_MAX_TOKENS=16384
@@ -250,7 +250,7 @@ MINIMAX_FORMAT=openai
250
250
  # =============================================================================
251
251
 
252
252
  # Defaults used when --preset / --strategy are omitted
253
- DEFAULT_PRESET=balanced
253
+ # DEFAULT_PRESET=balanced
254
254
  DEFAULT_STRATEGY=coverage
255
255
 
256
256
  # The invoking integration normally sets this per run for self-exclusion.
package/CLAUDE.md CHANGED
@@ -6,7 +6,7 @@ AI Consultants is a multi-model coverage system that queries up to 10 AI consult
6
6
 
7
7
  **Self-Exclusion**: The invoking agent is automatically excluded from both the panel and synthesis. Claude Code won't query or synthesize with Claude, Codex CLI won't query or synthesize with Codex, etc.
8
8
 
9
- **Version**: 4.0.4
9
+ **Version**: 5.1.0
10
10
 
11
11
  ## Distribution
12
12
 
@@ -349,9 +349,9 @@ Three normal tiers plus a `maximum` tier are configurable via `apply_model_tier(
349
349
 
350
350
  | Tier | Description | Example Models |
351
351
  |------|-------------|----------------|
352
- | **premium** | Latest flagship models | claude-opus-5, Gemini 3.7 Flash (High), gpt-5.6-sol |
353
- | **maximum** | All 10 consultants; maximum targets and highest provider effort | K3-256k, Qwen3.8-Max, MiniMax M3; Grok xhigh, GLM/DeepSeek max |
354
- | **standard** | Good quality at reasonable cost | claude-sonnet-5, Gemini 3.7 Flash (High), gpt-5.6-terra |
352
+ | **premium** | Latest flagship models | claude-fable-5-1, Gemini 3.7 Flash (High), gpt-6-astra |
353
+ | **maximum** | All 10 consultants; maximum targets and highest provider effort | claude-fable-5-1, K3-256k, Qwen3.8-Max, MiniMax M3; Grok xhigh, GLM/DeepSeek max |
354
+ | **standard** | Good quality at reasonable cost | claude-opus-5, Gemini 3.7 Flash (High), gpt-5.6-terra |
355
355
  | **economy** | Optimized for speed and low cost | claude-haiku-4-5, Gemini 3.7 Flash (Low), gpt-5.6-luna |
356
356
 
357
357
  **Default models are now premium tier** for maximum quality.
@@ -383,14 +383,14 @@ Three new presets leverage the model tiers:
383
383
  ./scripts/consult_all.sh --preset fast "quick syntax question"
384
384
  ```
385
385
 
386
- ### Premium Model Defaults (August 2026)
386
+ ### Premium Model Defaults (September 2026)
387
387
  All consultants now use premium models by default:
388
388
 
389
389
  | Consultant | Default Model |
390
390
  |------------|---------------|
391
- | Claude | claude-opus-5 |
391
+ | Claude | claude-fable-5-1 |
392
392
  | Gemini | Gemini 3.7 Flash (High) (via agy CLI); API: gemini-3.1-pro-preview |
393
- | Codex | gpt-5.6-sol |
393
+ | Codex | gpt-6-astra |
394
394
  | Mistral | CLI: mistral-medium-3.5; API: mistral-large-3 |
395
395
  | DeepSeek | deepseek-v4-pro |
396
396
  | GLM | glm-5.3-flash |
@@ -586,11 +586,11 @@ for f in scripts/*.sh scripts/lib/*.sh; do bash -n "$f" && echo "OK: $f"; done
586
586
  | `ENABLE_SMART_ROUTING` | false | Intelligent routing by category |
587
587
  | `ENABLE_COST_TRACKING` | true | Track costs |
588
588
  | `MAX_SESSION_COST` | 1.00 | Max budget ($) |
589
- | `CLAUDE_MODEL` | claude-opus-5 | Claude model (v2.5) |
589
+ | `CLAUDE_MODEL` | claude-fable-5-1 | Claude model (use claude-opus-5 for lower-cost standard) |
590
590
  | `CLAUDE_API_MAX_TOKENS` | 16384 | Claude API thinking + visible-output budget |
591
591
  | `GEMINI_MODEL` | Gemini 3.7 Flash (High) | Gemini agy CLI model |
592
592
  | `GEMINI_API_MODEL` | gemini-3.1-pro-preview | Gemini API-mode model ID (v2.15) |
593
- | `CODEX_MODEL` | gpt-5.6-sol | Codex model (v2.5) |
593
+ | `CODEX_MODEL` | gpt-6-astra | Codex model (v2.5) |
594
594
  | `MISTRAL_MODEL` | mistral-large-3 | Mistral model (v2.5) |
595
595
  | `MISTRAL_CLI_MODEL` | mistral-medium-3.5 | Vibe CLI model alias |
596
596
  | `SYNTHESIS_STRATEGY` | coverage | Synthesis strategy (coverage=union of distinct points) |
@@ -760,6 +760,26 @@ curl -fsSL https://raw.githubusercontent.com/matteoscurati/ai-consultants/main/s
760
760
 
761
761
  ## Changelog
762
762
 
763
+ ### v5.1.0 (2026-09-09)
764
+
765
+ - **Fable and Astra model policy.** `scripts/config.sh` and `scripts/configure.sh` align default/premium/maximum with Fable 5.1 and Astra, retain Opus 5/Terra for standard and Haiku/Luna for economy, and migrate exact historical unpinned Codex defaults while recording their origin. `resolve_codex_effort` applies implicit high per request so a later tier cannot inherit an automatically exported value.
766
+ - **Completion and identity are independent checks.** `scripts/lib/claude_stream.jq` derives content identity from assistant text events, keeps billing participants separate, rejects incomplete/error/max-token streams and preserves available accounting. `query_codex.sh` reads usage from JSON events while keeping the final-message file as the answer. Requested-only Codex identity remains truthful and is not an invented promotion blocker.
767
+ - **Grok sandbox checks precede fallback decisions.** `scripts/lib/grok_sandbox.sh` supplies passive socket and diagnostic checks shared with doctor/OAuth. Hidden `--no-memory` is supported by the installed parser even though omitted from help: the earlier diagnosis of an unsupported flag was incorrect. It remains mandatory in dispatch. Metadata annotation cannot replace the adapter's status when its same-directory temporary file fails.
768
+ - **Accounting and configuration.** Fable and Astra both have catalog-independent rate fallbacks. Astra estimates disclose long-context multipliers and excluded cache/service adjustments; no estimate is called a provider invoice. Explicit `AI_CONSULTANTS_CONFIG_DIR` selects private configuration; project dotenv discovery and credential import are not added.
769
+ - **Validation scope.** CLI-only acceptance was selected explicitly. The three provider smoke results retain their actual commit and identity provenance; API paths retain automated tests without a live-promotion claim. The maintainer Breadth v1 harness is included in the repository but excluded from npm, and its frozen inputs are unchanged. No completed P1 benchmark or coverage-gain claim is made.
770
+
771
+
772
+ ### v5.0.0
773
+
774
+ - **Coverage claims are now locally auditable instead of resting on synthesis prose.** `scripts/lib/coverage_integrity.sh` normalizes successful structured envelopes into deterministic `<consultant-slug>:<index>` findings, overwriting any provider-supplied IDs. `scripts/synthesize.sh` asks the synthesizer to cite those IDs, then independently compares expected and represented IDs. Missing/duplicate/non-normalizable sources produce `DEGRADED`; unknown IDs and structural failures produce `FAILED`; invented IDs are removed from published coverage. The legacy `coverage`, `weighted_recommendation`, risk, action, and individual-response fields remain present.
775
+ - **Truncation can no longer hide evidence loss.** Coverage/union prompts receive complete atomic findings. Only non-normalizable fallback context is capped, at Unicode code-point boundaries, and local `coverage_input_truncated` / `truncated_consultants` values overwrite model output in normal, local-fallback, and failed-closed artifacts. The report renders status, audited fields, truncation, and the affected consultants. The first Ubuntu CI run exposed an jq-expression compatibility gap; the final form uses jq 1.6-compatible string slicing and passed the release runner.
776
+ - **Presets are host-aware and fail closed.** `get_effective_preset_panel_size` and `select_preset_consultants` preserve the advertised panel after self-exclusion by filling from the canonical roster using static transport evidence only. `max_quality` is ten in the catalog and nine for a canonical host. Insufficient capacity now aborts with promised/selected/missing counts, and health-gate pruning is rechecked before Round 1. Custom agents can satisfy capacity; explicit per-consultant false values remain fallback opt-outs.
777
+ - **Public modes and their documentation have one executable source of truth.** `scripts/public_registry.sh` owns `fast-check -> fast/coverage`, `coverage-review -> balanced/coverage`, `max-coverage -> max_quality/coverage`, every existing preset/alias, and every strategy/default. `scripts/generate_public_docs.sh --check` renders and verifies README, SKILL, and reference tables. CLI conflict/override/unknown diagnostics run before user config, output directories, health checks, or adapters. `doctor --suggest-preset` downgrades to runnable `minimal` when only two effective transports remain.
778
+ - **The v5 release path was exercised end to end within the preregistered cap.** One no-retry `coverage-review` smoke dispatched Gemini, Mistral, and Kimi once each, then synthesized once with Claude: four dispatches total, 3/3 consultant responses, `coverage_integrity=MET` with 12/12 source IDs, and no truncation. The release gate passed 27/27 suites, ShellCheck, Bash 3.2 syntax, generated-doc drift, packaging, and sentinel isolation.
779
+ - **Development safety record.** An early P0.5 mode-registry lookup returned only the mode name, left the preset empty, and caused a local test to invoke ambient adapter auth/capability gates. Gemini/Codex were fixtures; the other adapters returned missing-key/auth/capability diagnostics. The retained transcript does not establish a network/provider request and no successful provider response was observed. The lookup was fixed, all later local release gates used provider/curl sentinels, and the final stub-only mode smoke recorded zero non-fixture adapter calls.
780
+
781
+ Deliberately retained: every v4 preset/alias, advanced configuration key, smart routing, custom agents, self-exclusion, and legacy JSON fields. Not claimed: semantic verification that a synthesized sentence faithfully paraphrases the cited atom; v5.0 verifies attribution-set integrity, not natural-language entailment.
782
+
763
783
  ### v4.0.4
764
784
 
765
785
  - **Housekeeping now removes dead implementation without removing public compatibility.** The cleanup deletes uncalled API, cache, optimizer, common, cost, persona, reliability, routing-summary, and session-display helpers, plus the stale README changelog and redundant npm ignore file. The documented `get_routing_mode`, `get_recommended_count`, and `get_category_timeout` helpers stay available and are regression-tested. Six historic config keys that had no runtime reader remain accepted as explicitly deprecated no-ops through v4.x: `SESSION_CLEANUP_DAYS`, `ENABLE_PROGRESS_BARS`, `ENABLE_EARLY_TERMINATION`, `USE_COMPACT_PROMPTS`, `ENABLE_SELECTIVE_CONTEXT`, and `MAX_FILES_PER_CONSULTANT`.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # AI Consultants v4.0.4
1
+ # AI Consultants v5.1.0
2
2
 
3
3
  > **Coverage, not a single guess.** A panel of up to 10 frontier models from different vendors fans out on your question in parallel and hands you the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses.
4
4
 
5
- [![Version](https://img.shields.io/badge/version-4.0.4-blue.svg)](https://github.com/matteoscurati/ai-consultants)
5
+ [![Version](https://img.shields.io/badge/version-5.1.0-blue.svg)](https://github.com/matteoscurati/ai-consultants)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
  [![Claude Code Skill](https://img.shields.io/badge/Claude%20Code-Skill-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/skills)
8
8
  [![GitHub stars](https://img.shields.io/github/stars/matteoscurati/ai-consultants?style=social)](https://github.com/matteoscurati/ai-consultants)
@@ -455,6 +455,7 @@ Choose the right balance of quality, speed, and cost with model quality tiers.
455
455
 
456
456
  A preset only chooses the **consultant set and model tier** — every run then fans out in
457
457
  parallel and returns the coverage union.
458
+ Preset panels use statically configured transports only (a CLI on `PATH`, or selected API mode with its key). Host self-exclusion is fail-closed; lost canonical slots are filled from `ALL_CONSULTANTS` in canonical order. If the effective target cannot be met, including after an enabled health gate prunes the panel, the run stops with promised/selected/missing-capacity guidance. Configured custom API agents are appended and may satisfy capacity, so a full preset can exceed its advertised count. `max_quality` still advertises 10 consultants, with an effective target of 9 for a canonical invoking host.
458
459
  For `max_quality`, Grok, GLM, and DeepSeek are also pinned to their highest
459
460
  accepted reasoning effort: Grok Build uses `xhigh`, while GLM and DeepSeek use
460
461
  `max`. Unsupported transport capabilities fail explicitly instead of reducing
@@ -468,18 +469,24 @@ likewise receives a 16,384-token completion budget in the maximum tier and a
468
469
  provider-specific compact Markdown contract through mmx's native system channel.
469
470
  Provider output is tagged `structured`, `fallback`, or `error`;
470
471
  malformed/truncated JSON fails
471
- closed, while usable prose remains available to synthesis with its quality
472
- disclosed. Synthesis excludes error envelopes and retains bounded response
473
- detail instead of reducing every consultant to its summary.
472
+ closed. In coverage/union mode, only locally atomized `summary`, `pros`,
473
+ `cons`, `alternatives`, `caveats`, and `references` can be source-attributed;
474
+ fallback prose remains context-only for manual review. `synthesis.json` records
475
+ `coverage_integrity`: `MET` applies only to those audited fields, while
476
+ `DEGRADED`/`FAILED` must not be read as comprehensive coverage. It also records
477
+ locally authoritative `coverage_input_truncated` and `truncated_consultants`:
478
+ only non-normalizable fallback context is capped (at Unicode code-point
479
+ boundaries), never atomic findings; a truncated coverage input is disclosed
480
+ and cannot support a comprehensive coverage claim.
474
481
 
475
482
  ### Models by Tier
476
483
 
477
484
  | Consultant | `max_quality` | Premium | Standard | Economy |
478
485
  |------------|---------------|---------|----------|---------|
479
- | Claude | claude-opus-5 | claude-opus-5 | claude-sonnet-5 | claude-haiku-4-5 |
486
+ | Claude | claude-fable-5-1 | claude-fable-5-1 | claude-opus-5 | claude-haiku-4-5 |
480
487
  | Gemini CLI | Gemini 3.7 Flash (High) | Gemini 3.7 Flash (High) | Gemini 3.7 Flash (High) | Gemini 3.7 Flash (Low) |
481
488
  | Gemini API | gemini-3.1-pro-preview | gemini-3.1-pro-preview | gemini-3.1-pro-preview | gemini-3.1-pro-preview |
482
- | Codex | gpt-5.6-sol | gpt-5.6-sol | gpt-5.6-terra | gpt-5.6-luna |
489
+ | Codex | gpt-6-astra | gpt-6-astra | gpt-5.6-terra | gpt-5.6-luna |
483
490
  | Mistral CLI | mistral-medium-3.5 | mistral-medium-3.5 | mistral-medium-3.5 | devstral-small-2 |
484
491
  | Mistral API | mistral-large-3 | mistral-large-3 | mistral-large-3 | mistral-large-3 |
485
492
  | DeepSeek | deepseek-v4-pro | deepseek-v4-pro | deepseek-v4-flash | deepseek-v4-flash |
@@ -494,8 +501,9 @@ smoke through the `agy` adapter and is now the CLI default; Low is the CLI
494
501
  economy target. The Google API model remains `gemini-3.1-pro-preview`, while
495
502
  `gemini-3.7-flash` stays an API-only opt-in until that separate transport is
496
503
  verified. The new Mistral API IDs (`mistral-medium-3-5`,
497
- `mistral-large-2512`, `mistral-small-2603`) and Claude Fable 5 likewise remain
498
- catalogued opt-ins. Selecting a preset later intentionally reapplies that
504
+ `mistral-large-2512`, `mistral-small-2603`) remain catalogued opt-ins. Claude
505
+ Fable 5.1 is the default/premium/maximum target; use
506
+ `CLAUDE_MODEL=claude-opus-5` for the lower-cost standard override. Selecting a preset later intentionally reapplies that
499
507
  preset's tier and can replace an explicit model override for the run.
500
508
  Qwen3.8-Max is likewise selected by `max_quality` only when API mode already
501
509
  points at an authenticated OpenAI-compatible Token Plan `/chat/completions`
@@ -525,39 +533,47 @@ apply_model_tier "economy" # Set all to economy models
525
533
 
526
534
  ## Configuration
527
535
 
528
- ### Presets
536
+ <!-- ai-consultants:public-registry:start -->
537
+ <!-- ai-consultants:default-synthesis-strategy=coverage -->
538
+ ### Public Modes
539
+
540
+ | Mode | Preset | Default strategy | Use case |
541
+ |---|---|---|---|
542
+ | `fast-check` | `fast` | `coverage` | Fast economy panel for a quick coverage check |
543
+ | `coverage-review` | `balanced` | `coverage` | Balanced panel for a general coverage review |
544
+ | `max-coverage` | `max_quality` | `coverage` | Maximum-quality panel for the broadest coverage |
545
+
546
+ ### Configuration Presets
547
+
548
+ | Preset | Alias | Target | Tier | Use case |
549
+ |---|---|---:|---|---|
550
+ | `minimal` | — | 2 | base | Quick questions |
551
+ | `balanced` | — | 3 | base | Standard coverage |
552
+ | `thorough` | — | 3 | base | Comprehensive analysis |
553
+ | `high-stakes` | — | 4 | premium | Critical decisions |
554
+ | `security` | — | 3 | base | Security reviews |
555
+ | `cost-capped` | — | 3 | economy | Budget-conscious options |
556
+ | `max_quality` | `max-quality` | 10 | maximum | Maximum coverage for critical decisions |
557
+ | `medium` | — | 3 | standard | General questions |
558
+ | `fast` | — | 2 | economy | Quick checks |
529
559
 
530
- Choose how many consultants to use:
560
+ ### Synthesis Strategies
531
561
 
532
- | Preset | Consultants | Tier | Use Case |
533
- |--------|-------------|------|----------|
534
- | `max_quality` | All 10 | Maximum + max effort | Critical decisions |
535
- | `medium` | 3 | Standard | General questions |
536
- | `fast` | 2 | Economy | Quick checks |
537
- | `minimal` | 2 (Gemini + Codex) | Default | Quick questions, low cost |
538
- | `balanced` | 3 (+ Mistral) | Default | Standard consultations |
539
- | `thorough` | 3 | Default | Comprehensive analysis |
540
- | `high-stakes` | Expanded panel (4 of 10) | Default | Critical decisions |
541
- | `security` | Security-focused (3) | Default | Security reviews |
542
- | `cost-capped` | Budget-conscious | Default | Minimal API costs |
562
+ | Strategy | Description |
563
+ |---|---|
564
+ | `coverage` | Union of every distinct point across the panel **Default** |
565
+ | `compare_only` | Present each consultant side-by-side, without a synthesized union |
566
+ | `majority` | Produce one blended recommendation, weighting all equally |
567
+ | `risk_averse` | Weight conservative responses higher |
568
+ | `security_first` | Prioritize security-focused insights |
569
+ | `cost_capped` | Prefer cheaper consultant opinions within budget |
570
+ <!-- ai-consultants:public-registry:end -->
543
571
 
544
572
  **Bash:**
545
573
  ```bash
546
574
  ./scripts/consult_all.sh --preset balanced "Question"
547
575
  ```
548
576
 
549
- ### Synthesis Strategies
550
-
551
- Control how responses are combined:
552
-
553
- | Strategy | Description |
554
- |----------|-------------|
555
- | `majority` | Most common answer wins (default) |
556
- | `risk_averse` | Weight conservative responses higher |
557
- | `security_first` | Prioritize security considerations |
558
- | `cost_capped` | Prefer simpler, cheaper solutions |
559
- | `compare_only` | No recommendation, just comparison |
560
-
561
577
  **Bash:**
562
578
  ```bash
563
579
  ./scripts/consult_all.sh --strategy risk_averse "Question"
@@ -594,11 +610,11 @@ Auto-selected `*_USE_API` values are marked `# ai-consultants:auto`, allowing a
594
610
  later run to adapt when a CLI or credential changes. Environment variables,
595
611
  `--set`, and unmarked values remain explicit user choices, except for the exact
596
612
  historical generated Claude default described below.
597
- Managed model defaults use `# ai-consultants:default`; `configure` upgrades the
598
- historical unmarked `CLAUDE_MODEL=claude-opus-4-8` default to Opus 5 and upgrades
599
- the exact managed Gemini CLI, GLM, and Grok defaults. To keep
600
- 4.8 intentionally, run
601
- `ai-consultants configure --set CLAUDE_MODEL=claude-opus-4-8`; explicit model
613
+ Managed model defaults use `# ai-consultants:default`; `configure` upgrades
614
+ un-pinned historical `CLAUDE_MODEL=claude-opus-4-8` and `claude-opus-5` defaults
615
+ to Fable 5.1, along with the exact managed Gemini CLI, GLM, and Grok defaults.
616
+ To keep the lower-cost Opus 5 choice, run
617
+ `ai-consultants configure --set CLAUDE_MODEL=claude-opus-5`; explicit model
602
618
  overrides are stored with `# ai-consultants:pin`.
603
619
 
604
620
  Enter credentials through `--interactive`/`--advanced` or export them before the
@@ -691,7 +707,11 @@ Classify -> Route -> Fan out (parallel) -> Coverage synthesis
691
707
  1. **Classify** the question into a category.
692
708
  2. **Route** (optional, `ENABLE_SMART_ROUTING`) to the consultants with the best category affinity (`references/affinity.json`).
693
709
  3. **Fan out** to every selected consultant in parallel — one shot each, no serial rounds.
694
- 4. **Synthesize** the **coverage union**: the deduplicated set of every distinct point, recommendation, risk, and edge case raised by any consultant. Override with `--strategy compare_only` (side-by-side) or `majority` (a single blended recommendation).
710
+ 4. **Synthesize** the **coverage union** over auditable normalized fields. Read
711
+ `coverage_integrity` before treating it as complete: `MET` means every local
712
+ atomic source ID is represented once; `DEGRADED` and `FAILED` are explicitly
713
+ non-comprehensive. Override with `--strategy compare_only` (side-by-side) or
714
+ `majority` (a single blended recommendation).
695
715
 
696
716
  ### Output
697
717
 
@@ -704,7 +724,7 @@ ${XDG_CACHE_HOME:-$HOME/.cache}/ai-consultants/consultations/TIMESTAMP/
704
724
  ├── codex.json # with confidence scores
705
725
  ├── mistral.json
706
726
  ├── grok.json
707
- ├── synthesis.json # Coverage union
727
+ ├── synthesis.json # Coverage union plus coverage_integrity/audited_fields
708
728
  ├── optimization_metrics.json
709
729
  └── report.md # Human-readable report
710
730
  ```
package/SKILL.md CHANGED
@@ -5,10 +5,10 @@ license: MIT
5
5
  compatibility: Requires bash, jq, and at least 2 AI CLI tools (agy, codex, vibe, etc.). macOS and Linux.
6
6
  metadata:
7
7
  author: matteoscurati
8
- version: 4.0.4
8
+ version: 5.1.0
9
9
  ---
10
10
 
11
- # AI Consultants v4.0.4 - AI Expert Panel
11
+ # AI Consultants v5.1.0 - AI Expert Panel
12
12
 
13
13
  **Coverage, not a single guess.** Convene a panel of AI "consultants" from different vendors for coding questions: they fan out in parallel and you get the *union* of what they collectively see — the risks, edge cases, and approaches a single model misses. Each consultant has a **configurable persona** that decorrelates its analysis.
14
14
 
@@ -106,7 +106,8 @@ smoke-tested K3-256k and MiniMax M3 targets, plus Qwen3.8-Max when an authentica
106
106
  already configured. Gemini 3.7 Flash High is the exact-transport-smoked `agy`
107
107
  default for maximum, premium, and standard CLI tiers; Low serves economy. The
108
108
  Gemini API target remains 3.1 Pro until `gemini-3.7-flash` completes a separate
109
- API smoke. Claude Fable 5 and the new Mistral API IDs remain explicit opt-ins.
109
+ API smoke. Claude Fable 5.1 is the default/premium/maximum target; the new
110
+ Mistral API IDs remain explicit opt-ins.
110
111
  Grok, GLM, and DeepSeek receive their
111
112
  highest accepted reasoning effort in this preset (`xhigh`, `max`, and `max`
112
113
  respectively); no failed target is silently replaced.
@@ -115,8 +116,14 @@ Maximum-quality transports use smoke-tested runtime budgets: four advisory
115
116
  turns for Mistral/Grok, extended Qwen/DeepSeek timeouts, and larger response
116
117
  budgets for reasoning APIs and a compact native-system Markdown contract for
117
118
  MiniMax M3. Responses carry an explicit `structured`,
118
- `fallback`, or `error` quality. Truncated JSON fails closed; usable prose is
119
- retained and disclosed, and synthesis consumes successful envelopes only.
119
+ `fallback`, or `error` quality. Truncated JSON fails closed. Coverage/union
120
+ synthesis source-attributed claims use only locally normalized atomic fields;
121
+ fallback prose remains visible as context-only manual-review material. Inspect
122
+ `coverage_integrity`: `MET` applies only to its listed `audited_fields`, while
123
+ `DEGRADED` and `FAILED` are never comprehensive coverage claims.
124
+ `synthesis.json` locally records `coverage_input_truncated` and
125
+ `truncated_consultants`; only non-normalizable fallback context can be capped
126
+ (on Unicode code-point boundaries), never normalized atomic findings.
120
127
 
121
128
  **Self-Exclusion**: The invoking agent is automatically excluded from the panel. When invoked from Claude Code, Claude is excluded; when invoked from Codex CLI, Codex is excluded, etc.
122
129
 
@@ -147,7 +154,46 @@ For detailed CLI installation instructions, see [Setup Guide](docs/SETUP.md).
147
154
  /ai-consultants:consult "What could go wrong with this design?" src/service.ts
148
155
  ```
149
156
 
150
- Presets: `minimal`, `balanced`, `thorough`, `high-stakes`, `security`, `cost-capped`, `max_quality`, `medium`, `fast`. Strategies: `coverage` (default; union of distinct points), `compare_only`, `majority`, `risk_averse`, `security_first`, `cost_capped`. See [Reference Details](references/details.md) for full tables, bash usage, and best practices.
157
+ <!-- ai-consultants:public-registry:start -->
158
+ <!-- ai-consultants:default-synthesis-strategy=coverage -->
159
+ ## Public Modes
160
+
161
+ | Mode | Preset | Default strategy | Use case |
162
+ |---|---|---|---|
163
+ | `fast-check` | `fast` | `coverage` | Fast economy panel for a quick coverage check |
164
+ | `coverage-review` | `balanced` | `coverage` | Balanced panel for a general coverage review |
165
+ | `max-coverage` | `max_quality` | `coverage` | Maximum-quality panel for the broadest coverage |
166
+
167
+ ## Configuration Presets
168
+
169
+ | Preset | Alias | Target | Tier | Use case |
170
+ |---|---|---:|---|---|
171
+ | `minimal` | — | 2 | base | Quick questions |
172
+ | `balanced` | — | 3 | base | Standard coverage |
173
+ | `thorough` | — | 3 | base | Comprehensive analysis |
174
+ | `high-stakes` | — | 4 | premium | Critical decisions |
175
+ | `security` | — | 3 | base | Security reviews |
176
+ | `cost-capped` | — | 3 | economy | Budget-conscious options |
177
+ | `max_quality` | `max-quality` | 10 | maximum | Maximum coverage for critical decisions |
178
+ | `medium` | — | 3 | standard | General questions |
179
+ | `fast` | — | 2 | economy | Quick checks |
180
+
181
+ ## Synthesis Strategies
182
+
183
+ | Strategy | Description |
184
+ |---|---|
185
+ | `coverage` | Union of every distinct point across the panel **Default** |
186
+ | `compare_only` | Present each consultant side-by-side, without a synthesized union |
187
+ | `majority` | Produce one blended recommendation, weighting all equally |
188
+ | `risk_averse` | Weight conservative responses higher |
189
+ | `security_first` | Prioritize security-focused insights |
190
+ | `cost_capped` | Prefer cheaper consultant opinions within budget |
191
+ <!-- ai-consultants:public-registry:end -->
192
+
193
+ Agents may use `--mode` instead of `--preset`; the mode chooses its mapped
194
+ preset and coverage strategy unless an explicit `--strategy` is supplied. See
195
+ [Reference Details](references/details.md) for capacity, fallback, and Bash
196
+ usage details.
151
197
 
152
198
  ## Workflow
153
199
 
@@ -15,6 +15,17 @@ BIN_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
15
15
  PROJECT_ROOT="$(cd -P "$BIN_DIR/.." && pwd)"
16
16
  SCRIPTS_DIR="$PROJECT_ROOT/scripts"
17
17
 
18
+ load_public_registry() {
19
+ # Keep `version` and the lightweight malformed-install diagnostic usable even
20
+ # when a partial installation lacks the optional public registry file.
21
+ if [ ! -f "$SCRIPTS_DIR/public_registry.sh" ]; then
22
+ echo "Error: public registry missing at $SCRIPTS_DIR/public_registry.sh" >&2
23
+ return 1
24
+ fi
25
+ # shellcheck source=../scripts/public_registry.sh
26
+ source "$SCRIPTS_DIR/public_registry.sh"
27
+ }
28
+
18
29
  # --- Ensure execute permissions (npm can strip them) ---
19
30
  ensure_permissions() {
20
31
  local needs_fix=false
@@ -47,11 +58,13 @@ case "${1:-}" in
47
58
  exit 0
48
59
  ;;
49
60
  help|--help|-h)
61
+ load_public_registry || exit 1
50
62
  cat <<EOF
51
63
  ai-consultants v$VERSION - Cross-vendor AI coverage panel
52
64
 
53
65
  Usage:
54
66
  ai-consultants "question" [files...] Consult AI experts
67
+ ai-consultants --mode <name> "question" Use a public mode
55
68
  ai-consultants --preset <name> "question" Use a configuration preset
56
69
  ai-consultants --strategy <name> "question" Use a synthesis strategy
57
70
  ai-consultants doctor [--fix] [--json] Run diagnostics
@@ -62,10 +75,9 @@ Usage:
62
75
  ai-consultants version Show version
63
76
  ai-consultants help Show this help
64
77
 
65
- Presets: minimal, balanced, thorough, high-stakes, security, cost-capped,
66
- max_quality, medium, fast
67
-
68
- Strategies: coverage, compare_only, majority, risk_averse, security_first, cost_capped
78
+ Modes: $(registry_mode_rows | cut -d'|' -f1 | tr '\n' ' ' | sed 's/ $//')
79
+ Presets: $(registry_preset_rows | cut -d'|' -f1 | tr '\n' ' ' | sed 's/ $//')
80
+ Strategies: $(registry_strategy_rows | cut -d'|' -f1 | tr '\n' ' ' | sed 's/ $//')
69
81
 
70
82
  Examples:
71
83
  npx ai-consultants "How to optimize this SQL query?"
@@ -1,4 +1,4 @@
1
- # Cost Rates - AI Consultants v4.0.4
1
+ # Cost Rates - AI Consultants v5.1.0
2
2
 
3
3
  This page documents the per-token rates used by the cost tracking system.
4
4
 
@@ -28,12 +28,14 @@ models programmatically.
28
28
  | Gemini 3.1 Pro (High) | CLI opt-in | $0.002 | Gemini (agy CLI) |
29
29
  | gemini-3.1-pro-preview | API default | $0.00125 | Gemini API |
30
30
  | Gemini 3.6 Flash (High/Low) | Legacy CLI pins | $0.0015 | Gemini |
31
- | gpt-5.6-sol | Premium | $0.005 | Codex |
31
+ | gpt-6-astra | Maximum/Premium | $0.010 | Codex |
32
+ | gpt-5.6-sol | Explicit override | $0.004 | Codex |
32
33
  | gpt-5.6-terra | Standard | $0.002 | Codex |
33
34
  | gpt-5.6-luna | Economy | $0.0002 | Codex |
34
- | claude-opus-5 | Premium | $0.005 | Claude |
35
- | claude-fable-5 | Opt-in | $0.010 | Claude |
36
- | claude-sonnet-5 | Standard | $0.003 | Claude |
35
+ | claude-fable-5-1 | Maximum/Premium | $0.010 | Claude |
36
+ | claude-opus-5 | Standard | $0.005 | Claude |
37
+ | claude-fable-5 | Legacy pins | $0.010 | Claude |
38
+ | claude-sonnet-5 | Legacy pins | $0.003 | Claude |
37
39
  | claude-haiku-4-5 | Economy | $0.001 | Claude |
38
40
  | mistral-large-3 | Premium | $0.002 | Mistral |
39
41
  | mistral-medium-3.5 / mistral-medium-3-5 | Premium CLI / API opt-in | $0.0015 | Mistral |
@@ -70,12 +72,14 @@ models programmatically.
70
72
  | Gemini 3.1 Pro (High) | CLI opt-in | $0.012 | Gemini (agy CLI) |
71
73
  | gemini-3.1-pro-preview | API default | $0.005 | Gemini API |
72
74
  | Gemini 3.6 Flash (High/Low) | Legacy CLI pins | $0.0075 | Gemini |
73
- | gpt-5.6-sol | Premium | $0.030 | Codex |
75
+ | gpt-6-astra | Maximum/Premium | $0.050 | Codex |
76
+ | gpt-5.6-sol | Explicit override | $0.020 | Codex |
74
77
  | gpt-5.6-terra | Standard | $0.012 | Codex |
75
78
  | gpt-5.6-luna | Economy | $0.0012 | Codex |
76
- | claude-opus-5 | Premium | $0.025 | Claude |
77
- | claude-fable-5 | Opt-in | $0.050 | Claude |
78
- | claude-sonnet-5 | Standard | $0.015 | Claude |
79
+ | claude-fable-5-1 | Maximum/Premium | $0.050 | Claude |
80
+ | claude-opus-5 | Standard | $0.025 | Claude |
81
+ | claude-fable-5 | Legacy pins | $0.050 | Claude |
82
+ | claude-sonnet-5 | Legacy pins | $0.015 | Claude |
79
83
  | claude-haiku-4-5 | Economy | $0.005 | Claude |
80
84
  | mistral-large-3 | Premium | $0.006 | Mistral |
81
85
  | mistral-medium-3.5 / mistral-medium-3-5 | Premium CLI / API opt-in | $0.0075 | Mistral |
@@ -22,7 +22,10 @@ The schema is defined in `scripts/lib/schema.json` following JSON Schema Draft-0
22
22
  "cons": [...],
23
23
  "alternatives": [...],
24
24
  "caveats": [...],
25
- "references": [...]
25
+ "references": [...],
26
+ "findings": [
27
+ {"id": "gemini:1", "kind": "summary", "field": "summary", "text": "..."}
28
+ ]
26
29
  },
27
30
  "confidence": {
28
31
  "score": 8,
@@ -61,6 +64,65 @@ The schema is defined in `scripts/lib/schema.json` following JSON Schema Draft-0
61
64
 
62
65
  ## Optional Fields
63
66
 
67
+ ### response.findings
68
+
69
+ `findings` is added locally by the synthesis stage to successful consultant
70
+ responses. It preserves all legacy fields and never trusts provider-supplied
71
+ IDs. Each item has a deterministic local `id` of
72
+ `<consultant-slug>:<one-based-index>`, plus `kind`, source `field`, and the
73
+ atomically attributable `text`. The shared slug rule ASCII-lowercases the
74
+ consultant name, retains `[a-z0-9_]`, replaces other runs with `_`, trims edge
75
+ underscores, and uses `unknown` if empty. Thus the public custom name
76
+ `My_agent` has IDs such as `my_agent:1`.
77
+
78
+ The conservative normalization contract derives findings only from `summary`,
79
+ `pros`, `cons`, `alternatives`, `caveats`, and `references`; alternatives may
80
+ be meaningful strings or objects with meaningful name/reason text. Empty,
81
+ null, or whitespace alternatives create no finding. Free-form fallback prose
82
+ (`response_quality: fallback`) and successful envelopes with zero atomic
83
+ findings are retained for human review but are non-normalizable; neither can
84
+ be presented as audited coverage. Error envelopes remain excluded from
85
+ synthesis.
86
+
87
+ ## Synthesis Coverage Attribution
88
+
89
+ Each synthesized `coverage` item requires `source_ids`, containing only local
90
+ IDs from normalized findings. `scripts/lib/schema.json` defines this as
91
+ `definitions.synthesis_coverage_item`; the model prompt requests it, but the
92
+ local post-check is authoritative.
93
+
94
+ Every synthesis includes `coverage_integrity`:
95
+
96
+ | Status | Meaning |
97
+ |-------|---------|
98
+ | `MET` | Every expected normalized source ID appears exactly once, with at least one expected ID and no non-normalizable success. It applies only to the audited fields. |
99
+ | `DEGRADED` | A coverage-union source is missing or duplicated, no atomic source exists, or a successful response is non-normalizable. It is never comprehensive. |
100
+ | `FAILED` | Coverage/source attribution is structurally unusable or includes an invented source ID; do not rely on coverage. |
101
+ | `NOT_APPLICABLE` | A non-coverage strategy was selected and no attribution failure was found; it makes no coverage-union claim. |
102
+
103
+ The object contains `expected_count`, `represented_count`, `missing_ids`,
104
+ `unknown_ids`, `duplicate_ids`, `non_normalizable_consultants`,
105
+ `structural_errors`, `audited_fields`, and `normalization_version`.
106
+ `represented_count` is the count of unique expected IDs actually represented;
107
+ unknown and duplicate IDs cannot inflate it. In coverage/union mode only
108
+ `audited_fields` reach the attributable prompt. Structured `detailed` text and
109
+ fallback prose are not atomized; fallback text is context-only and must never
110
+ produce coverage items or source IDs.
111
+
112
+ Every synthesis artifact also carries locally authoritative
113
+ `coverage_input_truncated` (boolean) and `truncated_consultants` (a stable,
114
+ first-occurrence-unique array of consultant names discovered in lexically
115
+ ordered response-file order). These fields overwrite any values supplied by a
116
+ model and are present even on local fallback or failed-closed artifacts.
117
+ `SYNTH_DETAIL_MAX_CHARS` applies only to usable, non-normalizable fallback
118
+ context, never to normalized finding text. Its unit is Unicode code points:
119
+ input with exactly the limit is retained and does not set the flag; only input
120
+ with more code points is shortened to that limit, preserving complete
121
+ multibyte UTF-8 characters. When such context is truncated, coverage/union is
122
+ at least `DEGRADED` and its disclosure names the affected consultants; it is
123
+ never a comprehensive claim. A non-coverage strategy can remain
124
+ `NOT_APPLICABLE`, but still exposes this metadata and disclosure.
125
+
64
126
  ### response.code_snippets
65
127
 
66
128
  Array of code snippets:
@@ -307,3 +369,23 @@ jq 'has("consultant") and has("response") and has("confidence")' output.json
307
369
  }
308
370
  }
309
371
  ```
372
+
373
+ ### Codex cost and cached-input metadata
374
+
375
+ When present, `metadata.cost_source` is `unavailable` without token data, otherwise
376
+ `estimated-standard-rates` or `estimated-long-context-standard-rates`.
377
+ `metadata.cost_note` discloses excluded cache/service adjustments; an estimate
378
+ is not a provider invoice. `metadata.tokens_cached_input`, when supplied by
379
+ CLI telemetry, is the cached subset of `tokens_input` and is not added again.
380
+ Unknown splits use the documented estimation heuristic; they cannot establish
381
+ an exact long-context bill. Astra maximum/premium uses `high` by default,
382
+ including in max_quality; valid explicit Codex effort always takes precedence.
383
+
384
+ ### Claude streaming billing metadata
385
+
386
+ `metadata.billing_models` is an optional array of provider billing model IDs.
387
+ It does not attest the content model. Claude content identity comes only from
388
+ response-bearing assistant events; successful terminal completion is a separate
389
+ requirement. `provider_cost_usd`, when present, is the provider's terminal cost.
390
+ Token accounting prefers a supplied per-model billing aggregate over terminal
391
+ usage, without adding those two summaries together; absent usage is estimated.
package/docs/SETUP.md CHANGED
@@ -592,10 +592,16 @@ shell history or observed by other local processes. Use `--interactive`,
592
592
  ### Using .env file
593
593
 
594
594
  ```bash
595
- cp .env.example .env
595
+ mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/ai-consultants"
596
+ # For a new configuration only; keep existing credentials/settings if present.
597
+ cp -n .env.example "${XDG_CONFIG_HOME:-$HOME/.config}/ai-consultants/.env"
598
+ chmod 600 "${XDG_CONFIG_HOME:-$HOME/.config}/ai-consultants/.env"
596
599
  ```
597
600
 
598
- Edit `.env`:
601
+ Edit that user configuration `.env`. A different existing private directory must
602
+ be selected explicitly with `AI_CONSULTANTS_CONFIG_DIR`; project `.env` files
603
+ are not discovered automatically:
604
+
599
605
 
600
606
  ```bash
601
607
  # Enable/disable consultants (10 available)
@@ -797,3 +803,50 @@ less "$output_dir/report.md"
797
803
  ```
798
804
 
799
805
  See [README.md](../README.md) for usage examples and full documentation.
806
+
807
+ For a configuration outside the standard user config directory, set
808
+ `AI_CONSULTANTS_CONFIG_DIR=/absolute/private/config-directory` explicitly.
809
+ The loader does not discover project `.env` files. Keep credentials in your
810
+ existing private configuration; do not copy them into this repository.
811
+
812
+ Claude CLI uses `stream-json --verbose`. Only response-bearing assistant
813
+ messages attest the content model; terminal `modelUsage` records billing
814
+ participants separately. A missing or conflicting content model remains
815
+ `requested-only` and cannot pass a model-promotion gate. Successful terminal
816
+ completion is required even when partial response text or billing is available.
817
+
818
+ Codex defaults to `gpt-6-astra`; premium and maximum select Astra, standard
819
+ selects `gpt-5.6-terra`, economy selects `gpt-5.6-luna`. Sol remains an explicit
820
+ `CODEX_MODEL=gpt-5.6-sol` override. Configure migrates exact unpinned persisted
821
+ `gpt-5.5` and `gpt-5.6-sol` values to Astra and records `migrated-from` provenance.
822
+ Use `# ai-consultants:pin`, an environment override or `--set` to keep a model.
823
+
824
+ Astra uses `high` effort when no effort is configured. Explicit `low`, `medium`,
825
+ `high`, `xhigh`, and `max` prevail; `none`/`minimal` fail before dispatch.
826
+ The default completion budget is 16384 tokens, including reasoning; override
827
+ `CODEX_API_MAX_TOKENS` explicitly as needed. The text-only Chat Completions
828
+ request uses `max_completion_tokens` and `reasoning_effort`, without tools.
829
+ See the [official migration guide](https://developers.openai.com/api/docs/guides/latest-model).
830
+ CLI JSON events supply token telemetry; the final message file supplies content.
831
+ A CLI `-m` selection remains `requested-only`, not provider attestation.
832
+
833
+ [Astra Standard pricing](https://developers.openai.com/api/docs/models/gpt-6-astra)
834
+ is $10/M input and $50/M output. More than 272K input tokens doubles input
835
+ and multiplies output by 1.5 for the whole request. Reported cost is an estimate
836
+ unless a provider cost is supplied: cache writes, cached-input discounts and
837
+ service processing rates can change the invoice.
838
+
839
+ Grok CLI and doctor passively inspect the container-runtime socket deny paths,
840
+ including Docker Desktop locations. Symlink endpoints (including dangling links)
841
+ block CLI dispatch because the sandbox cannot safely resolve those deny rules.
842
+ Absent paths and ordinary socket files pass this check. Nothing is removed and
843
+ Docker configuration is never changed. Runtime `sandbox_profile_refused` and
844
+ `sandbox_not_applied` diagnostics fail even with exit zero; they cannot trigger
845
+ retry or API fallback. OAuth synchronization and per-run isolation remain active.
846
+
847
+
848
+ Grok compatibility includes a provider-free parser probe of the complete advisory
849
+ argument list. Hidden flags such as `--no-memory` are still required in the
850
+ actual request even when omitted from public help. Unsupported mandatory flags
851
+ block dispatch; the optional `--no-auto-update` guard is used when its parser
852
+ probe succeeds, including on CLIs that hide it from help.