Check Reports from Other Engines

Check an external engine's saved report against selected source, output, linked files, and expected execution settings.

Code conversion and saved reports

Lena Code is a code analysis platform built on a deterministic pipeline. Explain and Review describe and review code, and Convert moves supported code to another language. Its foundation is Lena, its own Lisp dialect, and Facet IR, an intermediate form that captures code structure and references.

The walkthrough below checks a saved sample report for TypeScript code converted to Python. Its lena-gate-proof identifier names a linked sample file.

Use the Lispex npm CLI and Node.js. Set NPM_CLI to the installed package's bin/lispex.js path. This page uses the npm verify-bridge command for conversion reports.

Prepare the supplied example

Create a new working directory and run the following commands in Bash inside it. They download the five example files under examples/vouch-bridge.

SH
base=https://www.lispex.com/examples/vouch-bridge
for file in source/checkout-discount.ts target/checkout_discount.py \
    linked/lena-gate-proof.json reports/checkout-discount.bridge.json \
    context/checkout-discount.context.json; do
  curl -fsSL --create-dirs -o "examples/vouch-bridge/$file" "$base/$file"
done

Run the remaining commands from the same working directory.

File under examples/vouch-bridgePurpose
source/checkout-discount.tsTypeScript source
target/checkout_discount.pyPython output
linked/lena-gate-proof.jsonLinked file identified as lena-gate-proof
reports/checkout-discount.bridge.jsonSaved sample report, vouch.bridge-report/v0
context/checkout-discount.context.jsonRecipient's expected profile, case, and execution method

Use the supplied bytes, including line endings. Save command results outside the example directory. This exercise reads the saved sample. Its engine and gate fields are declarations in that report. For your own conversion, obtain the source, output, linked files, and report from the external engine. Choose the expected context independently before examining its result.

The source and output implement discount rates of 15, 10, or 0 based on customer tier and subtotal. The expected context selects case checkout-discount-ts-to-python and method checked-expression-route. It requires profile vouch.conversion-evidence-profile/v0 and the listed function, conditional, comparison, and integer-arithmetic capabilities.

Verify the selected files

SH
node "$NPM_CLI" verify-bridge \
  --source examples/vouch-bridge/source/checkout-discount.ts \
  --target examples/vouch-bridge/target/checkout_discount.py \
  --linked lena-gate-proof=examples/vouch-bridge/linked/lena-gate-proof.json \
  --expect-context examples/vouch-bridge/context/checkout-discount.context.json \
  examples/vouch-bridge/reports/checkout-discount.bridge.json \
  > bridge-verified.json

The command exits with code 0 and writes bridge-verified.json in vouch.bridge-verify-report/v0 format. Stderr contains:

bridge report is artifact-consistent

These are the complete checks and summary objects from that output.

JSON
{
  "checks": {
    "recomputed": [
      "source",
      "target",
      "linked_artifact:lena-gate-proof"
    ],
    "recorded_only": []
  },
  "summary": {
    "status": "pass",
    "exit_code": 0,
    "failure_count": 0
  }
}

Lispex read the three supplied files and compared their hashes with the report. It also checked source and target lengths, report structure, declared gate results, and expected context. The recipient decides which engine, execution method, and evidence to accept. The external engine creates the output and runs its declared checks.

See why the file flags matter

Read just the report with this separate command.

SH
node "$NPM_CLI" verify-bridge \
  examples/vouch-bridge/reports/checkout-discount.bridge.json \
  > bridge-record-only.json

It also exits with code 0 and prints bridge report is artifact-consistent to stderr. Its summary remains pass, but checks is now:

JSON
{
  "recomputed": [],
  "recorded_only": [
    "source",
    "target"
  ]
}

Here, Lispex checked the recorded structure and declarations. recorded_only identifies source and target values retained from the report. Use --source, --target, and --linked to check the actual files. Use --expect-context to check the profile, case, and execution method you chose.

Read the report's declarations

Report fieldWhat it records
subject.source, subject.targetLanguage, path, byte length, and hash
engineEngine name, version, and commit
subject.routeExecution method, profile, and supported operations
checksDeclared pass, fail, or not-run results and linked hashes
linked_artifactsIdentifiers and hashes for associated files
boundary.attests, boundary.excludesThe observations covered by the report and responsibilities left to the engine or application

--linked <id>=<file> selects a file for a declared linked identifier. --expect-context <file> reads vouch.bridge-context-manifest/v0. The verifier requires the report's summary to match its declared check counts and outcomes. A fail or not-run check makes that report's summary fail.

Exit 0 reports successful checks for the supplied inputs. Exit 1 reports a failed check or a failing declared summary; read summary and diagnostics. Exit 2 identifies usage, file-reading, or JSON parsing errors.

Choose the next command by file type

The npm verify-bridge command reads conversion reports and checks their selected file bindings. Native verify-bridge accepts a different execution report with explicit profile, engine, source, and input options. Use each command's own input format.

Native differential reports use csk.differential-receipt/v0. The npm lispex verify command checks those reports, and npm vouch replay compares saved case sets. Vouch signature authentication and a fresh Native gate have their own bundle and policy inputs. The calling application authorizes any external action.

Lispex Vouch · Compare Saved Decisions Again · Vouch Records and Reports