Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codex-usage-tracker",
"version": "0.4.1",
"version": "0.5.0",
"description": "Unofficial local tracker for aggregate Codex token usage from local session logs.",
"author": {
"name": "Douglas Monsky"
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

## 0.5.0 - 2026-06-10

- Add the dashboard localization foundation, including starter locale catalogs, language metadata, local browser language selection, `--lang`, and `CODEX_USAGE_TRACKER_LANG`.
- Add Vietnamese dashboard localization and focused validation coverage for translated dashboard labels.
- Keep the README landing page focused on dashboard screenshots and companion usage workflows before detailed localization guidance.
- Stabilize the CI synthetic benchmark smoke so coverage instrumentation does not create false release failures.
- Pin the marketplace MCP runtime launcher to the exact `codex-usage-tracking==0.5.0` package.

## 0.4.1 - 2026-06-09

- Harden the production PyPI workflow so manual publishing must run from `main` or a tag ref before artifacts are downloaded and uploaded.
Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,6 @@ If `codex-usage-tracker` is not found after installing with pipx, open a new ter

`serve-dashboard` refreshes active-session usage before opening by default. Use `--no-refresh` only when you intentionally want to inspect the cached local index.

## Dashboard Language

The dashboard supports localized UI text. English is the canonical catalog, and the project includes starter locale catalogs for common dashboard languages.

Set the initial dashboard language with `--lang`:

```bash
codex-usage-tracker --lang vi serve-dashboard --open
```

Or set a default with:

```bash
CODEX_USAGE_TRACKER_LANG=vi codex-usage-tracker serve-dashboard --open
```

The dashboard also includes a language selector. Browser selections are stored locally and can override the generated default for that browser.

Supported starter locales include English, Vietnamese, Spanish, French, German, Portuguese, Japanese, Simplified Chinese, Korean, Russian, Italian, and Arabic. This localizes dashboard UI text, not the full CLI output or data exports.

### Adding A Dashboard Language

1. Add a locale JSON file named by language code under `src/codex_usage_tracker/plugin_data/dashboard/locales/`.
2. Include every key from the English catalog.
3. Preserve every placeholder from the English string.
4. Add the language code, native name, English name, and text direction to the supported language metadata.
5. Run the i18n validation tests.

Package naming: the PyPI distribution is `codex-usage-tracking`; the installed command is `codex-usage-tracker`; the GitHub repository remains `douglasmonsky/codex-usage-tracker`. The `codex-usage-tracker` PyPI name is not this project, so avoid similarly named packages when following these docs.

Source install for development or branch testing:
Expand Down Expand Up @@ -181,6 +153,34 @@ The tracker cannot read your logged-in ChatGPT plan or live remaining usage auto
- Companion Codex skills for operational setup and conversational usage analysis.
- Optional local pricing, Codex credit, allowance, threshold, project alias, and privacy-mode configuration.

## Dashboard Language

The dashboard supports localized UI text. English is the canonical catalog, and the project includes starter locale catalogs for common dashboard languages.

Set the initial dashboard language with `--lang`:

```bash
codex-usage-tracker --lang vi serve-dashboard --open
```

Or set a default with:

```bash
CODEX_USAGE_TRACKER_LANG=vi codex-usage-tracker serve-dashboard --open
```

The dashboard also includes a language selector. Browser selections are stored locally and can override the generated default for that browser.

Supported starter locales include English, Vietnamese, Spanish, French, German, Portuguese, Japanese, Simplified Chinese, Korean, Russian, Italian, and Arabic. This localizes dashboard UI text, not the full CLI output or data exports.

### Adding A Dashboard Language

1. Add a locale JSON file named by language code under `src/codex_usage_tracker/plugin_data/dashboard/locales/`.
2. Include every key from the English catalog.
3. Preserve every placeholder from the English string.
4. Add the language code, native name, English name, and text direction to the supported language metadata.
5. Run the i18n validation tests.

## Common Commands

```bash
Expand Down
16 changes: 8 additions & 8 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fix/<issue-number>-short-description
docs/<issue-number>-short-description
chore/<issue-number>-short-description
test/<issue-number>-short-description
release/0.4.1
release/0.5.0
hotfix/0.3.3
```

Expand Down Expand Up @@ -91,7 +91,7 @@ blocked
Recommended milestones:

```text
0.4.1
0.5.0
1.0-readiness
1.0.0
```
Expand Down Expand Up @@ -147,8 +147,8 @@ python scripts/smoke_installed_package.py --docker
To verify the public PyPI package instead of the local checkout:

```bash
python scripts/smoke_installed_package.py --from-pypi --version 0.4.1
python scripts/smoke_installed_package.py --docker --from-pypi --version 0.4.1
python scripts/smoke_installed_package.py --from-pypi --version 0.5.0
python scripts/smoke_installed_package.py --docker --from-pypi --version 0.5.0
```

`scripts/check_release.py` treats these public-package smoke commands as release-state claims. Keep their `--version` and `codex-usage-tracking==...` values aligned with `pyproject.toml`; the release gate fails when the docs claim a different public version. It also checks that install docs point at the real PyPI distribution, `codex-usage-tracking`, and keep the warning that `codex-usage-tracker` is a different PyPI package.
Expand Down Expand Up @@ -224,7 +224,7 @@ Tracked timings:
| `pricing_coverage_seconds` | Pricing coverage report |
| `project_summary_seconds` | Project summary report |

The normal CI smoke uses a tiny synthetic history with `--enforce-thresholds` so regressions in the benchmark contract are visible on pull requests. The 10k/100k runs are a practical local gate for performance-sensitive changes; the 500k run is the release-sized gate and can take about a minute on a modern laptop because recommendations and project summary intentionally scan all aggregate rows.
The normal CI smoke uses a tiny synthetic history with `--enforce-thresholds` and a small `--threshold-scale` allowance so coverage instrumentation and shared runner noise do not create false failures. The 10k/100k runs are a practical local gate for performance-sensitive changes; the 500k run is the release-sized gate and can take about a minute on a modern laptop because recommendations and project summary intentionally scan all aggregate rows.

## Release Checklist

Expand Down Expand Up @@ -266,8 +266,8 @@ After the release branch merges, tag from updated `main`, not from an unreviewed
```bash
git switch main
git pull --ff-only
git tag -a v0.4.1 -m "codex-usage-tracker 0.4.1"
git push origin v0.4.1
git tag -a v0.5.0 -m "codex-usage-tracker 0.5.0"
git push origin v0.5.0
```

Do not create or push release tags without maintainer approval.
Expand All @@ -276,7 +276,7 @@ Do not create or push release tags without maintainer approval.

Publishing uses GitHub Actions Trusted Publishing through `.github/workflows/publish.yml`; do not upload from a local machine and do not add PyPI or TestPyPI API tokens.

The first public package release, `0.3.0`, was published on June 8, 2026. Patch release `0.3.1` followed the same day to ship the live-dashboard skill launch fix. Patch release `0.3.2` made dashboard launch refresh the default and added runtime enablement for context loading. Minor release `0.4.0` added Python 3.14 support, release recovery docs, stricter privacy/support-bundle regression coverage, and large-history benchmark thresholds. Patch release `0.4.1` was published by workflow dispatch from `main`; it hardened the PyPI publish workflow and checked off completed 1.0 readiness gates.
The first public package release, `0.3.0`, was published on June 8, 2026. Patch release `0.3.1` followed the same day to ship the live-dashboard skill launch fix. Patch release `0.3.2` made dashboard launch refresh the default and added runtime enablement for context loading. Minor release `0.4.0` added Python 3.14 support, release recovery docs, stricter privacy/support-bundle regression coverage, and large-history benchmark thresholds. Patch release `0.4.1` was published by workflow dispatch from `main`; it hardened the PyPI publish workflow and checked off completed 1.0 readiness gates. Minor release `0.5.0` added dashboard localization support and starter language catalogs.

- GitHub Release: `https://github.com/douglasmonsky/codex-usage-tracker/releases/tag/v0.3.0`
- GitHub Release: `https://github.com/douglasmonsky/codex-usage-tracker/releases/tag/v0.3.1`
Expand Down
18 changes: 9 additions & 9 deletions docs/one-dot-oh-readiness.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ Not guaranteed:

## 1. Public Install And Package Metadata

- [x] Verify the current public PyPI version is visible as `0.4.1`: `python -c "import json, urllib.request; print(json.load(urllib.request.urlopen('https://pypi.org/pypi/codex-usage-tracking/json'))['info']['version'])"`.
- [x] Verify public venv install for `0.4.1`: `python -m venv /tmp/codex-usage-pypi-smoke && . /tmp/codex-usage-pypi-smoke/bin/activate && python -m pip install codex-usage-tracking==0.4.1 && codex-usage-tracker --version`.
- [x] Verify public pipx install path for `0.4.1`: `PIPX_HOME=/tmp/codex-usage-pipx-home PIPX_BIN_DIR=/tmp/codex-usage-pipx-bin pipx install codex-usage-tracking==0.4.1 && /tmp/codex-usage-pipx-bin/codex-usage-tracker --version`.
- [x] Verify the current public PyPI version is visible as `0.5.0`: `python -c "import json, urllib.request; print(json.load(urllib.request.urlopen('https://pypi.org/pypi/codex-usage-tracking/json'))['info']['version'])"`.
- [x] Verify public venv install for `0.5.0`: `python -m venv /tmp/codex-usage-pypi-smoke && . /tmp/codex-usage-pypi-smoke/bin/activate && python -m pip install codex-usage-tracking==0.5.0 && codex-usage-tracker --version`.
- [x] Verify public pipx install path for `0.5.0`: `PIPX_HOME=/tmp/codex-usage-pipx-home PIPX_BIN_DIR=/tmp/codex-usage-pipx-bin pipx install codex-usage-tracking==0.5.0 && /tmp/codex-usage-pipx-bin/codex-usage-tracker --version`.
- [x] Verify installed package resources from a built wheel: `python scripts/smoke_installed_package.py`.
- [x] Verify installed package resources in Linux Docker: `python scripts/smoke_installed_package.py --docker`.
- [x] Verify public PyPI package in Docker: `python scripts/smoke_installed_package.py --docker --from-pypi --version 0.4.1`.
- [x] Verify public PyPI package in Docker: `python scripts/smoke_installed_package.py --docker --from-pypi --version 0.5.0`.
- [x] Verify PyPI metadata names remain unchanged: `python scripts/check_release.py`.
- [x] Add Python 3.14 as an official support target after CI, package classifiers, docs, and installed-package smoke coverage were added. Docker smoke coverage uses `python:3.14-slim` by default. Track this in issue #12.

Expand Down Expand Up @@ -134,14 +134,14 @@ Not guaranteed:

## Evidence References

These references are the concrete proof behind completed checklist items. Public package smoke commands are version-specific to `0.4.1`; all repo tests use synthetic or aggregate-only data.
These references are the concrete proof behind completed checklist items. Public package smoke commands are version-specific to `0.5.0`; all repo tests use synthetic or aggregate-only data.

### Public Install And Package Metadata

- Public PyPI version, public venv install, and public pipx install are proven by the exact public-install commands in section 1.
- Built-wheel and installed-resource coverage is proven by `scripts/smoke_installed_package.py` and `tests/test_cli_release.py::test_installed_package_smoke_checks_help_for_stable_commands`.
- Linux package-resource coverage is proven by `scripts/smoke_installed_package.py --docker`.
- Public PyPI Docker coverage is proven by `scripts/smoke_installed_package.py --docker --from-pypi --version 0.4.1`.
- Public PyPI Docker coverage is proven by `scripts/smoke_installed_package.py --docker --from-pypi --version 0.5.0`.
- PyPI metadata, package/distribution names, package resources, source/wheel member names, Python 3.10-3.14 support metadata, CI workflow requirements, publish workflow safety text, and tracked secret patterns are proven by `scripts/check_release.py`, `scripts/check_release.py --dist`, and `tests/test_cli_release.py::test_release_check_script_passes`.

### Upgrade And Migration
Expand Down Expand Up @@ -211,16 +211,16 @@ These references are the concrete proof behind completed checklist items. Public

- Benchmark command behavior and threshold contract are smoke-tested by `tests/test_cli_release.py::test_synthetic_history_benchmark_script_smoke`.
- Release-size 10k, 100k, and 500k benchmark claims are proven by running `python scripts/benchmark_synthetic_history.py --rows 10000 100000 500000 --json --enforce-thresholds` before release work when practical.
- CI-safe benchmark coverage is proven by the CI `Release readiness` job through `tests/test_cli_release.py::test_synthetic_history_benchmark_script_smoke`.
- CI-safe benchmark coverage is proven by the CI `Release readiness` job through `tests/test_cli_release.py::test_synthetic_history_benchmark_script_smoke`, using a small `--threshold-scale` allowance for coverage instrumentation and shared runner noise.

### Release Process

- Normal CI package build plus `twine check` and dist verification are proven by `.github/workflows/ci.yml` and enforced by `scripts/check_release.py::_check_ci_workflow`.
- Publish workflow package name, Trusted Publishing, TestPyPI/PyPI job presence, event guards, no push/PR publishing, no token/password publishing, and manual PyPI main/tag preflight are proven by `scripts/check_release.py::_check_publish_workflow`.
- The GitHub `pypi` environment gate is proven by `gh api repos/douglasmonsky/codex-usage-tracker/environments/pypi`, which reports a `required_reviewers` protection rule and `can_admins_bypass=false`.
- Dist filename and wheel/sdist member checks are proven by `python -m build`, `python -m twine check dist/*`, and `python scripts/check_release.py --dist`.
- TestPyPI publish process is proven by workflow-dispatch run `27210601817` on `main`, followed by TestPyPI metadata and clean virtualenv install checks for `codex-usage-tracking==0.4.1`.
- PyPI publish process is proven by workflow-dispatch run `27210741720` on `main`, protected `pypi` environment approval, PyPI metadata visibility, clean virtualenv install, temporary pipx install, and Docker public-package smoke for `codex-usage-tracking==0.4.1`.
- TestPyPI publish process is proven by a workflow-dispatch run on `main`, followed by TestPyPI metadata and clean virtualenv install checks for `codex-usage-tracking==0.5.0`.
- PyPI publish process is proven by a workflow-dispatch run on `main`, protected `pypi` environment approval, PyPI metadata visibility, clean virtualenv install, temporary pipx install, and Docker public-package smoke for `codex-usage-tracking==0.5.0`.
- Release recovery documentation is proven by `scripts/check_release.py` required-file and docs checks.

### Known Limitations
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "codex-usage-tracking"
version = "0.4.1"
version = "0.5.0"
description = "Unofficial local Codex plugin and dashboard for investigating aggregate token usage, costs, caching, and thread patterns."
readme = "README.md"
requires-python = ">=3.10"
Expand Down
4 changes: 2 additions & 2 deletions skills/codex-usage-tracker/scripts/run_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

PACKAGE_SPEC = os.environ.get(
"CODEX_USAGE_TRACKER_PACKAGE_SPEC",
"codex-usage-tracking==0.4.1",
"codex-usage-tracking==0.5.0",
)
RUNTIME_VERSION = "0.4.1"
RUNTIME_VERSION = "0.5.0"
PACKAGE_SPEC_MARKER = ".codex-usage-tracker-package-spec"
MODULE_CHECK = (
"import importlib.metadata; "
Expand Down
2 changes: 1 addition & 1 deletion src/codex_usage_tracker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

from codex_usage_tracker.models import UsageEvent

__version__ = "0.4.1"
__version__ = "0.5.0"

__all__ = ["UsageEvent", "__version__"]
3 changes: 3 additions & 0 deletions tests/test_cli_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ def test_synthetic_history_benchmark_script_smoke(tmp_path: Path) -> None:
str(tmp_path),
"--json",
"--enforce-thresholds",
"--threshold-scale",
"5",
],
check=True,
capture_output=True,
Expand All @@ -373,6 +375,7 @@ def test_synthetic_history_benchmark_script_smoke(tmp_path: Path) -> None:
)
payload = json.loads(result.stdout)

assert payload["threshold_scale"] == 5.0
assert payload["benchmarks"][0]["rows"] == 100
assert payload["benchmarks"][0]["filtered_rows"] <= 50
assert "idx_usage_model_effort" in payload["benchmarks"][0]["query_plan"]
Expand Down
Loading