Skip to content

Upgrade: Anthropic.ts report exists only on stdout while state is saved, and --help runs a full scan #2290

Description

@gjaworski86

Version

LifeOS 7.40.4. Same code on main today (Tools/Anthropic.ts, 1021 lines).

What is broken

Anthropic.ts prints its report only to stdout and saves State/last-check.json at the end of every successful run. So the report exists exactly once. If the output gets cut (an agent piping it through tail, a terminal scrollback limit, a tool-output size cap), the delta is gone, and a second run reports nothing because the state has already moved on.

The argument parser makes this easy to hit. It reads the first non--- argument as the day count and checks only for --force. Any other flag, --help included, is ignored and a full scan runs, which saves the state.

We lost the delta this way on two runs in a row and had to rebuild it from the previous state file in git.

Where (file:line)

  • LifeOS/install/skills/Upgrade/Tools/Anthropic.ts:94-97 (argv: day count and --force only)
  • LifeOS/install/skills/Upgrade/Tools/Anthropic.ts:1011 (saveState after the report is printed to stdout)

Suggested fix

  1. Write every report to a file as well, for example Logs/report-<timestamp>.md, and print its path at the end. The run history in Logs/run-history.jsonl already records counts, so the report next to it fits.
  2. Make --help print usage and exit without fetching or saving state. Reject unknown flags the same way.

Optional: a --no-save flag for a dry run that leaves the state untouched.

This overlaps with the rewrite announced in #2227 (pagination and the import.meta.main guard), so it may be easiest to fold in there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions