Repository navigation
feat(bin): add opt-in systemone and openai decision providers to dispatch resolution - #7664
Conversation
|
Speaking as Kun's firstmate: thank you @rchristensen. This builds on the #7149 seam instead of adding a second one, which is what we hoped for in #7643. What I checked: I read head
What's needed from you (this is waiting on you, no rush):
Separately, |
d72cb79 to
8d01fe8
Compare
|
Both items are addressed at head
|
|
Speaking as Kun's firstmate: thank you @rchristensen. Both asks are done: the attestation binds What I checked (head Contract-class (my own read): opt-in, unchanged. VISION.md per rule: One captain aligns · Authority aligns (off unless configured) · Scripts aligns (deterministic jq mapping) · Restart neutral · Delegation aligns (live capture on record) · Vendor aligns (less coupling to one decision vendor) · Scope aligns. Status: waiting on CI, not on you. Every behavior check passes except |
|
The one failing job here, |
…h resolution Extend the FM_DISPATCH_PROVIDER/FM_DISPATCH_MODEL seam with a generic systemone provider (any System One-compatible host at FM_DISPATCH_BASE_URL, optional FM_DISPATCH_API_KEY) and an openai provider that maps the Choice request to OpenAI's Decisions API and its answer back. No provider set keeps the original off line; the never-send check runs on the endpoint and the final per-provider body. Live provider captures are recorded as pending. Refs kunchenguid#7643, builds on kunchenguid#7149.
…atch resolution Add a dated 2026-10-23 section for the openai provider: 25 hand-labeled synthetic briefs against gpt-6-luna, outcome and latency tables, the usage and header fields actually returned, a calibration note, and one verbatim request and response pair. The systemone live check stays pending. Refs kunchenguid#7643.
…ovider
Replace the pending systemone section with a dated 2026-10-23 run against
Cloudflare Workers AI's @cf/cloudflare/clef, reached through a local
test-only relay because Workers AI serves System One at /ai/run/<model> in
a {result, success} envelope. Adds the outcome and latency tables, a
calibration note compared with the gpt-6-luna run, and one verbatim request
and envelope pair. A direct Workers AI option stays out of scope.
Refs kunchenguid#7643.
8d01fe8 to
7236b68
Compare
|
The
|
|
Speaking as Kun's firstmate: thank you @rchristensen — the Clef capture closes the last open item, and the write-up of the Workers AI relay (test-only, body forwarded unchanged, token/account id absent from the captures) is exactly the clarity I'd want. The resolver code is byte-identical to what I reviewed ( Contract-class (my own read): opt-in, unchanged. VISION per rule is as in my last note (all align / restart neutral). Status: waiting on CI, not on you. On this head, |
|
None of the CI results at head
Could a maintainer rerun |
|
Speaking as Kun's firstmate: thanks @rchristensen, and agreed on all three. I checked the logs for run
I've rerun the failed jobs (run |
|
@kunchenguid it looks like serial 1 was canceled, can we retry? |
|
Speaking as Kun's firstmate: thanks for the nudge, @rchristensen. You're right: on attempt 2 of run I'm not re-running it right now, and here's why. Main's own CI is currently red because GitHub moved I re-checked the tip Status: waiting on CI, on our side, not on you. If the fresh run is green and the head is still |
|
@kunchenguid can we get one more re-run here? looks like serial 1 was cancelled. let me know if i need to rebase or make further changes |
|
Speaking as Kun's firstmate: thanks for the nudge, @rchristensen. No rebase or changes are needed from you. Rather than re-run the old run, which would reuse the Oct 23 merge ref, I closed and reopened this PR to start a fresh CI run against current main (run 40890060873). Main is now on the 24.04 runner pin and has the packing fix, so this run is the useful signal. Head is still Status: waiting on CI, on our side. If the fresh run is green and the head is unchanged, this lands on the opt-in path next pass. |
[Medium impact] The PR appears safe to merge; no actionable defects were found. Reviews (1) · Last reviewed commit: "docs(verification): record the live Clef..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: this is merged. Thank you @rchristensen — really appreciate you taking the time on this. |
Intent
Add two opt-in decision providers to bin/fm-dispatch-resolve.sh (issue #7643) on top of #7149's FM_DISPATCH_PROVIDER/FM_DISPATCH_MODEL provider seam, which has merged: a generic
systemoneprovider (any System One-compatible host such as a local llama.cpp server running Cloudflare's Clef models, given FM_DISPATCH_BASE_URL and an optional FM_DISPATCH_API_KEY) and anopenaiprovider (OpenAI's Decisions API, mapped to and from the System One shape). Constraints from the issue and the maintainer triage: reuse the one provider seam, never add a second; "off stays off" byte for byte (no provider set keeps the original typesafe key gate, one stderr off line, exit 0, no network call), backed by a config-absent test; keys reach curl only through fd 3, never argv or child environments; exit 2 on an unknown provider or a missing required setting before any network call; malformed or partial responses are rejected; transport failure returns to normal intake as an error outcome; the never-send check runs on the endpoint and the final per-provider request body, including JSON text inside OpenAI's input. Docs the seam already documents are updated (docs/configuration.md, the fm-env-lib header, docs/verification/dispatch-resolve.md). The PR carries a dated live section per provider: the OpenAI section records a real 2026-10-23 run with 25 hand-labeled synthetic briefs (the Jev run's original briefs are not available, which the section states) and verbatim request/response captures; the systemone section records a real 2026-10-23 run of the same 25 briefs against Clef on Cloudflare Workers AI (@cf/cloudflare/clef), approved by the operator, reached through a local test-only relay because Workers AI serves System One at /ai/run/ inside a {result, success} envelope instead of /v1/systemone; the relay, the capture scripts, the token, and the account id are deliberately not committed, and a direct Workers AI option (a configurable path plus envelope unwrapping) is deliberately out of scope. The one failing CI job (Behavior portable parallel 2, tests/fm-test-run.test.sh 'packing exactly at the budget must be accepted') also fails on unmodified main and was decided as unrelated, with no fix to be added in this PR. Out of scope: any other change to the resolver, enabling dispatch resolution in any home, and editing #7149. This run exists so the PR body carries the no-mistakes Pipeline attestation that the maintainer requested.What Changed
bin/fm-dispatch-resolve.shgains two opt-in providers on the existingFM_DISPATCH_PROVIDER/FM_DISPATCH_MODELseam.systemonetargets any System One-compatible host viaFM_DISPATCH_BASE_URLand an optionalFM_DISPATCH_API_KEY.openaicalls OpenAI's Decisions API and maps requests and responses to and from the System One shape. Keys reach curl only through fd 3. An unknown provider or missing required setting exits 2 before any network call. Malformed or partial responses are rejected, and transport failures return to normal intake as an error outcome. The never-send check covers the endpoint and the final per-provider request body, including JSON text inside OpenAI'sinput. With no provider set, behavior is unchanged: the original key gate, one stderr off line, exit 0, and no network call.bin/fm-env-lib.shheader is updated to match.tests/fm-dispatch-resolve.test.shadds coverage for the new providers, including a config-absent test for the off-stays-off path.docs/configuration.mddocuments the new settings.docs/verification/dispatch-resolve.mdadds dated 2026-10-23 live sections for each provider. The OpenAI section records a run with 25 hand-labeled synthetic briefs and verbatim request/response captures. It states that the original briefs from the earlier run are unavailable. The systemone section records the same 25 briefs run against Clef (@cf/cloudflare/clef) on Cloudflare Workers AI through a local test-only relay, because Workers AI serves System One at/ai/run/<model>inside a{result, success}envelope. The relay, capture scripts, token, and account id are not committed. A direct Workers AI option is out of scope.Risk Assessment
✅ Low: The opt-in providers reuse the existing seam and validation gates, with bounded request mapping, protected credential handling, and no substantiated material regressions.
Testing
I ran the dispatch-resolve test script, which drives the real script against local fake servers, and every test passed. That includes the systemone and openai request mapping, key handling on fd 3 only, never-send checks, malformed and partial responses, transport failures, and exit 2 on configuration errors. I also ran the script by hand in a disposable lab home. With no provider it printed the one off line and exited 0. An unknown provider, and systemone or openai without a model, each exited 2 before any network call. I did not repeat the live runs against OpenAI or Clef recorded in the verification doc.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-dispatch-resolve.test.shbin/fm-dispatch-resolve.shrun in a disposable lab home with no provider, an unknown provider, and systemone/openai without a model✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.