Command-line reference
Every lacuna command and option, with input formats, exit codes, what goes to stdout and stderr, and runnable examples.
The lacuna command ships with lacuna-quant. It runs the same workflows as the Python API on files, which makes it suited to CI jobs and to teams that want an audit as a build step. It contains no analysis of its own: each command builds a SignalStudy, a standardized audit or a bundle verification and prints the result.
python -m lacuna runs the same program. With no subcommand it prints the help and exits 0.
| Command | Does |
|---|---|
lacuna doctor | Checks the installation: versions, native core, packaged schemas. |
lacuna signal | Audits a signal against a price panel, as SignalStudy.audit. |
lacuna audit | Assembles a standardized audit from saved result files. |
lacuna bench | Runs the developer benchmarks. |
lacuna bundle verify | Verifies a reproducibility bundle. |
The examples on this page run against files that a first Python block writes: a small synthetic panel and the evidence of one audit.
from datetime import date, timedelta
from pathlib import Path
import lacuna as lc
import numpy as np
import polars as pl
rng = np.random.default_rng(1)
n_sessions, n_instruments = 60, 20
calendar = (date(2024, 1, 1) + timedelta(days=k) for k in range(120))
sessions = [day for day in calendar if day.weekday() < 5][:n_sessions]
instruments = [f"S{i:02d}" for i in range(n_instruments)]
signal_values = rng.normal(size=(n_sessions, n_instruments))
returns = rng.normal(scale=0.02, size=(n_sessions, n_instruments))
returns[1:] += 0.004 * signal_values[:-1]
close = 100 * np.cumprod(1 + returns, axis=0)
rows = [
(day, name, close[i, j], signal_values[i, j])
for i, day in enumerate(sessions)
for j, name in enumerate(instruments)
]
panel = pl.DataFrame(rows, schema=["time", "instrument", "close", "signal"], orient="row")
panel.select("time", "instrument", "signal").write_parquet("signal.parquet")
panel.select("time", "instrument", "close").write_parquet("prices.parquet")
study = lc.SignalStudy(
signal=panel.select("time", "instrument", "signal"),
prices=panel.select("time", "instrument", "close"),
horizons=("1D", "5D", "10D"),
signal_observed_at="open",
entry="current_close",
price_adjustment="total_return_adjusted",
)
report = study.audit(bootstrap_resamples=200, seed=1)
for name, result in report.evidence.items():
Path(f"{name}.json").write_text(result.to_json())
print(sorted(path.name for path in Path(".").glob("*.json"))) ['bootstrap.json', 'decay.json', 'ic.json', 'labels.json', 'quantiles.json', 'turnover.json'] Global options
lacuna --help
lacuna --version usage: lacuna [-h] [--version] {doctor,audit,signal,bench,bundle} ...
Quantitative research validation for finding where alpha breaks.
positional arguments:
{doctor,audit,signal,bench,bundle}
doctor show build and runtime diagnostics
audit assemble a standardized cross-phase audit from result JSON evidence
signal analyze a cross-sectional signal against a price panel
bench run reproducible developer benchmarks
bundle inspect non-executable reproducibility bundles
options:
-h, --help show this help message and exit
--version show program's version number and exit
lacuna 0.14.3 --version prints the installed version and exits 0. -h and --help work at the top level and on every subcommand.
Conventions
Exit codes
| Code | Meaning |
|---|---|
0 | The command ran. For signal and audit, --fail-on did not trip. |
1 | An error: unreadable or unsupported input, an invalid argument value that Lacuna rejects, a refusal to overwrite, a failed bundle verification. The message goes to standard error as lacuna: error: .... |
2 | A usage error from the argument parser: an unknown option, a missing required option, a value outside a choices list, a number that fails its range check. The parser prints its usage to standard error. |
3 | --fail-on tripped. The report was still written. |
lacuna doctor returns 1 when a check fails, and with --strict when one warns.
Standard output and standard error
The report goes to standard output as text when you do not pass --out, so you can pipe it. Everything else goes to standard error: the wrote Lacuna audit to ... and wrote Lacuna reproducibility bundle to ... lines, and errors. A command that writes its report with --out therefore prints nothing to standard output.
The report format is the --format value, or the --out extension when you omit --format, or Markdown when you pass neither. The extensions are .json, .md or .markdown, and .html; any other extension without --format is an error. --format wins when both are given.
When a command writes both a bundle and a report, it writes the bundle first, so an error while writing the report (an existing file, say) can leave a bundle behind.
Input files
Data files are chosen by extension, compared without regard to case, and read with Polars:
| Extension | Format |
|---|---|
.parquet, .pq | Parquet |
.arrow, .feather, .ipc | Arrow IPC |
.csv | CSV, with Polars defaults and ISO time parsing |
Any other extension is an error. Prefer Parquet or Arrow: they carry column types.
A CSV is parsed with Polars defaults, except for the observation-time column of each table (--signal-time and --price-time). When Polars reads that column as text, Lacuna parses it. The text must be ISO 8601. A column of YYYY-MM-DD values becomes a date. A column of datetimes, written as the date, then T or a space, then HH:MM, HH:MM:SS or HH:MM:SS.fraction, becomes a datetime. A datetime column where every value carries a UTC offset, such as Z or +01:00, becomes a UTC-aware datetime; a column with no offsets stays naive. Whole-number time columns are left as integers. Any other text, a column that mixes offset and naive values, or one that mixes dates with datetimes exits with code 1 and a message naming the column and the file. Other columns keep the types Polars inferred, so an identifier that looks like a date is never reinterpreted.
Other date layouts are rejected
Slash-separated dates such as 01/02/2025 or 2025/01/02, and unpadded dates such as 2025-1-2, are rejected rather than guessed: a file written month first and one written day first look the same, and only the ISO layout is unambiguous. Rewrite the column as YYYY-MM-DD, or save the tables as Parquet. Lacuna 0.14.2 accepted slash dates and read them day first, so recheck any result it produced from such a file.
The two tables must still agree on the time type. A CSV of dates against a CSV or Parquet file of datetimes fails with a key-dtype mismatch, so write both tables the same way.
The panel written above, saved as CSV with ISO dates, runs the same audit:
panel.select("time", "instrument", "signal").write_csv("signal.csv")
panel.select("time", "instrument", "close").write_csv("prices.csv") lacuna signal \
--signal signal.csv --prices prices.csv \
--signal-observed-at open --entry current_close \
--price-adjustment total_return_adjusted \
--seed 1 --bootstrap-resamples 100 \
--format json --out csv-audit.json 2>&1 wrote Lacuna audit to csv-audit.json Output files
--out and --bundle must name different files. An existing file is an error unless you pass --overwrite, which applies to both. Missing parent directories are created.
lacuna doctor
lacuna doctor --help usage: lacuna doctor [-h] [--json] [--strict]
options:
-h, --help show this help message and exit
--json emit machine-readable JSON
--strict return a failure exit code for warnings as well as failed checks doctor inspects the installed runtime and reads none of your data. It checks that the package version is well-formed and matches the installed distribution metadata, that no unrelated distribution named lacuna shadows the import, that the Python version and platform are in the tested matrix, that NumPy and Polars match their metadata, that the native core loads and passes a smoke operation at the same version, that the four packaged schemas are readable, and that the LACUNA_* runtime settings parse.
lacuna doctor --json | python -c "import json, sys; print([check['code'] for check in json.load(sys.stdin)['checks']])" ['AUDIT_RESULT_SCHEMA', 'BUNDLE_MANIFEST_SCHEMA', 'DISTRIBUTION_METADATA', 'DISTRIBUTION_NAME_COLLISION', 'NATIVE_CORE', 'PACKAGE_VERSION', 'PERSISTED_ARTIFACT_COMPATIBILITY', 'PLATFORM_WHEEL', 'PYTHON_RUNTIME', 'RUNTIME_CONFIGURATION', 'RUNTIME_DEPENDENCIES', 'STANDARD_AUDIT_PROFILE_SCHEMA'] Each check has a state of PASS, WARN or FAIL, and the overall status is the worst of them. A FAIL means something is broken enough that results may be wrong, such as a native core that does not match the Python package. A WARN means a configuration outside the tested set: a Python minor version outside the release-tested range, a platform with no published wheel, or missing distribution metadata in a source checkout.
| Option | Meaning |
|---|---|
--json | Print the diagnostics as JSON with sorted keys instead of the text summary. The object carries schema_version, diagnostic_version, status, healthy, lacuna_version, distribution_version, python_version, platform, native, config, dependencies, runtime and checks. |
--strict | Exit 1 for a WARN as well as a FAIL. Use it in CI where an untested platform should stop the job. |
lacuna signal
lacuna signal --help usage: lacuna signal [-h] --signal SIGNAL --prices PRICES [--horizon HORIZON]
[--signal-time SIGNAL_TIME] [--price-time PRICE_TIME]
[--instrument INSTRUMENT] [--signal-value SIGNAL_VALUE] [--price PRICE]
[--entry {current_close,next_close,next_open}]
[--signal-observed-at {open,close}]
[--price-adjustment {raw,split_adjusted,total_return_adjusted,unknown}]
[--delisting-return DELISTING_RETURN] [--missing {drop,raise}]
[--allow-same-close] [--quantiles QUANTILES]
[--bootstrap-resamples BOOTSTRAP_RESAMPLES] [--seed SEED]
[--survivorship-safe | --no-survivorship-safe]
[--trial-history-available | --no-trial-history-available] [--no-native]
[--no-color] [--format {json,markdown,html}] [--out OUT]
[--html-renderer {core,plotly}] [--bundle BUNDLE] [--overwrite]
[--fail-on {never,fail,warn}]
options:
-h, --help show this help message and exit
--signal SIGNAL signal data file
--prices PRICES price data file
--horizon HORIZON forward horizon such as 5D; repeat for multiple horizons
--signal-time SIGNAL_TIME
signal observation-time column
--price-time PRICE_TIME
price observation-time column
--instrument INSTRUMENT
instrument identity column
--signal-value SIGNAL_VALUE
numeric signal column
--price PRICE price column used for close exits
--entry {current_close,next_close,next_open}
explicit label entry convention
--signal-observed-at {open,close}
market phase when the signal becomes observable
--price-adjustment {raw,split_adjusted,total_return_adjusted,unknown}
corporate-action semantics of the price field
--delisting-return DELISTING_RETURN
optional column containing terminal delisting returns
--missing {drop,raise}
missing-price policy
--allow-same-close allow a close-observed signal to enter at that same close
--quantiles QUANTILES
--bootstrap-resamples BOOTSTRAP_RESAMPLES
--seed SEED
--survivorship-safe, --no-survivorship-safe
declare whether historical-universe construction is survivorship-safe
--trial-history-available, --no-trial-history-available
declare whether complete research trial history is available
--no-native use Python references only
--no-color accepted for compatibility; has no effect because output is never colored
--format {json,markdown,html}
report format; inferred from --out or Markdown on stdout
--out OUT write the report to this path
--html-renderer {core,plotly}
HTML renderer; Plotly requires lacuna-quant[report]
--bundle BUNDLE also write a deterministic .lacuna reproducibility bundle
--overwrite replace an existing report
--fail-on {never,fail,warn}
return exit code 3 when the selected finding state is present signal loads a signal table and a price table, builds a SignalStudy from them, runs SignalStudy.audit and prints or writes the report. It is the same audit as in Audits and reports. The options are the study’s parameters, plus the output options below.
Study options
| Option | Default | Maps to | Meaning |
|---|---|---|---|
--signal PATH | required | signal | The signal table. One row per instrument per observation. |
--prices PATH | required | prices | The price table. |
--horizon H | 1D, 5D, 20D | horizons | A forward horizon in observations, such as 5D. Repeat for several. The first one is the audit’s inference horizon, and the CLI has no other way to choose it. |
--signal-time COL | time | signal_time | The signal table’s observation-time column. |
--price-time COL | time | price_time | The price table’s observation-time column. |
--instrument COL | instrument | instrument | The instrument identifier column, in both tables. |
--signal-value COL | signal | signal_value | The numeric signal column. |
--price COL | close | price | The price column used for entries at the close and for exits. |
--entry | none | entry | current_close, next_close or next_open. next_open needs a price column named open, which has no flag to rename it. Leave it out and the labels use the same-row price, with no finding about it. |
--signal-observed-at | none | signal_observed_at | open or close: when the signal becomes known. Leave it out, along with --entry, and the audit raises no finding, so set both for a causal audit. |
--price-adjustment | unknown | price_adjustment | raw, split_adjusted, total_return_adjusted or unknown. |
--delisting-return COL | none | delisting_return | A column of delisting returns in the price table. |
--missing | drop | missing | drop or raise for missing prices. raise rejects null or NaN prices, except a null price on a row with a --delisting-return value, and still drops labels past the end of the data. |
--allow-same-close | off | allow_same_close | Let a close-observed signal enter at that same close. |
--quantiles N | 5 | quantiles | The number of quantiles. At least 2: 1 passes the parser and fails with exit code 1. |
--bootstrap-resamples N | 1000 | bootstrap_resamples | Resamples for the IC bootstrap. At least 100. |
--seed N | none | seed | The bootstrap seed, a non-negative integer. Without it a random seed is drawn on every run, because the command has no way to set a runtime seed. The seed is recorded in the bootstrap evidence. |
--no-native | off | use_native=False | Use the Python reference implementations instead of the Rust kernels. |
Forward-return labels explains --entry, --signal-observed-at, --price-adjustment and --delisting-return. A close-observed signal with --entry current_close fails with exit code 1, as in the Python API.
Declared policies
| Option | Effect |
|---|---|
--survivorship-safe, --no-survivorship-safe | Declares the survivorship_safe policy as True or False. |
--trial-history-available, --no-trial-history-available | Declares the trial_history_available policy as True or False. |
Leave a flag out and the policy is not declared, so its check stays UNKNOWN. The positive flag passes the check, and the negative one declares False, which warns. These are caller assertions, exactly as in the Python API. They are not verified. The CLI cannot pass a split, extra evidence, other policies or custom rules. For those, use the Python API.
Output options
These options are shared with lacuna audit.
| Option | Default | Meaning |
|---|---|---|
--format | see Conventions | json, markdown or html. |
--out PATH | none | Write the report to a file instead of standard output. |
--html-renderer | core | core or plotly, and only for HTML output. The Plotly renderer needs lacuna-quant[report] and fails with exit code 1 without it. |
--bundle PATH | none | Also write a reproducibility bundle. The path must end in .lacuna. |
--overwrite | off | Replace existing report and bundle files. |
--fail-on | never | never, fail or warn. See below. |
--no-color | off | Accepted and ignored. Lacuna never writes color, so there is nothing to disable. |
Examples
The report goes to standard output, so a redirect is enough to save it:
lacuna signal \
--signal signal.parquet --prices prices.parquet \
--signal-observed-at open --entry current_close \
--price-adjustment total_return_adjusted \
--seed 1 --bootstrap-resamples 200 > report.md
sed -n 3,12p report.md ## Summary
- Robustness score: **72 / 100**
- Evidence coverage: **0.78**
- Failures: **0**
- Warnings: **1**
- Unknown checks: **4**
- Not applicable: **1**
## Findings With --out, the report goes to the file and standard output stays empty. The status line goes to standard error, so 2>&1 shows it here. A bundle is written in the same call:
lacuna signal \
--signal signal.parquet --prices prices.parquet \
--signal-observed-at open --entry current_close \
--price-adjustment total_return_adjusted \
--seed 1 --bootstrap-resamples 200 \
--format json --out report.json --bundle study.lacuna 2>&1 wrote Lacuna reproducibility bundle to study.lacuna
wrote Lacuna audit to report.json Declare what you know about the universe and the trial history. A flag you leave out remains UNKNOWN:
lacuna signal \
--signal signal.parquet --prices prices.parquet \
--signal-observed-at open --entry current_close \
--price-adjustment total_return_adjusted \
--survivorship-safe --no-trial-history-available \
--seed 1 --bootstrap-resamples 200 \
--format json --out declared.json 2>&1 wrote Lacuna audit to declared.json import json
states = {f["code"]: f["state"] for f in json.load(open("declared.json"))["findings"]}
print({code: states[code] for code in ("SURVIVORSHIP_HANDLING_DECLARED", "TRIAL_HISTORY_AVAILABLE")}) {'SURVIVORSHIP_HANDLING_DECLARED': 'PASS', 'TRIAL_HISTORY_AVAILABLE': 'WARN'} Gating a build with --fail-on
--fail-on turns the audit into a pass/fail check. After the report is written, the command exits with code 3 when a finding has a state that the option selects:
| Value | Exits 3 when the report contains |
|---|---|
never | Never. |
fail | A FAIL finding. |
warn | A FAIL or a WARN finding. |
An UNKNOWN finding never trips the gate. A report with no evidence at all, where every check is UNKNOWN, exits 0 under --fail-on warn. If missing evidence should stop the build, check unknown_count in the JSON report yourself, which both commands write, or required_evidence_complete, which only lacuna audit reports.
On this 60-session panel the audit warns, so the gate trips. The 1D inference horizon has 59 IC periods, one short of the 60 that IC_PERIOD_SUPPORT wants for a PASS:
lacuna signal \
--signal signal.parquet --prices prices.parquet \
--signal-observed-at open --entry current_close \
--price-adjustment total_return_adjusted \
--seed 1 --bootstrap-resamples 200 \
--fail-on warn --format json --out gate.json 2>&1 || echo "exit code $?" wrote Lacuna audit to gate.json
exit code 3 gate = json.load(open("gate.json"))
print([(f["code"], f["state"]) for f in gate["findings"] if f["state"] in ("WARN", "FAIL")]) [('IC_PERIOD_SUPPORT', 'WARN')] The report was written before the command exited, so you can read what tripped the gate. --fail-on fail on the same data exits 0, because nothing failed.
Errors exit 1, and usage mistakes exit 2:
lacuna signal --signal signal.parquet --prices prices.parquet --signal-observed-at close --entry current_close 2>&1 || echo "exit code $?"
lacuna signal --signal notes.txt --prices prices.parquet 2>&1 || echo "exit code $?"
lacuna signal --prices prices.parquet 2> usage.txt || echo "exit code $?"
tail -n 1 usage.txt
lacuna signal --signal signal.parquet --prices prices.parquet --signal-observed-at open --entry current_close --format json --out gate.json 2>&1 || echo "exit code $?" lacuna: error: a close-observed signal cannot use the same close; use entry='next_open' or entry='next_close' (horizons of at least 2D), or explicitly set allow_same_close=True
exit code 1
lacuna: error: unsupported input format '.txt' for notes.txt; use Parquet, CSV, Arrow IPC, or Feather
exit code 1
exit code 2
lacuna signal: error: the following arguments are required: --signal
lacuna: error: refusing to overwrite existing report: gate.json
exit code 1 lacuna audit
lacuna audit --help usage: lacuna audit [-h] [--evidence NAME=PATH] [--scope {signal,strategy,options}] [--no-color]
[--format {json,markdown,html}] [--out OUT] [--html-renderer {core,plotly}]
[--bundle BUNDLE] [--overwrite] [--fail-on {never,fail,warn}]
options:
-h, --help show this help message and exit
--evidence NAME=PATH named AnalysisResult v1 JSON; repeat for multiple results
--scope {signal,strategy,options}
research scope controlling required, optional, and inapplicable evidence
--no-color accepted for compatibility; has no effect because output is never colored
--format {json,markdown,html}
report format; inferred from --out or Markdown on stdout
--out OUT write the report to this path
--html-renderer {core,plotly}
HTML renderer; Plotly requires lacuna-quant[report]
--bundle BUNDLE also write a deterministic .lacuna reproducibility bundle
--overwrite replace an existing artifact
--fail-on {never,fail,warn}
return exit code 3 when the selected finding state is present audit assembles a standardized audit from results you saved earlier. It computes nothing new. It reads each --evidence file, matches it to a capability by its method, and reports which capabilities the profile requires and which the evidence covers.
Each file must hold one AnalysisResult in schema-v1 JSON, as written by result.to_json(), and be no larger than 16 MiB. Parsing is strict: a file with unknown fields, duplicate keys or NaN is rejected with exit code 1. Nothing in a file is executed.
| Option | Default | Meaning |
|---|---|---|
--evidence NAME=PATH | none | A named result file. Repeat for several. NAME must match [a-z][a-z0-9_-]{0,63} and be unique. A bad name is a usage error (exit 2) and a duplicate is an error (exit 1). With no --evidence, every required capability is UNKNOWN. Only missing required capabilities are UNKNOWN; a missing optional one is NOT_APPLICABLE. |
--scope | strategy | signal, strategy or options. Chooses which capabilities are required, optional or not applicable. |
The output options are those listed under lacuna signal. With --bundle, the bundle contains the evidence files’ results, a configuration naming the profile, and an invocation record with the command, scope and evidence names. Only the built-in profiles are available here; custom profiles need the Python API.
lacuna audit --scope signal \
--evidence labels=labels.json --evidence ic=ic.json --evidence bootstrap=bootstrap.json \
--format json --out standard.json --fail-on warn 2>&1 || echo "exit code $?" wrote Lacuna audit to standard.json
exit code 3 standard = json.load(open("standard.json"))
print(standard["metadata"]["method"], standard["metrics"]["required_evidence_coverage"])
print([f["evidence"]["source_finding_code"] for f in standard["findings"] if f["state"] == "WARN"]) audit.standard 0.18181818181818182
['BOOTSTRAP_IID_ASSUMPTION'] The gate tripped because the bootstrap result carries its own WARN, that an IID resample assumes independent periods, and the standardized audit propagates domain findings unchanged. Missing capabilities are UNKNOWN and do not trip it.
Two details about --scope. A result whose method belongs to no capability in the profile raises an UNRECOGNIZED_EVIDENCE warning, so passing an audit report, which has method audit.v0_1, as evidence trips --fail-on warn. And evidence for a capability the scope declares not applicable also warns.
lacuna bench
lacuna bench --help usage: lacuna bench [-h] [--tier {smoke,small,medium}] [--repetitions REPETITIONS]
[--warmups WARMUPS] [--seed SEED] [--no-native] [--out OUT] [--overwrite]
options:
-h, --help show this help message and exit
--tier {smoke,small,medium}
deterministic dataset scale
--repetitions REPETITIONS
--warmups WARMUPS
--seed SEED
--no-native omit native benchmark cases
--out OUT write the benchmark JSON to this path
--overwrite replace an existing artifact bench runs Lacuna’s reproducible benchmark suite on generated data and prints the result as JSON. It is a developer tool for comparing implementations and machines. It does not audit anything, and its output is a benchmark record, not an AnalysisResult.
| Option | Default | Meaning |
|---|---|---|
--tier | smoke | The dataset scale: smoke is 100 instruments over 40 periods, small is 500 over 200, medium is 5,000 over 1,000. |
--repetitions N | 3 | Timed runs per case. A positive integer. |
--warmups N | 1 | Untimed runs first. A non-negative integer. |
--seed N | 42 | The seed for the generated data. |
--no-native | off | Omit the native-kernel cases. |
--out PATH | none | Write the JSON to a file. Otherwise it goes to standard output. |
--overwrite | off | Replace an existing file. |
lacuna bench --tier smoke --repetitions 1 --warmups 0 --out bench.json 2>&1 wrote Lacuna benchmark to bench.json bench = json.load(open("bench.json"))
print(sorted(bench))
print(bench["config"]["instruments"], bench["config"]["periods"])
print(sorted(bench["cases"][0])) ['benchmark_version', 'cases', 'config', 'environment', 'generated_at', 'schema_version']
100 40
['backend', 'checksum', 'maximum_seconds', 'median_seconds', 'minimum_seconds', 'name', 'python_traced_peak_bytes', 'throughput', 'throughput_unit'] Each case reports its backend, minimum, median and maximum seconds, throughput, peak traced memory and a checksum of its output. The memory figure is Python’s tracemalloc peak, which does not reliably include native allocations. Timings depend on the machine, so compare them only against runs on the same hardware.
lacuna bundle verify
lacuna bundle --help
lacuna bundle verify --help usage: lacuna bundle [-h] {verify} ...
positional arguments:
{verify}
verify verify structure and artifact SHA-256 digests
options:
-h, --help show this help message and exit
usage: lacuna bundle verify [-h] [--json] path
positional arguments:
path path to a .lacuna bundle
options:
-h, --help show this help message and exit
--json emit machine-readable JSON bundle has one subcommand, and running it without one is a usage error (exit 2). bundle verify PATH checks a .lacuna bundle’s structure and every SHA-256 digest without extracting it or running anything in it, using lc.verify_bundle. It exits 0 when the bundle is intact and 1 when it is not.
| Argument | Meaning |
|---|---|
PATH | The bundle to verify. |
--json | Print the verification as JSON with sorted keys instead of the text summary. |
lacuna bundle verify study.lacuna | sed -E 's/^(Total bytes +).*/\1<n>/; s/^(SHA-256 +).*/\1<digest>/'
lacuna bundle verify study.lacuna --json | python -c "import json, sys; d = json.load(sys.stdin); print(sorted(d)); print(d['integrity_verified'], d['authenticity_verified'])"
printf 'not a bundle' > broken.lacuna
lacuna bundle verify broken.lacuna 2>&1 || echo "exit code $?" Bundle study.lacuna
Format lacuna.reproducibility-bundle v1
Artifacts 11
Total bytes <n>
SHA-256 <digest>
Integrity verified
Authenticity not verified (use signed release/provenance channels separately)
['archive_sha256', 'artifact_count', 'authenticity_verified', 'bundle_version', 'format', 'integrity_verified', 'path', 'reproducibility_level', 'total_size']
True False
lacuna: error: bundle is not a valid ZIP archive: broken.lacuna
exit code 1 Both outputs say that authenticity was not verified. A digest check proves the members match their manifest and does not prove who made the archive. Reproducibility bundles explains the difference and what to do about it.
Differences from the Python API
The CLI is a thin layer over public services, and some things exist only in Python.
| In Python | On the command line |
|---|---|
split=, additional_evidence=, rules=, policies= with other keys | Not available. |
inference_horizon policy | The first --horizon. |
Custom AuditProfile | Only the three built-in scopes. |
provenance= and configuration= for bundles | Not available. lacuna audit --bundle writes its own configuration and invocation records. |
to_html(view=...) | Not available. The Plotly renderer picks the auto view. |
exit, signal_schema, price_schema, min_observations | Not available. The exit price is close, the two schema options only name the columns of NumPy arrays and have no use for files, and min_observations is fixed at 3. |
Exit-code behaviour also differs: the Python API raises exceptions, and the CLI turns the ones it expects into lacuna: error: ... and exit code 1.