Task: Implement compass journal subcommand

Table of Contents

This page documents a task in the Compass session journal story. It captures the goal, current status, acceptance, and any notes or results.

Goal

Add compass journal as a new compass subcommand with three sub-subcommands: update (append entry), where (last entry), log (full history). This makes the .journal.org format spec from Task 1 machine-readable and queryable from the CLI.

Status

Field Value
State DONE
Parent story Compass session journal
Now Nothing.
Waiting on Nothing.
Next Done. Task 3: wire compass goto auto-update.
Last touched 2026-05-31

Acceptance

  • compass journal --help shows update, where, log subcommands.
  • compass journal update --story <UUID> --task <UUID> --branch <name> [--state STARTED] [--pr none] appends a timestamped entry with org-roam links to .journal.org. Titles are resolved from the compass index; UUIDs are used as fallback.
  • compass journal where prints the last entry (timestamp, story, task, state, branch, PR) in the standard fleet-style format.
  • compass journal log prints all entries newest-last with a count header.
  • compass journal is registered in --help output of the top-level parser.

Notes

Implementation location

All code added to projects/ores.compass/src/compass.py:

  • JOURNAL_FILE constant (PROJECT_ROOT / ".journal.org")
  • _ORG_LINK_RE — parses org-roam [[id:UUID][Title]] links
  • _lookup_title(uuid) — resolves UUID → title via doc_index.load_all()
  • _journal_entries(text) — splits .journal.org text into entry dicts
  • _print_entry(entry) — formats one entry in fleet-style output
  • _journal_update(args) / _journal_where() / _journal_log() — handlers
  • cmd_journal(argv) — top-level dispatcher with argparse sub-subcommands
  • Wired into main() short-circuit (line ~1270) and argparse registry

PRs

PR Title
#952 [compass] Implement compass journal subcommand

Review

Round 1 — 2026-05-31

# Comment summary File Decision Notes
1 PR prefix bug: ##123 when caller passes #123 compass.py Fixed: strip # before digit check Gemini review
2 Atomic write: open("w") risks corruption on interrupted write compass.py Fixed: tmp file + Path.replace() Gemini review

Result

  • compass journal update, where, log implemented and tested.
  • Title resolution via doc_index.load_all() (dict keyed by lowercase UUID).
  • compass journal where output verified against live .journal.org.
  • compass journal log shows multi-entry history with count header.

Emacs 29.1 (Org mode 9.6.6)