Skip to content
Open
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Repository commands use the checkout’s `origin` by default. Use `--remote NAME

In GitHub Actions, `proofline ci review --annotations` prints unresolved findings as workflow annotations at verified cited lines. Findings without a verified head location appear on the job. The review link contains the full result.

`proofline checkpoint verify` records acceptance evidence from one exact GitHub Actions `push` run attempt at one exact commit. It reads its JSON manifest and workflow file from that commit, never from an uncommitted working-tree edit, and does not use a Proofline sign-in or API. See [Checkpoint evidence](docs/checkpoints.md) for the manifest, trust boundary, artifacts, and exit codes.

For a CodePipeline execution or Amplify job, run `proofline ci deploy --commit SHA --aws-run ID` in a later pipeline. Add `--environment-id UUID` to select its Proofline environment. The output names the AWS provider and run ID. Proofline records successful CodePipeline executions and failed, stopped or cancelled ones it ties to the ECS rollout that served the commit. A reader inside a still-running execution finds no matching deploy, waits until its timeout and exits 2. On a GitHub `workflow_run` event, an explicit `--aws-run` disables the default Actions run and attempt filters.

`proofline ci deploy --until 1h` waits until Proofline has recorded the deploy checks of the job's commit through the hour check, then exits 0 when each recorded `HEALTHY` with no gap, 3 when a deploy failed or regressed, and 2 when the result is not established, including when a deploy reads a state this CLI version does not know. After a read that answered, the wait keeps reading through a read that fails in transport, times out or gets a 5xx answer, and exits 4 after five such failures in a row, naming the last error; the first read and a refusal end it at once. Without `--timeout`, a wait for `--until landing`, `--until 20m` or `--until 1h` lasts until that check is due for the selected deploys, and at least 30 minutes, so a landing check that reads the runtime again, up to 75 minutes after landing, is still read; `--until 1d` needs `--timeout`. `--environment-id` (the Proofline environment's UUID, the `environment_id` that `--json` prints for each deploy), `--environment` (the GitHub Environment name), `--task`, `--deployment` (the ID of the GitHub deployment a pipeline created), `--run` and `--attempt` select the deploy, and on a `workflow_run` event the commit, `--run` and `--attempt` default to the completed run's. When `--run` defaults to a completed run that did not succeed, the command waits at most 5 minutes for a deploy from that run, then exits 2 with a last line that names the run's conclusion and says it recorded no deploy; a deploy the run did record gets the usual wait for its check. `--json` prints the response. Each deploy prints one line per check. A deploy that rolled the environment back to an earlier commit first prints a `rollback` line with the page of the deploy it restores, when Proofline recorded one, and the pages of the deploys it rolled back. A deploy whose newest check found its service serving an earlier deploy again first prints a `rolled back` line, and stops printing it once a later check finds none; with `--json` the response carries it as `rolled_back`. Both lines can appear for one deploy. A rollback's exit code comes from its checks like any other deploy's; neither line changes it or means the rollback fixed anything. A deploy whose deploy checks ended without recording the `--until` check ends the wait at once with exit 2, and the last line names the check and the deploy's page; a check that is overdue while the checks still run keeps the wait going until the timeout.
Expand Down
160 changes: 160 additions & 0 deletions docs/checkpoints.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"schema": "proofline.checkpoint-manifest.v1",
"task": "contact-display-name-migration",
"repository": {
"host": "github.com",
"full_name": "YOUR_USERNAME/proofline-migration-demo"
},
"milestones": [
{
"id": "expand",
"purpose": "Add the new field without breaking the baseline application.",
"depends_on": [],
"github": {
"workflow_path": ".github/workflows/acceptance.yml",
"event": "push"
},
"criteria": [
{
"id": "schema-upgrade",
"description": "The baseline database upgrades successfully.",
"required": true,
"job_name": "acceptance / schema-upgrade"
},
{
"id": "legacy-compatibility",
"description": "The baseline application still reads and writes.",
"required": true,
"job_name": "acceptance / legacy-compatibility"
},
{
"id": "tenant-isolation",
"description": "Tenant-scoped operations preserve other tenants' records.",
"required": true,
"job_name": "acceptance / tenant-isolation"
}
],
"review": {
"required": false,
"accepted_source": "none"
}
},
{
"id": "backfill",
"purpose": "Populate display_name with a resumable tenant-scoped backfill.",
"depends_on": ["expand"],
"github": {
"workflow_path": ".github/workflows/acceptance.yml",
"event": "push"
},
"criteria": [
{
"id": "backfill-values",
"description": "Migrated values match the expected fixture data.",
"required": true,
"job_name": "acceptance / backfill-values"
},
{
"id": "backfill-idempotency",
"description": "Repeated execution leaves the intended state unchanged.",
"required": true,
"job_name": "acceptance / backfill-idempotency"
},
{
"id": "backfill-resume",
"description": "Interrupted work resumes without omitting records.",
"required": true,
"job_name": "acceptance / backfill-resume"
},
{
"id": "preserve-newer-values",
"description": "The backfill does not overwrite a newer value written during migration.",
"required": true,
"job_name": "acceptance / preserve-newer-values"
},
{
"id": "tenant-isolation",
"description": "Tenant A's backfill does not mutate tenant B's overlapping contact IDs.",
"required": true,
"job_name": "acceptance / tenant-isolation"
}
],
"review": {
"required": false,
"accepted_source": "none"
}
},
{
"id": "switch",
"purpose": "Use the new field while retaining the declared external API contract.",
"depends_on": ["backfill"],
"github": {
"workflow_path": ".github/workflows/acceptance.yml",
"event": "push"
},
"criteria": [
{
"id": "new-reader",
"description": "The application uses the new field as intended.",
"required": true,
"job_name": "acceptance / new-reader"
},
{
"id": "transition-fallback",
"description": "Declared transitional records are handled correctly.",
"required": true,
"job_name": "acceptance / transition-fallback"
},
{
"id": "api-contract",
"description": "Existing clients receive the declared response contract.",
"required": true,
"job_name": "acceptance / api-contract"
},
{
"id": "tenant-isolation",
"description": "Tenant-scoped reads and writes remain isolated.",
"required": true,
"job_name": "acceptance / tenant-isolation"
}
],
"review": {
"required": false,
"accepted_source": "none"
}
},
{
"id": "contract",
"purpose": "Remove old storage after legacy consumers are retired in the controlled test scenario.",
"depends_on": ["switch"],
"github": {
"workflow_path": ".github/workflows/acceptance.yml",
"event": "push"
},
"criteria": [
{
"id": "contract-upgrade",
"description": "The expanded and backfilled schema contracts successfully.",
"required": true,
"job_name": "acceptance / contract-upgrade"
},
{
"id": "api-contract",
"description": "Current application behavior preserves the required API contract.",
"required": true,
"job_name": "acceptance / api-contract"
},
{
"id": "tenant-isolation",
"description": "Tenant isolation holds after contraction.",
"required": true,
"job_name": "acceptance / tenant-isolation"
}
],
"review": {
"required": false,
"accepted_source": "none"
}
}
]
}
53 changes: 53 additions & 0 deletions docs/checkpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Checkpoint evidence

`proofline checkpoint verify` binds a milestone's declared acceptance jobs to one exact GitHub Actions workflow run attempt and commit. It reads existing metadata; it does not run project commands, dispatch or rerun workflows, fetch Git history, approve a deployment, or establish production safety.

The command supports one `github.com` repository, a trusted `push` producer, and exact job names. Review imports and SARIF are not supported in this acceptance-only version.

```sh
proofline checkpoint verify \
--manifest .proofline/checkpoints.json \
--milestone backfill \
--repo OWNER/REPOSITORY \
--commit FULL_SHA \
--run RUN_ID \
--attempt 1 \
--prior expand=/absolute/path/to/expand/checkpoint.json \
--out /absolute/path/to/new-checkpoint-directory
```

The checkout's `origin` must name the same `github.com` repository. A full SHA-1 or SHA-256 object name is required. Without `--base`, an individual commit uses its first parent. With `--base`, the CLI verifies that the exact base is a local ancestor of the selected head. The caller is responsible for preparing complete local history; the command never fetches or changes the checkout.

The repository-relative manifest path must identify an ordinary Git blob at `--commit`. The version is `proofline.checkpoint-manifest.v1`; [checkpoints.example.json](checkpoints.example.json) shows the complete tenant-migration example. Unknown fields, duplicate IDs or job selectors, dependency cycles, unsupported events or review sources, and manifests larger than 256 KiB are refused. Version 1 supports only `"accepted_source": "none"`. A required review remains visibly incomplete because this version imports no review evidence.

GitHub credentials are read from `GH_TOKEN`, then `GITHUB_TOKEN`. Public metadata can be read anonymously subject to GitHub's limits. The production client sends credentials only to `https://api.github.com`, refuses redirects, and reads at most ten 100-job pages. Each response is limited to 1 MiB, temporary GET failures receive at most two retries after the first request, and all collection must finish within 30 seconds.

