Run artifact

workspace/targets/LayersTesting/blueprint/FEATURE-CLI-Dispatcher.md

FEATURE: CLI Dispatcher

FieldValue
Version20261020 V1
DescriptionProvide the executable ledger dispatcher, CSV output boundary, and exit-code mapping.
Depends OnFEATURE-Database-Configuration.md, DATABASE.md
Provides./ledger, command dispatch, CSV output, exit-code dispatch
ConsumesDATABASE_URL resolution, schema initialization

Command Boundary

The executable ledger is located at the application root and invokes the CLI entry point. The dispatcher recognizes the documented command families: init, count, load, account, txn, transfer, and report.

Successful commands emit deterministic CSV with a header and newline-delimited rows, except init, which emits nothing. Diagnostics are written only to standard error. The dispatcher maps domain failures to the documented exit codes.

Programmatic Acceptance

=== AC cli-dispatch-executable ===
Intent: The application root contains an executable ledger entry point. from pathlib import Path import os

ledger = Path("ledger") assert ledger.is_file() assert os.access(ledger, os.X_OK) === END AC cli-dispatch-executable ===

=== AC cli-dispatch-init-and-count ===
Intent: The dispatcher reaches schema initialization and produces structured count output. import csv from cli.testing import cli_runner

init_code, init_stdout, init_stderr = cli_runner("init") assert init_code == 0 assert init_stdout == "" count_code, count_stdout, count_stderr = cli_runner("count") assert count_code == 0 rows = list(csv.reader(count_stdout.splitlines())) assert rows[0] == ["table", "rows"] assert len(rows) == 4 assert all(len(row) == 2 for row in rows) === END AC cli-dispatch-init-and-count ===

=== AC cli-dispatch-error-channel ===
Intent: Rejected commands return a failure code without standard-output data and provide diagnostics on standard error. from cli.testing import cli_runner

code, stdout, stderr = cli_runner("account", "add", "BAD-CODE", "Name") assert code == 3 assert stdout == "" assert stderr != "" === END AC cli-dispatch-error-channel ===

User Acceptance

Guardrails