Check the Tcl runtime and evaluate a bounded script

Read the Tcl runtime descriptors and signed readiness record, then evaluate one bounded script from stdin and check its receipt.

Use Altifigence CLI 0.1.9 on Linux to read the installed Tcl runtime descriptors, confirm the signed runtime readiness record and evaluate one bounded Tcl script through the installed runner.

Read the runtime descriptors

Run the commands as your ordinary user. Each query answers from the packaged alti-tcl descriptors and prints JSON.

alti tcl capabilities
alti tcl environment
alti tcl commands

alti tcl commands lists the registered product commands and each command's availability. Keep its output with your scripts.

Check the signed runtime

Read the signed runtime readiness record. This query does not run Tcl.

set -euo pipefail
WORK="$(mktemp -d)"
alti tcl readiness > "$WORK/readiness.json"
jq '{schemaVersion, installedQualified, cryptographicVerifierLinked, blocker}' \
  "$WORK/readiness.json"

Require exit status 0 and these values before you evaluate a script:

{
  "schemaVersion": "altifigence.eda-tcl-runtime-component-readiness.v1",
  "installedQualified": true,
  "cryptographicVerifierLinked": true,
  "blocker": null
}

Evaluate a script

Pass the script on stdin and save the receipt:

printf '%s' 'expr {6 * 7}' | alti --json tcl evaluate > "$WORK/tcl-evaluate.json"
jq '{schema, status, inputBytes, result, resultBytes, resultArtifactId, failure}' \
  "$WORK/tcl-evaluate.json"

Require exit status 0. The selected receipt fields are:

{
  "schema": "altifigence.cli.tcl-evaluation.v1",
  "status": "succeeded",
  "inputBytes": 12,
  "result": "42",
  "resultBytes": 2,
  "resultArtifactId": "tcl-evaluation",
  "failure": null
}

The receipt also has inputSha256, jobSha256, resultArtifactSha256 and provenance. In provenance, resolved_placement is local, resolved_device_class is cpu and backend_id is embedded-tcl.

Without --json, the command writes the result to stdout and a summary line to stderr:

printf '%s' 'expr {6 * 7}' | alti tcl evaluate
42
[succeeded] tcl.evaluate input=12 sha256=e96de7a3a920d7cd5aafa8c86630028d97a0fb0dc260da2f089de12ea4214a6f artifact=tcl-evaluation

Each run reads one script of up to 4194304 bytes. The CLI writes it to a private workspace under /tmp, runs it as a local CPU job with 1 CPU slot, 536870912 bytes of memory and a 5000 ms wall-time limit, reads the result back from the runner and removes the workspace.

Recover from a failed evaluation

With --json, read failure.code and failure.message in the receipt. Without it, stderr shows Tcl evaluation failed: followed by the code.

TCL_INPUT_EMPTY with Tcl input must not be empty. exits with status 2. Pipe a non-empty script and run the command again.

TCL_INPUT_TOO_LARGE with Tcl input exceeds the 4194304-byte limit. exits with status 2. Keep the script within 4194304 bytes.

status failed with failure.code eda-tcl.local-runner.unsupported-command and the message local Tcl evaluation failed within the requested boundary exits with status 1. For product commands, choose an entry with availability available from alti tcl commands, such as ::alti::echo or ::alti::capabilities.

TCL_INSTALLED_RUNNER_UNAVAILABLE with The installed qualified Tcl runner is unavailable. exits with status 127. Run the alti that the 0.1.9 bootstrap installed, then check alti tcl readiness again.

CLI engine commands