Skip to content

Fix upgrade-path script safety and currency labels - #1914

Merged
iamtoruk merged 15 commits into
mainfrom
fix/upgrade-script-home-currency-labels
Nov 7, 2026
Merged

iamtoruk merged 15 commits into
mainfrom
fix/upgrade-script-home-currency-labels

Conversation

@iamtoruk

@iamtoruk iamtoruk commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Small review follow-ups.

  • upgrade-path: the Copilot fixture path is built under the throwaway home on every platform, with a guard against deleting outside it (win32 used the real APPDATA)
  • upgrade-path: unclassified provider differences now fail parity; a warm run with no pending-parse line passes
  • gnome: budget alert no longer applies the FX rate twice
  • mac: cost per edit and the menubar placeholder use the selected currency

Swift is untested locally; CI compiles it.

Windows proof for the Copilot fixture path (upgrade-path, windows-latest, both Node legs):

ok    corpus generated: {"claude":204,"codex":24,"gemini":1,"kiro":2,"dsh":1,"grok":9,"cursor":2,"copilot":80}
ok    baseline copilot: 80 calls, $3.620000, 875808/114055/325249 in/out/cacheRead
copilot   80 -> 80   1315112 -> 1066480   3.622030 -> 3.015976   changed by design (#1830)

… every platform

On win32 the fixture path came from the real APPDATA and the generator rmSync'd the user's real agent-traces.db. It now derives from the throwaway home and throws if the path resolves outside it. Checked by loading the generator with process.platform mocked to darwin, win32 and linux and APPDATA pointing elsewhere: all three wrote under the corpus home.
A provider outside the exact and changed lists only added a note, so parity could never fail for it. Differences now push a failure; identical stays a note. Checked with a two-dir fixture: differing zzz tokens print FAIL and parity reports 1 difference; identical dirs report parity ok.
The warm check was skipped when no 'parse workers=' line printed, but that line only prints when work is pending. No line is now a pass; a line with pending work still fails.
Cost was multiplied by the FX rate and then _fmt multiplied again. Before, EUR at 0.9 with 100 USD spent over a 50 USD limit: cost 90 -> _fmt 81.00 EUR / thresholdConverted 45 -> 40.50. After: 90.00 EUR / 45.00 EUR.
Both cost-per-edit labels printed a literal dollar sign with no FX rate; they now use the currency symbol and rate like the neighbouring values.
The no-data title showed a dollar sign under other currencies.
…no cache file changed, add vitest coverage

Helpers moved to scripts/upgrade-path/lib.mjs so they can be imported. The guard no longer breaks on drive or UNC roots. The warm check now compares mtime and size of every cache file before and after the warm run; the parse-workers line is secondary.
…s, allow dot-prefixed child names

Adds tests for each, plus a wiring test that runs gen-corpus under a mocked win32 platform and checks run.mjs uses the shared warm helpers.
…alog

The localization coverage test flagged the new interpolated literal. Adds the %@/edit key to every locale.
A warm run rewrites envelope.json and republishes the codex month index under a new name with identical content (known #1032 churn), so those two cannot be part of a no-change snapshot. Their content is already covered by the existing shard check (piece, key file and index bodies unchanged); every piece and key file is still content-hashed here.
#1830 f846b63: OTel input_tokens is cache-inclusive, cache reads carved out of inputTokens. inputTokens and cost may only drop; calls, output, reasoning, cache read and cache write stay exact. Tests: the corpus-shaped drop passes, a cost rise, input rise or cache-read change fails.
…readable cache entries

Seeded corpus is deterministic, so copilot must land on inputTokens 627176 and cost 3.015976 with every other field exact; anything else fails naming #1830. treeStats skips an unreadable entry or dangling symlink with a note. Index/envelope exclusion stays: a real re-parse rewrites piece files, which are hashed.
…runs on Windows

A bare drive-letter path is not a valid ESM specifier (ERR_UNSUPPORTED_ESM_URL_SCHEME), so the child died at startup on Windows. The test now uses pathToFileURL and reports status, stderr and the fixture path on failure.
The Windows upgrade-path job is the end-to-end check there; the child that builds the whole corpus exceeds the test timeout on that runner.
@iamtoruk
iamtoruk merged commit b823f98 into main Nov 7, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant