integration authoring skill

integration (lmctl-ai/integration) is the public E2E verification repository and reusable GitHub Actions harness for published @lmctl-ai/lmctl npm releases and SHA-256-verified lmcode host binaries.

Purpose

Use integration to test published lmctl, lmscript, lmmock, miniplayer, and lmcode host releases end-to-end across T0 in-process ClaudeMock scenarios, T1 loopback lmmock ACP chains, and the ported 88-entry mono-test suite, with mandatory red-control verification.

When to use it

Choose integration when validating a new @lmctl-ai/lmctl@latest or @staging package against pinned or latest lmcode hosts, when embedding lmctl-ai/integration/actions/setup@<sha> or .github/workflows/e2e.yml@<sha> in another repository's CI workflow, or when running hermetic regression and mutation controls.

Install

Clone lmctl-ai/integration locally to run scenarios and self-tests, or reference actions/setup and .github/workflows/e2e.yml by full 40-character commit SHA in GitHub Actions.

git clone https://github.com/lmctl-ai/integration.git
cd integration
bash tests/setup-selftest.sh

Commands

Run the setup self-tests, individual T0 and T1 scenarios via scripts/run-scenario.sh, scenario negative controls, the ported mono-test runner, and suite mutation controls.

bash tests/setup-selftest.sh
bash scripts/run-scenario.sh scenarios/t0-claudemock
bash scripts/run-scenario.sh scenarios/t0-fanout
bash scripts/run-scenario.sh scenarios/t0-provider-smoke-mock
bash scripts/run-scenario.sh scenarios/t1-lmmock-ai
bash scripts/run-scenario.sh scenarios/t1-lmmock-modes
bash tests/scenario-controls.sh
node suites/mono-test/run.mjs
node suites/mono-test/run.mjs --control broken-bin
bash tests/suite-controls.sh

Inputs and outputs

The setup action accepts lmctl (latest, staging, X.Y.Z, or none), tools (comma-separated NAME[@TAG][+EXTRA_ASSET...] entries such as lmmock@v0.1.30+examples.tar.gz,lmgit@latest), and miniplayer (full 40-hex commit SHA or empty). It outputs lmctl-version and bin-dir, prepends the private bin directory to PATH, and exports INTEGRATION_ASSETS_<NAME> for extra verified release assets. Scenarios execute in isolated temporary directories and exit 0 on pass or non-zero with diagnostic logs on failure.

Safety rules

Always run scenarios through scripts/run-scenario.sh (which runs the scenario under scripts/hermetic.sh) so each scenario gets a private HOME, LMCTL_DB, and cache, and scrubs active session markers such as LMCTL_SELF_SESSIONID (which otherwise causes nested lm_prompt calls to fail). Never install lmctl globally (-g) or touch ~/.lmctl in CI; setup installs exclusively under RUNNER_TEMP. Always start and stop lmmock via lmmock exec ... -- <test command> on an OS-assigned port rather than leaving background daemons running. Always pass --no-preflight to lmscript in integration scenarios so dry preflight does not run side effects twice, and always verify both status == "ok" and non-empty expected reply content.

Worked examples

Example: Using the reusable setup action and e2e workflow pinned by full commit SHA in GitHub Actions.

# Step usage in a job:
- uses: lmctl-ai/integration/actions/setup@<full-40-char-commit-sha>
  with:
    lmctl: latest
    tools: lmmock@v0.1.36+examples.tar.gz,lmgit@latest
    miniplayer: ""

# Running a hermetic scenario and broken-binary vacuity control locally:
bash scripts/run-scenario.sh scenarios/t0-claudemock
node suites/mono-test/run.mjs --control broken-bin

Errors and exit codes

Exit code 0 indicates all scenario assertions, request count audits (via lmmock GET /__requests), and negative controls succeeded. Any checksum mismatch in SHA256SUMS, unresolved npm or GitHub release tag, non-40-hex miniplayer pin, empty model reply, expired allowlist.json entry, or vacuous suite that stays green under --control broken-bin exits non-zero and turns the single required PR check job (gate) red.

How to verify

Run the three self-test and negative-control scripts to confirm both positive scenarios and deliberate-break controls pass.

bash tests/setup-selftest.sh
bash tests/scenario-controls.sh
bash tests/suite-controls.sh