Documentation menu

Development

Crate layout, budgets checked in CI, tests and fixtures.

On this page

Layout

crates/ktesio-model   record types, the .ktesio/ format, ktesio.toml, status / recall / record
crates/ktesio-hosts   host and model detection, installers, capability tables, headless runners;
                      packages/ holds the skills and agent definitions, one source for every host
crates/ktesio-store   the SQLite cache: files, symbols, edges, records, FTS5, vectors, outcomes
crates/ktesio-index   tree-sitter extraction and incremental sync
crates/ktesio-embed   local static embeddings, model fetch and conversion
crates/ktesio-context context packs and hybrid search
crates/ktesio-guard   plan: routing, cost of being wrong, ask / probe / assume, team learning
crates/ktesio-verify  verify, check, digest, accept / reject, rollback lists, command detection
crates/ktesio-mcp     MCP server over stdio
crates/ktesio-cli     the ktb binary (package ktesio-build): commands, run, import, report
bench/                end-to-end fixtures with hidden acceptance tests
scripts/              benchmarks and budget checks

Ktesio Build records its own design decisions in .ktesio/decisions/. Read the relevant ones before you change a part of the code.

Checks

cargo fmt --all --check
cargo clippy --all-targets -- -D warnings
cargo test

Budgets checked in CI

BudgetLimitWhere
Cold start< 20 ms median (ktb status)scripts/cold-start.py
Each skill or agent file< 1,200 tokens (estimated)crates/ktesio-cli/tests/budgets.rs
All 9 tool schemas< 1,500 tokens (estimated)same
One tool reply< 2,000 tokens unless asked for morektesio.toml budgets.reply
Context pack on a 100k-line repo< 1 s wall, end to endscripts/bench-pack.py

End-to-end fixtures

scripts/bench-e2e.py KTESIO --host claude|codex runs the three fixtures in bench/, each in a fresh git repo:

  • a greenfield CLI;
  • a feature in an existing repo, tagged money, that reuses a recorded decision;
  • a refactor.

Each fixture gets ktb init, a plan of tasks and calls with no tiers, ktb run, and then the hidden acceptance tests. The script reports pass or fail, the tiers each task used, attempts, tokens, cost and time.

--host solution replays reference solutions instead of a model. CI runs it at zero tokens, along with forced-retry and forced-escalation variants.

scripts/bench-compare.py compares Ktesio Build with SpecKit, BMAD and plain Claude Code. See Benchmarks.

Releases

Tags drive .github/workflows/release.yml:

TagPublishes
v0.2.0a release, marked latest
v0.2.0-rc.1, v0.2.0-beta.1a pre-release

The tag must equal the workspace version in Cargo.toml, with a v in front. The workflow checks that before it builds. To cut one:

  1. Set version under [workspace.package] in Cargo.toml and on each ktesio-* entry under [workspace.dependencies] (crates.io needs it; crates/ktesio-cli/tests/release.rs checks they match), run cargo check to update Cargo.lock, and merge that in a chore: release v0.2.0 pull request.

  2. Tag the merge commit and push the tag:

    git switch main && git pull
    git tag -s v0.2.0 -m v0.2.0
    git push origin v0.2.0

The workflow builds ktb for x86_64 and arm64 Linux, arm64 and x86_64 macOS, and x86_64 Windows on native runners, from a clean tree with no build cache. It uploads one archive per target with LICENSE and README.md, a SHA256SUMS file and build provenance, and writes release notes from the pull request titles. Then two jobs run:

  • crates publishes every workspace crate to crates.io in dependency order, with trusted publishing: the job trades its GitHub OIDC identity for a short-lived token, so no token is stored. Crates already at the version are skipped, so a re-run after a partial publish uploads only the rest. cargo install ktesio-build installs ktb. Pre-releases publish too; cargo install skips them unless asked for the exact version.
  • homebrew writes Formula/ktb.rb (macOS and Linux, arm64 and x86_64) from the checksums and pushes it to Ktesio/homebrew-tap with a GitHub App token, so brew install ktesio/tap/ktb works. It skips pre-releases, and it skips the push while this repository is private, because brew downloads the archives anonymously.

A pull request that changes the workflow runs every job without publishing: it builds every target, packages and builds each crate as crates.io would, and prints the formula.

crates.io versions can't be replaced or deleted, only yanked. Check the version before you push the tag.

One-time setup

  • crates.io. Trusted publishing works only for crates that already exist, so publish the first version by hand from the tagged commit with a crates.io API token: cargo publish --workspace --locked. crates.io lets a new account publish only a few new crate names at once, then about one every ten minutes, so this first run may stop with a 429 partway: wait and publish the rest with -p (or ask help@crates.io to raise the limit first). Then, for each of the ten crates, add a trusted publisher in its crates.io settings: owner Ktesio, repository build, workflow release.yml. Revoke the token afterwards.
  • Homebrew. Create a GitHub App owned by the Ktesio org with one repository permission, Contents: read and write, and install it on Ktesio/homebrew-tap only. In this repository, save its client ID as the Actions variable TAP_APP_CLIENT_ID and a private key it generates as the secret TAP_APP_PRIVATE_KEY. Each run gets a token that lasts an hour and can write only the tap; nothing to renew.