Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export default defineConfig({
{ text: "Overview", link: "/cli/" },
{ text: "fullsend agent", link: "/cli/agent" },
{ text: "fullsend github", link: "/cli/github" },
{ text: "fullsend execution-plan", link: "/cli/execution-plan" },
{ text: "fullsend inference", link: "/cli/inference" },
{ text: "fullsend lint", link: "/cli/lint" },
{ text: "fullsend mint", link: "/cli/mint" },
Expand Down Expand Up @@ -403,6 +404,7 @@ export default defineConfig({
{ text: "Behaviour Testing", link: "/guides/dev/behaviour-testing" },
{ text: "CLI Internals", link: "/guides/dev/cli-internals" },
{ text: "E2E Testing", link: "/guides/dev/e2e-testing" },
{ text: "Execution Plan Drivers", link: "/guides/dev/execution-plan-driver" },
{ text: "Testing Workflows", link: "/guides/dev/testing-workflows" },
{ text: "Tracing Internals", link: "/guides/dev/tracing" },
],
Expand Down
1 change: 1 addition & 0 deletions docs/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ To update an installed binary later, run [`fullsend self-update`](self-update.md
|---------|-------------|
| [`fullsend run`](run.md) | Execute an agent locally in a sandbox. See [running agents locally](../guides/user/running-agents-locally.md). |
| `fullsend poll` | Discover forge events and dispatch agent pipelines. `--forge gitlab` runs the cron poller ([ADR 0067](../ADRs/0067-gitlab-cron-polling-event-dispatch.md)); events-mode polling also recovers issue opens whose webhook delivery was missed. `--input-driver jira-poll` polls Jira (see [Jira integration](../guides/user/jira-integration.md)). It reads the Jira site, API gateway, project, and query only from the effective `tracker.jira` config (`base_url` and `project` required; the removed `--jira-url`, `--jira-project`, and `--jql` flags are rejected), authenticates with `FULLSEND_JIRA_TOKEN` (plus `FULLSEND_JIRA_EMAIL` for a bot user) or with OAuth 2.0 client credentials via `FULLSEND_JIRA_CLIENT_ID` and `FULLSEND_JIRA_CLIENT_SECRET`, and skips the cycle unless `tracker.jira.poll.enabled` is `true`; by default it writes dispatch records (`--output`) for a GitHub repository (`--target-repo`, an `owner/repo` slug; one that contains `..` is refused), and with `--target-forge gitlab` it starts the protected agent pipelines of the GitLab project named by `--project` (full path, nested groups allowed; default `CI_PROJECT_PATH`) on the https `--gitlab-url` instance, through the same signed, typed-input dispatch route and Poller credential as the GitLab poller, advancing a Jira issue's checkpoint only once its pipelines are created ([GitLab runtime](../guides/user/jira-integration.md#gitlab-runtime)). `--input-driver gitlab-webhook` is the GitLab dispatcher job's webhook fast-path ([ADR 0125](../ADRs/0125-gitlab-hybrid-webhook-poller-dispatch.md)). It reads the native webhook body from the file-type `TRIGGER_PAYLOAD` variable, re-validates it against the GitLab API, and creates each routed stage's pipeline (typed inputs, `FULLSEND_DISPATCH_SECRET` HMAC) with the poller-role credential (the `api` route, the default). Scheduled cron polling and the webhook fast path run as the trigger-only service account: once its dispatch activation is recorded, the managed webhook carries the account's pipeline trigger token ([#8509](https://github.com/fullsend-ai/fullsend/issues/8509)), the scaffold sets `FULLSEND_GITLAB_DISPATCH_ROUTE=child-pipeline`, and the command instead starts each pipeline with the job's own `CI_JOB_TOKEN` through the pipeline trigger API (`source=pipeline`); an unknown route, or `child-pipeline` without `CI_JOB_TOKEN`, fails closed. `fullsend poll --forge gitlab --print-dispatch-routes` prints the routes the CLI supports (`api` and `child-pipeline`) and exits; the scaffold runs it before selecting `child-pipeline`, and a CLI that predates the route rejects the flag, so the job stops before any dispatch. It requires `--project`, which has no `CI_PROJECT_PATH` fallback. It deduplicates against the poller's per-mode state on the `fullsend-poll-state-slash` and `fullsend-poll-state-events` branches, so an event the webhook dispatched is not dispatched again by the poller, and the reverse. Shared poller state is occurrence-aware (label additions are keyed on the resource label event ID, dispatched keys are retained for the webhook freshness window, and a failed label dispatch is handed back to the poller as a pending retry); legacy persisted keys keep working. Older pollers do not recognise the new label keys, so before a rollback or mixed-version run, follow the [ADR 0132](../ADRs/0132-occurrence-aware-shared-poller-state.md) guidance to drain in-flight poll jobs or pin every poller to one version. Both GitLab drivers dispatch the fix stage only for a changes-requested marker note authored by the registered Analyst, whose numeric user ID the scaffold exports as the job-local `FULLSEND_GITLAB_ANALYST_USER_ID`. |
| [`fullsend execution-plan`](execution-plan.md) | Reconcile an experimental immutable multi-target plan with a trusted host driver and persistent local state. |
| `fullsend dispatch` | Evaluate harness CEL triggers for one forge event and print the dispatch matrix (`--output-driver gha-matrix` or `json`); used by the dispatch workflow's `Harness dispatch` job. `--route <agent>` (`review`, `retro`, `triage` or `prioritize`) instead decides routing for that built-in agent and prints one JSON line, `{"agent":"<agent>","decision":"run\|skip\|bash","reason":"…","harness":"config:<source>\|agents@<sha>"}` (`harness` is optional: it is omitted when the harness cannot be resolved or the decision did not need it, as for `bash`): `run` or `skip` when the repository set `agents[].trigger` on the agent's entry ([Choosing when review runs](../guides/user/customizing-agents.md#choosing-when-review-runs), [Choosing when retro runs](../guides/user/customizing-agents.md#choosing-when-retro-runs), [Choosing when triage and prioritize run](../guides/user/customizing-agents.md#choosing-when-triage-and-prioritize-run)), `bash` to leave the decision to the workflow's built-in rules. The dispatch workflow's `Route` job runs it. With `--input-driver gha-event`, a GitHub bot actor's registered fullsend role is looked up first through the mint (a layered `mint_url`, else `FULLSEND_MINT_URL`) with the job's Actions OIDC token, so the job needs `id-token: write` ([ADR 0107](../ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md)); label-added events skip the lookup, and an unregistered bot or a failed lookup is denied (an empty matrix, or a `skip` decision) rather than failing the command. An absent config falls back to `FULLSEND_MINT_URL`, but a config that fails to load or parse is a failed lookup, not a fallback. |
| `fullsend lock [agent-name]` | Pin remote dependencies to `lock.yaml`. If `lock.yaml` exists but cannot be parsed or declares an unsupported version, the command exits without writing and leaves the file unchanged. An entry is stale when the harness file or the `harness:` block of the agent's `agents:` entry has changed. When it composes a harness (a new or stale entry, or `--update`), it also prints the harness diagnostics, including [reserved `env.sandbox` keys](run.md#reserved-envsandbox-keys). A current entry is not composed, so its keys are not checked, and `lock` composes without event context, so keys from event-guarded overlays are reported only by `fullsend run`. A harness whose runtime fetch service can start (`allow_runtime_fetch: true`, URL-sourced skill or plugin directories, or a bare, deprecated `allowed_remote_resources` declaration) must have every harness-level `allowed_remote_resources` prefix covered by the config-level allowlist — `config.yaml`'s `allowed_remote_resources` plus the built-in default prefixes (the defaults are included when the list is omitted or non-empty; an explicit `allowed_remote_resources: []` stays deny-all and excludes them); `lock` fails naming an uncovered prefix, and fails closed when no repository config (`config.yaml` or `config.base.yaml`) exists. With a `harness:` block on the agent's entry, the prefixes checked are the ones the block sets. |
| `fullsend lint` | Lint `config.yaml` and agent harness definitions — deprecations, misconfigurations, and file checks, with diagnostics for each enabled agent, or for one agent with `fullsend lint <agent-name>`. See [`fullsend lint`](lint.md), and [Checking a trigger before you merge](../guides/user/cel-triggers-reference.md#checking-a-trigger-before-you-merge) for a walkthrough. |
Expand Down
102 changes: 102 additions & 0 deletions docs/cli/execution-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
sidebar_label: execution-plan
---

# fullsend execution-plan

Advance a bounded group of source-bound executions once. This experimental
command persists attempts before dispatch and reconciles existing attempts
before scheduling more work. A trusted host driver supplies authorization and
execution. Fullsend supplies plan identity, concurrency limits, retry accounting
and aggregate completion.

```sh
fullsend execution-plan \
--plan /srv/fullsend/plan.json \
--state-dir /srv/fullsend/state \
--driver /opt/fullsend/plan-driver
```

| Flag | Required | Meaning |
| --- | --- | --- |
| `--plan` | Yes | Reviewed immutable plan JSON, within 4 MiB |
| `--state-dir` | Yes | Private persistent directory for checkpoints and locks |
| `--driver` | Yes | Absolute path to an operator-controlled executable |
| `--driver-timeout` | No | Timeout per call; default `30s`, maximum `5m` |

The command prints `{"complete":false,"state":{...}}` or a completed state.
A successful exit means reconciliation finished. Check `complete` to determine
whether all required executions succeeded. Authorization blockers, exhausted
attempts and outstanding work keep completion false. Errors exit nonzero;
previous checkpoints remain available for recovery.

State and stdout contain plan inputs, domain context and execution receipts.
Keep them in restricted storage. Supply credentials through the driver's
protected environment, never through plan fields.

## Plan input

```json
{
"version": 1,
"id": "advisory-123",
"request": "advisory-123",
"authorization": "reviewed-installation-grant",
"harness": "assessment",
"control_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"deadline": "2099-01-01T00:00:00Z",
"max_parallel": 2,
"max_attempts": 2,
"targets": [
{
"id": "release-1",
"forge": "github",
"host": "github.com",
"repository": "example/project",
"ref": "refs/heads/release-1",
"sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
}
]
}
```

Replace illustrative identities and SHAs with reviewed real inputs. The
`authorization` field names a grant the driver verifies; writing a value here
cannot grant repository access. `control_sha` identifies trusted configuration
separately from the source under assessment.

Each target has a stable ID within the plan and an exact source SHA. `forge`
accepts `github`, `gitlab` or `forgejo`; `host` distinguishes installations.
GitLab repository paths may include subgroups. `ref` is a full branch ref.
Optional `context` carries at most 64 KiB of JSON domain data. Drivers treat it
as data, with no authority to choose credentials or executable commands.

Initial limits allow 1–256 targets, parallelism of 1–32 and 1–10 attempts per
target. These ceilings bound this experimental contract's work and state;
revisit them with measured installation needs before expanding the contract.
The deadline prevents new attempts while existing work remains reconcilable.
A failed attempt consumes its budget; an uncertain attempt consumes both an
attempt and a concurrency slot.

A plan is immutable, including its targets, order, deadline and limits. Reusing
its ID with changed input fails. Supersession and migration of consumed budgets
are not implemented. Preserve existing state; changing IDs to bypass limits is
not a recovery procedure.

## Storage and execution scope

The file store uses a context-aware OS lock and atomic private checkpoints.
It supports processes sharing one persistent filesystem with working `flock`
semantics. The parent of `--state-dir` must already exist durably. Protect the directory
and all its ancestors from untrusted writes.
Separate CI machines need a shared, fenced storage adapter. Copying state files
between jobs does not provide distributed coordination.

Native forge launch adapters, automatic source checkout and integration with
existing dispatch workflows are not included. Forge names identify targets;
they do not establish that an installed driver supports those targets. The
operator must install a driver that verifies authorization, source checkout
and trusted configuration for every enabled forge.

See [building a plan driver](../guides/dev/execution-plan-driver.md) for the
protocol and CVE workflow migration boundary.
1 change: 1 addition & 0 deletions docs/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ Guides for contributors developing and testing fullsend itself.
- [Behaviour test drivers](dev/behaviour-drivers.md) — Implement SCM and CI drivers for behaviour tests
- [Testing workflow changes](dev/testing-workflows.md) — Point a test repository at a branch to test workflow, action, and agent changes before release, and run the PR CI checks locally with `make ci-local`
- [Tracing internals](dev/tracing.md) — How the distributed tracing implementation works and how to extend it
- [Execution plan drivers](dev/execution-plan-driver.md) — Connect the experimental multi-target coordinator to a trusted execution backend
5 changes: 5 additions & 0 deletions docs/guides/dev/cli-internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ fullsend
│ └── --base-url <url> # Forge API base URL
├── post-comment # Post issue/PR comments to GitHub (deprecated)
│ └── --token <string> # GitHub token (default: $GH_TOKEN / $GITHUB_TOKEN / gh auth token)
├── execution-plan # Experimental multi-target reconciliation
│ ├── --plan <path> # Reviewed immutable plan JSON
│ ├── --state-dir <path> # Private persistent local checkpoints
│ ├── --driver <absolute-path> # Trusted host executable
│ └── --driver-timeout <duration> # Per-call timeout (default 30s; maximum 5m)
├── eval-measure # Score wild-run traces (eval measurements)
│ ├── --telemetry <path> # Path to run-telemetry.jsonl (or --output-dir)
│ ├── --output-dir <path> # CI output base or runDir (managed-job form)
Expand Down
103 changes: 103 additions & 0 deletions docs/guides/dev/execution-plan-driver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: Build an execution plan driver
---

# Build an execution plan driver

Fullsend owns a plan's durable attempts and accounting. A driver connects those
attempts to an execution backend. Domain mapping and assessment remain outside
the coordinator. See the [command reference](../../cli/execution-plan.md) for
plan fields, flags, limits and current storage restrictions.

## Prerequisites

- An operator-controlled executable, working directory and environment.
- A protected persistent state directory shared by all local reconcilers.
- A source-bound single-target worker and authoritative backend lookup.
- Reviewed authorization policy covering each target and requested harness.

Keep driver code outside the source checkout being assessed. A target or model
response cannot select the driver, its credentials or trusted configuration.
Go implementations of forge operations must use `forge.Client`.

## Implement the protocol

1. Read exactly one JSON request from stdin. Fullsend invokes the executable
directly with no arguments or shell expansion. Each request contains
`version: 1`, `operation`, the complete `plan`, and either `target` for
authorization or `attempt` for submission and lookup.
2. Handle `authorize` by verifying the current grant, target access, harness
permission and trusted control revision. Return `{"authorized":true}` only
after those checks. Errors and missing approval hold the target with an
authorization blocker. Recheck policy inside the launch boundary when the
backend cannot atomically preserve the prior decision.
3. Handle `submit` by launching one exact attempt. Verify repository, branch
and SHA against the admitted target. Keep trusted configuration at
`plan.control_sha` separate from the assessed source. The attempt ID is the
correlation key. Record it where authoritative backend lookup can recover
an accepted launch after its acknowledgement is lost.
4. Handle `lookup` by observing that exact attempt without creating work. An
absent receipt means the outcome remains unknown. An empty search result
cannot authorize a second submission. Return a terminal receipt only when
the external run has stopped consuming execution capacity.
5. Print one JSON response to stdout, within 1 MiB. Fullsend rejects unknown
response fields and trailing JSON. Driver stderr is discarded to avoid
retaining credentials from external diagnostics. Honor process cancellation.

For submit and lookup, the response contains an optional `receipt`:

```json
{
"authorized": false,
"receipt": {
"attempt_id": "the-exact-request-attempt-id",
"plan_digest": "the-exact-request-plan-digest",
"target_id": "release-1",
"source_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"run_id": "authoritative-backend-run-id",
"state": "running"
}
}
```

Receipt states are `running`, `succeeded` and `failed`. The `authorized` field
is used only by authorization calls. For an unresolved lookup, return
`{"authorized":false}`. An accepted attempt's backend run ID cannot change.

Fullsend persists an `uncertain` attempt before calling submit. A timeout,
process loss, invalid receipt or lost response leaves the attempt reserved.
Later reconciliation calls lookup rather than submit. A confirmed failure can
start a new numbered attempt within the original budget. A successful attempt
is retained and not rerun. Each invocation launches at most one new attempt per
target.

## Keep findings separate from execution

A successful run means the driver accepted a completed worker result. Domain
consumers still validate assessment evidence and interpret affected,
unaffected or inconclusive findings. Fullsend plan completion grants no coding,
publication, merge or tracker-closure authority. Drivers must not return success
merely because CI exited zero or a tracker exists.

## Adapt a CVE workflow

1. Resolve reviewed release mappings into targets. Put public-advisory identity,
component and evidence-bundle descriptors in domain context. Retain disclosure
and destination policy in the trusted CVE integration.
2. Translate an admitted manifest into one immutable execution plan. The
coordinator owns dispatch, attempt budgets, concurrency and completion.
3. Connect the driver to a single-target assessment harness. Validate its
source-bound assessment receipt before reporting execution success. Keep
Jira investigation creation and human coding approval in the CVE workflow.
4. Prove lost-acknowledgement recovery and branch isolation before enabling
recurring execution. Keep existing journal records and consumed budgets.

> **Planned:** Native CI launch adapters, a shared fenced journal, and budget-
> preserving supersession remain integration work tracked with
> [#9260](https://github.com/fullsend-ai/fullsend/issues/9260). This draft
> coordinator does not migrate an existing CVE installation or its journal.

The coordinator contract covers targets on GitHub, GitLab and Forgejo. Each
installed driver must explicitly support its selected forge and host or deny
execution. An installation that runs the controller on GitLab and assesses
GitHub source does not need to use the same forge for both roles.
Loading
Loading