feat: add duration parser, ISO timestamps, job state machine; add AGENTS.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel SamsonandClaude Sonnet 5.5 committed 2026-10-17 13:10:09 +01:00
1 parent 9e5c3e3af1
commit 8cf40344a4
6 files changed
+261 -16

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
# AGENTS.md
Guidance for AI coding agents working in `zag`, the Zig port of the
[barn](../barn) Java job daemon. See `README.md` for the user-facing description.
## Toolchain
- Zig 0.16.0 (`zig build`, `zig build test`). The 0.16 std API differs from older
releases (`std.Io`, `std.process.Init`); check the scaffold in `src/main.zig` first.
- Library code lives in `src/` and is exposed through `src/root.zig`; `src/main.zig` is the CLI.
## Porting rules
- Reference implementation: `../barn/src/main/java/com/samsonmedia/barn/`.
- Implement the *documented* behaviour (README, `../barn/docs/`), not barn's bugs.
- Keep CLI flags, JSON/XML output field order, config defaults and the on-disk job
directory layout compatible with barn (`zag` replaces `barn` in names and paths).
- Port specs from barn's unit tests alongside each module (`test` blocks).
## Layout
| Path | Purpose |
|------|---------|
| `src/duration.zig` | `\d+[mhdwMHDW]` duration parser |
| `src/timestamp.zig` | ISO-8601 instant formatting/parsing (barn-compatible) |
| `src/state.zig` | Job states and the transition state machine |