# PR submission receipt Action

Preview: not for production or regulated use.

Add the three-input Action step in [example.yml](example.yml) to an existing
`pull_request` workflow with Node 22.23.4. It verifies an **already-issued**
public signed receipt, using the unchanged Enzan V1 verifier/attachment CLI, and
retains redacted reference artifacts plus this run's attempt-specific link. Root
has selected the reviewed full Enzan commit
`6872c26a901df7a26f60a7a1c7c3faa27fa7b3fc` already present in the example. Keep
that pin until a replacement has been reviewed. The example is executable
workflow syntax, not an observed hosted Action run. The private Enzan repository
must be accessible to the consuming repository through GitHub's permitted
private-Action sharing; public distribution/release has not occurred.

## Copy the supported format

The pinned example accepts **public-record V1 work receipts only**. It takes
three paths, not JSON pasted into workflow inputs:

| Input     | File contents                                                                                                   |
| --------- | --------------------------------------------------------------------------------------------------------------- |
| `receipt` | Exact signed `WORK_RECEIPT` envelope bytes                                                                      |
| `trust`   | `{ issuerId, publicKeyPem }`, selected independently                                                            |
| `context` | `{ publicationId, recordRef: { publicNamespaceId, kind, recordId, revision, digest } }`, selected independently |

Keep `recordRef.kind` as `WORK_RECEIPT` and `revision` numeric. Do not omit the
namespace or substitute the separate signed-submission receipt/context shape. A
local preflight uses the built `receipt-pr-attachment-v1.js --help` interface;
its four required flags are `--receipt`, `--trust`, `--context` and `--output`.
The output directory must be new and its parent must exist. Exit zero plus
`ATTACHMENT_READY` is selected-record integrity, not a GitHub or PR binding
check.

The current development branch also contains an explicit
`receipt-format: SIGNED_SUBMISSION_V1` candidate. That mode is **not present in
the reviewed example pin** and is not adopted by this guide. Do not select it
against the old pin, remove format checks or change the pin for convenience. Its
independent review and release remain separate.

## Prepare trusted inputs and inspect the result

Select the real receipt, issuer public trust and expected publication out of
band. Never derive trust/context from the candidate receipt or use arbitrary
PR-supplied trust files. The example reads public inputs from the trusted base
commit without executing PR code; replace the example input paths with your own
disclosure-approved files. A later owner-approved public artifact producer can
supply newly issued per-PR receipts. Reusing a receipt does not bind it to
another PR: the current Action explicitly reports
`receiptCommitBinding: NOT_ESTABLISHED`. This is a submission **reference**, not
a new signed receipt format or an identity/signing service. The existing issuer
remains a separate private operator operation; never give it signing keys inside
an untrusted PR job. No successful evaluation is inferred from a CLAIM or
signature.

The Action requires an ephemeral trusted Linux runner, Node 22, npm and normal
npm/GitHub artifact availability. It installs its pinned source tree's locked
dependencies with lifecycle scripts disabled and builds that tree, not the
consumer's PR tree. It runs no consumer build/test/install/hooks and no GitHub
API calls or PR comments; no write token, signing secret, ID token, account,
Registrar, remote signer or environment-secret discovery is requested. Do not
use `pull_request_target`/privileged workflows to run untrusted PR code. Keep
`contents: read`, `persist-credentials: false`, a bounded job timeout and an
exact reviewed Action pin. The Action cannot constrain preceding/following
steps; a job that already ran untrusted code is not an independent observer.

The retained files are `receipt-reference.json`, `receipt-pr.md`,
`submission-evidence.json`, `submission-pr.md`. Neither raw signed envelope nor
arbitrary signed summary/key/private path is uploaded. The selected inputs must
remain available separately for reproducing signature verification. Artifact
retention is seven days; download/retain according to your approved evidence
policy before expiry. No automatic posting, long-term custody or publication
follows. GitHub owns artifact access/availability. Outputs include its artifact
URL; the job summary includes the independently hosted run location.

Run/PR/repository/head and runner SHA are **runner-reported, not independently
fetched**. Head SHA and Actions merge SHA stay distinct. The run URL supplies a
separate evidence location showing what that run records; it does not attest
that work was correct, that agent identity or issuer authority is established,
or that the signed receipt belongs to this PR/commit. An attacker controlling
the workflow/runner can forge these unsigned metadata. Check the actual run,
reviewed Action revision, retained receipt digest, independently selected
issuer/context and source association before relying on it. No timestamp or
recorded PASS is invented. Global/continuing identity and current status remain
unestablished/unknown. Repeated references do not create extra assessed work.

Invalid signature/context/metadata or existing output fails closed. Failures may
leave partial new artifacts, never success; the runner does not retry issuance,
overwrite, delete or repair output. In-process source fixtures do not establish
actual hosted GitHub execution, artifact availability, Linux CI or release.

Local source verification (disposable test signatures only):

```sh
TSX_TSCONFIG_PATH=tsconfig.json node --import tsx --test \
  tests/foundation/pr-submission-receipt-action-v1.node.test.ts
```

GitHub contracts:
[composite actions](https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action),
[contexts](https://docs.github.com/en/actions/reference/workflows-and-actions/contexts),
[artifact action v4.6.2](https://github.com/actions/upload-artifact/releases/tag/v4.6.2).
