mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-01 02:04:24 +00:00
The server answers the `/api/v1/runs/{id}/petri/*` endpoints from one
`SqliteRunStore` over its pool. `PetriRuns` in `AppState` keeps the
writer handle each worker opened, keyed by the run and the worker's
owner id, so the lease semantics stay the store's: the handle drops on
the worker's `release`, and every handle of a run drops when the server
observes the run's worker exit, in the subprocess wait path. Never by
timeout. A write from an owner with no held handle reopens only when
the lease row still names that owner, so a server restart or a lost
open reply recovers, and an owner the lease moved away from gets
`petri_stale_owner`.
Every endpoint is worker-scoped through the existing worker auth; a
new `RequireWorkerRunSegment` extractor covers the two-segment routes.
Store errors answer with a machine-readable code, the leased owner and
the conflict position under `meta`, and a backend failure's cause goes
to the server log rather than the worker.
A test drives a held worker through the scheduler, opens the run over
the API with its token, ends the worker, and sees the lease end.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| auth | ||
| demo | ||
| prompts | ||
| server | ||
| worker_control | ||
| automation_materializer.rs | ||
| canonical_host.rs | ||
| canonical_origin.rs | ||
| csp.rs | ||
| diagnostics.rs | ||
| error.rs | ||
| git_checkout.rs | ||
| github_webhooks.rs | ||
| install.rs | ||
| interp.rs | ||
| jwt_auth.rs | ||
| lib.rs | ||
| manifest_validation.rs | ||
| migrations.rs | ||
| petri_runs.rs | ||
| principal_middleware.rs | ||
| request_id.rs | ||
| run_compiler.rs | ||
| run_files.rs | ||
| run_files_security.rs | ||
| run_intent.rs | ||
| run_manifest.rs | ||
| run_selector.rs | ||
| run_title_generation.rs | ||
| run_tool_create.rs | ||
| security_headers.rs | ||
| serve.rs | ||
| server.rs | ||
| server_secrets.rs | ||
| spawn_env.rs | ||
| startup.rs | ||
| static_files.rs | ||
| test_support.rs | ||
| web_auth.rs | ||
| worker_runtime.rs | ||
| worker_token.rs | ||