The CLI validates the repository numeric ID and canonical name, head repository, fork status, run ID, attempt, workflow ID and path, `push` event, exact head SHA, and each job's available run identity before evaluation. A required job passes only when its status is `completed` and conclusion is `success`. `failure` and `timed_out` establish failure; missing, skipped, neutral, cancelled, pending, and unknown results are incomplete.

Every dependency listed by the milestone must be supplied explicitly with `--prior MILESTONE=PATH`. The prior record must have schema `proofline.checkpoint-evidence.v1`, source class `github_api`, the same task and repository, the named satisfied milestone, and a head that is a local ancestor of the current head. A dependency does not transfer its passing jobs to the current milestone.

`--out` must not already exist. The CLI stages and atomically publishes a directory containing:

- `checkpoint.json`, the versioned allowlisted evidence record;
- `summary.md`, a human-readable rendering;
- `SHA256SUMS`, covering the two generated files but not itself.

`--json` additionally writes exactly the saved `checkpoint.json` to standard output; diagnostics remain on standard error. Policy failures and unavailable evidence are still saved when local inputs and the output destination are valid. Existing output is never overwritten.

Exit codes are:

| Exit | Meaning |
|---:|---|
| 0 | The declared acceptance policy is satisfied. |
| 1 | Invocation, manifest, identity, dependency trust, protocol, or artifact writing was rejected. |
| 2 | Required evidence is missing, pending, incomplete, or an unsupported required review is absent. |
| 3 | A required acceptance job or already evaluated dependency establishes policy failure. |
| 4 | Required GitHub evidence could not be collected within the bounded retry/deadline policy. |

