Check the final file handoff and read the current approve decision. Your application then decides whether to submit the print job.
Use Native and Bash. Complete Use Lispex Vouch first. Keep its print-handoff.lspx, policy.json, and issuer key. The printer independently chooses the accepted source, public key, executable, and input.
Bind the print request
Save this complete file as current-request.checked.json with UTF-8, LF line endings, and a final newline.
{
"input": "csk.checked-input/v1",
"value": [
true,
true,
true,
true,
"edition-final",
"print-request-123",
"operator-7",
"print",
1785600000
]
}The first four values describe page size, margins, embedded fonts, and page count. The fifth identifies the final file revision. The remaining values bind the request ID, actor, action, and expiry to the signed input.
The expiry is fixed exercise data. For a live job, the application supplies trusted facts, authenticates the actor, and checks expiry against server time. The rule reads only the first four values. The signed input binds all nine.
Issue the request and check it again
Set ISSUER_KEY_URI to the same absolute private-key path used in the Vouch guide. Use new output paths for each request.
lispex vouch issue --source print-handoff.lspx \
--input current-request.checked.json --profile csk.checked-profile/v1 \
--key-handle "$ISSUER_KEY_URI" --out-dir current-request-issued --emit-bundle
lispex vouch gate --bundle current-request-issued/vouch-input-bundle.json \
--trust-policy policy.json --source print-handoff.lspx \
--input current-request.checked.json --profile csk.checked-profile/v1 \
--require-decision approve --report-out current-request-gate.jsonBoth commands exit 0 and print nothing. Issuance creates issue-report.json, payload.json, envelope.dsse.json, and vouch-input-bundle.json under current-request-issued. The issue report says issued-native. The gate writes current-request-gate.json with the following result.
{
"basis": "csk.current-native-agreement/v0",
"observed_decision": "approve",
"reason": null,
"required_decision": "approve",
"status": "granted"
}The gate authenticates the record, binds the independently supplied source and input, and reruns the rule in this Native invocation. Vouch checks agreement between the record and re-execution. The application determines the actual action.
Read the gate as a request record
Retain current-request-gate.json together with the exact checked input and signed bundle. These fields identify what this invocation checked.
| Field | Meaning |
|---|---|
context.input_sha256 | Vouch identifier of the exact checked-input bytes |
context.source_sha256 | Accepted rule source identifier |
context.envelope_sha256 | Signed envelope used by this call |
authentication.status | authenticated for this request |
comparison.current_vs_signed | agree for the complete execution records |
reexecution.status | execution-agreed for the new execution |
gate.status | granted when the current decision meets the requirement |
The application adds its request ID, authenticated actor, action, expiry, file revision, printer transaction ID, and final transaction state to its audit record. Keep the exact input and gate-report bytes with that record. A Vouch input identifier uses its own hash domain, so a generic file SHA-256 is a different identifier.
A received decision bundle and an application transaction use separate records. Reserve each request ID atomically before sending the job. Follow the printer service's idempotency rules and retain its response. On timeout, reconcile the transaction before retrying.
Handle a refused request
These outcomes use the files from this exercise and the preceding Vouch guide.
| Change | Observed result | Application response |
|---|---|---|
Pass the nine-value request to the five-value issued bundle | Exit 1 with native-request-input-mismatch, gate not-evaluated | Issue the request's own bundle |
Omit --input while supplying a source | Usage exit 2 before execution | Supply the complete source and input pair |
Require deny for the approving input | Exit 10 with gate denied and reason required-decision-mismatch | Stop and inspect the decision |
| Actor, action, expiry, or request reuse fails the application's checks | Application refusal | Stop before submitting the job |
For input mismatch, the gate writes the diagnostic report at the requested path. A usage error produces no report. Decision mismatch writes a denial report and leaves standard output empty. Save refused requests separately from completed print transactions.
Submit the print job in your application
- Authenticate the operator and load the final file and trusted inspection facts.
- Check the requested action, expiry, and the association between the file revision and exact file bytes.
- Supply the exact source and input to a fresh Vouch gate requiring
approve. - Atomically reserve the request ID in application storage.
- Submit the file through the application's printer connection.
- Save the printer's response and mark the request complete.
- Resolve an unknown outcome before retrying.
The commands above end at the gate report. Your application implements reservation, printing, and recovery. Retain the final file, signed input, bundle, policy, gate report, and printer response so both parties can review a printing problem.
If authentication, input binding, execution, or the required decision fails, stop the request and read the diagnostic. A saved gate report records a past call. Run a fresh gate for the current request.