Skip to content

Design: jev_decide tool — TypeSafe Jev (System One) as an optional fast decision layer (probe-gated, Read-Only) #172

Closed

Description

@ajianaz

What

A probe-gated, Read-Only systemone_decide tool speaking the System
One decision contract (typed choice/score/noul + calibrated
confidence) — one client for interchangeable backends via a single env
pair: hosted TypeSafe Jev, the fleet's self-hosted laya-service,
and (optionally) Jeff-style local fine-tunes. NOT a provider
replacement: the agent's model stays TOLE_*.

Configuration — env naming decision (2026-10-05)

  • SYSTEMONE_API_KEY — bearer token.
  • SYSTEMONE_BASE_URL — full POST endpoint URL, default
    https://api.typesafe.ai/v1/systemone.
  • Naming rationale: the env names the CONTRACT (the System One
    decision API), not a vendor — TYPESAFE_* ties the fleet to one
    hosted vendor; JEVLAYA_* enumerates two backends and already goes
    stale with Jeff as a third; SYSTEMONE_* stays correct for any
    implementer. (Both alternatives were considered; SYSTEMONE_*
    selected.)
  • Fleet endpoint target: the internal laya-service instance (URL +
    token live in the internal uteke laya-service room/skill —
    deliberately NOT written here; internal-only infrastructure).
  • Probe contract: no key → no tool, one warning line.

Backend path expectation (owner requirement, 2026-10-05)

laya-service must ALSO expose /api/v1/systemone (the
TypeSafe-compatible path) alongside /api/v1/decide — so backend
swaps are path-symmetric and the full-URL env stays trivial. Recorded
for the laya-service workstream (in progress).

Backend-specific constraints (encode as client guidance + caps)

Hosted Jev (default): Choice ≤255 options; 70–500 ms; batch questions
in one call (~10× cheaper).

laya-service (fleet, measured E2E late Sep):

  • Choice 2–20 options (service-side validation; >20 = token-budget
    collapse), Score 2–10 levels.
  • Keep state SHORT (small context window; ~2.5k-token states
    measured ~17 s). Client-side state size cap is mandatory.
  • Serial throughput ~170 calls/min (no parallel speedup) — the tool
    must queue, never fan out concurrent calls from N children.
  • Measured quality anchors: spam/phishing gate 0.99 (strongest
    internal case), needs_human 0.97, ID-language intent OK at 3–5
    labels; moderation is an ANTI-case (0.53 held-out).
  • Confidence ≥ ~0.85 = measured auto-act threshold; re-validate per
    schema/traffic (distribution shift).

Jeff fine-tunes (optional third target): Jev-compatible request
format, ~30 ms on consumer hardware, max 26 options (A–Z),
English-only, zero-shot ~0.70 — narrow internal classifiers, not
general routing.

Design sketch

  • Input schema: { state, questions: [{id, type: choice|score|noul, criteria, instructions?}] } — client-side validation mirrors the
    ACTIVE backend's caps (option count, state size), honest errors on
    rate-limit equivalents (verify_package contract).
  • Output: typed answers + probabilities + confidence verbatim.
  • Class-level mitigations: literal criteria, no math/counting/dates in
    the model, filtered state (never raw tool results — decision models
    are not adversarial-resistant), shuffle option order against
    first-option bias.
  • Integration once Design: depth-1 child agents (agent_start/agent_poll) — worktree isolation, structural depth cap, policy subset, uteke handoff #171 lands: task partitioning (Choice), child-result
    scoring (Score + confidence gate), summary re-ranking.
  • Vendor/config risk: all System One knowledge confined to one module;
    backends swap via the two env vars.

Why

Decisions that today cost a full LLM round-trip become sub-second and
near-free — and the laya path keeps them entirely inside the fleet
(no vendor, no per-token cost, data at home) with measured quality
anchors for exactly the decision classes #171 needs.

Activity

  1. ajianaz commented on Oct 5, 2026

    @ajianaz
    ContributorAuthor

    Implemented by PR #173 — merged to develop 2026-10-05 (commit ec3858…): systemone_decide ReadOnly tool in tole-core/src/systemone.rs, wired in tole-cli (main.rs, session_host.rs), probe-gated via SYSTEMONE_API_KEY/SYSTEMONE_BASE_URL per the env-naming decision recorded in the issue body. Closing per the post-merge stale-issue sweep (PR body had no closing keyword). The laya-service /api/v1/systemone path-symmetry requirement stays tracked in the laya-service workstream, not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions