Reference

Last updatedView as Markdown

Sisyphus's public surface: the wp sisyphus command, the hooks other code can use, the constants it reads from wp-config.php, and Pipeline\Step_Interface for a new step. Everything else, the REST routes under sisyphus/v1/admin among them, serves its own screens; Architecture lists them.

WP-CLI

WP-CLI lists every wp sisyphus command and option.

Hooks

HookKindWhen
sisyphus_stepsfilterBuilding the pipeline: the steps, in order. Anything that is not a Step_Interface is dropped
sisyphus_clef_confidencefilterResolving a conflict hunk: how sure clef must be, from 0 to 1, for its choice to stand without Sonnet. 0.75 unless filtered
sisyphus_readyactionAfter every controller registered its hooks, with the Core\Bootstrap
sisyphus_activatedactionAfter activation created the tables
sisyphus_run_tickAction Scheduler action, group sisyphusEach tick, with the run id
sisyphus_schedule_checkRecurring Action Scheduler action, group sisyphusEvery 15 minutes, to start the sites that are due
linchpin_governing_cleanup_allowlistfilter, fired by packagist-plugin-managerSisyphus adds its own slug, so the cleanup pass leaves it active
linchpin_governing_environment_maintenancefilter, fired by packagist-plugin-managerFor an enrolled production environment, Sisyphus answers with its latest run (id, status, created_at, finished_at), next_run_at while the site runs nightly, and overview_path, unless another callback already answered
mantle_ai_gateway_base_urlfilter, Mantle'sRead, the way Mantle reads it, for the gateway base when MANTLE_AI_GATEWAY_URL is not defined

Add a step with sisyphus_steps, as Add a step shows.

Constants

Reference

wp-config.php constants

Sisyphus reads these at run time. None has a settings screen.
4 fields
SISYPHUS_API_CLIENT_ID string required
The api.linchpin.com application client Sisyphus uses, with the maintenance:read, maintenance:write and tests:run scopes. Without it and the secret, every run fails at Preflight, and the screens and the registry commands say what is missing.
SISYPHUS_API_CLIENT_SECRET string required
That client’s secret. Sisyphus exchanges the two for an hour-long token and keeps it in a transient. A secret: keep it out of version control.
SISYPHUS_API_URL url
The API base, only to point somewhere other than production, such as a local wrangler dev.
MANTLE_AI_GATEWAY_URL url
Mantle’s, read the way Mantle reads it: the ai.linchpin.com base Resolve sends conflicts to. When it is not defined, Mantle’s mantle_ai_gateway_base_url filter decides.

Resolve uses Mantle's gateway key on the same site (Gateway_Credentials::usable_key()), so Sisyphus has no AI key of its own. Resolve says which models the key has to allow.

The step interface

Linchpin\Sisyphus\Pipeline\Step_Interface is one step of a run:

MethodReturns
name()stringA stable slug, stored on every run. Renaming one fails the runs still using the old name
timeout()intSeconds from start() before the step fails as timed out
poll_interval()intSeconds between polls while the step waits
start( Step_Context $context )Step_ResultBegin the step. Called at most once, after the step is marked running
poll( Step_Context $context )Step_ResultCheck on a step that is waiting. It must treat missing data as work that never began

A step returns Step_Result::waiting( $message, $data ) to be polled again, passed( $message, $data ) to move the run on, or failed( $message, $data ) to stop it. The data is merged into what the step saved before. Step_Context carries $run_id, $site, $data (what this step saved so far) and $results (what each earlier step saved, by step name).

A step that hands work off can also implement Pipeline\Stoppable_Interface. Its stop( Step_Context $context ): string is called when a person restarts the run at that step: it stops the work, never throws, and returns what it stopped, or an empty string. Every GitHub workflow step does, by cancelling its workflow run.

Have a question about this page?

Linchpin assistant

Was this helpful?