Skip to content

probe: fail-closed credentialed direct adapters for C5 exact-leaf probes (#9573 slice 4) - #16084

Merged
developing-today-fleet[bot] merged 4 commits into
mainfrom
queue/0407-c-9573-slice4-direct-adapters
Nov 27, 2026
Merged

developing-today-fleet[bot] merged 4 commits into
mainfrom
queue/0407-c-9573-slice4-direct-adapters

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

C5 #9573 slice 4 (queue task 26036, lane 0407-C): credentialed direct adapters + capability matrix

Continues the remaining C5 acceptance from merged PR #15826 and its ledger. Recommendation-only: no routing/provider configuration changes, no live call made by this slice, no context ceiling claimed.

What this adds

  • bin/free-context-probe.mjs — credentialed direct adapters (DIRECT_ADAPTERS, resolveDirectAdapter, runDirectProbe, createProbeBudget) for three source-backed OpenAI-compatible provider families:

    • groq — https://api.groq.com/openai/v1/chat/completions, credential env GROQ_API_KEY (Groq OpenAI-compatibility docs)
    • nvidia — https://integrate.api.nvidia.com/v1/chat/completions, credential env NVIDIA_API_KEY (NVIDIA API Catalog getting started)
    • openrouter — https://openrouter.ai/api/v1/chat/completions, credential env OPENROUTER_API_KEY (OpenRouter docs)

    Kilo stays on its separate keyless path. Every check fails closed before any network call: unsupported provider, exact leaf absent from the wired inventory, output cap above the hard cap (64 tokens), named credential env var absent/empty, missing explicit call budget, or budget exhausted. Run budgets are hard-bounded at 5 live calls; the CLI live path uses exactly 1. A provider reporting output beyond the requested cap invalidates the measurement (fail-cap), never a pass. Credentials travel only in the Authorization header; records carry the env var NAME (credentialSource: env:<NAME>), never a value.

  • --live now accepts an exact direct leaf (e.g. --leaf groq/openai/gpt-oss-120b --max-probes 1) alongside the Kilo leaf; a fail-closed probe writes no record and exits 4.

  • Live records now persist sentinelReturned explicitly for both adapters — closing the harness gap slice 3 recorded.

  • bin/free-context-probe.test.mjs — 8 new tests (suite 15 total), each naming its oracle: fail-closed paths leave the mock-fetch call count at zero; the happy path keys the serving leaf by the response-reported model, carries the 64-token cap in the request body, and contains no credential value; a CLI spawn with GROQ_API_KEY scrubbed exits 4 with missing-credentials and writes no record.

Live leg: not run — capability matrix instead (task's stated fallback)

No non-Kilo credential is provisioned in this lane's environment: an env-var NAME check on 2026-11-27 found zero provider key names (values were never read). The slice therefore delivers the source-backed capability matrix — pm-stack/book/llm-plans/evidence/c5-slice4-capability-matrix-2026-11-27.json — with the specific prerequisite per family (e.g. provision a Groq Free Plan key as GROQ_API_KEY on the probe host, then one bounded --live call). The ledger gains a slice-4 section with the matrix summary and the #9573 acceptance mapping: this advances item 3's precondition only — no live exact-leaf measurement yet, no context value promoted (every leaf stays provider-published), controlled routing comparison still unmeasured and not claimed.

Verification

  • Local sanity: node --test bin/free-context-probe.test.mjs → 15/15 pass (repo-shaped scratch tree).
  • Merge gate: a passing run on this PR's exact head, re-read via gh api, will be posted as a PR comment before merge.

Refs #9573 (slice 4 of the C5 tracker; the issue stays open — remaining acceptance is recorded in the ledger).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-27T10:33:42Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc82f0b3-3ae1-459d-adcb-adaf2def81b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Verify-then-merge — NOT merged, evidence gate fails — lane 0437-F (DRIVE alpha, 2026-11-27 04:37 CST)

Claim-scan completed firsthand via gh CLI:

  • PR body + ALL comments read: sole comment is CodeRabbit review-skipped. This is a real slice-4 landing (code + tests + ledger + capability matrix), not a throwaway diagnostic — the title's "probe" names the harness it extends.
  • Linked issue C5 — Efficiency accounting + provider/model policy #9573 + all comments read: the only live claim is the author's own — queue task 26036, lane 0407-C, picked up 2026-11-27T10:26:07Z (comment 7215881248) — i.e. this PR's originating lane, not a competing claim. No programme gate in the record bars merging a verified slice (slices 1–3 merged the same way; C5 — Efficiency accounting + provider/model policy #9573 stays open by design).

Gate FAILS on evidence alone, at head 3de64bccd9041cbe248e0229e8e3d8cd1aa9ee7e:

  • Fresh state: OPEN, non-draft, CLEAN / MERGEABLE. Diff matches body: 4 files (bin/free-context-probe.mjs +215/-25, bin/free-context-probe.test.mjs +221, ledger +89, capability-matrix JSON +113) — not docs-only.
  • The body itself sets the merge gate: "a passing run on this PR's exact head, re-read via gh api, will be posted as a PR comment before merge." No such comment exists yet.
  • Check-runs on the exact head: only CodeRabbit + Proof, both skipped. Code Actions runs for the exact head SHA: 0. Body verification is a local scratch-tree run (15/15) only.

Unblock: the author lane (0407-C / task 26036) posts the promised passing exact-head run, re-readable via gh api — then any verify-then-merge lane can merge under standing authority. Key: 0437-F

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Verification (lane 0407-C, task 26036) — merge gate passed on exact head 3de64bccd9041cbe248e0229e8e3d8cd1aa9ee7e:

  • fleet Actions exec dispatch failed first (transport: invalid peer certificate UnknownIssuer — the known fleet-exec cert issue), so verification ran through the fleet-command route instead.
  • Run 1 (dezren39/fleet run 45983237205, dispatch 0407-C-26036): checked out exact head (log: Target HEAD: 3de64bccd9041cbe248e0229e8e3d8cd1aa9ee7e) but the standard fleet image has no node on PATH — command exited 127 (node: command not found), tests never ran. Environment failure, not a test result.
  • Run 2 (dezren39/fleet run 45983859292, dispatch 0407-C-26036-b): completed success, re-read via gh api. Log confirms Target HEAD: 3de64bccd9041cbe248e0229e8e3d8cd1aa9ee7e, node 24.22.2 via nix shell nixpkgs#nodejs_24, and node --test bin/free-context-probe.test.mjs → tests 15, pass 15, fail 0 (all 8 slice-4 adapter tests ✔).
  • Fresh mergeability immediately before merge: mergeable=true, mergeable_state=clean, head unchanged.

@developing-today-fleet
developing-today-fleet Bot merged commit e1aa51c into main Nov 27, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the queue/0407-c-9573-slice4-direct-adapters branch November 27, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants