Commit Graph

515 Commits

Author SHA1 Message Date
Dragan Spiridonov 8f91c6e227 chore(release): bump version to v3.13.3 2026-07-29 15:08:25 +00:00
Dragan Spiridonov c71efaaeab chore(release): bump version to v3.13.2 2026-07-24 10:19:19 +02:00
Dragan Spiridonov 4876c9ee57 chore(release): bump version to v3.13.1
Version bumped in all four places that carry it: package.json,
.claude-plugin/plugin.json, and the fleetVersion in both the .claude/ and
assets/ skills manifests (the assets mirror drifts easily and is shipped).

Adds the v3.13.1 changelog entry and release notes covering the four fixed
issues (#565, #567, #568, #569) plus the Codex QE skills and lifecycle hooks
from a parallel session (763ea385), and draft issue-closing comments to post
once the release is published.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 16:14:34 +00:00
Dragan Spiridonov e5a7719aa7 feat(#569): add AQE_COVERAGE_NO_EXEC opt-out; broaden credential stripping (#568)
Closes the two security questions raised by the adversarial review that the
prosecutors never returned a ruling on, so I settled them with evidence.

1. Coverage measurement executes the analyzed repository.
   Collecting real coverage means running the project's own tests: the JS/TS path
   runs `npx vitest|jest|nyc` (pre-existing), and the Rust path added in this
   release runs `cargo llvm-cov`, which compiles and runs test binaries, executes
   `build.rs`, and honors any `runner`/linker directive in that repo's
   `.cargo/config.toml`. For a trusted project that is exactly what the caller
   wants; it is surprising for an operation that reads like a static query, and an
   agent can be pointed at an untrusted checkout.

   Execution stays the default — requiring opt-in would make measured coverage the
   exceptional case and estimation the norm, inverting ADR-126's whole point — but
   is now opt-out via `AQE_COVERAGE_NO_EXEC=1`, which disables ALL build-tool
   execution. Existing coverage reports are still parsed; everything else degrades
   to clearly-labelled static estimation with guidance explaining why.

   Verified end-to-end through the real MCP server with a fake `cargo` shim on
   PATH: switch off -> cargo invoked; switch on -> not invoked. The unit test
   includes the same control, so it cannot pass vacuously.

2. Credential stripping in agentOverrides was already complete, but under-reported.
   `sanitizeAgentOverrides` builds its result as an ALLOW-LIST, so any field that
   is not provider/model/temperature/maxTokens/priority never survives — apiKey,
   token, password and friends were all dropped already. Only the *warning* was
   apiKey-specific, so a user who pasted a token got no feedback. The warning now
   covers all credential-shaped keys, and a test asserts no warning ever echoes a
   secret value.

ADR-126 gains a section recording the execution decision and what was rejected
(opt-in-by-default, sandboxing), plus the requirement that future language
delegations honor the same switch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 10:35:11 +00:00
Dragan Spiridonov 9b6de39792 fix: resolve issues #565, #567, #568, #569 (deps, LLM wiring, agent routing, coverage honesty)
Four independent user-reported issues, each verified end-to-end through the real
MCP protocol server and adversarially reviewed via qe-court.

#565 — HIGH CVE reachable by consumers
`@huggingface/transformers` was an *optional* peerDependency, but npm >=7
auto-installs optional peers — `optional` only suppresses the error when the peer
cannot be resolved. Every `npm install agentic-qe` therefore pulled
onnxruntime-node -> adm-zip@0.5.x (GHSA-xcpc-8h2w-3j85), and no resolvable
version of that chain is unaffected. Dropped the peer (it stays a devDependency
and an opt-in for local in-process embeddings; both load sites already degrade
with an actionable message). Consumer audit: 4 HIGH -> 0.

#567 — test_generate_enhanced never invoked the LLM
The DI factory behind the task-executor path was registered as `(memory) => ...`,
so `llmRouter` never reached TestGeneratorService and the ADR-051 branch was
unreachable regardless of provider configuration. Threaded the router through the
registry -> resolveTestGeneratorService -> getTestGenerator (now async), honored
the documented `aiEnhancement` opt-out, and surfaced `llmEnhanced` /
`generationMode` / `note` so a silent fallback is diagnosable. `llmEnhanced` now
reflects what the LLM actually produced — a broken provider (401/timeout/empty)
no longer reports AI-enhanced output it did not produce. The CLI was unaffected
(it goes through the domain plugin, which was already wired).

#568 — per-agent provider routing had no on-disk surface
Added `agentOverrides` to `.agentic-qe/llm-config.json` with keyed-object merge,
validation that drops bad entries individually and strips leaked API keys, and
resolution ahead of the category defaults. Materialized the overrides into
routing rules the router actually evaluates, and threaded `agentType` through all
nine router-calling domain services — without it a parsed override built a rule
that never fired. Also added the missing `codex` entry to ALL_PROVIDER_TYPES,
which had made that provider unselectable through the router.

#569 — coverage_analyze_sublinear reported fabricated data for Rust
Coverage now carries provenance (`estimated` / `measured` / `coverageMethod`),
uncollected branch and function metrics report `null` instead of 0 or 100, gaps
derived from an estimate carry low confidence and an `estimated` flag, and Rust
crates are measured with `cargo llvm-cov` where available. Test code (`tests/`,
`benches/`, brace-matched `#[cfg(test)]` blocks) is excluded from production
coverage, and line numbers can no longer exceed the file length. Security scans
now state their analysis depth so "zero findings" is not read as "verified clean".

Adversarial review (qe-court, cross-vendor) found and this commit fixes: an
anchoring bug that dropped `latest_parser.rs` as a test file; brace matching that
counted braces inside string literals and comments; `#[cfg(test)]` on a
non-module item swallowing the following production function; crate detection
that skipped instrumentation for subdirectory targets, over-claimed nonexistent
targets, and hijacked polyglot subtrees; and a Cobertura fallback that rounded a
measured 47% to 0%.

ADR-125 (on-disk agent routing overrides) and ADR-126 (measurement provenance)
document the decisions; ADR-115 gains an amendment on optional peers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 09:59:49 +00:00
Dragan Spiridonov 9fbd9db91f chore(release): bump version to v3.13.0 2026-07-18 16:41:27 +00:00
Dragan Spiridonov 5c41f62fab docs(intro): list qe-court + bump user-facing QE skill count 75→76
The user-facing intro's "Selected QE skills available" table omitted qe-court and
still read 75. Adds /qe-court to the Review category and updates the count to 76.
AQE-QE-scoped only (excludes ruflo/platform/dev skills); the on-disk "115 skill
definitions" line is already correct (qe-court made it 114→115).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 15:59:00 +00:00
Dragan Spiridonov 40d2930005 docs(analysis): M3.1 retired — ruflo flywheel already significance-gated (no PR)
Source-verified in /workspaces/ruflo: the flywheel already refuses to promote a
candidate whose paired candidate-vs-baseline delta isn't significant —
`significant = bootstrapDeltaCILow(paired holdout deltas) > 0`, rule accept/v1+sig,
one-sided 95% paired bootstrap, n>=20 (evolve-proof.ts:174-183). That is STRONGER
than the unpaired ANOVA we were going to contribute (2-group ANOVA F = t², and it
drops the pairing). Our premise ("maybe ruflo promotes noise") was wrong.

Outcome: NO contribution PR (would be redundant and weaker). Corrects the strategy
report's open-Q #3 (ruflo's flywheel IS rigorously DoE-validated) and retires the
M3.1 action. The draft is kept, marked superseded, documenting the one genuinely-
additive idea (an ANOVA candidate-SELECTION veto) and why it's a bigger, replay-
verifier-touching change — deferred, not pursued.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 14:29:58 +00:00
Dragan Spiridonov 1c0ac96a9f docs(analysis): M3.1 ruflo DoE contribution (draft) + M3.2 AgentDB assessment
M3.1: a ready-to-post, collegial issue draft offering AQE's DoE/ANOVA screen
(ADR-122) to validate ruflo's ADR-176 flywheel promotions — the "2 compounding
promotions / flat human anchor" shape matches AQE's own "beads" null. HELD from
posting to ruvnet/ruflo pending the user (a ruflo collaborator).

M3.2: assessment — ruflo v3.25.2's torn-full-image-flush fix does not apply to
AQE (better-sqlite3 WAL = atomic commits, not sql.js full-image flushes); AQE's
actual corruption class (virtiofs WAL/shm) is already mitigated in safe-db.ts.
Transferable lesson filed: auto-restore-on-malformed-open (AQE restores manually
today) — a scoped follow-up, not built here (memory.db recovery is data-sensitive).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 14:07:29 +00:00
Dragan Spiridonov 538557485a docs(analysis): M3.3 embedder trial — evidence-based verdict (two "lattices")
(A) npm "@ruvector Lattice WASM" = vaporware (E404; claude-flow's own source admits
the default package doesn't exist; inert opt-in slot) — the ruvllm mock-mode pattern.

(B) github.com/ohdearquant/lattice = a REAL pure-Rust inference engine (runs on
arm64 here, pushed 2026-07-18). But the shipped binary is chat-only — serve exposes
/v1/chat/completions,/v1/models,/health, NO /v1/embeddings (source
crates/inference/src/serve/mod.rs:248). Embeddings are a separate lattice-embed
crate, source-build-only, CLI not HTTP. Models incl. BGE-small 384 (default) …
Qwen3-Embedding 1024.

Verdict: GO-with-caveats, NOT a drop-in and not the cheapest path — the near-term
win (BGE-small @384, MTEB-stronger than MiniLM, same dim) is reachable via AQE's
existing transformers.js path (Xenova/bge-small-en-v1.5), no Rust/shim. Keep lattice
for a bigger move (Qwen3-1024, SIMD perf, Cognitum-side embedding serving).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 14:00:03 +00:00
Dragan Spiridonov e6b0b72b8f feat(qe-flywheel): cross-side witness verifier for the qe-harness bridge (ADR-124 M2.2)
Adds the single AQE-side verifier that reconciles AQE flywheel receipts with
Cognitum qe-harness witness bundles, so QE evidence signed by the shared platform
identity (fingerprint f1ac28607da49ec1) is verifiable on either side.

Investigation (read-only, cognitum-one/qe-harness) established the bridge is
HALF-wired already: both sides use Ed25519, the same QE_WITNESS_SIGNING_KEY (JSON
PEM), and the IDENTICAL fingerprint scheme sha256(pem.trim())[:16] — both sign as
f1ac28607da49ec1. What was NOT aligned: the signed artifacts (AQE = fixed-order
JSON body, hex; qe-harness = stableStringify sha256: digest, base64, nested
witness{}) are not natively cross-verifiable.

- src/learning/qe-flywheel/witness-verify.ts: allowlist-driven verifier for BOTH
  formats + stableStringify/canonicalDigest (qe-harness parity), tamper-detecting,
  fail-closed allowlist. node:crypto only; reuses receipt.ts for the AQE path.
- 15 tests: fingerprint parity (keyFingerprint === signer.keyId), both formats
  round-trip, tamper → bad-signature/digest-mismatch, allowlist enforcement.

Two external dependencies remain (need the qe-harness owner — documented in the
GOAP plan, NOT done unilaterally): provision the f1ac28607da49ec1 PUBLIC key via
QE_WITNESS_PUBLIC_KEYS_JSON; confirm byte-parity vs a real qe-harness sample;
decide canonicalization convergence (AQE's hand-listed body silently drops new
fields — recommend adopting stableStringify).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 13:42:29 +00:00
Dragan Spiridonov 42e5bf9b3b docs(api): draft /v1/qe/verdict OpenAPI spec — hosted QE-Court (ADR-124 Phase 2, M2.1)
The hosted qe-court: POST a delivery (diff/patch/files), get a signed,
overturn-tested verdict. Grounded in the M1 live probe — a NEW route on the
existing api.cognitum.one inference service (X-API-Key, x_cognitum receipts),
NOT the ADR-308 funnel (which 404s on that host); /v1/qe/* confirmed free.

Verdict semantics reference the OSS referee (src/skills/qe-court/referee.ts) so
client and server agree: 3-valued verdict, the overturn mechanic (overturnDepth),
writer≠juror + vendor-diversity (422 PANEL_INVARIANT_VIOLATION), DoE-gated score,
Ed25519-signed record (ADR-118), provenance-tiered charges (ADR-121). Sync + async
job models; budget/cap semantics mirror /v1/chat/completions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 13:37:49 +00:00
Dragan Spiridonov 7ab6b48564 docs(analysis): record M1 Cognitum live-probe result
M1 resolved: api.cognitum.one's inference API and the ADR-308 funnel/proxy API
are NOT the same backend. /v1/proxy/*, /v1/credits, /v1/events, /v1/funnel-policy
all 404 ROUTE_NOT_FOUND on the inference host; the funnel layer is a separate
service (confirms ADR-308's addendum). /v1/qe/* namespace is free (404) — build
ADR-124 Phase 2 as a new route on the existing inference Express app. Hard cap
confirmed: hardCapUsd $20, headroom $19.34. Tiers route to a model marketplace
(cognitum-low -> z-ai/glm-5.2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 13:15:44 +00:00
Dragan Spiridonov fd3b6790b6 docs(analysis): ruflo/Cognitum integration strategy + GOAP plan
Six Thinking Hats strategy report and the precondition-ordered GOAP execution
plan for the AQE <-> ruflo <-> Cognitum integration work. Captures: what's new
in ruflo (Cognitum funnel ADR-301..319), AQE's current integration state, the
gap analysis / top-10 opportunities, the QE-Court addendum (= ADR-124 /
/v1/qe/verdict from the user-facing end), and the tiered plan with per-item
approval gates (incl. Codex-as-prosecutor and Codex-as-provider M3.5).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 12:51:04 +00:00
Dragan Spiridonov 5f323ec77c feat(skills): add qe-court adversarial review skill (ADR-124)
QE-Court convenes independent, cross-vendor AI reviewers against a delivery
(diff / PR / test-suite), makes them file charges from their own probe sets,
then forces any SHIP verdict to SURVIVE an escalating deeper review before it
stands (loop-until-dry overturn). Verdict is 3-valued — SHIP / REMAND / BLOCK —
with a human as final judge. It is the reference implementation of ADR-124; the
hosted sibling is the planned Cognitum /v1/qe/verdict endpoint.

The skill is an orchestration layer that COMPOSES existing assets — it does not
reimplement critics:
  - Prosecutors: qe-devils-advocate, brutal-honesty-review, sherlock-review,
    qe-security-scanner, qe-mutation-tester, and `codex exec review` (cross-vendor
    GPT lens — the strongest form of writer≠juror).
  - Kill round: src/verification/adversarial-verify. Jury: two-gate judge (ADR-119).
  - Evidence: provenance tiers (ADR-121), signed receipt (ADR-118).

Configurable per-role model routing (config.json `routing`) across Claude /
Cognitum tiers / OpenRouter / Codex / local, all through the ADR-123 provider
layer (budget caps + receipts). Invariants: >=2 distinct vendors, jury vendor
!= writer, DoE-gated scoring (no un-validated "91/100").

Self-learning (ADR-124 M0.B/C): signed court records feed the flywheel; reproduced
charges become oracle-tier qe_patterns; an overturned SHIP is persisted as a
discriminator training pair for the frozen anchor + two-gate judge.

Ships via `aqe init` (added to V3_DOMAIN_SKILLS; auto-installed, not excluded)
and the assets/ npm mirror. Includes a runnable acceptance eval + a seeded-mutant
fixture (a boundary off-by-one a shallow reviewer rates SHIP; the overturn round
must flip it, and MUST regress to SHIP at overturnDepth=0). trust_tier 1 until the
eval runs green (>=5 oracle cases) → then tier 3.

Skill count: 75 -> 76 user-facing (totalQESkills 81 -> 82). Parity clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-18 12:50:52 +00:00
Dragan Spiridonov 871d6c81af chore(release): bump version to v3.12.3
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 13:20:03 +00:00
Dragan Spiridonov 9943c0c2d0 chore(release): bump version to v3.12.2
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 11:49:37 +00:00
Dragan Spiridonov b9a4b4c6e8 feat(llm): billing-aware execution — subscription provider, enforced budgets, real eval (ADR-123)
Closes the structural gap from issue #557: AQE could only bill the paid
Anthropic API even for Pro/Max subscribers, and its budget caps were never
enforced.

- claude-code provider: run QE via `claude -p` on the user's subscription;
  child env strips API-billing keys so it can't revert to API billing
- Enforced cross-process spend caps (--max-budget-usd / AQE_MAX_BUDGET_USD),
  persisted to memory.db (llm_spend); enforced on the ProviderManager AND
  HybridRouter paths; over-budget aborts with COST_LIMIT_EXCEEDED
- cognitum provider: OpenAI/Anthropic-compatible gateway with per-request
  cost receipts, embeddings, and a server-side hard cap
- Billing-mode taxonomy + startup notice + `aqe health` LLM Billing section
- config-store: honor explicit `enabled: false` over env key presence;
  AQE_LLM_PROVIDER selector
- Fix: `aqe eval run` no longer scores fabricated mock responses — real
  provider by default, hard-error when none configured, `--mock` opt-in
- Consensus verification path prints a billing warning (deferred full port)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 11:49:28 +00:00
Dragan Spiridonov e06a975d46 chore(release): bump version to v3.12.1
Non-destructive `aqe init` for `.claude/settings.json`: merge instead of
overwrite, preserve user-owned config (custom statusLine, explicit
includeCoAuthoredBy, AQE_* env overrides, other tools' hooks such as ruflo /
Claude Flow), deep-merge v3 sections, and back up the pristine original before
writing (mirroring CLAUDE.md.backup).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 16:44:21 +00:00
Dragan Spiridonov ad30937ed8 chore(release): bump version to v3.12.0 2026-07-10 19:28:03 +00:00
Dragan Spiridonov 7537fefb4e feat(doe): definitive 27/27 DoE re-run via OpenRouter — real F-tests + persisted raw data
Completes and supersedes the 2026-07-09 directional DoE (which was 25/27 cells, had
no F-test, and — the reproducibility gap found this session — never persisted its raw
data). Re-run full under the CRIT-2 design (N=5 stochastic replicates of fixed item
A1-inRange, real within-cell error term), qwen local $0 + anthropic/claude-haiku-4.5
+ anthropic/claude-opus-4.8 via OpenRouter. $1.538 total, well under the $11 budget.

Results (real main-effects ANOVA, 135 observations, first real data the aggregator
has ever consumed — previously stub-only):
- scaffold: none 1.000 >> plan-and-solve 0.311 >> reflexion 0.067
    F(2,108)=218.9, p=1.0e-38, 71.9% of variance — DOMINANT and strongly NEGATIVE.
    Both scaffolds DROP. retort's "more harness lowers reliability", now overwhelming.
- model: qwen3-coder:30b 0.644 > haiku-4.5 0.400 > opus-4.8 0.333
    F(2,108)=25.1, p=1.1e-9 — local qwen best & free; opus 5x+ cost = negative value.
    (Complete 27/27 reverses the prior unequal-n haiku>opus>qwen ordering, significantly.)
- retrieval: off 0.480 > on 0.433  F(1,108)=1.5, p=0.22 NOT significant, slightly
    negative — the ADR-118 flywheel feature-on-trial formally fails as `beads`.
    EXPLAINED by the 2026-07-10 coupling finding: A1-inRange is a no-headroom item
    the models know cold, so a retrieved exemplar has nothing to add.
- prompt: TDD 0.533 > ATDD 0.467 > neutral 0.378  F(2,108)=5.7, p=4.5e-3.

Changes:
- scripts/doe-run.ts: cloud path rewired from raw Anthropic fetch to OpenRouter
  (vendor/model ids, opus-4.8 not opus-4-7, exact per-call cost from usage.cost).
- docs/implementation/doe-run-2026-07-10.jsonl: raw per-cell data persisted IN-REPO
  (fixes the gap that lost the 2026-07-09 run's data).
- DOE-HARNESS-SCREEN-DESIGN.md §Results (DEFINITIVE) + ADR-122 status/history updated;
  prior directional run retained, marked SUPERSEDED.

Verified: tsc 0 errors; $0 --stub and --smoke pipelines green before the metered run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 16:28:55 +00:00
Dragan Spiridonov 68c8914f92 feat(learning-integrity): live coupling validation closes CRIT-1 — mechanism real but headroom-gated
Runs the CRIT-1 coupling experiment live on qwen3-coder:30b (Ollama, $0) and
characterizes EXACTLY when the ADR-118 flywheel's retrieval helps generated tests.

Result (N=5/condition, mutation-oracle graded, end-to-end "runs∧kills" response):
- POSITIVE CONTROL (POS-reserved — an arbitrary system-specific rule the model
  cannot know a priori, a proxy for project-specific corpus knowledge):
    NONE 0.00 / IRRELEVANT 0.00 / RELEVANT 1.00  →  gain +1.00  COUPLING VALIDATED.
  Without the exemplar qwen can't even write a passing test; with it, a perfect one.
- TEXTBOOK (B4-isLeapYear — the century/400 rule):
    NONE 1.00 / RELEVANT 1.00  →  NO HEADROOM (the model knows the trap cold).

Conclusion: the coupling mechanism is REAL (the harness demonstrably detects it, so
its nulls are live measurements) but HEADROOM-GATED — retrieval improves tests iff
the corpus supplies knowledge the base model lacks. Generic QE edge cases are
already known to code models (30b AND 7b), which is WHY the ADR-122 DoE rated
retrieval `beads`. This explains the prior honest nulls rather than contradicting them.

Getting here required fixing three measure-the-measurement traps that had produced a
FALSE "no coupling" verdict on the first run:
- baseline floored by 500-token truncation (→ 1400) and empty-input over-reach;
- spec leaked the trap (anchor inputUnderTest spells out the edge) → no headroom →
  switched to UNDER-SPECIFIED specs graded against the frozen trap-encoding reference;
- metric conditioned on baseline, hiding retrieval's strongest effect (rescuing a
  test that otherwise can't be written) → switched to end-to-end usable-quality.

Also:
- OpenRouter wired as the cloud path (vendor/model ids; anthropic/claude-haiku-4.5
  et al. confirmed reachable), replacing the rate-limited Anthropic-direct fetch.
- coupled-anchor.test.ts: adds an honest AQE_LIVE_COUPLING-gated end-to-end test that
  fails loudly (never fabricates a pass) rather than asserting the mechanism the
  scripted unit test only assumes.
- ADR-118 status → "INFRASTRUCTURE WITH A CHARACTERIZED SIGNAL": the flywheel's
  retrieval-tuning pays off iff qe_patterns holds knowledge the base model lacks.

Verified: tsc 0 errors; coupled-anchor 1 passed + 1 skipped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 14:40:45 +00:00
Dragan Spiridonov df183d1ea4 fix(learning-integrity): remediate brutal-honesty-review findings on ADR-117..122
Addresses the CRITICAL/HIGH/MED findings from the brutal-honesty review of the
learning-integrity cluster. The theme: the machinery was real but several claims
outran the evidence. This makes the claims honest and the evidence falsifiable.

CRIT-1 / HIGH-3 (flywheel gated vapor / toy anchor can't move):
- verification/anchors/qe-anchor-v2.json — 5 oracle-verified DISCRIMINATING items
  (13 mutants), each with a trap edge a happy-path test misses, so the anchor CAN
  actually move. v1's items were too easy to discriminate a retrieval effect.
- scripts/coupling-experiment.ts — falsifiable NONE/IRRELEVANT/RELEVANT controlled
  test (N reps, temp>0, $0 mutation-oracle grading). Live run remains blocked on
  model availability; the harness refuses to fabricate a verdict.

CRIT-2 (DoE "stats" were a range proxy):
- scripts/doe-run.ts — N real replicates of a FIXED item at temp=0.6 (was 5
  different items x1 at temp=0), per-replicate seed, plus a deterministic $0 --stub.
- scripts/doe-aggregate.mjs — real main-effects factorial ANOVA: within-cell error
  term, F-test via dependency-free regularized incomplete beta; beads verdict now
  gates on p<0.05, not an eyeballed mean delta.
- tests/unit/scripts/doe-aggregate.test.ts — F-CDF + incomplete-beta vs closed
  forms/R, planted-effect recovery (p<0.001), null factor (p>0.5), unbalanced cells.

HIGH-4 / MED-6 (over-claimed gate guarantees):
- ADR-120 gains a "Threat model and limits (honest)" section: gateReExecutes
  catches a lying log, not a buggy gate (same-process seal+rule).
- ADR-118 status reframed to "infrastructure awaiting a validated signal."
- tests/unit/validation/rule-consistency.test.ts — property test scoping what the
  gate actually guarantees (determinism, stable fingerprints, flipped-verdict).
- DOE-HARNESS-SCREEN-DESIGN.md — unequal-n note.

HIGH-5 / MED-7 (self-fulfilling test / brittle scripts):
- tests/unit/learning/mmr-scaling.test.ts — FALSIFIABLE regression for the real
  O(n^4) scoreHeldOut hang the MMR_POOL_SIZE cap fixed (96s->420ms at n=300).
- coupled-anchor.test.ts de-faked: relabeled as a MECHANISM/wiring test, documents
  that the scripted generator hardcodes the outcome and the real model was an
  honest null — no longer readable as evidence that coupling helps.
- tests/unit/validation/sealed-hash-roundtrip.test.ts — regression for the
  canonicalJson undefined-key seal bug.

Verification: tsc 0 errors; 33/33 new remediation tests + 290/290 full
validation+flywheel cluster green. No live model run (Ollama offline + Anthropic
account at usage limit) — coupling live-validation surfaced as the one honest
open item, not faked.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 14:12:31 +00:00
Dragan Spiridonov 0a8254f7a9 feat(learning): ADR-117..122 learning-integrity cluster (frozen anchor, two-gate judge, gate-reexecute, provenance tiers, receipt-gated flywheel, DoE)
Adopts the receipt-gated self-improvement discipline from the 2026-07 cross-repo
analysis of ruflo (flywheel), MetaHarness (gateReExecutes), and retort (two-gate
spec conformance + DoE). All DI'd and unit-tested (178 tests); run end-to-end on
real qe_patterns; every limitation honestly scoped.

- ADR-117 frozen oracle anchor: hash-pinned, constant-denominator eval set that
  no promotion may regress; loader throws on drift (verification/anchors/qe-anchor-v1.json).
- ADR-118 receipt-gated QE-policy flywheel: generational loop over qe_patterns,
  conjunctive frozen accept(), Ed25519-signed receipts + compounding lineage,
  durable persistence (flywheel_receipts), corpus + semantic-retriever coupling.
- ADR-119 two-gate quality verdicts: mechanical gate + frontier judge, three-valued
  (pass/fail/inconclusive) with preflight; new `aqe quality-gate` CLI + `qe/quality/gate` MCP tool.
- ADR-120 gateReExecutes: re-execute a versioned frozen rule on sealed inputs;
  catches the A8-EXT forged-promote class; retrofit onto pattern-promote + dream-apply.
- ADR-121 provenance tiers: only oracle:test-exec evidence changes fleet behavior;
  additive, conservative-backfill migration.
- ADR-122 DoE screen: model x prompt x retrieval x scaffold, run on real data
  (25/27 cells, $1.25) — scaffolding (esp. reflexion) and retrieval degrade
  reliability (the retort `beads` signature); simplest+cheapest stack wins.
- safe-db: AQE_DISABLE_WAL / AQE_JOURNAL_MODE env-gate (macOS virtiofs bind-mount
  WAL corruption mitigation; default behavior unchanged).

Honest nulls documented: the flywheel lift is on a self-supervised proxy with the
anchor held flat; making the coupled anchor move needs harder items + a relevant
corpus (an ADR-117 re-freeze), not a retriever change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 10:26:54 +00:00
Dragan Spiridonov 235ed8df0f chore(release): bump version to v3.11.5
Bumps package.json + package-lock + skills-manifest fleetVersion to
3.11.5. Also fixes .claude-plugin/plugin.json and
assets/skills/skills-manifest.json fleetVersion, which had drifted
stale at 3.11.0 across the last 4 releases (found via full-repo
version-string audit).
2026-07-07 07:47:50 +00:00
Dragan Spiridonov a454889099 chore: clean up dead DB rows, fix pre-existing GOAP lint errors, track remaining work
- Backup-verified cleanup of .agentic-qe/memory.db: 200/200 degenerate
  mincut_snapshots rows, 501/501 degenerate mincut_history rows, 530/530
  test-fixture execution_results rows, 705/705 test-fixture executed_steps
  rows (all confirmed 100% junk before deleting); corrected 72
  dream_insights.applied rows corrupted by the now-fixed counter bug back
  to the correct boolean value. Full backup + before/after row counts +
  integrity check per data-protection policy.
- Fixed 4 unused-vars lint errors in goap-planner.ts/goap-execute.ts
  (2 pre-existing + 1 that surfaced after removing the first + 1 in
  goap-execute.ts). Left two genuinely unimplemented stub params
  (updateActionStats duration tracking, findSimilarPlan fuzzy matching)
  honestly marked rather than scope-expanded.
- Filed proffesor-for-testing/agentic-qe#554 to track everything from the
  system-integrity remediation that's deliberately deferred, so it isn't
  silently dropped.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 17:18:19 +00:00
Dragan Spiridonov 53ee377aec fix(learning): close system-integrity audit gaps in dream engine, witness chain, mincut, GOAP executor, and SONA
Full remediation of docs/analysis/SYSTEM-INTEGRITY-AUDIT-2026-07-04.md's
P0-P2 findings, tracked in docs/plans/SYSTEM-INTEGRITY-REMEDIATION-GOAP-PLAN-2026-07-04.md.

Highlights:
- Dream engine: real pattern creation on insight apply, error/outcome
  concept nodes from real ADR-110 data, and a follow-up fix ensuring the
  concept refresh actually runs on the real automatic path (not just via
  test wrappers); persistTaskOutcome now genuinely promotes pending
  insights instead of blindly incrementing an applied counter
- Witness chain: Ed25519 signing wired via persistent key directory,
  archival/append-after-archival bug fixed, CI verification gate added
- Mincut: real event-bus wiring (was a no-op stub) and scaffold-vertex
  detection fixes
- GOAP: real domain-API dispatch executor replacing the always-mock one
- SONA: EWC++ cold-start deadlock fixed via independent request-count
  persistence
- ADR-110 pattern-nulls wired into the real production capture path
- Daemon/snapshot visibility, TTL unit bugs, and 8 ADRs re-statused with
  additive verification notes

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 12:18:00 +00:00
Dragan Spiridonov e058c94fa5 chore(release): bump version to v3.11.4
3.11.4 = the local-model-improvements branch (LLM/Ollama plumbing, free-tier
local test-gen, proof-gate ADR-116) + the already-merged dependency-security
system (ADR-115). Merged origin/main in first so the release carries the
grpc-js HIGH fix and moderate-CVE reductions rather than regressing them.

Bumps package.json + package-lock + skills-manifest fleetVersion to 3.11.4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 06:38:12 +00:00
Dragan Spiridonov 9ca2c128ef Merge remote-tracking branch 'origin/main' into feat/local-model-improvements 2026-07-01 06:24:12 +00:00
Dragan Spiridonov f2742c8651 docs(adr): add ADR-116 for proof-gate + cross-ref from code
The proof-gate work cited only upstream RuVector 'ADR-194' — which is not an
AQE in-repo ADR. Adds ADR-116 (the AQE-side integration decision: port the
hash-chain to TS, opt-in/fail-soft/single-store wiring, and why NOT to depend
on the @ruvector npm packages — backed by the verified ruvllm mock-mode/demo
findings) and cross-references it from the four source/test files that cite
ADR-194, so the in-repo decision is discoverable from the code.

Comment/docs only — no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 06:22:43 +00:00
Dragan Spiridonov 6dcb919aee feat(deps): dependency-security system + fix grpc-js HIGH (ADR-115)
Closes the gap that let @grpc/grpc-js@1.14.3 (CVE-2026-48068/48069, HIGH)
sit undetected: every existing dependency check only fires on dep-file
changes, so a CVE disclosed against a frozen pin was invisible.

Adds:
- scripts/dependency-audit.mjs    in-repo + consumer-POV audit, severity gate
- scripts/dependency-update.mjs   security-first in-range updater with a guard
                                  that refuses to drop optional @ruvector
                                  platform deps (the Dependabot lockfile bug)
- dependency-audit.yml            daily consumer-POV scan -> tracking issue
- dependency-update.yml           weekly in-range security PR (gh CLI)
- docs/guides/dependency-security-policy.md + ADR-115
- tests/unit/scripts/dependency-security.test.ts (11 hermetic tests)
- npm scripts: deps:audit[:consumer], deps:update[:all]

Also bumps @grpc/grpc-js 1.14.3 -> 1.14.4 in-range (HIGH 1 -> 0); optional
platform deps preserved (90 -> 90).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 12:18:21 +00:00
Dragan Spiridonov 6174652c57 feat(llm): unified AQE_OLLAMA_URL + adaptive Ollama timeouts (#2, #3)
#2: single resolveOllamaBaseUrl() knob (AQE_OLLAMA_URL > OLLAMA_URL >
each call-site default) wired into all local clients — chat provider,
consensus provider, local judge, embeddings, free-tier. Unset = identical
behavior; one var now repoints every client at a remote/host Ollama.

#3: size each Ollama request timeout from num_predict and the model's
observed tok/s (EMA) instead of a fixed 120s, so slow dense/thinking
models (~15 tok/s measured) no longer silently time out mid-generation.
Explicit/configured timeouts still win.

Adds scripts/oracle-model-bench-local.ts (local mutation-oracle bench).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 11:39:55 +00:00
Dragan Spiridonov eead05dbbf chore(release): bump version to v3.11.3
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 16:27:58 +00:00
Dragan Spiridonov 0f418231c9 feat(conservation): gate plugins (strict mirror) + .kiro (presence); add --sync resync
Close the biggest remaining drift gap (ADR-114 follow-up).

- skill-parity now gates plugins/agentic-qe-fleet/skills as a strict body-mirror alongside
  assets/skills; reconcileBody + `check-skill-parity --sync` resync drifted mirrors while
  preserving each tree's frontmatter (used to fix the plugins qe-quality-assessment drift)
- .kiro/skills is an intentionally divergent 86-skill variant (qe- prefixed, some large
  .kiro-only bodies) — gated by PRESENCE via the conservation guard's kiro-skills surface,
  not body-equality (which would destroy the divergence)
- both guards (verify:skill-parity blocking, verify:conservation non-blocking) wired into
  invariant-check.yml with plugins/.kiro paths; policy doc updated
- tests: reconcileBody/splitFrontmatter covered; 16 validation tests pass

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 15:56:52 +00:00
Dragan Spiridonov af4140efb9 feat(quality): oracle evals, durable-first tests, conservation guard + provider fixes
Apply Phoenix Architecture principles to AQE — regenerate internals, conserve the interface.

ADR-113 (evals are oracles, durable-first tests, mutation-score gate):
- src/validation/oracle-eval.ts grades a generated test by running it against a
  reference impl + operator mutants (reuses qe-arena, ADR-104); rejects assertion-less output
- oracle mode wired into scripts/run-skill-eval.ts (skips under the simulating runner; runs live)
- qe-test-generation rewritten durable-first; its eval flipped to oracle
- src/feedback/regenerability-gate.ts: mutation-score + regenerability gate (warn-default, opt-in block)
- live-validated: Claude sonnet-4-6 clears the oracle 5/5; weak local-model output correctly fails

ADR-114 (conservation layer, Phoenix essay 14):
- src/validation/conservation-guard.ts + scripts/conservation-guard.ts guard CLI commands,
  output schemas, and dashboard API against breaking removals (deprecation registry exempts)
- policy doc + baselines in verification/conservation/; wired into invariant-check.yml non-blocking

LLM provider fixes:
- OpenRouterProvider.type was 'openai' but registered under 'openrouter' -> ProviderManager
  failover never found it; fixed to 'openrouter' end-to-end
- Gemini default model gemini-1.5-pro was retired -> gemini-2.5-flash; models/pricing refreshed
  from the live Gemini ListModels API
- scripts/provider-health.ts (npm run providers:health)

Cheaper-model eval lanes:
- scripts/oracle-model-bench.ts + openrouter-models.ts; openai/gpt-oss-120b clears the oracle
  ~50-70x cheaper than Claude Sonnet; guide in docs/guides/cheaper-model-eval-lanes.md

Verification: npm run build ok; 115 new+touched tests pass; 724 LLM tests pass; lint + parity clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 15:37:46 +00:00
Dragan Spiridonov 4a3b96d112 chore(release): bump version to v3.11.2 2026-06-27 11:36:40 +00:00
Dragan Spiridonov 9fd18ed00a feat(code-intelligence): first-class C4 architecture diagrams (ADR-112)
Consolidate C4 diagram generation onto a single engine and expose it to
users via CLI and MCP, with a deterministic confidence gate and real
Knowledge-Graph-derived relationships.

- Consolidation (C1/C6): C4ModelService is the single render/analyze/store
  engine; the bridge delegates and FAILS LOUD on a render error instead of
  silently degrading. Duplicate inline generators removed.
- C2: real component relationships from the Knowledge Graph (AST import/call
  edges) replace the naming heuristic; project-scoped via a new KG basePath
  so repos outside cwd don't trip the path-traversal guard.
- C3: deterministic confidence gate (high/medium/low + reasons) on every
  diagram — surfaces the detector's known limits instead of hiding them.
- C4/C5: `aqe code c4` CLI + `qe/code/c4` MCP tool (generate/search),
  verified at MCP-CLI parity and through the protocol-server bridge.
- Search: generate persists embeddings (opt-in `enableC4Embeddings`, on for
  MCP) so `qe/code/c4 search` returns hits in the standard flow.
- Fixed pre-existing lint in touched files (require->import, unused catches).

Docs: ADR-112 + docs/guides/c4-architecture-diagrams.md. tsc + lint clean;
C4 surface fully green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27 11:27:25 +00:00
Dragan Spiridonov 408e07e3a8 Darwin-for-QE — Cost Reduction & Plain-English Results 2026-06-26 16:48:21 +00:00
Dragan Spiridonov bd2d1736f6 docs(learning): add memory.db Data Model section to ReasoningBank guide
Document the qe_patterns table (5 column groups, dedup index, score
formulas) and all connected tables: FK-bound satellites (embeddings,
nulls, versions, evolution, relationships), convention-linked tables
(usage ledger, deltas, FTS), outcome/feedback tables (experiences,
applications, trajectories, routing_outcomes, rl_q_values), and the
shared backbone (kv_store task-bridge, vectors, dream, concept graph).
Grounded in the live schema v10. Includes relationship diagram.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:22:46 +00:00
Dragan Spiridonov 3fd38c09d5 docs(learning): fill gaps in ReasoningBank guide — nulls, CLI, routing confidence, free-tier
- Add "Learning From Failure — Kept Nulls" section (ADR-110): negative
  pattern records, context fingerprints, retrieval-time discount
- Add "Inspecting & Steering — CLI Commands": aqe learning / aqe memory
- Add "Understanding the Numbers": explain session-start routing
  confidence / success rate and why confidence climbs with use
- Add "Cheap-Local Self-Improvement" (ADR-111, opt-in escalation ladder)
- Fix stale v3/src/ paths → src/; add nulls/free-tier/CLI files to table

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:01:52 +00:00
Dragan Spiridonov e25a1ef95e chore(release): bump version to v3.11.1 2026-06-25 08:25:02 +00:00
Dragan Spiridonov a42c3073e0 feat(shared): graceful optional-module loading + CI absent-drill (plan 05 / A9)
ADR-150 graceful-degradation core. AQE's native/optional deps (@ruvector/*,
hnswlib-node, rvlite) must degrade — not crash — when a platform binary or a
Dependabot-pruned lockfile is missing.

- src/shared/optional-module.ts: loadOptionalModule(name, req?) → {available}|
  {degraded}. Fixes the #528 anti-pattern in the existing ad-hoc
  try{require}catch{} (6+ ruvector wrappers): degrades ONLY on genuine absence
  (MODULE_NOT_FOUND) and RE-THROWS real load failures (ABI mismatch / corrupt
  .node) instead of masking them. 8 tests incl. the rethrow property.
- .github/workflows/degraded-mode.yml: the absent drill — npm ci --omit=optional
  --ignore-scripts, then run the degraded-path tests. Pairs with the regular
  install job (proves both paths, #528).

Follow-up (held, CI-verified): migrate the ad-hoc sites + the static import in
sona-wrapper.ts onto loadOptionalModule (changes a production native-load path).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:59:04 +00:00
Dragan Spiridonov 82dfa013ef chore(darwin): A8 version contract — pin ScoreCard compat, hold the dep-swap
Investigated A8 (pin @metaharness/darwin + retire the type-mirror):
- VERIFIED: AQE's DarwinScoreCard mirror is byte-identical to upstream ScoreCard
  from @metaharness/darwin@0.2.1 THROUGH the published 0.7.0 (no drift, 5 minors).
- HELD the dep-swap deliberately: upstream is fast-moving pre-1.0 with napi/wasm
  transitive deps; adding it changes every user's install + lockfile and can't be
  verified locally (host-shared-node_modules breaks native rebuilds) — negative-EV
  vs 74 stable, zero-coupling mirror lines.
- SHIPPED the version-contract half: pinned provenance (0.2.1–0.7.0) + a drift-
  guard test (darwin-version-contract.test.ts) that fails CI on any field-set
  divergence. 17 darwin tests green; tsc clean.

Swap only after upstream stabilizes (≥1.0) + a CI-verified install impact; needs OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:30:43 +00:00
Dragan Spiridonov a384a640bb feat(audit): witnessed finding delivery (A7) + user-facing Darwin-QE guide
A7 (AQE side): point the Ed25519 witness chain at DELIVERED findings, not just
internal events.
- witness-chain: add FINDING_DELIVERED / FINDING_BLOCKED action types.
- witness-findings.ts: recordDeliveredFindings / recordGateResult bridge
  adversarial-verify verdicts → the tamper-evident chain; verifyDeliveryChain
  FAILS CLOSED (throws on tamper / signature failure) — no silent {valid:true}.
  Kept AQE-side (the @ruvector/adversarial-verify package stays host-agnostic).
- 4 tests (in-memory DB): delivered chain verifies, gate result split, tamper →
  throws, Ed25519 sign+verify round-trip. tsc clean.
- MetaHarness-side JS verifier contribution is cross-repo (separate, needs OK).

Docs: docs/guides/darwin-qe-self-learning.md — user-facing guide (benchmarks,
learnings, what shipped, how to enable + configure the cheap-first/cross-model
self-learning lane).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:28:01 +00:00
Dragan Spiridonov c347662f63 feat(routing): cost-Pareto Value Score + measured QE economics (plan 05 / A13)
Operationalize ADR-111's "competitive cheaper than frontier" / Ruv's ADR-179
quality-per-$ leaderboard as pure router primitives:

- value-score.ts: valueScore(m,{costWeight}) tunable slider, rankByValue, and
  paretoFrontier (the non-dominated cost/quality set a router should choose from).
- MEASURED_QE_TEST_GEN: a dated D3/A12 economics snapshot (measured composite +
  per-instance cost) — NOT vendor claims (qwen3-coder rank didn't transfer). The
  measured frontier correctly drops qwen3:8b (below floor, dominated) and keeps
  qwen3:30b-a3b (free, floor-clearing) + sonnet (frontier).
- 8 tests; strict-tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:21:27 +00:00
Dragan Spiridonov bac8604a79 feat(verification): verifyGate output gate (plan 05 / A5)
The opt-in "verify before you emit" primitive a vertical/harness embeds: route
findings through the blind refuters, drop the refuted, surface every verdict for
witness, report overhead. Built in @ruvector/adversarial-verify (vendor-ready,
zero deps) so MetaHarness can embed it.

- gate.ts: verifyGate(findings, {judge, enabled, dropUncertain}) →
  {emitted, blocked, all, latencyMs, judgeCalls}. Disabled ⇒ no-op, ZERO judge
  calls (cost-neutral). Default-off-able per cheap-vertical posture.
- gate.test.ts (6): (a) false claim killed (b) true survives (c) no-op cost-
  neutral when disabled (d) overhead measured. 31 green across the module; tsc clean.

MetaHarness-side embedding (template var + generated-harness wiring) is spec'd in
plan 05 — cross-repo (agent-harness-generator) + needs the package vendored/
published, both pending explicit OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:15:11 +00:00
Dragan Spiridonov 1960598c59 feat(verification): extract @ruvector/adversarial-verify (plan 05 / A2)
Factor AQE's blind-refuter primitive out of qcsd-development-review.js into a
host-agnostic, ZERO-AQE-dependency module (publishable as @ruvector/* later;
not published per no-publish-without-OK). Closes G2.

- src/verification/adversarial-verify/: types (Finding/FindingVerdict/Judge),
  blind refuterPrompt + lenses (ADR-074), pure k-of-n majority-kill synthesis,
  adversarialVerify orchestrator (injected Judge — no agent()/Claude dep),
  calibrate() (false-kill/false-keep vs ground truth, any Judge).
- 25 tests: synthesis math, blind orchestration, calibration (majority-of-3 ≤
  single-refuter error), and PARITY — byte-identical to the workflow's inline
  synthesis. The Workflow harness sandboxes .claude/workflows (no imports), so
  the workflow inline-mirrors the package; annotated canonical + parity-guarded.
- Verification (plan A2): (a) synthesis tests ✓ (b) calibration mechanism ✓
  (c) regression parity ✓ (d) zero AQE import (grep) ✓. strict-tsc clean.

Remaining (optional): empirical real-LLM false-kill on a labeled corpus (inject
a real local/OpenRouter Judge into calibrate()). Unblocks A5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:07:14 +00:00
Dragan Spiridonov e44503e389 feat(routing): cross-model best-of-k in the free-tier executor (A12, opt-in)
A12 measured cross-model best-of-N at +6 composite over single-model (diverse
models cover each other's validity failures; the win is captured by first-pass
selection, no judge needed). Wire it as an opt-in capability:

- executor: candidateProviders?: FreeTierProviderConfig[] — when set, round-0
  best-of-k at the START free tier draws each candidate from a DIFFERENT provider
  (e.g. local qwen + an OpenRouter model) instead of one model's variants;
  selection stays the objective verifier (first-pass = validity rescue). Per-
  candidate attempt.model telemetry. Off (single-model) unless set.
- coordinator-support: FreeTierCoordinatorConfig.freeTierCandidateProviders
  passthrough so coordinators can opt in.
- tests: cross-model rescue (falls through to the valid model, no escalation) +
  single-model-unchanged. 87 green across the lane; strict-tsc clean.

No judge wired — A12 showed it does not beat first-valid on the cross-model pool.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 06:55:38 +00:00
Dragan Spiridonov 2ce12df382 bench(A12): cross-model best-of-N is the WIN — +6 composite, judge not needed
Measured n=20 (qwen3:30b local + glm-5.2 OpenRouter, judge deepseek-v3.2):
- Cross-model best 84.8 vs qwen-alone 63.5 / glm-alone 71.2; the two models cover
  each other's validity failures (qwen 0-valid on 4 instances, glm on 3, both on 11).
- Selector delivery (14 judged): judge 82.8 vs first-valid 82.2 (Δ0.6, noise) vs
  qwen-alone 76.1 → cross-model gives +6 over single-model and barely needs the judge.
- A11 judge's same-model 88.9% did NOT transfer cross-model (33% best-pick).
- Production lever = cross-model GENERATION + cheap selection, NOT a judge.

Fixed a tautological metric: "union lift vs max(single models)" was always 0
(== cross-model best); now reports lift vs EACH model alone + validity rescue.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 17:19:42 +00:00
Dragan Spiridonov 5e42ea1696 docs(metaharness): correct A12 — executor escalation is ALREADY cold (not warm)
Code check of FreeTierEscalatingExecutor: each escalated tier's round-0 prompt is
built from req.messages (cold), not the prior tier's failed output (executor.ts:248-251).
The only warm context is within-tier repairMessages — correctly scoped. So the
plan's "executor escalates warm" claim was wrong; ADR-182 cold-start is already
satisfied. A12 reduces to the cross-model best-of-N lever (d3-xmodel.mjs, running).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 12:13:04 +00:00