You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
agentic_math_lab is the only company bundle that produces a verifiable pass/fail — a number is either right or it is not. Every other bundle produces prose an operator must judge. This task adds three more bundles whose outputs can be verified automatically without a human reader, drives them against the compiled binary via the REST surface (no browser, no Playwright), and documents the results in a format that slots into the existing tests/ suite alongside offline_e2e.rs.
The three scenarios are deliberately chosen to cover different orchestration shapes the existing suite does not exercise:
Bundle
Core loop
Verifiable claim
Vending Machine
One orchestrator, one peer; buy/restock/audit cycle
Ledger inventory matches purchase log; change calculation is correct
E-Commerce Store
Order intake → fulfilment → invoice; multi-step with approval gate
Invoice total equals order total; every dispatched card reaches Done
Reorder quantity is within forecast bounds; no shelf goes below safety stock
Problem
The 24 existing bundles are untested end-to-end. The suite has offline_e2e.rs (one card, one scripted turn, done) and orchestration-simulation.spec.ts (scripted orchestrator via the browser), but no test boots a real company bundle and runs its agents through a full business cycle. So:
A change to src/company/ that breaks how manifests load their agents fails silently — the company passes cargo check but the agents never pick up the right tools or prompts.
The agentic_math_lab pattern (tests/ Rust file + scripted endpoint + verifiable integer) has not been replicated for any business scenario. The math lab proves the stack can finish a card with a checkable answer; it leaves the business logic of ledger writes, budget checks, and multi-agent delegation untested.
The test harness exists but is not reused.offline_e2e.rs already shows the exact pattern:
spawn_script(turns) — a scripted loopback POST /chat/completions endpoint.
RuntimeBuilder — boots the host with a real company manifest and an injectable endpoint URL.
HTTP calls via reqwest / axum::test — drives the REST surface (/api/v1/company/…) exactly as the console would.
Assertions on the final state: task column, ledger entries, spend recorded.
What is missing is the company manifests (companies/agentic_vending_machine/, etc.) and the test files that drive them.
Mechanism (main @ current HEAD).
The scripted endpoint is defined in tests/offline_e2e.rs:
A test boots the host with that endpoint as its inference URL and a company bundle as its manifest:
let manifest = CompanyManifest::load(companies/agentic_math_lab).unwrap();let state = AppState::new(AppConfig{inference_url: endpoint, … }, manifest).await;
Then it drives the REST surface and asserts on the settled state:
// POST /api/v1/company/tasks → dispatches a card// GET /api/v1/company/tasks/{id} → checks column == "done"// GET /api/v1/company/ledgers/inventory → checks entry fields
All three simulation tests will follow this pattern. None of them opens a browser.
Solution
1 — Bundle: companies/agentic_vending_machine/
A single-location vending machine company. The operator states a purchase (item + quantity); the orchestrator dispatches to a Sales Agent that records the transaction and a Stock Agent that decrements inventory and flags a reorder if stock falls below the par level.
Roster:
orchestrator.toml — delegates purchase and restock tasks
agents/sales_agent.toml — records sale to ledger
agents/stock_agent.toml — manages ledger; can issue restock request
Ledgers:
# ledgers/inventory.toml
[[fields]]
name = "item"required = true
[[fields]]
name = "qty_on_hand"required = truetype = "integer"
[[fields]]
name = "par_level"required = truetype = "integer"
# ledgers/transactions.toml
[[fields]]
name = "item"; required = truename = "qty"; required = true; type = "integer"name = "unit_price"; required = true; type = "decimal"name = "total"; required = true; type = "decimal"
Test file:tests/vending_machine_e2e.rs
Scripted turns (two cards, two agents):
Orchestrator receives "sell 3 × cola @ $1.50" → calls spawn_task for Sales and spawn_task for Stock.
// Change calculation is correctlet txn = get_ledger_entry("transactions","cola").await;assert_eq!(txn["total"], json!(4.50));// Inventory decrementedlet inv = get_ledger_entry("inventory","cola").await;assert!(inv["qty_on_hand"].as_i64().unwrap() < initial_qty);// Both cards donefor id in&card_ids {assert_eq!(stage_of(id).await,"done");}
2 — Bundle: companies/agentic_ecommerce_store/
A single-SKU storefront. The operator places an order; the orchestrator routes intake to a Fulfilment Agent that reserves stock, then to a Finance Agent that generates an invoice. The invoice total must exactly match the order total — the assertion the test makes, and the one a human would otherwise have to read.
Roster:
orchestrator.toml
agents/fulfilment_agent.toml — reserves stock in ledger
agents/finance_agent.toml — writes invoice to ledger
Approval gate exercised: Finance Agent uses request_approval before posting the invoice (autonomy tier supervised). The test answers the blocker via POST /api/v1/company/approvals/{id}/approve — the same path blocker-dm-flow.spec.ts drives from the browser. This is the first core-only proof that the approve → resume path works without a browser.
Test file:tests/ecommerce_e2e.rs
Scripted turns:
Orchestrator: spawn_task for Fulfilment + Finance.
let inv = get_ledger_entry("invoices", order_id).await;assert_eq!(inv["total"], json!(59.98));assert_eq!(inv["qty"], json!(2));// Prove the blocker-resume path without a browserlet approval = get_approval(approval_id).await;assert_eq!(approval["verdict"],"approved");
3 — Bundle: companies/agentic_grocery_supply/
A three-location grocery supply chain. A Forecast Agent reads weekly sales history and outputs a replenishment quantity; a Buyer Agent submits the purchase order; a Shelf Agent records the received stock and checks the shelf against the safety-stock floor. The test verifies that the reorder quantity stays within the forecast bounds (lower: safety stock, upper: 2× forecast) and that no shelf goes below zero.
Roster:
orchestrator.toml
agents/forecast_agent.toml — reads ledger; writes to
agents/buyer_agent.toml — writes purchase order to ledger
agents/shelf_agent.toml — updates ; flags breach to ledger
Scheduled trigger exercised: The workflow is triggered by a cron (every Monday 06:00 UTC). The test fires it manually via POST /api/v1/company/workflows/{id}/run and asserts the run reaches done — the first core-only proof of manual workflow trigger without a browser.
Three bundles land in companies/ — agentic_vending_machine, agentic_ecommerce_store, agentic_grocery_supply — each with a company.toml, agents/, ledgers/, workspace/, and a README.md explaining what the company is and what the test proves.
Three test files in tests/ — vending_machine_e2e.rs, ecommerce_e2e.rs, grocery_supply_e2e.rs — each gated on #[cfg(feature = "openhuman")] and following the offline_e2e.rs scripted-endpoint pattern. No browser, no Playwright.
Verifiable assertions — each test has at least one assertion that would fail if the business logic went wrong: correct totals (vending), invoice matches order (e-commerce), reorder within bounds (grocery). Not "the card reached Done"; that is a harness proof, not a business proof.
Approval gate covered — the e-commerce test drives POST /api/v1/company/approvals/{id}/approve and confirms the run resumes and the invoice is written. This is the first core-only proof of the blocker-resume path (complements the Playwright proof in blocker-dm-flow.spec.ts).
Scheduled workflow trigger covered — the grocery test fires a workflow via POST /api/v1/company/workflows/{id}/run and confirms it reaches done. This is the first core-only proof of a manual workflow run.
A Simulation E2E CI lane — added to .github/workflows/ci.yml, running cargo test --features openhuman --test vending_machine_e2e --test ecommerce_e2e --test grocery_supply_e2e. The lane must assert a non-zero test count (script: scripts/ci/assert-integration-targets-run.sh).
Documented results — docs/simulations/ contains one Markdown file per simulation with the run output (turn counts, latencies, assertion outcomes) from the first successful CI run.
Diff coverage ≥ 80% — any new Rust helpers in tests/ and any new src/ paths touched by the manifests meet the changed-lines gate.
README updated — companies/README.md lists the three new bundles and links their simulation docs, in the same format as the agentic_math_lab entry.
Related
tests/offline_e2e.rs — the scripted-endpoint pattern these tests reuse
companies/agentic_math_lab/ — the only existing bundle with a verifiable pass/fail; the model for this work
frontend/test/e2e/orchestration-simulation.spec.ts — scripted orchestration loop via browser; these new tests are its core-only sibling
Summary
agentic_math_labis the only company bundle that produces a verifiable pass/fail — a number is either right or it is not. Every other bundle produces prose an operator must judge. This task adds three more bundles whose outputs can be verified automatically without a human reader, drives them against the compiled binary via the REST surface (no browser, no Playwright), and documents the results in a format that slots into the existingtests/suite alongsideoffline_e2e.rs.The three scenarios are deliberately chosen to cover different orchestration shapes the existing suite does not exercise:
Problem
The 24 existing bundles are untested end-to-end. The suite has
offline_e2e.rs(one card, one scripted turn, done) andorchestration-simulation.spec.ts(scripted orchestrator via the browser), but no test boots a real company bundle and runs its agents through a full business cycle. So:src/company/that breaks how manifests load their agents fails silently — the company passescargo checkbut the agents never pick up the right tools or prompts.agentic_math_labpattern (tests/Rust file + scripted endpoint + verifiable integer) has not been replicated for any business scenario. The math lab proves the stack can finish a card with a checkable answer; it leaves the business logic of ledger writes, budget checks, and multi-agent delegation untested.The test harness exists but is not reused.
offline_e2e.rsalready shows the exact pattern:spawn_script(turns)— a scripted loopbackPOST /chat/completionsendpoint.RuntimeBuilder— boots the host with a real company manifest and an injectable endpoint URL.reqwest/axum::test— drives the REST surface (/api/v1/company/…) exactly as the console would.What is missing is the company manifests (
companies/agentic_vending_machine/, etc.) and the test files that drive them.Mechanism (main @ current HEAD).
The scripted endpoint is defined in
tests/offline_e2e.rs:A test boots the host with that endpoint as its inference URL and a company bundle as its manifest:
Then it drives the REST surface and asserts on the settled state:
All three simulation tests will follow this pattern. None of them opens a browser.
Solution
1 — Bundle:
companies/agentic_vending_machine/A single-location vending machine company. The operator states a purchase (item + quantity); the orchestrator dispatches to a Sales Agent that records the transaction and a Stock Agent that decrements inventory and flags a reorder if stock falls below the par level.
Roster:
Ledgers:
Test file:
tests/vending_machine_e2e.rsScripted turns (two cards, two agents):
spawn_taskfor Sales andspawn_taskfor Stock.record_entry { ledger: "transactions", item: "cola", qty: 3, unit_price: 1.50, total: 4.50 }→update_card { column: "done" }.record_entry { ledger: "inventory" … }→update_card { column: "done" }.Assertions:
2 — Bundle:
companies/agentic_ecommerce_store/A single-SKU storefront. The operator places an order; the orchestrator routes intake to a Fulfilment Agent that reserves stock, then to a Finance Agent that generates an invoice. The invoice total must exactly match the order total — the assertion the test makes, and the one a human would otherwise have to read.
Roster:
Approval gate exercised: Finance Agent uses
request_approvalbefore posting the invoice (autonomy tiersupervised). The test answers the blocker viaPOST /api/v1/company/approvals/{id}/approve— the same pathblocker-dm-flow.spec.tsdrives from the browser. This is the first core-only proof that the approve → resume path works without a browser.Test file:
tests/ecommerce_e2e.rsScripted turns:
spawn_taskfor Fulfilment + Finance.request_approval, parks.POST /approvals/{id}/approve.{ order_id, qty: 2, unit_price: 29.99, total: 59.98 }; done.Assertions:
3 — Bundle:
companies/agentic_grocery_supply/A three-location grocery supply chain. A Forecast Agent reads weekly sales history and outputs a replenishment quantity; a Buyer Agent submits the purchase order; a Shelf Agent records the received stock and checks the shelf against the safety-stock floor. The test verifies that the reorder quantity stays within the forecast bounds (lower: safety stock, upper: 2× forecast) and that no shelf goes below zero.
Roster:
Scheduled trigger exercised: The workflow is triggered by a cron (
every Monday 06:00 UTC). The test fires it manually viaPOST /api/v1/company/workflows/{id}/runand asserts the run reachesdone— the first core-only proof of manual workflow trigger without a browser.Test file:
tests/grocery_supply_e2e.rsScripted turns:
sales_history(avg 40 units/week); writes{ item: "milk", forecast: 40, safety_stock: 10 }.{ item: "milk", qty: 40 }topurchase_orders; done.Assertions:
Documentation
Each bundle gets a
README.mdatcompanies/agentic_<name>/README.mdfollowing theagentic_math_labpattern:Results from the first automated run (CI
Simulation E2Elane) are committed todocs/simulations/:Acceptance criteria
companies/—agentic_vending_machine,agentic_ecommerce_store,agentic_grocery_supply— each with acompany.toml,agents/,ledgers/,workspace/, and aREADME.mdexplaining what the company is and what the test proves.tests/—vending_machine_e2e.rs,ecommerce_e2e.rs,grocery_supply_e2e.rs— each gated on#[cfg(feature = "openhuman")]and following theoffline_e2e.rsscripted-endpoint pattern. No browser, no Playwright.POST /api/v1/company/approvals/{id}/approveand confirms the run resumes and the invoice is written. This is the first core-only proof of the blocker-resume path (complements the Playwright proof inblocker-dm-flow.spec.ts).POST /api/v1/company/workflows/{id}/runand confirms it reachesdone. This is the first core-only proof of a manual workflow run.Simulation E2ECI lane — added to.github/workflows/ci.yml, runningcargo test --features openhuman --test vending_machine_e2e --test ecommerce_e2e --test grocery_supply_e2e. The lane must assert a non-zero test count (script:scripts/ci/assert-integration-targets-run.sh).scripts/ci/feature-lanes.txtastestedunder theopenhumanfeature (issue ci: every merge cancels the previous merge's verification, so main is never actually verified #770 pattern).docs/simulations/contains one Markdown file per simulation with the run output (turn counts, latencies, assertion outcomes) from the first successful CI run.tests/and any newsrc/paths touched by the manifests meet the changed-lines gate.companies/README.mdlists the three new bundles and links their simulation docs, in the same format as theagentic_math_labentry.Related
tests/offline_e2e.rs— the scripted-endpoint pattern these tests reusecompanies/agentic_math_lab/— the only existing bundle with a verifiable pass/fail; the model for this workfrontend/test/e2e/orchestration-simulation.spec.ts— scripted orchestration loop via browser; these new tests are its core-only siblingblocker-dm-flow.spec.ts— the e-commerce test exercises the same approve → resume path at the REST layerworkflow-canvas-live.spec.ts/workflow-run-inference.spec.ts— the grocery test exercises the same workflow-run path without a browserscripts/ci/feature-lanes.txt— where the new lane entries go (issue ci: every merge cancels the previous merge's verification, so main is never actually verified #770)