Commands

The package installs three console commands. The scripts in the repository are thin backward-compatible wrappers.

Build an exact libcbm stand-state cache for one chain family.

The builder intentionally lives in fresh-cbm, not in the WS4 runtime. It imports WS4’s CarbonLedger so the cached rows are produced by the same exact path the optimizer uses.

fresh_cbm.build.parse_offsets(text: str) → list[int][source]

Parse 0-49 or 0,1,2 into offsets.

Parameters:

text (str) – Comma-separated offsets or ranges.

Returns:

list of int – Sorted unique offsets.

fresh_cbm.build.build(args: Namespace) → None[source]

Build the cache.

Parameters:

args (argparse.Namespace) – Parsed builder arguments.

Raises:

RuntimeError – When WS4 is not importable on the current path.

fresh_cbm.build.main(argv: Sequence[str] | None = None) → int[source]

Parse arguments and build the cache.

Parameters:

argv (sequence of str or None, optional) – Command-line arguments. None reads sys.argv.

Returns:

int – Process exit status.

Validate a fresh-cbm state cache against the exact WS4 carbon ledger.

fresh_cbm.validate.main(argv: Sequence[str] | None = None) → int[source]

Compare sampled cached rows with an exact ledger run.

Parameters:

argv (sequence of str or None, optional) – Command-line arguments. None reads sys.argv.

Returns:

int – Process exit status.

Validate cache completeness and write checksums for a release.

fresh_cbm.release.sha256(path: Path) → str[source]

Return a file SHA-256 digest.

Parameters:

path (Path) – File to hash.

Returns:

str – Hexadecimal digest.

fresh_cbm.release.main(argv: Sequence[str] | None = None) → int[source]

Validate a cache directory and write its release checksums.

Parameters:

argv (sequence of str or None, optional) – Command-line arguments. None reads sys.argv.

Returns:

int – Process exit status.