codex-agent-hour-tracker 0.2.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/CHANGELOG.md +16 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/PKG-INFO +60 -6
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/README.md +57 -3
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/SECURITY.md +3 -1
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/community/api.js +15 -6
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/community/db.js +28 -11
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/community/score.js +4 -2
- codex_agent_hour_tracker-0.3.0/docs/account-usage.md +23 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/docs/community.md +5 -3
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/docs/exports.md +19 -4
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/docs/methodology.md +16 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/functions/community/_middleware.js +2 -2
- codex_agent_hour_tracker-0.3.0/migrations/0002_provider_scores.sql +21 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/pyproject.toml +3 -3
- codex_agent_hour_tracker-0.3.0/scripts/export_account_usage.py +14 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/_headers +1 -2
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/app.js +17 -4
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/benchmarks/index.html +6 -5
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/community/index.html +10 -4
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/community.js +19 -7
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/index.html +35 -16
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/score.mjs +12 -6
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/styles.css +8 -0
- codex_agent_hour_tracker-0.3.0/skills/codex-agent-hour-tracker/SKILL.md +61 -0
- codex_agent_hour_tracker-0.3.0/src/agent_hour_tracker/__init__.py +6 -0
- codex_agent_hour_tracker-0.3.0/src/agent_hour_tracker/account_usage.py +341 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/archive.py +66 -55
- codex_agent_hour_tracker-0.3.0/src/agent_hour_tracker/claude_scanner.py +220 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/cli.py +124 -51
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/report.py +17 -2
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/scanner.py +1 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/share.py +21 -4
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/community-api.mjs +44 -1
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/community-auth.mjs +1 -1
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/community-database.mjs +49 -1
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/community-headers.mjs +4 -2
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/community-runtime.mjs +1 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/community-score.mjs +17 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/community-security-auth.mjs +1 -4
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/site-local.mjs +13 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/site-score.mjs +24 -3
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/site-ui.mjs +70 -1
- codex_agent_hour_tracker-0.3.0/tests/test_account_usage_exporter.py +338 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_archive.py +1 -1
- codex_agent_hour_tracker-0.3.0/tests/test_claude_scanner.py +229 -0
- codex_agent_hour_tracker-0.3.0/tests/test_provider_integration.py +180 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_public_files.py +4 -3
- codex_agent_hour_tracker-0.3.0/tests/test_public_share.py +71 -0
- codex_agent_hour_tracker-0.2.1/skills/codex-agent-hour-tracker/SKILL.md +0 -43
- codex_agent_hour_tracker-0.2.1/src/agent_hour_tracker/__init__.py +0 -6
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/.gitignore +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/LICENSE +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/community/auth.js +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/community/cookies.js +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/community/crypto.js +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/community-env.d.ts +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/functions/api/community/[[path]].js +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/migrations/0001_community.sql +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/package-lock.json +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/package.json +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/scripts/sync_benchmarks.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/benchmarks-data.js +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/benchmarks.js +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/favicon.png +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/favicon.svg +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/site/social-card.png +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/skills/codex-agent-hour-tracker/agents/openai.yaml +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/__main__.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/benchmarks.json +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/benchmarks.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/metrics.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/src/agent_hour_tracker/session_io.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_cli.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_compressed_sessions.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_metrics.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_report.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_scanner.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/tests/test_v020_reports.py +0 -0
- {codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/wrangler.jsonc +0 -0
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
- Add Claude Code native main and completed foreground-agent timing scans and Codex, Claude, or combined local reports.
|
|
6
|
+
- Add repeatable Claude roots, provider breakdowns, and combined CSV provider columns.
|
|
7
|
+
- Write provider-aware private archive schema v2. Continue reading v1 as Codex and deduplicate copied histories within each provider.
|
|
8
|
+
- Add Claude and combined `--share` text and public JSON schema v2 with an explicit provider. Preserve Codex public JSON schema v1.
|
|
9
|
+
- Add provider selections to share cards and separate community boards by provider and session scope. Preserve the shared five-post account quota and aggregate-only public fields.
|
|
10
|
+
- Keep historical benchmarks Codex-only. Label Claude main-session origin as unverified in Claude and combined views.
|
|
11
|
+
- Exclude Claude history without native timing and unverified human initiation from human-root statistics.
|
|
12
|
+
|
|
13
|
+
## 0.2.2
|
|
14
|
+
|
|
15
|
+
- Add `agent-hours account-usage` for private, service-reported ChatGPT account usage JSON and daily CSV.
|
|
16
|
+
- Fingerprint account identity by default; require explicit flags for plaintext identity or stdout.
|
|
17
|
+
- Keep account usage separate from public share cards and the community scoreboard.
|
|
18
|
+
|
|
3
19
|
## 0.2.1
|
|
4
20
|
|
|
5
21
|
- Read `.jsonl.zst` rollouts in local scans and private exports on Python 3.11–3.14.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: codex-agent-hour-tracker
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Measure cumulative Codex agent runtime without decoding conversation content.
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Measure cumulative Codex and Claude Code agent runtime without decoding conversation content.
|
|
5
5
|
Project-URL: Homepage, https://agenthours.dev
|
|
6
6
|
Project-URL: Repository, https://github.com/tim-osterhus/codex-agent-hour-tracker
|
|
7
7
|
Project-URL: Issues, https://github.com/tim-osterhus/codex-agent-hour-tracker/issues
|
|
8
8
|
Author-email: Tim Osterhus <tim@millrace.ai>
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Keywords: agents,analytics,codex,privacy
|
|
11
|
+
Keywords: agents,analytics,claude-code,codex,privacy
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -27,7 +27,7 @@ Description-Content-Type: text/markdown
|
|
|
27
27
|
|
|
28
28
|
# Agent Hours
|
|
29
29
|
|
|
30
|
-
Agent Hours is a local CLI that measures cumulative Codex agent-hours from
|
|
30
|
+
Agent Hours is a local CLI that measures cumulative Codex and Claude Code agent-hours from recorded turn timing.
|
|
31
31
|
|
|
32
32
|
See your runtime across profiles and machines, calculate optional Agent Leverage, and make a share card at [agenthours.dev](https://agenthours.dev).
|
|
33
33
|
|
|
@@ -43,7 +43,7 @@ The score is mean cumulative runtime across the 30 most recent completed local c
|
|
|
43
43
|
|
|
44
44
|
If today is March 1 in a non-leap year, the window is January 30 through February 28. Custom date ranges produce reports, not canonical scores.
|
|
45
45
|
|
|
46
|
-
The default `interactive-only` scope excludes exec/batch files. It includes delegated turns and non-batch turns with uncertain source metadata. Use `--include-exec` to count exec/batch work as well. Every score states its scope.
|
|
46
|
+
The default Codex `interactive-only` scope excludes exec/batch files. It includes delegated turns and non-batch turns with uncertain source metadata. Use `--include-exec` to count exec/batch work as well. Every score states its scope.
|
|
47
47
|
|
|
48
48
|
## Install once
|
|
49
49
|
|
|
@@ -61,6 +61,54 @@ codex-agent-hour-tracker --share
|
|
|
61
61
|
|
|
62
62
|
Both command names invoke the same tool. Upgrade an existing uv installation with `uv tool upgrade codex-agent-hour-tracker`.
|
|
63
63
|
|
|
64
|
+
## Claude Code and combined reports
|
|
65
|
+
|
|
66
|
+
Codex remains the default. Select Claude Code or combine both providers:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
agent-hours --provider claude
|
|
70
|
+
agent-hours --provider all --monthly
|
|
71
|
+
agent-hours --provider all --sessions-dir ~/.codex/sessions --claude-sessions-dir ~/.claude/projects
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Both directory options are repeatable. Explicit Claude roots select Claude when `--provider` is omitted. Supplying both root options selects both providers.
|
|
75
|
+
|
|
76
|
+
Claude discovery uses `$CLAUDE_CONFIG_DIR/projects`, or `~/.claude/projects` when the variable is unset. Combined discovery skips missing default roots. Explicit missing roots produce errors.
|
|
77
|
+
|
|
78
|
+
Claude main totals use native `system` / `turn_duration` records with `durationMs`, a timestamp, and an immutable UUID. Delegated totals use completed foreground-agent summaries with `totalDurationMs`, agent ID, completion UUID, and timestamp. The start is the recorded end minus the native duration. Async launches and histories without either timing source contribute no runtime. Child-native timers are excluded to avoid counting the same delegated run twice. Transcript gaps, prompts, and assistant timestamps never supply estimated durations. Claude main-session human initiation is unverified, so those turns do not enter human-initiated statistics. Claude native totals may include SDK or headless activity because origin cannot be verified.
|
|
79
|
+
|
|
80
|
+
Combined reports show provider subtotals and add concurrent runtime across both providers. Combined CSV appends provider hours and turn counts to the aggregate columns. Single-provider CSV retains the existing three columns.
|
|
81
|
+
|
|
82
|
+
Public `--share` output supports Codex, Claude Code, and combined totals. Historical published benchmarks remain Codex-only. Claude and combined scores retain the timing coverage and origin limits described above.
|
|
83
|
+
|
|
84
|
+
For four machines, run this export on each machine with a distinct label and filename:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
agent-hours --provider all --export reports/machine1.agent-hours-private.json --label machine1
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Privately transfer the four archives, then combine them:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
agent-hours --provider all --timezone Pacific/Honolulu --monthly \
|
|
94
|
+
--merge reports/machine1.agent-hours-private.json \
|
|
95
|
+
--merge reports/machine2.agent-hours-private.json \
|
|
96
|
+
--merge reports/machine3.agent-hours-private.json \
|
|
97
|
+
--merge reports/machine4.agent-hours-private.json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use the same imports with `--provider codex` or `--provider claude` for separate totals. Merge-only commands do not scan local defaults. Copied histories are deduplicated within each provider. Keep archives private. See [export contracts](docs/exports.md).
|
|
101
|
+
|
|
102
|
+
## Private ChatGPT account usage
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
agent-hours account-usage --label laptop
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Uses your existing ChatGPT-backed Codex login to request service-reported token summaries and daily buckets. API-key-only login is unsupported. It writes private JSON and daily CSV to `reports/account-usage/`, ignored in this repository, with no metrics printed. Choose `--output-dir` for another private location. Identity is fingerprinted by default; `--include-identity` explicitly includes plaintext identity. These exports must never enter share cards or the public scoreboard.
|
|
109
|
+
|
|
110
|
+
This is separate from archive-derived runtime. Daily history can be sparse; timezone, retention, and lifetime completeness are unknown. See [private account exports](docs/account-usage.md) for permissions, Windows, secure capture, and null values.
|
|
111
|
+
|
|
64
112
|
## Calculate Agent Leverage
|
|
65
113
|
|
|
66
114
|
Supply your human hours for the entire report period:
|
|
@@ -81,19 +129,25 @@ Agent Leverage divides agent runtime by human hours over the same period. A week
|
|
|
81
129
|
|
|
82
130
|
```bash
|
|
83
131
|
agent-hours --share --format json
|
|
132
|
+
agent-hours --provider claude --share --format json
|
|
133
|
+
agent-hours --provider all --share --format json
|
|
84
134
|
```
|
|
85
135
|
|
|
86
136
|
Upload or paste this sanitized aggregate JSON into the [share studio](https://agenthours.dev/#share). Preview and download a square or landscape PNG/SVG in your browser. Importing a score and making a card run locally. The website accepts only the public score schema.
|
|
87
137
|
|
|
138
|
+
Codex public JSON keeps schema v1. Claude and combined JSON use schema v2 with an explicit provider. Combined public scores contain one aggregate. The `scope` field selects Codex source eligibility. Claude native turns retain unverified main-session origin under either scope. See [export contracts](docs/exports.md).
|
|
139
|
+
|
|
88
140
|
`--share` is the safe default for sharing, but dates, counts, durations, timezone, and optional human-hours assumptions remain a deliberate aggregate disclosure. Review the card before posting it.
|
|
89
141
|
|
|
90
142
|
## Join the community scoreboard
|
|
91
143
|
|
|
92
144
|
The separate [community page](https://agenthours.dev/community/) shows self-reported scores. GitHub sign-in identifies the person posting, but does not verify their runtime. Scores can be edited or inflated.
|
|
93
145
|
|
|
146
|
+
Codex, Claude, and combined scores have separate boards for each session scope. Posting replaces your score for that provider and scope. Historical Codex benchmarks do not establish Claude or combined rankings.
|
|
147
|
+
|
|
94
148
|
After importing your score, choose **Share to community**. Review the public fields, sign in with GitHub, and confirm the post. Importing a file never posts it. The community score omits Agent Leverage and human-hours assumptions.
|
|
95
149
|
|
|
96
|
-
Each GitHub account can make five successful posts in a rolling 30-day window. Updating a score counts as a post. Deleting it does not refund a slot. The page warns you after your fourth post and shows when a slot opens.
|
|
150
|
+
Each GitHub account can make five successful posts in a rolling 30-day window across all providers and session scopes. Updating a score counts as a post. Deleting it does not refund a slot. The page warns you after your fourth post and shows when a slot opens.
|
|
97
151
|
|
|
98
152
|
The local card tool works without an account or community access. Hosting and privacy details are in the [community guide](docs/community.md).
|
|
99
153
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Hours
|
|
2
2
|
|
|
3
|
-
Agent Hours is a local CLI that measures cumulative Codex agent-hours from
|
|
3
|
+
Agent Hours is a local CLI that measures cumulative Codex and Claude Code agent-hours from recorded turn timing.
|
|
4
4
|
|
|
5
5
|
See your runtime across profiles and machines, calculate optional Agent Leverage, and make a share card at [agenthours.dev](https://agenthours.dev).
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ The score is mean cumulative runtime across the 30 most recent completed local c
|
|
|
16
16
|
|
|
17
17
|
If today is March 1 in a non-leap year, the window is January 30 through February 28. Custom date ranges produce reports, not canonical scores.
|
|
18
18
|
|
|
19
|
-
The default `interactive-only` scope excludes exec/batch files. It includes delegated turns and non-batch turns with uncertain source metadata. Use `--include-exec` to count exec/batch work as well. Every score states its scope.
|
|
19
|
+
The default Codex `interactive-only` scope excludes exec/batch files. It includes delegated turns and non-batch turns with uncertain source metadata. Use `--include-exec` to count exec/batch work as well. Every score states its scope.
|
|
20
20
|
|
|
21
21
|
## Install once
|
|
22
22
|
|
|
@@ -34,6 +34,54 @@ codex-agent-hour-tracker --share
|
|
|
34
34
|
|
|
35
35
|
Both command names invoke the same tool. Upgrade an existing uv installation with `uv tool upgrade codex-agent-hour-tracker`.
|
|
36
36
|
|
|
37
|
+
## Claude Code and combined reports
|
|
38
|
+
|
|
39
|
+
Codex remains the default. Select Claude Code or combine both providers:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
agent-hours --provider claude
|
|
43
|
+
agent-hours --provider all --monthly
|
|
44
|
+
agent-hours --provider all --sessions-dir ~/.codex/sessions --claude-sessions-dir ~/.claude/projects
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Both directory options are repeatable. Explicit Claude roots select Claude when `--provider` is omitted. Supplying both root options selects both providers.
|
|
48
|
+
|
|
49
|
+
Claude discovery uses `$CLAUDE_CONFIG_DIR/projects`, or `~/.claude/projects` when the variable is unset. Combined discovery skips missing default roots. Explicit missing roots produce errors.
|
|
50
|
+
|
|
51
|
+
Claude main totals use native `system` / `turn_duration` records with `durationMs`, a timestamp, and an immutable UUID. Delegated totals use completed foreground-agent summaries with `totalDurationMs`, agent ID, completion UUID, and timestamp. The start is the recorded end minus the native duration. Async launches and histories without either timing source contribute no runtime. Child-native timers are excluded to avoid counting the same delegated run twice. Transcript gaps, prompts, and assistant timestamps never supply estimated durations. Claude main-session human initiation is unverified, so those turns do not enter human-initiated statistics. Claude native totals may include SDK or headless activity because origin cannot be verified.
|
|
52
|
+
|
|
53
|
+
Combined reports show provider subtotals and add concurrent runtime across both providers. Combined CSV appends provider hours and turn counts to the aggregate columns. Single-provider CSV retains the existing three columns.
|
|
54
|
+
|
|
55
|
+
Public `--share` output supports Codex, Claude Code, and combined totals. Historical published benchmarks remain Codex-only. Claude and combined scores retain the timing coverage and origin limits described above.
|
|
56
|
+
|
|
57
|
+
For four machines, run this export on each machine with a distinct label and filename:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
agent-hours --provider all --export reports/machine1.agent-hours-private.json --label machine1
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Privately transfer the four archives, then combine them:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
agent-hours --provider all --timezone Pacific/Honolulu --monthly \
|
|
67
|
+
--merge reports/machine1.agent-hours-private.json \
|
|
68
|
+
--merge reports/machine2.agent-hours-private.json \
|
|
69
|
+
--merge reports/machine3.agent-hours-private.json \
|
|
70
|
+
--merge reports/machine4.agent-hours-private.json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Use the same imports with `--provider codex` or `--provider claude` for separate totals. Merge-only commands do not scan local defaults. Copied histories are deduplicated within each provider. Keep archives private. See [export contracts](docs/exports.md).
|
|
74
|
+
|
|
75
|
+
## Private ChatGPT account usage
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
agent-hours account-usage --label laptop
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Uses your existing ChatGPT-backed Codex login to request service-reported token summaries and daily buckets. API-key-only login is unsupported. It writes private JSON and daily CSV to `reports/account-usage/`, ignored in this repository, with no metrics printed. Choose `--output-dir` for another private location. Identity is fingerprinted by default; `--include-identity` explicitly includes plaintext identity. These exports must never enter share cards or the public scoreboard.
|
|
82
|
+
|
|
83
|
+
This is separate from archive-derived runtime. Daily history can be sparse; timezone, retention, and lifetime completeness are unknown. See [private account exports](docs/account-usage.md) for permissions, Windows, secure capture, and null values.
|
|
84
|
+
|
|
37
85
|
## Calculate Agent Leverage
|
|
38
86
|
|
|
39
87
|
Supply your human hours for the entire report period:
|
|
@@ -54,19 +102,25 @@ Agent Leverage divides agent runtime by human hours over the same period. A week
|
|
|
54
102
|
|
|
55
103
|
```bash
|
|
56
104
|
agent-hours --share --format json
|
|
105
|
+
agent-hours --provider claude --share --format json
|
|
106
|
+
agent-hours --provider all --share --format json
|
|
57
107
|
```
|
|
58
108
|
|
|
59
109
|
Upload or paste this sanitized aggregate JSON into the [share studio](https://agenthours.dev/#share). Preview and download a square or landscape PNG/SVG in your browser. Importing a score and making a card run locally. The website accepts only the public score schema.
|
|
60
110
|
|
|
111
|
+
Codex public JSON keeps schema v1. Claude and combined JSON use schema v2 with an explicit provider. Combined public scores contain one aggregate. The `scope` field selects Codex source eligibility. Claude native turns retain unverified main-session origin under either scope. See [export contracts](docs/exports.md).
|
|
112
|
+
|
|
61
113
|
`--share` is the safe default for sharing, but dates, counts, durations, timezone, and optional human-hours assumptions remain a deliberate aggregate disclosure. Review the card before posting it.
|
|
62
114
|
|
|
63
115
|
## Join the community scoreboard
|
|
64
116
|
|
|
65
117
|
The separate [community page](https://agenthours.dev/community/) shows self-reported scores. GitHub sign-in identifies the person posting, but does not verify their runtime. Scores can be edited or inflated.
|
|
66
118
|
|
|
119
|
+
Codex, Claude, and combined scores have separate boards for each session scope. Posting replaces your score for that provider and scope. Historical Codex benchmarks do not establish Claude or combined rankings.
|
|
120
|
+
|
|
67
121
|
After importing your score, choose **Share to community**. Review the public fields, sign in with GitHub, and confirm the post. Importing a file never posts it. The community score omits Agent Leverage and human-hours assumptions.
|
|
68
122
|
|
|
69
|
-
Each GitHub account can make five successful posts in a rolling 30-day window. Updating a score counts as a post. Deleting it does not refund a slot. The page warns you after your fourth post and shows when a slot opens.
|
|
123
|
+
Each GitHub account can make five successful posts in a rolling 30-day window across all providers and session scopes. Updating a score counts as a post. Deleting it does not refund a slot. The page warns you after your fourth post and shows when a slot opens.
|
|
70
124
|
|
|
71
125
|
The local card tool works without an account or community access. Hosting and privacy details are in the [community guide](docs/community.md).
|
|
72
126
|
|
|
@@ -14,12 +14,14 @@ The `--share` command emits a bounded aggregate designed for sharing. Sharing it
|
|
|
14
14
|
|
|
15
15
|
## Data boundaries
|
|
16
16
|
|
|
17
|
-
The scanner reads local plain or Zstandard-compressed archive bytes and decodes only bounded timing and source metadata. It does not decode conversation, reasoning, or tool payloads. The
|
|
17
|
+
The scanner reads local plain or Zstandard-compressed archive bytes and decodes only bounded timing and source metadata. It does not decode conversation, reasoning, or tool payloads. The archive scanner does not send session data over the network. The separate `account-usage` command queries OpenAI account services through the installed Codex app-server using an existing ChatGPT-backed login; it uploads no exports.
|
|
18
18
|
|
|
19
19
|
Private merge exports retain exact start timestamps, durations, source classes, and persistent hashed turn identifiers. Hashes permit correlation and do not anonymize activity. Keep these exports private. Full text and CSV reports also reveal activity patterns.
|
|
20
20
|
|
|
21
21
|
Public share exports use a separate allowlist of aggregate fields. The website validates that schema, rejects private archives, and renders images locally. Importing a score does not submit it. Downloaded cards still disclose their displayed aggregates and optional human-hours assumptions.
|
|
22
22
|
|
|
23
|
+
Account usage exports contain token metrics and daily activity. They use fingerprinted identity by default; fingerprints permit correlation and are not anonymization. Plaintext identity requires `--include-identity`. Default output is under ignored `reports/account-usage/`; other destinations require your own Git exclusions. Files are created exclusively as mode 0600 inside a mode 0700 output directory on POSIX. Direct Windows file output fails closed because private ACLs are not verified. `--stdout` is an explicit private-data disclosure to the caller; capture it securely. Account exports never enter the share schema or scoreboard. See [account export details](docs/account-usage.md).
|
|
24
|
+
|
|
23
25
|
## Optional community scoreboard
|
|
24
26
|
|
|
25
27
|
Publishing requires a separate confirmation on the community page. A post links your GitHub login to aggregate runtime, dates, timezone, scope, and software versions. It excludes daily rows, machine labels, turn identifiers, and human-hours assumptions. Public scores are visible to anyone and can be copied.
|
|
@@ -147,7 +147,7 @@ async function boundedRequestText(request, maxBytes = MAX_BODY_BYTES) {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
async function readJsonBody(request, expectedKeys) {
|
|
150
|
+
async function readJsonBody(request, expectedKeys, optionalKeys = []) {
|
|
151
151
|
const contentType = request.headers.get("Content-Type") ?? "";
|
|
152
152
|
if (!/^application\/json(?:\s*;|$)/i.test(contentType)) {
|
|
153
153
|
throw error("request_invalid", 400, "The request must use JSON.");
|
|
@@ -163,7 +163,7 @@ async function readJsonBody(request, expectedKeys) {
|
|
|
163
163
|
body === null ||
|
|
164
164
|
typeof body !== "object" ||
|
|
165
165
|
Array.isArray(body) ||
|
|
166
|
-
Object.keys(body).
|
|
166
|
+
Object.keys(body).some((key) => !expectedKeys.includes(key) && !optionalKeys.includes(key)) ||
|
|
167
167
|
expectedKeys.some((key) => !Object.hasOwn(body, key))
|
|
168
168
|
) {
|
|
169
169
|
throw error("request_invalid", 400, "The request fields are invalid.");
|
|
@@ -313,14 +313,15 @@ async function postScore(request, env, { now, fetchImpl }) {
|
|
|
313
313
|
|
|
314
314
|
async function deleteScore(request, env, { now }) {
|
|
315
315
|
const session = await requireMutationSession(request, env, now);
|
|
316
|
-
const body = await readJsonBody(request, ["scope"]);
|
|
316
|
+
const body = await readJsonBody(request, ["scope"], ["provider"]);
|
|
317
|
+
const provider = providerValue(body.provider);
|
|
317
318
|
if (body.scope !== "interactive-only" && body.scope !== "including-exec") {
|
|
318
319
|
throw error("request_invalid", 400, "The score scope is invalid.");
|
|
319
320
|
}
|
|
320
321
|
if (!(await consumeWriteRateLimit(dbRequired(env), env, request, now))) {
|
|
321
322
|
throw error("rate_limited", 429, "Too many community requests. Try again shortly.");
|
|
322
323
|
}
|
|
323
|
-
await deleteOwnScore(dbRequired(env), { githubId: session.githubId, scope: body.scope });
|
|
324
|
+
await deleteOwnScore(dbRequired(env), { githubId: session.githubId, scope: body.scope, provider });
|
|
324
325
|
return responseJson({ ok: true });
|
|
325
326
|
}
|
|
326
327
|
|
|
@@ -353,16 +354,24 @@ async function session(request, env, now) {
|
|
|
353
354
|
});
|
|
354
355
|
}
|
|
355
356
|
|
|
357
|
+
function providerValue(value = "codex") {
|
|
358
|
+
if (value !== "codex" && value !== "claude" && value !== "all") {
|
|
359
|
+
throw error("request_invalid", 400, "The score provider is invalid.");
|
|
360
|
+
}
|
|
361
|
+
return value;
|
|
362
|
+
}
|
|
363
|
+
|
|
356
364
|
async function board(url, env, now) {
|
|
357
365
|
const db = dbRequired(env);
|
|
358
|
-
if (url.searchParams.getAll("scope").length !== 1 || [...url.searchParams.keys()].some((key) => key !== "scope")) {
|
|
366
|
+
if (url.searchParams.getAll("scope").length !== 1 || url.searchParams.getAll("provider").length > 1 || [...url.searchParams.keys()].some((key) => key !== "scope" && key !== "provider")) {
|
|
359
367
|
throw error("request_invalid", 400, "A score scope is required.");
|
|
360
368
|
}
|
|
361
369
|
const scope = url.searchParams.get("scope");
|
|
362
370
|
if (scope !== "interactive-only" && scope !== "including-exec") {
|
|
363
371
|
throw error("request_invalid", 400, "The score scope is invalid.");
|
|
364
372
|
}
|
|
365
|
-
|
|
373
|
+
const provider = providerValue(url.searchParams.has("provider") ? url.searchParams.get("provider") : undefined);
|
|
374
|
+
return responseJson({ scores: await getPublicScores(db, scope, { now, limit: 50, provider }) }, 200, { cache: "public, max-age=60" });
|
|
366
375
|
}
|
|
367
376
|
|
|
368
377
|
const AUTH_MESSAGES = Object.freeze({
|
|
@@ -27,6 +27,13 @@ function normalizedScope(scope) {
|
|
|
27
27
|
return scope;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function normalizedProvider(provider = "codex") {
|
|
31
|
+
if (provider !== "codex" && provider !== "claude" && provider !== "all") {
|
|
32
|
+
throw new DatabaseError();
|
|
33
|
+
}
|
|
34
|
+
return provider;
|
|
35
|
+
}
|
|
36
|
+
|
|
30
37
|
async function requestRow(db, requestId) {
|
|
31
38
|
return db
|
|
32
39
|
.prepare(
|
|
@@ -103,6 +110,7 @@ export async function recordAcceptedScore(
|
|
|
103
110
|
}
|
|
104
111
|
if (typeof requestId !== "string" || !requestId) throw new DatabaseError();
|
|
105
112
|
const scope = normalizedScope(score?.scope);
|
|
113
|
+
const provider = normalizedProvider(score?.provider);
|
|
106
114
|
const nowMs = assertNow(now);
|
|
107
115
|
const digest = await scoreDigest(score);
|
|
108
116
|
const existing = await requestRow(db, requestId);
|
|
@@ -134,9 +142,11 @@ export async function recordAcceptedScore(
|
|
|
134
142
|
.bind(requestId, githubId, scope, digest, nowMs),
|
|
135
143
|
db
|
|
136
144
|
.prepare(
|
|
137
|
-
|
|
145
|
+
provider === "codex"
|
|
146
|
+
? "INSERT INTO community_scores (github_id, scope, login, score_json, score_digest, window_end, window_timezone, eligible_until, agent_hours_per_day, updated_at, request_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(github_id, scope) DO UPDATE SET login = excluded.login, score_json = excluded.score_json, score_digest = excluded.score_digest, window_end = excluded.window_end, window_timezone = excluded.window_timezone, eligible_until = excluded.eligible_until, agent_hours_per_day = excluded.agent_hours_per_day, updated_at = excluded.updated_at, request_id = excluded.request_id"
|
|
147
|
+
: "INSERT INTO community_provider_scores (github_id, scope, login, score_json, score_digest, window_end, window_timezone, eligible_until, agent_hours_per_day, updated_at, request_id, provider) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(github_id, scope, provider) DO UPDATE SET login = excluded.login, score_json = excluded.score_json, score_digest = excluded.score_digest, window_end = excluded.window_end, window_timezone = excluded.window_timezone, eligible_until = excluded.eligible_until, agent_hours_per_day = excluded.agent_hours_per_day, updated_at = excluded.updated_at, request_id = excluded.request_id",
|
|
138
148
|
)
|
|
139
|
-
.bind(
|
|
149
|
+
.bind(...[
|
|
140
150
|
githubId,
|
|
141
151
|
scope,
|
|
142
152
|
login,
|
|
@@ -148,7 +158,8 @@ export async function recordAcceptedScore(
|
|
|
148
158
|
score.metrics.agent_hours_per_day,
|
|
149
159
|
updatedAt,
|
|
150
160
|
requestId,
|
|
151
|
-
|
|
161
|
+
...(provider === "codex" ? [] : [provider]),
|
|
162
|
+
]),
|
|
152
163
|
]);
|
|
153
164
|
if (!Array.isArray(results) || !results[2]) throw new DatabaseError();
|
|
154
165
|
} catch (error) {
|
|
@@ -167,20 +178,23 @@ export async function recordAcceptedScore(
|
|
|
167
178
|
};
|
|
168
179
|
}
|
|
169
180
|
|
|
170
|
-
export async function deleteOwnScore(db, { githubId, scope }) {
|
|
181
|
+
export async function deleteOwnScore(db, { githubId, scope, provider = "codex" }) {
|
|
171
182
|
normalizedScope(scope);
|
|
183
|
+
normalizedProvider(provider);
|
|
172
184
|
await db
|
|
173
|
-
.prepare(
|
|
174
|
-
|
|
185
|
+
.prepare(provider === "codex"
|
|
186
|
+
? "DELETE FROM community_scores WHERE github_id = ? AND scope = ?"
|
|
187
|
+
: "DELETE FROM community_provider_scores WHERE github_id = ? AND scope = ? AND provider = ?")
|
|
188
|
+
.bind(...[githubId, scope, ...(provider === "codex" ? [] : [provider])])
|
|
175
189
|
.run();
|
|
176
190
|
}
|
|
177
191
|
|
|
178
192
|
export async function getUserScores(db, githubId) {
|
|
179
193
|
const rows = await db
|
|
180
194
|
.prepare(
|
|
181
|
-
"SELECT login, score_json, updated_at FROM community_scores WHERE github_id = ? ORDER BY scope ASC",
|
|
195
|
+
"SELECT login, score_json, updated_at, scope, 'codex' AS provider FROM community_scores WHERE github_id = ? UNION ALL SELECT login, score_json, updated_at, scope, provider FROM community_provider_scores WHERE github_id = ? ORDER BY scope ASC, provider ASC",
|
|
182
196
|
)
|
|
183
|
-
.bind(githubId)
|
|
197
|
+
.bind(githubId, githubId)
|
|
184
198
|
.all();
|
|
185
199
|
return (rows.results ?? []).flatMap((row) => {
|
|
186
200
|
try {
|
|
@@ -191,15 +205,18 @@ export async function getUserScores(db, githubId) {
|
|
|
191
205
|
});
|
|
192
206
|
}
|
|
193
207
|
|
|
194
|
-
export async function getPublicScores(db, scope, { now, limit = MAX_BOARD_ROWS } = {}) {
|
|
208
|
+
export async function getPublicScores(db, scope, { now, limit = MAX_BOARD_ROWS, provider = "codex" } = {}) {
|
|
195
209
|
normalizedScope(scope);
|
|
210
|
+
normalizedProvider(provider);
|
|
196
211
|
const nowMs = assertNow(now);
|
|
197
212
|
const boundedLimit = Math.min(MAX_BOARD_ROWS, Math.max(1, Number(limit) || MAX_BOARD_ROWS));
|
|
198
213
|
const rows = await db
|
|
199
214
|
.prepare(
|
|
200
|
-
|
|
215
|
+
provider === "codex"
|
|
216
|
+
? "SELECT login, score_json, updated_at FROM community_scores WHERE scope = ? AND eligible_until > ? ORDER BY agent_hours_per_day DESC, login ASC LIMIT ?"
|
|
217
|
+
: "SELECT login, score_json, updated_at FROM community_provider_scores WHERE scope = ? AND eligible_until > ? AND provider = ? ORDER BY agent_hours_per_day DESC, login ASC LIMIT ?",
|
|
201
218
|
)
|
|
202
|
-
.bind(scope, nowMs, boundedLimit)
|
|
219
|
+
.bind(...[scope, nowMs, ...(provider === "codex" ? [] : [provider]), boundedLimit])
|
|
203
220
|
.all();
|
|
204
221
|
return (rows.results ?? []).flatMap((row) => {
|
|
205
222
|
try {
|
|
@@ -3,6 +3,7 @@ const MAX_SCORE_BYTES = 32_768;
|
|
|
3
3
|
const MAX_HOURS_PER_DAY = 1_000_000_000;
|
|
4
4
|
const MAX_TOTAL_HOURS = 30_000_000_000;
|
|
5
5
|
const MAX_TURNS = 100_000_000;
|
|
6
|
+
const PROVIDERS = new Set(["codex", "claude", "all"]);
|
|
6
7
|
const SCOPES = new Set(["interactive-only", "including-exec"]);
|
|
7
8
|
|
|
8
9
|
const TOP_LEVEL_KEYS = [
|
|
@@ -168,10 +169,11 @@ export function parseScore(input, { now = Date.now() } = {}) {
|
|
|
168
169
|
invalid("Public score JSON must be 32 KB or smaller.");
|
|
169
170
|
}
|
|
170
171
|
|
|
171
|
-
exactKeys(score, TOP_LEVEL_KEYS);
|
|
172
|
+
exactKeys(score, score.schema_version === 2 ? [...TOP_LEVEL_KEYS, "provider"] : TOP_LEVEL_KEYS);
|
|
172
173
|
if (
|
|
173
174
|
score.schema !== "agent-hours-score" ||
|
|
174
|
-
score.schema_version !== 1 ||
|
|
175
|
+
(score.schema_version !== 1 && score.schema_version !== 2) ||
|
|
176
|
+
(score.schema_version === 2 && !PROVIDERS.has(score.provider)) ||
|
|
175
177
|
typeof score.tracker_version !== "string" ||
|
|
176
178
|
!/^\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(score.tracker_version) ||
|
|
177
179
|
score.methodology_version !== "1" ||
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Private account usage exports
|
|
2
|
+
|
|
3
|
+
`agent-hours account-usage --label laptop` writes `laptop.json` and `laptop.daily.csv` under `reports/account-usage/`. The long command alias supports the same arguments. Existing files are never overwritten. Success prints a generic message, without identity, token metrics, or dates. Use a new label for each snapshot.
|
|
4
|
+
|
|
5
|
+
The command uses an existing ChatGPT-backed Codex login. API-key-only login is unsupported. `--codex PATH` selects a native executable; Windows requires `codex.exe`, not an npm shell shim. Only `initialize`, `initialized`, `account/read` with `refreshToken: false`, and `account/usage/read` are sent. No turns, login/logout operations, credential file reads, thread filters, or export uploads occur. Errors omit protocol content, notifications, and app-server stderr.
|
|
6
|
+
|
|
7
|
+
[Official token-usage documentation](https://learn.chatgpt.com/docs/app-server#7-token-usage-chatgpt) defines nullable summary metrics and optional daily buckets. These service-reported metrics are separate from local runtime and Agent-Hour Score. The service does not document bucket timezone, retention, date filters, pagination, or lifetime completeness. Sparse history is not proof of zero use on missing dates. Null metrics and null buckets remain null in JSON; a null bucket list produces a header-only CSV, so consult JSON to distinguish null from empty history. Dates are preserved verbatim. Duplicate dates remain separate rows; diagnostics flag duplicates and leave the daily total null to avoid implying a reliable total.
|
|
8
|
+
|
|
9
|
+
JSON uses the private `agent-hours-account-usage` schema, version 1. The account contains a stable SHA-256 fingerprint of the returned email and workspace account ID, or null if neither is available. It enables correlation, not anonymity; it may change when those identity fields change. By default plaintext email, workspace name, account ID, and plan are omitted. `--include-identity` explicitly includes the allowlisted identity fields. Credentials and unknown fields are never exported. Labels are user-supplied private provenance, so avoid sensitive labels when possible.
|
|
10
|
+
|
|
11
|
+
`--output-dir DIRECTORY` selects another private location. The default `reports/` path is ignored by this repository; it is not automatically ignored in other repositories. Check your own Git exclusions. On POSIX the destination directory is mode 0700 and files are mode 0600; files are created exclusively, without replacement. Parent-directory access, storage encryption, backups, and secure transfer remain your responsibility. A write failure never falls back to stdout.
|
|
12
|
+
|
|
13
|
+
Direct Windows file output fails closed until private ACLs can be verified. Use explicit `--stdout` only to capture PRIVATE JSON on a secured POSIX host over an authorized SSH connection. For example, after configuring a private capture directory:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
mkdir -p private-capture
|
|
17
|
+
chmod 700 private-capture
|
|
18
|
+
(umask 077; set -C; ssh WINDOWS_HOST 'agent-hours account-usage --label remote --stdout' > private-capture/remote.json)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Check the SSH exit status before using the result; a failed command may leave an empty or incomplete capture. Stdout remains fingerprinted unless `--include-identity` is also supplied. This mode emits JSON only and no success status text. Never paste either JSON or CSV into share cards, public issues, the website, or the community scoreboard. Neither command accepts `--share`. The existing runtime share schema and website payloads are unchanged.
|
|
22
|
+
|
|
23
|
+
The historical `python scripts/export_account_usage.py` entry point remains a wrapper with the same options, plus the private defaults above.
|
|
@@ -12,18 +12,20 @@ A post contains your GitHub login, posting time, and these score fields:
|
|
|
12
12
|
|
|
13
13
|
- Average, total, and peak daily agent-hours.
|
|
14
14
|
- Completed turns and active days.
|
|
15
|
-
-
|
|
15
|
+
- Provider, window dates, timezone, and session scope.
|
|
16
16
|
- Tracker, methodology, and schema versions.
|
|
17
17
|
|
|
18
18
|
Human-hours assumptions and Agent Leverage are omitted. Private archives, daily rows, machine names, and session identifiers are rejected.
|
|
19
19
|
|
|
20
|
-
The board has separate
|
|
20
|
+
The board defaults to Codex. Select Claude or Combined (Codex + Claude) to view those scores. Each provider has separate interactive-only and exec-inclusive lists. Each list shows up to 50 recent scores, sorted by hours per day. A new post replaces your current score for that provider and session scope.
|
|
21
|
+
|
|
22
|
+
Public score schema v1 means Codex. Schema v2 requires `provider` with `codex`, `claude`, or `all`. Both accept only the public aggregate fields. Private archive schema v2 is a different format and is rejected. Generate an export with `agent-hours --provider claude --share --format json`, or select `codex` or `all`. Combined scores add provider runtime. The historical Codex benchmarks do not establish Claude or combined rankings.
|
|
21
23
|
|
|
22
24
|
Scores cover 30 completed calendar days. When posted, their end date must be yesterday or one of the seven days before yesterday, in the score's timezone. Old scores leave the recent list. Numeric checks reject malformed data, not dishonest claims.
|
|
23
25
|
|
|
24
26
|
## Five posts in 30 days
|
|
25
27
|
|
|
26
|
-
Each GitHub account gets five accepted posts in a rolling 30 × 24-hour window, across
|
|
28
|
+
Each GitHub account gets five accepted posts in a rolling 30 × 24-hour window, across all providers and session lists. This is not a calendar-month reset.
|
|
27
29
|
|
|
28
30
|
After the fourth post, the page says you have one left and shows when the next slot opens. After the fifth, you must wait. Each slot opens exactly 30 days after its post was accepted.
|
|
29
31
|
|
|
@@ -2,39 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
Agent Hours has two JSON formats. They serve different purposes and are not interchangeable.
|
|
4
4
|
|
|
5
|
-
## Public score: `agent-hours-score`, schema
|
|
5
|
+
## Public score: `agent-hours-score`, schema versions 1 and 2
|
|
6
6
|
|
|
7
7
|
Create with `agent-hours --share --format json`. The CLI fixes the window to 30 completed calendar days ending yesterday.
|
|
8
8
|
|
|
9
9
|
| Field | Contents |
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| `schema`, `schema_version` | Format identity and version |
|
|
12
|
+
| `provider` | Required in version 2: `codex`, `claude`, or `all`. Absent in version 1 (Codex) |
|
|
12
13
|
| `tracker_version`, `methodology_version` | Software and timing-rule versions |
|
|
13
14
|
| `window` | `start`, `end`, `days`, and IANA `timezone` |
|
|
14
15
|
| `scope` | `interactive-only` or `including-exec` |
|
|
15
16
|
| `metrics` | `agent_hours_per_day`, `total_agent_hours`, `peak_day_agent_hours`, `completed_turns`, `active_days` |
|
|
16
17
|
| `leverage` | `null`, or `ratio`, `human_hours`, `basis`, and `human_hours_per_week` |
|
|
17
18
|
|
|
19
|
+
Codex exports keep version 1 for compatibility. `agent-hours --provider claude --share --format json` and `agent-hours --provider all --share --format json` write version 2. Readers also accept version 2 with `provider: "codex"`. Combined scores contain one aggregate across both providers, with no provider subtotals. Both versions reject unexpected fields.
|
|
20
|
+
|
|
21
|
+
The `scope` enum controls Codex source selection: `interactive-only` excludes Codex exec/batch sources, while `including-exec` includes them. Claude scores include native recorded turns with unverified main-session origin under either scope. They can include SDK or headless activity. A combined score adds these Claude observations to the selected Codex sources. Neither Claude nor combined scores assert that all activity was human initiated.
|
|
22
|
+
|
|
18
23
|
Leverage basis is `reported-period` or `estimated-weekly`. Reported-period leverage has a null weekly-hours field. Numeric values are finite and nonnegative. Supplied human hours are positive.
|
|
19
24
|
|
|
20
25
|
The schema excludes daily rows, machine labels, account details, paths, identifiers, and diagnostics. The browser rejects private exports and unexpected fields. Imported scores are self-reported, not independently verified. A user can edit JSON, so scores do not attest to an account's activity.
|
|
21
26
|
|
|
22
27
|
Pasting a score does not submit it to a server. PNG/SVG generation uses the same local renderer as the card preview. Exported images disclose the fields shown on the preview.
|
|
23
28
|
|
|
24
|
-
Community posting is a separate, confirmed action. The server accepts this schema with `leverage: null` and links it to the signed-in GitHub login. It checks the date window and numeric bounds, not whether the claimed runtime happened.
|
|
29
|
+
Community posting is a separate, confirmed action. The server accepts this schema with `leverage: null` and links it to the signed-in GitHub login. It checks the date window and numeric bounds, not whether the claimed runtime happened. Provider and scope selections have separate boards. See [community rules](community.md).
|
|
25
30
|
|
|
26
|
-
## Private archive: `agent-hours-archive`, schema version
|
|
31
|
+
## Private archive: `agent-hours-archive`, schema version 2
|
|
27
32
|
|
|
28
33
|
Create with `agent-hours --export reports/machine.agent-hours-private.json --label machine`. Export collects available timing observations across the selected directories, including exec/batch observations. It is not a date-bounded public score.
|
|
29
34
|
|
|
30
35
|
Scans and exports accept both `.jsonl` and `.jsonl.zst` rollouts. Merge exports created by version 0.2.1 with Agent Hours 0.2.1 or newer. Version 0.2.0 rejects the new `decompression_errors` diagnostic field. Version 0.2.1 still reads older private exports.
|
|
31
36
|
|
|
32
|
-
The archive contains a methodology version, optional user label, compact observations, and diagnostics. Each observation includes a deterministic hash of the typed turn identifier, start timestamp, duration, timing usability, and source class. It contains no conversation payloads or raw turn identifiers.
|
|
37
|
+
The archive contains a methodology version, optional user label, compact observations, and diagnostics. Each version 2 observation includes `provider` (`codex` or `claude`), a deterministic hash of the typed turn identifier, start timestamp, duration, timing usability, and source class. It contains no conversation payloads or raw turn identifiers.
|
|
33
38
|
|
|
34
39
|
Retaining the best observation per source class lets a later merge apply source selection before deduplication. It also preserves the independent human-root sample. The merge rejects incompatible versions and malformed data rather than silently reinterpreting them.
|
|
35
40
|
|
|
36
41
|
Precise timestamps and persistent hashes reveal activity patterns and permit correlation between exports. Hashing does not make this public-safe. Transfer archives only between machines or people you intend to grant this access. Store them under ignored `reports/` paths. Never paste a private archive into the public share studio.
|
|
37
42
|
|
|
43
|
+
Version 0.3.0 writes schema version 2 and reads version 1 as Codex. Older versions cannot read version 2. Existing Codex hashes remain unchanged. Merge deduplication uses the provider and hash, so a Codex identifier cannot collide with a Claude identifier.
|
|
44
|
+
|
|
45
|
+
Use `--provider all` to collect or report both providers. Provider selection also filters imported archives. Public score schema version 1 remains Codex-only. Claude and combined `--share` selections use public schema version 2.
|
|
46
|
+
|
|
47
|
+
Claude observations require main native duration records or completed foreground-agent summaries. Missing timing contributes no runtime. Child-native timers are excluded to prevent duplicate delegated runtime. Diagnostics report coverage gaps and unverified main-session origin. These labels disclose no paths or transcript content.
|
|
48
|
+
|
|
38
49
|
## Reproduction
|
|
39
50
|
|
|
40
51
|
Use the same methodology, scope, date bounds, timezone, and input archives to reproduce a report. Individual input subtotals may overlap. Use the globally deduplicated combined total. Session histories that have been removed or rewritten can change later measurements.
|
|
52
|
+
|
|
53
|
+
## Account usage
|
|
54
|
+
|
|
55
|
+
`agent-hours account-usage --label NAME` writes a separate private account schema and daily CSV. It cannot be merged into runtime archives or used as a public score. See [account usage](account-usage.md).
|
|
@@ -85,3 +85,19 @@ The CLI reports malformed candidate lines and affected file counts. It reports i
|
|
|
85
85
|
- Batch detection is file-level. One batch classification excludes all completed turns in that file under the default scope.
|
|
86
86
|
|
|
87
87
|
- Malformed records, incomplete turns, unmatched completions, and invalid metadata do not contribute to totals. Diagnostics expose counts, not the discarded content.
|
|
88
|
+
|
|
89
|
+
## Claude Code coverage
|
|
90
|
+
|
|
91
|
+
Claude Code uses separate native timing sources. Main-session `system` / `turn_duration` records require finite `durationMs`, a timestamp, and an immutable UUID. Completed foreground-agent summaries require direct `user.toolUseResult` metadata with `status: completed`, `totalDurationMs`, and an agent ID. Their outer completion records require a UUID and timestamp.
|
|
92
|
+
|
|
93
|
+
The start timestamp is the recorded end minus the native duration. Native durations are retained without the Codex event-gap cap. Child-native sidechain timers are excluded to avoid counting a delegated run through both representations. Async launches without completion timing contribute no runtime. Child-native-only histories are unsupported.
|
|
94
|
+
|
|
95
|
+
Files without either supported timing source contribute no runtime. The scanner does not estimate durations from transcript gaps, user messages, assistant messages, or filesystem timestamps. Tool and conversation content are structurally skipped without decoding. Only approved direct scalar metadata fields are decoded.
|
|
96
|
+
|
|
97
|
+
Main-session human initiation is unverified. Native Claude totals may include SDK or headless activity. Main observations have unknown source and contribute to runtime, but not human-initiated top-level statistics. Completed foreground-agent summaries are delegated. Immutable event UUIDs deduplicate copied and forked histories within Claude. Completion UUID plus agent ID distinguishes resumed delegated runs. Provider-scoped identity prevents collisions with Codex.
|
|
98
|
+
|
|
99
|
+
A parent main timer and its delegated agent summary count as separate agent runtime. Combined totals add completed runtime across providers, including overlap. Provider totals use the same date range and timezone.
|
|
100
|
+
|
|
101
|
+
Public scores identify Codex, Claude Code, or combined activity. Version 1 public scores and published Codex benchmarks retain their Codex-only interpretation. Version 2 public scores carry a provider selection. Their scope enum controls Codex source selection. Claude native recorded turns retain unverified main-session origin under either scope. Claude and combined scores do not imply human-only activity.
|
|
102
|
+
|
|
103
|
+
Diagnostics report files without a main native timer, files with unverified main origin, ignored child-native timer records, and async launches without completion timing. These coverage counts do not measure missing runtime.
|
{codex_agent_hour_tracker-0.2.1 → codex_agent_hour_tracker-0.3.0}/functions/community/_middleware.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Only the community page can contact the API and load the bot check.
|
|
2
2
|
// Replace the inherited policy: appending would retain connect-src 'none'.
|
|
3
|
-
const COMMUNITY_CSP = "default-src 'self'; script-src 'self' https://challenges.cloudflare.com; style-src 'self'; img-src 'self' data:; connect-src 'self'; frame-src https://challenges.cloudflare.com; font-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors
|
|
3
|
+
const COMMUNITY_CSP = "default-src 'self'; script-src 'self' https://challenges.cloudflare.com; style-src 'self'; img-src 'self' data:; connect-src 'self'; frame-src https://challenges.cloudflare.com; font-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors https://timosterhus.com; form-action 'none'";
|
|
4
4
|
|
|
5
5
|
export async function onRequest(context) {
|
|
6
6
|
const downstream = await context.next();
|
|
@@ -8,7 +8,7 @@ export async function onRequest(context) {
|
|
|
8
8
|
response.headers.set('Content-Security-Policy', COMMUNITY_CSP);
|
|
9
9
|
response.headers.set('Referrer-Policy', 'no-referrer');
|
|
10
10
|
response.headers.set('X-Content-Type-Options', 'nosniff');
|
|
11
|
-
response.headers.
|
|
11
|
+
response.headers.delete('X-Frame-Options');
|
|
12
12
|
response.headers.set('Permissions-Policy', 'camera=(), microphone=(), geolocation=()');
|
|
13
13
|
return response;
|
|
14
14
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Expand-only: legacy Codex rows and quota ledger remain unchanged. */
|
|
2
|
+
CREATE TABLE IF NOT EXISTS community_provider_scores (
|
|
3
|
+
github_id INTEGER NOT NULL REFERENCES github_users(github_id) ON DELETE CASCADE,
|
|
4
|
+
provider TEXT NOT NULL CHECK (provider IN ('claude', 'all')),
|
|
5
|
+
scope TEXT NOT NULL CHECK (scope IN ('interactive-only', 'including-exec')),
|
|
6
|
+
login TEXT NOT NULL,
|
|
7
|
+
score_json TEXT NOT NULL,
|
|
8
|
+
score_digest TEXT NOT NULL,
|
|
9
|
+
window_end TEXT NOT NULL,
|
|
10
|
+
window_timezone TEXT NOT NULL,
|
|
11
|
+
eligible_until INTEGER NOT NULL,
|
|
12
|
+
agent_hours_per_day REAL NOT NULL,
|
|
13
|
+
updated_at TEXT NOT NULL,
|
|
14
|
+
request_id TEXT NOT NULL UNIQUE,
|
|
15
|
+
PRIMARY KEY (github_id, scope, provider)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
CREATE INDEX IF NOT EXISTS community_provider_scores_board_idx
|
|
19
|
+
ON community_provider_scores(provider, scope, agent_hours_per_day DESC, login ASC);
|
|
20
|
+
CREATE INDEX IF NOT EXISTS community_provider_scores_window_idx
|
|
21
|
+
ON community_provider_scores(provider, scope, eligible_until);
|