[claude] Session Sovereignty Report Generator (#957) #1162

Closed
claude wants to merge 2 commits from claude/issue-957 into main
Collaborator

Fixes #957

What this does

Implements the Session Sovereignty Report Generator (P0 Sovereignty Loop feature).

New code

  • src/timmy/sovereignty/session_report.py — core report module:
    • mark_session_start() — record session start time
    • generate_report(session_id) — render markdown sovereignty scorecard
    • commit_report(report_md, session_id) — commit to reports/sovereignty/ via Gitea Contents API (degrades gracefully)
    • generate_and_commit_report(session_id) — async entry point for session end hook
  • src/timmy/sovereignty/__init__.py — public re-exports

Report contents

  • Session duration + ID
  • Activity counts (user messages, Timmy responses, tool calls, errors)
  • Model calls by tool (breakdown table)
  • Sovereignty scorecard (current value vs graduation target, per metric)
  • Sovereignty delta (start → end change this session)
  • Cost breakdown (API spend)
  • Per-layer sovereignty % (perception/decision/narration)
  • Trend vs previous session

Fixes to WIP commit

  • Moved get_session_logger, get_sovereignty_store, GRADUATION_TARGETS to module-level imports with graceful fallbacks so tests can patch them correctly
  • Fixed broken patch.object on pydantic settings class in test
  • Added pytestmark = pytest.mark.unit so tests run under tox -e unit
  • All 23 unit tests pass
Fixes #957 ## What this does Implements the Session Sovereignty Report Generator (P0 Sovereignty Loop feature). ### New code - `src/timmy/sovereignty/session_report.py` — core report module: - `mark_session_start()` — record session start time - `generate_report(session_id)` — render markdown sovereignty scorecard - `commit_report(report_md, session_id)` — commit to `reports/sovereignty/` via Gitea Contents API (degrades gracefully) - `generate_and_commit_report(session_id)` — async entry point for session end hook - `src/timmy/sovereignty/__init__.py` — public re-exports ### Report contents - Session duration + ID - Activity counts (user messages, Timmy responses, tool calls, errors) - Model calls by tool (breakdown table) - Sovereignty scorecard (current value vs graduation target, per metric) - Sovereignty delta (start → end change this session) - Cost breakdown (API spend) - Per-layer sovereignty % (perception/decision/narration) - Trend vs previous session ### Fixes to WIP commit - Moved `get_session_logger`, `get_sovereignty_store`, `GRADUATION_TARGETS` to module-level imports with graceful fallbacks so tests can patch them correctly - Fixed broken `patch.object` on pydantic settings class in test - Added `pytestmark = pytest.mark.unit` so tests run under `tox -e unit` - All 23 unit tests pass
claude added 2 commits 2026-03-23 19:48:12 +00:00
Automated salvage commit — agent session ended (exit 124).
Work in progress, may need continuation.
feat: Session Sovereignty Report Generator (#957)
Some checks failed
Tests / lint (pull_request) Failing after 16s
Tests / test (pull_request) Has been skipped
4ab7a6f6e6
- Add `src/timmy/sovereignty/session_report.py` with `generate_report()`,
  `commit_report()`, `generate_and_commit_report()`, and `mark_session_start()`
- Add `src/timmy/sovereignty/__init__.py` exporting the public API
- Move `get_session_logger`, `get_sovereignty_store`, and `GRADUATION_TARGETS`
  to module-level imports (graceful fallback on ImportError) so tests can
  patch them at the correct namespace
- Fix broken `patch.object` in test that raised AttributeError on pydantic settings
- Add `pytestmark = pytest.mark.unit` so tests run under `tox -e unit`
- All 23 sovereignty report tests pass

Fixes #957

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner

Closing: merge conflicts with main after other PRs landed. Will re-implement on a fresh branch if still needed.

Closing: merge conflicts with main after other PRs landed. Will re-implement on a fresh branch if still needed.
Timmy closed this pull request 2026-03-23 20:00:11 +00:00
Some checks failed
Tests / lint (pull_request) Failing after 16s
Tests / test (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1162