aboutsummaryrefslogtreecommitdiff
path: root/AGENTS.md
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-20 09:39:52 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-20 09:39:52 +0200
commit8556122e8dcc75849868b4a04a65a5a79224cc20 (patch)
tree97d9e59d99d0d749e6faa2c538cdfe570fdcfe96 /AGENTS.md
parent6a06fd7a7afc5932e20410ba591475a13e2db51d (diff)
downloadbokf-8556122e8dcc75849868b4a04a65a5a79224cc20.tar.gz
bokf-8556122e8dcc75849868b4a04a65a5a79224cc20.zip
tests: wire check, pty and sanitizer targets and document them
Diffstat (limited to 'AGENTS.md')
-rw-r--r--AGENTS.md17
1 files changed, 13 insertions, 4 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 0d04f7f..55408ba 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -48,9 +48,14 @@ Never rewrite ledger rows in a migration.
1. Handler in `commands.c` (or the domain file it belongs to), using the
`fail()/failf()` helpers and stable error codes from `PROTOCOL.md` ยง5.3.
-2. Entry in `g_commands[]` with permission, `need_org`, `mutating`, `dry_run`.
+2. Entry in `g_commands[]` with permission, `need_org`, `mutating`, `dry_run`
+ and a `CMD_ARGS(args_x)` name/type/required/default schema; the dispatcher
+ validates present arguments before the handler runs and `describe` emits
+ the schema.
3. Audit (`audit_append`) for mutations, after success.
-4. Update `docs/PROTOCOL.md`; add tests in `tests/test_core.c`.
+4. Update `docs/PROTOCOL.md`; add tests in `tests/test_core.c`. `make check`
+ (part of `make test`) fails when a command or error code is missing from
+ PROTOCOL.md.
5. `agent.instructions` in `commands.c` if agents need to know about it.
## Server code style
@@ -74,8 +79,12 @@ first (spec in `TUI-GUIDELINES.md` + tests in `tests/test_tui.c`).
## Verifying
-- Server changes: `make test`. UI changes: also drive `bokftui` over a pty
- (`script -qec`) or against the demo daemon and check the real behaviour.
+- Server changes: `make test` (runs `make check`, the server suite and the TUI
+ unit tests). UI changes: also run `make test-pty`, which drives the real TUI
+ over a pty against a throwaway `/tmp` daemon and asserts on screen text.
+- Sanitizers: `make test-asan` (ASan) and `make test-ubsan` (UBSan) build
+ `test_core` in `build-asan`/`build-ubsan`. Run them after touching
+ allocation or arithmetic paths.
- Never run `bokftui` for tests without `scripts/tui-sandbox.sh`: it
isolates `XDG_CONFIG_HOME`/`XDG_CACHE_HOME` so a run cannot overwrite the
human's `~/.config/bokf/tui.conf`, `~/.cache/bokf/tui.log` or bw session.