dotnet restore TokenTap.sln
dotnet build TokenTap.slnThe solution targets net8.0, enables nullable reference types, uses the latest recommended analyzers, and builds cleanly with zero warnings.
dotnet test TokenTap.slnCurrent coverage includes:
- cost calculation
- config roundtrip
- redaction and hashing
- OpenAI JSON parser
- Anthropic JSON parser
- generic text parser
- CSV importer
- SQLite idempotent inserts
- totals queries
- cleanup aggregate rollup
- watched sources
- alert history
- CSV and XLSX export
- alert evaluation
- counter metadata
- CLI init/help
$root = Join-Path $PWD ".token-tap-smoke"
New-Item -ItemType Directory -Force $root | Out-Null
$log = Join-Path $root "codex.log"
"2026-05-01T12:00:00Z codex model=gpt-5.4 input tokens: 120 output tokens: 30 cached tokens: 5" | Set-Content $log
dotnet run --project src/TokenTap.Cli -- init --config "$root\token-tap.json" --database "$root\token-tap.db"
dotnet run --project src/TokenTap.Cli -- import log "$log" --config "$root\token-tap.json"
dotnet run --project src/TokenTap.Cli -- today --config "$root\token-tap.json"
dotnet run --project src/TokenTap.Cli -- export --today --format xlsx --out "$root\report.xlsx" --config "$root\token-tap.json"- Keep privacy defaults conservative.
- Add parser support behind
IUsageLogParser. - Keep raw log archival out of storage unless explicitly designed and documented.
- Keep SQLite writes parameterized.
- Prefer deterministic event fingerprints for idempotent imports.
- Do not make Windows-only APIs leak into core/parser/storage projects.
- Add tests for new parser patterns and storage migrations.
- Add a class in
TokenTap.ParsersimplementingIUsageLogParser. - Return normalized
UsageEventrows. - Set
Confidenceaccurately. - Avoid storing full content in
RawExcerptRedacted. - Add the parser to
CompositeUsageParser.CreateDefaultParsers. - Add tests with representative log lines.
- Add the command case in
TokenTapCli.RunAsync. - Keep argument handling in the command method.
- Use
ConfigManagerandOpenDatabaseAsync. - Print concise results suitable for PowerShell.
- Add tests if the command changes behavior or touches storage.