EMRY-016: Run metadata files (run.meta, config.json, summary.json) #61

Merged
vxfemboy merged 1 commit from emry-016-run-metadata into main 2026-06-25 04:27:22 +00:00
vxfemboy commented 2026-06-25 04:12:18 +00:00 (Migrated from github.com)

Closes EMRY-016 (#14). Branched off main. Completes M1.

What

emry-store/src/meta.rs:

  • RunMetaFile + Summary structs; run_dir_name / create_run_dir for the logs/{project}_{timestamp}/ layout; write_json helper.
  • A dependency-free UTC epoch→YYYYMMDD_HHMMSS formatter (Hinnant civil_from_days) — avoids pulling in a date crate.

emry-engine/src/session.rs: Engine::start writes run.meta (v4 run_id, start_time, mode) + config.json; finish writes summary.json (duration, reason, steps, dropped). RunConfig gains a mode field.

Verification

  • ./scripts/pre-commit-rust.sh green: clippy -D warnings, 43 engine + 17 store tests, meta.rs 100% / session.rs 96% lines, total 97.99%
  • Ran the demo: the run dir now contains all five files; confirmed run.meta (v4 uuid + "file" mode) and summary.json (200 steps, COMPLETED) contents.
  • Timestamp formatter tested at epoch 0 (19700101_000000) and a known 2021 value.

Review

A focused review verified the civil_from_days transcription against Hinnant's reference (era/day-of-era/month/day math, negative-z truncation, constants) — correct. Two 'important' findings examined and declined as non-bugs (.and() error priority is intentional; the create_run_dir clock-fallback concern is pre-existing and unused by the engine).

Closes EMRY-016 (#14). Branched off `main`. **Completes M1.** ## What `emry-store/src/meta.rs`: - `RunMetaFile` + `Summary` structs; `run_dir_name` / `create_run_dir` for the `logs/{project}_{timestamp}/` layout; `write_json` helper. - A **dependency-free** UTC epoch→`YYYYMMDD_HHMMSS` formatter (Hinnant `civil_from_days`) — avoids pulling in a date crate. `emry-engine/src/session.rs`: `Engine::start` writes `run.meta` (v4 run_id, start_time, mode) + `config.json`; `finish` writes `summary.json` (duration, reason, steps, dropped). `RunConfig` gains a `mode` field. ## Verification - `./scripts/pre-commit-rust.sh` green: clippy `-D warnings`, 43 engine + 17 store tests, meta.rs 100% / session.rs 96% lines, total 97.99% - **Ran the demo**: the run dir now contains all five files; confirmed `run.meta` (v4 uuid + "file" mode) and `summary.json` (200 steps, COMPLETED) contents. - Timestamp formatter tested at epoch 0 (`19700101_000000`) and a known 2021 value. ## Review A focused review verified the `civil_from_days` transcription against Hinnant's reference (era/day-of-era/month/day math, negative-z truncation, constants) — **correct**. Two 'important' findings examined and declined as non-bugs (`.and()` error priority is intentional; the `create_run_dir` clock-fallback concern is pre-existing and unused by the engine).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
femboy/emry!61
No description provided.