- Rust engine: real bootstrap/wiring preflight (guardrail-agent), execution layer (retry/router/pre-trade/post-trade/reconciliation), guardrail-doctor diagnostics with allowlist-drift guard. - guardrail-cli: extracted pure helpers into util.rs (split in progress). - 6 Track-2 skills + ensemble; python-lab analytics (regime/drawdown/montecarlo/dossier/ensemble/journal/seed); clients (ts/py/go/mcp/langchain/web-lite/proof-verifier); alert relay; scenarios; helm/k8s/compose; docs. - dashboard/vercel.json + docs/VERCEL_DEPLOY.md for Vercel deployment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
"""Flow E — client cancels before funding.
|
|
|
|
createJob → (no setBudget / no fund) → client ``reject`` → REJECTED.
|
|
No escrow ever moved, no provider action needed.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from _helpers import banner, expiry_for, load_settings, make_client
|
|
|
|
from bnbagent.erc8183 import JobStatus
|
|
|
|
|
|
def main() -> None:
|
|
s = load_settings()
|
|
client = make_client(s.client_pk, s.network)
|
|
|
|
banner("CANCEL OPEN — client cancels before funding")
|
|
|
|
expired_at = expiry_for(client, slack_minutes=1)
|
|
res = client.create_job(
|
|
provider=s.provider_address,
|
|
expired_at=expired_at,
|
|
description="ERC-8183 demo: cancel-open",
|
|
)
|
|
job_id = res["jobId"]
|
|
print(f"[client] createJob jobId={job_id}")
|
|
|
|
client.register_job(job_id)
|
|
print("[client] registerJob (optional, shown for completeness)")
|
|
|
|
client.cancel_open(job_id)
|
|
job = client.get_job(job_id)
|
|
assert job.status == JobStatus.REJECTED, f"expected REJECTED, got {job.status.name}"
|
|
print(f"[client] cancel OK -> {job.status.name} (no escrow moved)")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|