Code conversion and saved reports
Lena Code is a code analysis platform built on a deterministic pipeline. Understand, improve, and transform your code across 30 languages. Explain and Review work with code in its own language. Convert translates code into a chosen language.
For conversion, put code in the input editor, choose an available target language, and review the code in the result editor. Check the language choices in the workspace before starting.
Lena Code's technical foundation includes Lena, its own Lisp dialect, and Facet IR, a structured intermediate representation of code. Its team has built code analysis and conversion tools, interpreters, and a verification corpus. These assets support code analysis, generation, conversion, and deterministic result checking.
The walkthrough below checks a saved TypeScript-to-Python report supplied with Lispex.
Its lena-gate-proof identifier names a linked sample file.
For another conversion, collect the source, result, linked files, and a vouch.bridge-report/v0 report from the tool that produced it.
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
Open a Lispex source checkout at its repository root.
The complete input files are supplied under examples/vouch-bridge.
| File under that directory | Purpose |
|---|---|
source/checkout-discount.ts | TypeScript source |
target/checkout_discount.py | Python output |
linked/lena-gate-proof.json | Linked file identified as lena-gate-proof |
reports/checkout-discount.bridge.json | Saved sample report, vouch.bridge-report/v0 |
context/checkout-discount.context.json | Recipient'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
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.jsonThe command exits with code 0 and writes bridge-verified.json in vouch.bridge-verify-report/v0 format.
Stderr contains:
bridge report is artifact-consistentThese are the complete checks and summary objects from that output.
{
"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.
node "$NPM_CLI" verify-bridge \
examples/vouch-bridge/reports/checkout-discount.bridge.json \
> bridge-record-only.jsonIt also exits with code 0 and prints bridge report is artifact-consistent to stderr.
Its summary remains pass, but checks is now:
{
"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 field | What it records |
|---|---|
subject.source, subject.target | Language, path, byte length, and hash |
engine | Engine name, version, and commit |
subject.route | Execution method, profile, and supported operations |
checks | Declared pass, fail, or not-run results and linked hashes |
linked_artifacts | Identifiers and hashes for associated files |
boundary.attests, boundary.excludes | The 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.