From cbcd35b65d88de1306465bb3ceba7bce6635be19 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Fri, 27 Mar 2026 14:36:58 -0600 Subject: [PATCH] morning_briefing: flat file storage at sol/briefing.md Change briefing storage from sol/briefing/{day}.md to sol/briefing.md (same pattern as pulse.md). The day is in the YAML frontmatter. Fixes PermissionError when cortex agent writes to a new subdirectory. Co-Authored-By: Claude Opus 4.6 (1M context) --- muse/morning_briefing.md | 7 +------ think/tools/sol.py | 38 +++++++------------------------------- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/muse/morning_briefing.md b/muse/morning_briefing.md index 9362eeb53..3f14b0fac 100644 --- a/muse/morning_briefing.md +++ b/muse/morning_briefing.md @@ -60,27 +60,22 @@ cat <<'EOF' | sol call sol briefing --write --- type: morning_briefing date: $day_YYYYMMDD -generated: [ISO 8601 datetime of generation, e.g. 2026-03-27T06:30:00] +generated: [current ISO 8601 datetime] --- ## Your Day - [content] ## Yesterday - [content] ## Needs Attention - [content] ## Forward Look - [content] ## Reading - [content] EOF ``` diff --git a/think/tools/sol.py b/think/tools/sol.py index 7c50668c8..0f83b185c 100644 --- a/think/tools/sol.py +++ b/think/tools/sol.py @@ -5,8 +5,7 @@ Provides read and write access to ``{journal}/sol/self.md``, ``{journal}/sol/agency.md``, ``{journal}/sol/pulse.md``, and -``{journal}/sol/briefing/{day}.md`` — sol's -identity and initiative files. +``{journal}/sol/briefing.md`` — sol's identity and initiative files. Mounted by ``think.call`` as ``sol call sol ...``. """ @@ -127,45 +126,22 @@ def briefing_cmd( write: bool = typer.Option( False, "--write", "-w", help="Write briefing from stdin." ), - day: str | None = typer.Option( - None, "--day", "-d", help="Specific day YYYYMMDD." - ), ) -> None: - """Read or write sol/briefing/{day}.md.""" - import os - + """Read or write sol/briefing.md.""" sol_dir = _sol_dir() - briefing_dir = sol_dir / "briefing" + briefing_path = sol_dir / "briefing.md" if write: - target_day = day or os.environ.get("SOL_DAY") - if not target_day: - typer.echo("Error: --day required (or set SOL_DAY).", err=True) - raise typer.Exit(1) content = sys.stdin.read() if not content.strip(): typer.echo("Error: no content provided on stdin.", err=True) raise typer.Exit(1) - briefing_dir.mkdir(parents=True, exist_ok=True) - (briefing_dir / f"{target_day}.md").write_text(content, encoding="utf-8") - typer.echo(f"Briefing for {target_day} saved.") + briefing_path.write_text(content, encoding="utf-8") + typer.echo("briefing.md updated.") return # Read mode - if day: - path = briefing_dir / f"{day}.md" - if not path.exists(): - typer.echo("No briefing found.", err=True) - raise typer.Exit(1) - typer.echo(path.read_text(encoding="utf-8")) - return - - # No day specified — find most recent - if not briefing_dir.exists(): - typer.echo("No briefing found.", err=True) - raise typer.Exit(1) - files = sorted(briefing_dir.glob("*.md"), reverse=True) - if not files: + if not briefing_path.exists(): typer.echo("No briefing found.", err=True) raise typer.Exit(1) - typer.echo(files[0].read_text(encoding="utf-8")) + typer.echo(briefing_path.read_text(encoding="utf-8")) -- 2.51.2