|
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1m36s
Closes Compliance Gap 1 from fai/platform :: docs/advanced/
compliance-gaps.md. The module now probes the LLM endpoint's
/api/show on every successful chat invocation and surfaces
the model's SHA-256 digest as a separate output field.
The probe is strictly best-effort:
- derive_show_url returns None unless the configured endpoint
ends in /api/chat, so non-Ollama deployments (OpenAI,
Anthropic) skip the probe entirely.
- probe_model_digest swallows every failure path (network
error, non-200 status, malformed JSON, missing digest field)
and yields None. The plan generation succeeds either way.
- extract_show_digest looks for digest at top level, then
details.digest, then model_info.digest — the fields shift
across Ollama versions, so the lookup is tolerant.
A new generate_plan_with_identity returns a PlanWithIdentity
struct ({plan_json, model_digest}). The original generate_plan
remains as a #[allow(dead_code)] convenience wrapper that
returns just the plan JSON.
The invoke entry point in lib.rs now emits four outputs:
plan (json) — unchanged
model_endpoint (text) — unchanged
model_name (text) — unchanged
model_digest (text) — NEW; empty for non-Ollama or stub paths
module.yaml documents the new output and bumps the orchestrator
capability version to 0.3.0 (additive minor; downstream flows
that referenced @^0 keep working).
Eight new tests in src/llm.rs cover the new code paths:
- URL transform (/api/chat → /api/show)
- URL transform skipped for non-Ollama endpoints
- Digest extraction at all three documented JSON locations
- Digest extraction graceful failure (missing, empty, bad JSON)
- End-to-end probe success
- End-to-end probe skipped for non-Ollama
- End-to-end probe failure swallowed without breaking plan
Total tests: 26 (was 18). Wasm artifact builds with v1.0
imports baked in. Platform-side integration tests in
fai/platform :: orchestrator_llm_path.rs pass against the
new module unchanged.
Bumps the module to 0.3.1 (patch — output schema additively
extended, behaviour unchanged for existing flows).
Signed-off-by: flemming-it <sf@flemming.it>
|
||
|---|---|---|
| .forgejo/workflows | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.toml | ||
| LICENSE | ||
| module.yaml | ||
| README.md | ||
| rust-toolchain.toml | ||
orchestrator-llm
F∆I orchestrator module — turns natural-language goals into
structured execution plans (fai_hub::plan::Plan JSON).
Status
v0.1.0 — deterministic stub. Always returns a structurally
valid plan that creates a single debug.echo flow regardless of
the goal. Useful as a smoke test for the full module → plan →
fai plan apply path.
v0.2.0 (next) — replaces the stub with an actual LLM call to a
configured endpoint (Ollama or OpenAI-compatible) once the F∆I
platform exposes outbound HTTP to permitted modules via wasi-http.
Capability
orchestrator.plan@0.1.0
Inputs
| Name | Type | Description |
|---|---|---|
goal |
text | Natural-language goal |
available_capabilities |
text (JSON list) | Optional. Capabilities currently installed in the hub. |
store_capabilities |
text (JSON list) | Optional. All capabilities the hub knows about. |
Outputs
| Name | Type | Description |
|---|---|---|
plan |
json | Plan JSON deserializable by fai_hub::plan::Plan |
Permissions
None. The deterministic stub does not call out. v0.2.0 will
declare net: <llm-endpoint> once the platform supports it.
Build
cargo build --release --target wasm32-wasip2
The built WASM lands at
target/wasm32-wasip2/release/orchestrator_llm.wasm.
Test
Host-side unit and integration tests exercise the pure plan-building logic (no WASM build required for tests):
cargo test
Use from a flow
schema_version: 1
name: plan-from-goal
inputs:
goal: text
steps:
- id: orchestrate
use: orchestrator.plan@^0
with:
goal: $inputs.goal
outputs:
plan: $orchestrate.plan
The plan output is JSON — pipe it through fai plan apply -
to execute it.
License
Apache-2.0. See LICENSE.