Skip to content

Commit fb5b15d

Browse files
ainameclaude
andcommitted
feat: upload evidence files one artifact each and link them from the proof
The zip upload gave one link to an archive nobody can open in place, and a per-file upload cannot share it without uploading the same bytes twice. A new `upload-artifacts` operation publishes every file under `artifact_path`, plus the result JSON, as its own non-archived artifact through @actions/artifact, so a screenshot or recording link opens the file in the browser. It emits `artifact_links` for finalize. The proof comment now shows an `Artifacts` row pointing at the run's artifact list with the file count, a download command right under the overview table, and links in every evidence cell whose token names an uploaded file by relative path or unique file name. `gh run download` cannot fetch non-archived artifacts (cli/cli#13012), so the installed maintenance script gains `artifacts RUN_ID [DIR]`, which fetches each artifact through the API and keeps archived ones as .zip files. The validation contract asks agents to cite evidence by path relative to the artifact directory so the links resolve. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 9b9fd88 commit fb5b15d

17 files changed

Lines changed: 2826 additions & 311 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ performs eligible `Todo` to `Ready` updates.
3737
action.yml composite action surface (inputs are the public API)
3838
src/
3939
index.ts operation dispatch; builds context per namespace
40-
shared/ config.ts, github-client.ts, prompt.ts, proof.ts, result.ts
40+
shared/ artifacts.ts, config.ts, github-client.ts, prompt.ts, proof.ts, result.ts
4141
lifecycle/operations.ts lifecycle/<verb> implementations
4242
loop/operations.ts loop/list-epics, prepare-triage and finalize-triage
4343
dist/index.js committed esbuild bundle — regenerate, never hand-edit

‎action.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ inputs:
4141
pull_number:
4242
description: Task pull request number
4343
required: false
44+
artifact_path:
45+
description: Directory whose files upload-artifacts publishes as one non-archived artifact each
46+
required: false
4447
artifact_links:
45-
description: Uploaded validation evidence to link from the proof comment, one per line as "<name> <url>"; the name is optional
48+
description: Uploaded files to link from the proof comment, one per line as "<name> <url>"; upload-artifacts emits this format and the name is optional
4649
required: false
4750
next_status:
4851
description: Status used by the individual update-status operation
@@ -100,6 +103,10 @@ outputs:
100103
description: Number of EPICs enabled for Todo triage
101104
ready_count:
102105
description: Number of Todo tasks moved to Ready by loop/finalize-triage
106+
artifact_links:
107+
description: One "<name> <url>" line per file that upload-artifacts published
108+
artifact_count:
109+
description: Number of files upload-artifacts published
103110

104111
runs:
105112
using: node24

‎dist/index.js‎

Lines changed: 353 additions & 188 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/integration.md‎

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,29 @@ The action runs in the same job, runner, and checked-out workspace as `lifecycle
171171
The validation agent uses the installed `/octestra-contracts` skill to write JSON to
172172
`inputs.result_path` and check its format.
173173

174-
After the agent finishes, the workflow uploads `inputs.artifact_path` and `inputs.result_path` with
175-
`actions/upload-artifact`, even when the agent failed, and passes the upload's name and URL to
176-
`lifecycle/finalize-validation` as `artifact_links`. The proof comment on the task issue then shows an
177-
`Artifacts` row next to the outcome, with the artifact name as the link text. To link several uploads,
178-
pass one per line as `<name> <url>`; a line with only a URL is labelled `Artifact` and numbered when
179-
there are several, and a line without a URL is skipped. Leave `artifact_links` empty to post the
180-
comment without that row; `report-proof` accepts the same input.
174+
### Evidence files
175+
176+
After the agent finishes, the workflow runs `operation: upload-artifacts` with `artifact_path` and
177+
`result_path`, even when the agent failed. It uploads every file under the directory, and the result
178+
JSON, as its own artifact without archiving, so the link to a screenshot or recording opens the file
179+
in the browser. The artifact name is the file's path relative to the directory with `/` replaced by
180+
`--`; the step's `artifact_links` output lists one `<relative path> <url>` line per file and
181+
`artifact_count` gives the number. A file that fails to upload is logged and skipped, and GitHub's
182+
limit of 500 artifacts per job caps what is uploaded.
183+
184+
The workflow passes `artifact_links` to `lifecycle/finalize-validation` (`report-proof` accepts the
185+
same input). The proof comment on the task issue then shows:
186+
187+
- an `Artifacts` row in the overview table, linking to the run's artifact list with the file count;
188+
- a command to download every file of the run,
189+
`.github/octestra/octestra.sh artifacts <run id>`, because `gh run download` cannot fetch
190+
non-archived artifacts ([cli/cli#13012](https://github.com/cli/cli/issues/13012));
191+
- links in the `Evidence` cells of the acceptance, checks, and evidence tables wherever the agent
192+
named an uploaded file by its relative path, or by its file name when that name is unique.
193+
194+
Leave `artifact_links` empty to post the comment without any of these. When the lines come from
195+
somewhere other than `upload-artifacts`, a line with only a URL is labelled `Artifact` and numbered
196+
when there are several, and a line without a URL is skipped.
181197

182198
### Use the agent debug flag
183199

0 commit comments

Comments
 (0)