Render a saved record without GitHub or Proofline access:

```sh
proofline checkpoint report /absolute/path/to/checkpoint.json
```

Reporting replays the saved evaluation and exits zero when rendering succeeds, independently of the recorded policy verdict. It states when the evidence was observed and does not claim that the remote run still exists or is unchanged.
2 changes: 2 additions & 0 deletions src/agent/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ fn arguments(origin: &Origin) -> [String; 3] {

fn executable() -> Result<String, InstallError> {
std::env::current_exe()
.map_err(InstallError::Executable)?
.canonicalize()
.map_err(InstallError::Executable)?
.into_os_string()
.into_string()
Expand Down
8 changes: 6 additions & 2 deletions src/agent/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ fn origin() -> Origin {
Origin::parse("https://proofline.sh").unwrap()
}

fn executable() -> PathBuf {
std::env::current_exe().unwrap().canonicalize().unwrap()
}

fn target(home: &Path, client: Client) -> PathBuf {
home.join(client.relative_path())
}
Expand Down Expand Up @@ -109,7 +113,7 @@ fn configuration(client: Client) -> Vec<u8> {
fn assert_new_server(client: Client, server: &Value, selected_origin: &str) {
assert_eq!(
server["command"],
std::env::current_exe().unwrap().to_str().unwrap()
executable().to_str().unwrap()
);
assert_eq!(
server["args"],
Expand Down Expand Up @@ -177,7 +181,7 @@ fn all_clients_preserve_private_settings_and_add_only_the_launcher() {
.unwrap();
assert_eq!(
server["command"].as_str(),
std::env::current_exe().unwrap().to_str()
executable().to_str()
);
assert_eq!(
server["args"]
Expand Down
Loading