Skip to content

AV: add validated djev-spark decision lane - #4

Draft
seanphan wants to merge 2 commits into
mainfrom
codex/av-djev-clipping-174
Draft

seanphan wants to merge 2 commits into
mainfrom
codex/av-djev-clipping-174

Conversation

@seanphan

Copy link
Copy Markdown
Contributor

Summary

  • Add an explicit AV_DJEV_ENDPOINT decision lane for the existing refined-ask workflow, speaking the documented djev-spark POST /v1/systemone contract.
  • Validate response shape, option/legend/probability semantics, retries, skipped questions, served model/engine identity, and provider-accurate fallback metadata.
  • Add deterministic offline compatibility tests and a cookbook recipe with self-host hardening and comparison limits.

Verification

  • uv run --offline pytest tests/ — 317 passed
  • Touched-file ruff check with I001,F401,RUF059 — passed
  • uv build --offline — wheel and source distribution built successfully
  • No live endpoint or socket is used by the adapter tests.

Evidence and limits

  • Upstream source audited and pinned at 1444f3e927f83ba508e5b28a4fd4fdd9ecd0976b.
  • Served model and engine are required in successful responses and recorded separately from hosted Jev.
  • No live djev inference, latency/quality comparison, playable export comparison, or hosted-cost result is claimed here.
  • The two-second/two-cent clipping claim remains unverified.
  • Image input is not wired; the primary comparison remains text-to-text.

The shared candidate/fixture contract and matched comparison remain follow-up work once the public contract is available and an authorized runtime is cleared.

…ne adapter

Run the existing refined-ask workflow against a self-hosted djev-spark
server, which speaks the same documented /v1/systemone contract as hosted
System One. An explicit AV_DJEV_ENDPOINT selects the lane; no default
endpoint ships, and the endpoint wins over hosted Jev when both are set.

- DjevClient mirrors the hosted client's timeout/retry/backoff semantics,
  passes a reproducible seed, and visibly rejects malformed responses:
  missing or unknown answers, type mismatches, choices outside the offered
  options, legend/probability mismatches, out-of-range or non-summing
  probabilities, scores outside the zero-based legend range or inconsistent
  with sum(i*p), null answers for questions without ask_if, and responses
  that do not identify the served model and engine.
- Every successful decision records the served model, engine, and redacted
  endpoint host into usage receipts and ask metadata, so a djev answer is
  never presented as a Jev measurement; confidence_basis strings are
  lane-derived.
- Boundary judging resolves single-candidate sides locally instead of
  sending one-option questions, which structured providers reject.
- Offline deterministic tests cover the wire contract, validation, identity
  enforcement, lane selection, and ask-path outputs; cookbook recipe
  documents configuration, self-host hardening, and the pending live
  comparison.

Upstream audited at mmastrac/djev-spark 1444f3e927f83ba508e5b28a4fd4fdd9ecd0976b.
Set membership raises TypeError on an unhashable answer value (a JSON
array or object), which escaped RefinementError handling and crashed past
ask's sanitized fallback. Require a string before comparing the reported
choice against the offered options, with fake-session regressions for
array and object choices, and rename an unused local flagged by the
targeted lint check.
@seanphan

Copy link
Copy Markdown
Contributor Author

Verification at reviewed head 7dc30cb:

  • uv run --offline pytest tests/ — 317 passed
  • Touched-file Ruff checks (I001, F401, RUF059) — passed
  • uv build --offline — wheel and source distribution built successfully
  • Diff whitespace check — passed

This PR intentionally reports no live djev inference, quality/latency comparison, playable-export comparison, hosted-cost result, or parity claim. The upstream revision is pinned to 1444f3e927f83ba508e5b28a4fd4fdd9ecd0976b; runtime/comparison follow-up remains gated on an authorized self-hosted runtime and the shared public fixture contract.

This branch has not been deployed

No deployments
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.

1 participant