docs/cpp-safety.md (the four-layer safe-C++ playbook and design decisions) and the AGENTS.md standing rule were skipped by taicpp/.gitignore's *.md pattern in 79ae6f2; force-add them so the policy is actually in the tree, matching how the other docs are tracked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
1.6 KiB
Markdown
31 lines
1.6 KiB
Markdown
# AGENTS.md — detz (taicpp) workflow
|
|
|
|
Source of truth: `../tai.py` (untouched) + `../test_tai.py`, `../tai_test.py`.
|
|
Reuse: moloapp (`/home/retoor/projects/moloapp`) — clients/SSE, llm providers, app patterns. Vendor/link only, never modify.
|
|
|
|
## Workflow (per milestone, in order)
|
|
1. Spec delta: update `docs/<module>.md` + parity table vs tai.py symbols.
|
|
2. Code: headers `.h` + impl `.cpp`, one class per file pair, `-std=c++23 -Wall -Wextra`, warning-free.
|
|
3. Tests: `tests/*_test.cpp` mirroring python cases; `make test` green.
|
|
4. Changelog: prepend `CHANGELOG.md` entry.
|
|
|
|
## Commands
|
|
- `make` — build `build/detz`
|
|
- `make test` — build + run all tests
|
|
- `make lint` — warnings + clang-format check
|
|
- `make version-bump PART=patch|minor|major`
|
|
- `make changelog MSG="..."`
|
|
- `make tag` — annotated tag `detz-v$(cat VERSION)`
|
|
- `make release PART=x MSG="..."` — bump+changelog+commit+tag (never push unless asked)
|
|
|
|
## Rules
|
|
- No outputs outside `build/`.
|
|
- `src/cli/version.hpp` generated from `VERSION` at build.
|
|
- Max depth/layering, maximally OO. argparse tree must stay molo-subcommand-ready.
|
|
- Safe C++ is mandatory, per [docs/cpp-safety.md](docs/cpp-safety.md): any code that
|
|
parses untrusted bytes uses overflow-safe size checks (`len <= size - pos`, never
|
|
`pos + len`), reads lengths unsigned and range-checked before any allocation or slice,
|
|
guards every shift/loop bound, and lets no exception escape a top-level dispatch loop.
|
|
A new parser is unfinished without a hostile-input test and a sanitizer run
|
|
(`tools/san-whatsapp.sh` is the pattern). We do not accept regressions here.
|