[claude] Three-Strike Detector for Repeated Manual Work (#962) #1163

Closed
claude wants to merge 2 commits from (deleted):claude/issue-962 into main
Collaborator

Fixes #962

Summary

  • src/timmy/sovereignty/three_strike.py: SQLite-backed ThreeStrikeStore with three-tier strike system (discovery → warning → block), ThreeStrikeError exception, FalseworkChecklist pre-cloud-API checklist, and module-level get_detector() singleton
  • src/timmy/sovereignty/__init__.py: New sovereignty subpackage
  • src/dashboard/routes/three_strike.py: REST API under /sovereignty/three-strike (list, blocked, record, register automation, events)
  • src/dashboard/app.py: Router registered in FastAPI app
  • tests/timmy/test_three_strike.py: 52 unit tests covering all strike states, blocking, automation registration, and falsework checklist
  • tests/timmy/test_three_strike_routes.py: 7 unit tests for API routes with per-test temp DB isolation via monkeypatched get_detector()

Behaviour

  • Strike 1 (count=1): discovery — action proceeds normally, logged at INFO
  • Strike 2 (count=2): warning — action proceeds, logged at WARNING
  • Strike 3 (count≥3): blocked — raises ThreeStrikeError; caller must register an automation artifact first

Categories tracked

vlm_prompt_edit, game_bug_review, parameter_tuning, portal_adapter_creation, deployment_step

Fixes #962 ## Summary - **`src/timmy/sovereignty/three_strike.py`**: SQLite-backed `ThreeStrikeStore` with three-tier strike system (discovery → warning → block), `ThreeStrikeError` exception, `FalseworkChecklist` pre-cloud-API checklist, and module-level `get_detector()` singleton - **`src/timmy/sovereignty/__init__.py`**: New sovereignty subpackage - **`src/dashboard/routes/three_strike.py`**: REST API under `/sovereignty/three-strike` (list, blocked, record, register automation, events) - **`src/dashboard/app.py`**: Router registered in FastAPI app - **`tests/timmy/test_three_strike.py`**: 52 unit tests covering all strike states, blocking, automation registration, and falsework checklist - **`tests/timmy/test_three_strike_routes.py`**: 7 unit tests for API routes with per-test temp DB isolation via monkeypatched `get_detector()` ## Behaviour - Strike 1 (count=1): discovery — action proceeds normally, logged at INFO - Strike 2 (count=2): warning — action proceeds, logged at WARNING - Strike 3 (count≥3): blocked — raises `ThreeStrikeError`; caller must register an automation artifact first ## Categories tracked `vlm_prompt_edit`, `game_bug_review`, `parameter_tuning`, `portal_adapter_creation`, `deployment_step`
claude added 2 commits 2026-03-23 19:51:16 +00:00
Automated salvage commit — agent session ended (exit 124).
Work in progress, may need continuation.
feat: Three-Strike Detector for Repeated Manual Work
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
f3a7a26108
Implements the three-strike detector that tracks recurring manual
actions by category and blocks the action on the third occurrence,
requiring an automation artifact to be registered first.

- src/timmy/sovereignty/three_strike.py: SQLite-backed ThreeStrikeStore,
  ThreeStrikeError, FalseworkChecklist (pre-cloud-API checklist),
  and module-level get_detector() singleton
- src/timmy/sovereignty/__init__.py: new sovereignty subpackage
- src/dashboard/routes/three_strike.py: REST API endpoints under
  /sovereignty/three-strike (list, blocked, record, register automation,
  events)
- src/dashboard/app.py: router registered in FastAPI app
- tests/timmy/test_three_strike.py: 52 unit tests covering all strike
  states, blocking, automation registration, and falsework checklist
- tests/timmy/test_three_strike_routes.py: 7 unit tests for API routes;
  fixed test isolation via monkeypatched get_detector() per-test temp DB

Fixes #962

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:07 +00:00
Owner

Good work — three-tier strike system looks solid and 59 tests are thorough. However this PR has merge conflicts with main. Please rebase on main and force-push, then I will merge.

Good work — three-tier strike system looks solid and 59 tests are thorough. However this PR has merge conflicts with main. Please rebase on main and force-push, then I will merge.
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled

Pull request closed

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

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1163