amux-runtime 0.1.0

Persistent process and TTY runtime for AI agents, with durable logs and human attach
Documentation
# Developing amux with Treefold

Treefold's default dependency is this repository's GitHub `main` branch. Its
backend `Cargo.lock` pins the exact commit; ordinary builds do not update main.
The runtime library, bundled CLI, and `skills/amux` must all come from that same
checkout. Keep the `amux-runtime` package name, `amux` library/binary targets,
and `skills/amux/SKILL.md` available together when changing this integration.

To use an amux worktree, run from the intended Treefold checkout:

```sh
export TREEFOLD_AMUX_MANIFEST=/absolute/path/to/amux-worktree/Cargo.toml
just check-backend
just prepare-sidecars
just app-dev-watch
```

An absolute path allows the two worktrees to live anywhere. A relative value
is resolved from the Treefold checkout. Source changes need not be committed.
Each Treefold development process can select a different amux worktree through
its own environment; no shared symlink or global Cargo configuration is needed.

Treefold's xtask applies a local Cargo patch, uses temporary backend and CLI lockfiles,
and verifies Cargo actually selected that manifest before building. It also
builds the CLI and copies the Skill from the resolved package directory. The
selected source is printed during builds and recorded in staged
`amux-source.json`. Watch mode rebuilds when the selected amux Rust sources or
Cargo files change and refreshes the Skill with each build. For Skill-only edits,
run `just prepare-sidecars`.
Local package versions can differ from the pinned Git version; neither
repository's committed lockfile is rewritten by the override.

For a focused backend command, use `cargo xtask backend test <test-filter>`
(also supports `build`, `check`, `clippy`, and `run`). Raw backend Cargo commands
do not apply `TREEFOLD_AMUX_MANIFEST`; Treefold rejects them when it is set.
The override does not alter ordinary Cargo commands in the amux repository.

Unset `TREEFOLD_AMUX_MANIFEST` and rebuild to return to the locked Git source.
To advance that default dependency, run in Treefold:

```sh
cargo update --manifest-path src/backend/Cargo.toml -p amux-runtime
```

Commit the resulting Treefold lockfile change after verifying the new revision.