feat: add FinalToken v1 for Claude and Codex usage (#2)
FinalToken v1: a NativeAOT tray app for Windows 11 and CachyOS that tracks Claude Code and Codex usage and limits through their CLIs only, with no provider sign-in and no tokens (R1-R7, D1-D11). - Core: incremental collectors for Claude transcripts and Codex rollouts, limit probes through `claude -p /usage` and `codex app-server`, a journaled history store, the refresh engine, pace and popup decisions, and the snapshot.json contract. - App (Avalonia): stats panel with limit bars, pace, projections, token totals, charts, limit history and breakdowns; tray, settings, non-activating pace popups, single-instance activation, start with the OS, and the Off/Ask/Automatic Stream Deck plugin install. - Stream Deck plugin (SDK v2, NativeAOT) for Elgato and OpenDeck. - finaltoken-cli, tools/publish.py, the documentation check and the agent review workflow. Closes #1
This commit was merged in pull request #2.
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
# Agent review
|
||||
|
||||
Every PR needs a passing review from a fresh agent session before it merges. The review sets the
|
||||
`agent-review` commit status on the PR's head commit. A push after the review moves the head, so
|
||||
the PR needs a new review.
|
||||
|
||||
## Starting a review (author)
|
||||
|
||||
After the last push, start a reviewer that has none of the work's context: a new agent session, or
|
||||
a subagent whose whole prompt is `Review PR #<N> of FinalFactory/FinalToken following
|
||||
docs/agents/review.md`. Use a capable model at high effort. The PR body, the issue and the earlier
|
||||
reviews on the PR explain the change; the reviewer gets no other briefing.
|
||||
|
||||
## Reviewing (reviewer)
|
||||
|
||||
1. Record the head commit you review:
|
||||
`tools/gitea.sh GET /repos/FinalFactory/FinalToken/pulls/<N> | jq -r .head.sha`.
|
||||
2. Read the PR, its linked issue, the root `AGENTS.md`, the `AGENTS.md` of every touched project,
|
||||
the [requirements](../requirements.md) and the [recorded decisions](../decisions.md) the change
|
||||
touches, and the earlier agent reviews on the PR.
|
||||
3. Read the whole diff: `git fetch origin && git diff origin/master...<sha>`. On a re-review it is
|
||||
context; step 5 says what can block.
|
||||
4. Check out the head in a separate worktree and run the checks in
|
||||
[AGENTS.md](../../AGENTS.md#building-and-testing) that the change affects, always including
|
||||
`python -B tools/docs/check_docs.py`.
|
||||
5. If the PR already has a failed agent review, this is a re-review. Check that each blocking
|
||||
finding of the last failed review is fixed or answered. Then review only the author's commits
|
||||
since the commit that review covered (named in its first line), leaving out what came in from
|
||||
`master`: `git log -p --no-merges ^<old sha> ^origin/master <sha>`. Only these two can block.
|
||||
Anything else you notice is a note, even a bug; the author decides whether to fix it in this
|
||||
PR. A full pass in every round finds new problems each time, and the loop never ends.
|
||||
6. Look for:
|
||||
- **Spec**: it does what the issue asks and stays inside its scope.
|
||||
- **Decisions**: it matches the recorded decisions, or the PR changes their text and carries
|
||||
the `type/decision` label.
|
||||
- **Correctness**: bugs, edge cases, error handling, concurrency, resource cleanup.
|
||||
- **Rules**: the rules in `AGENTS.md` and in the touched projects' `AGENTS.md`.
|
||||
- **Tests**: new behaviour has tests.
|
||||
- **Docs**: docs and `AGENTS.md` files match the new behaviour, commands and decisions.
|
||||
7. Decide the verdict. `fail` only for a blocking finding: a bug, missing behaviour the issue asks
|
||||
for, code that breaks a recorded decision or a rule from step 6, missing tests for new
|
||||
behaviour, or a failing check. A check or tool that misses some cases does not break the rule
|
||||
it guards: name the gap as a note. Everything else is a note and the review passes.
|
||||
8. Write the review to a file in this format, then post it with
|
||||
`tools/agent-review.sh <N> <sha> <pass|fail> <file>`:
|
||||
|
||||
```markdown
|
||||
## Blocking
|
||||
|
||||
1. `path:line`: what is wrong, why it matters, and the fix.
|
||||
|
||||
## Notes
|
||||
|
||||
- `path:line`: the suggestion.
|
||||
|
||||
## Checked
|
||||
|
||||
What you read and ran, on which commit.
|
||||
```
|
||||
|
||||
The reviewer reports and leaves the code to the author.
|
||||
|
||||
## After a failed review (author)
|
||||
|
||||
Fix each blocking finding, or answer it in a PR comment when it is wrong. Push, then start a new
|
||||
fresh review.
|
||||
|
||||
After the second failed review, stop. Comment on the issue with the open findings, add the
|
||||
`status/needs-decision` label and leave it to a developer: merge anyway, allow more rounds, split
|
||||
the PR or close it.
|
||||
Reference in New Issue
Block a user