Repository navigation
Persist A Morning Report
Note
Status: implemented — shipped by PLAN-observability-residue-trio.md#task-2 (agentm _harness/).
Goal: Write an overnight run's morning report to a file on disk instead of only printing it to stdout, so it can be re-derived or archived after the terminal session that produced it is gone.
Prereqs: A populated observability rollup (aggregator.default_db_path() or a --db-path you pass explicitly) with at least one event for the plan you're reporting on. See CI gates § The nightly health tier for the sibling scripts/health/ CLI family this script belongs to.
scripts/health/morning_report.py renders why an overnight run ended — plan finished, gates green, an escalation parked, or the window ran out — with the plan's spend attached (wiki/designs/agentm-autonomy.md § When the window runs out). The --out flag adds a second, on-disk copy of the same markdown without changing stdout behavior.
- Run
morning_report.pywith--plan,--ending-cause, and--db-pathas before, adding--out <path>to also write the rendered markdown to<path>:scripts/health/morning_report.py:110declares the flag (--out, defaultNone, "also write the rendered report to this path (stdout output is unchanged either way)"). - Stdout is unchanged whether or not
--outis passed:morning_report.py:127-128renders the page once (page = render_morning_report(data)) and always prints it (print(page, end="")) before the--outbranch runs. - When
--outis given,morning_report.py:129-132buildsPath(args.out), creates any missing parent directories (out_path.parent.mkdir(parents=True, exist_ok=True)), then writes the samepagestring to it (out_path.write_text(page, encoding="utf-8")) — so a nested path likereports/morning.mdworks even ifreports/doesn't exist yet. - The trailing
{"total_cost_usd": 0.0}JSON line still prints to stdout after, unaffected by--out(morning_report.py:133). - Read back the persisted file to confirm it matches what was printed — the file content and the stdout content are byte-identical copies of the same
pagestring.
-
test_main_with_out_writes_the_same_content_stdout_gets(scripts/health/test_morning_report.py:165-179) passes--out <tmp>/reports/morning.md— a nested, not-yet-existing directory, proving themkdir(parents=True)behavior — and asserts the written file's content equalsrender_morning_report(...)'s output and that the same content also appears in stdout. -
test_main_without_out_writes_no_file_and_stdout_is_unchanged(scripts/health/test_morning_report.py:154-163) asserts that omitting--outproduces zero.mdfiles in the tmp dir and that stdout equals the exact pre-existing byte-identical format (expected + '{"total_cost_usd": 0.0}\n').
-
Health scorecard — the sibling
scripts/health/surface, explains where the scorecard lives and how it's produced. - Read the morning note and the nightly scorecard — the morning note, the nightly memory report, which is a different page from this overnight-run report.
- CI gates § The nightly health tier — the reference page for the tier this script's data comes from.
-
wiki/designs/agentm-autonomy.md§ When the window runs out — the design line this flag closes out ("The morning report names why the run ended... with the spend attached").
🔧 How-to
- Install machine-wide (recommended)
- Your first install
- Your first Agent View dispatch
- Configure a new project
- Re-detect a configured project
- Update an installed harness
- Use auto-context in phases
- Audit the vault
- Find missing note links
- Use AgentMemory in any agent
- Drop a card in the inbox
- Tune auto-orchestration
- Run without a vault
- Choose a storage backend
- Back the vault with Google Drive
- Set up Obsidian on the vault
- Find your way around the vault
- Run the memory-root trims migration
- Run the root casing migration
- Run the projects migration
- Run the card backfill
- Run the maps and root notes migration
- Persist a morning report
- Enable on-device notifications
- Enable the daily email
- Ingest an article
- Capture from your phone
- Archive a finished project
- Tune the archive
- Read the morning note and the nightly scorecard
- Read the weekly field brief
- Review flagged memories
- Use the daily calendar