Repository navigation
fix(usage): preserve project identity and qualify session counts - #1271
Merged
iamtoruk merged 6 commits intoSep 8, 2026
Merged
Conversation
Independent default app npmtest killed the chatty optimize child at 614ms because the 600ms idle timer started at spawn and the first progress byte waited on Node boot plus setInterval. Emit the first stderr byte immediately after boot, then ten 400ms ticks (result ticks 11) under a 2s silence budget. Node boot still counts; the larger smoke window absorbs it. Work still outlives a fixed total-runtime cap. Production already resets on every byte; timeout constants unchanged.
FORCE_COLOR=1 on agent/CI runners makes chalk paint table chrome with ESC. The C0/C1 assertion is a model-ID sanitization check, not a color check.
The regression spawned dist/cli.js, which is absent in a clean npm-test checkout. Drive the same end-to-end check through src/cli.ts and keep the fixture on owned temporary paths isolated from inherited provider dirs.
Same-package render-5 records omit the field, so empty identity-0 is served as unavailable. Bump STATUS_SNAPSHOT_RENDER_VERSION to 6. Daily and session caches stay put so unknown retained accounting remains a partial bound.
avs-io
marked this pull request as ready for review
September 7, 2026 18:09
…s, drop scratch tests
Member
|
Pushed df38e63 on top of the branch:
|
mathieustan
added a commit
to mathieustan/codeburn
that referenced
this pull request
Sep 11, 2026
A rooted pattern selects one project or nothing, so a typo does not fail: it quietly reports a total over a set the caller did not mean, which looks exactly like a correct answer. The run now says so on stderr. Hits are recorded as the rule matches and reported once at exit, rather than per call, because the live parse and the day cache are filtered separately: a pattern that names only a carried project matches in the second pass alone, and a per-call check would call it unmatched. A loose word never warns, since a substring that matches nothing is not evidence of a typo. The README gains the two rules that were not written down: an absolute POSIX path is case-sensitive (the identity rule from getagentseal#1271 applies to patterns too) while a Windows drive or UNC path folds case, and a path that names nothing is reported. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mathieustan
added a commit
to mathieustan/codeburn
that referenced
this pull request
Sep 11, 2026
A rooted pattern selects one project or nothing, so a typo does not fail: it reports a total over a set nobody asked for, which reads exactly like a correct answer. The run now says so on stderr, and the exit status is untouched. unmatchedRootedPatterns() tries each pattern on its own against the UNFILTERED project list, which is what keeps it honest. Judged inside filterProjectsByName instead, an earlier --project would mask a later one selecting the same project (include.some short-circuits), and an --exclude would be tested against what --project had already removed. The message is period-scoped, since a range-scoped parse is what was checked; the durable path additionally passes the carried days' project identities, so a pattern naming only an expired-source project stays silent. Nothing is reported under `serve`. That path routes process.stderr.write into the progress-frame emitter (runCaptured), so a warning would reach the desktop app as a scan-progress line. The rule itself is now compiled once per filter instead of being re-normalized per comparison, which matters because the day cache runs it for every project of every day and again per provider slice, and the include-then-exclude composition lives in one projectPassesFilters that both filterProjectsByName and the day-cache slice call. The README gains the two rules that were not written down: an absolute POSIX path is case-sensitive (the identity rule from getagentseal#1271 applies to patterns too) while a Windows drive or UNC path folds case, and a path matching nothing in the period is reported. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mathieustan
added a commit
to mathieustan/codeburn
that referenced
this pull request
Sep 11, 2026
filterProjectsByName matched every pattern as a raw substring, so --exclude /a/my-company also removed the sibling /a/my-company-kit, and no pattern the caller could type expressed "this project and not its neighbours". A rooted pattern (POSIX, Windows drive, UNC) now keys through normalizeAbsProjectPathKey, the helper getagentseal#1271 added for project identity, and matches the way isProxiedPath matches proxyPaths: equal to the project path, or a prefix of it on a path-segment boundary. Going through that helper keeps one identity rule in the parser: identified Windows paths casefold, POSIX case stays identity, and a Codex-style stripped absolute path ("root/vault") keys the same as the pattern "/root/vault" the user types. A pattern that is not rooted stays the loose substring people type on the command line, so --project my-company keeps covering my-company-kit and worktrees. The rule lives in one closure (makeProjectFilter) applied to the live parse and to the carry-forward day cache alike. The cache path had its own copy, lowercasing and substring-matching, so a filtered headline anchored today's live days while matching every cached day loosely: on a carried day split across /Users/gone/app ($30) and /Users/gone/app-kit ($70), --exclude /Users/gone/app returned 0 instead of 70, and --exclude /users/gone/app excluded both instead of neither. Both shapes are in tests/project-filter-durable-totals.test.ts, the suite that exists to pin that a filter selects the same projects whether it is resolved against a fresh parse or against the cache. The README gains the rules that were not written down: an absolute POSIX path is case-sensitive while a Windows drive or UNC path folds case, and a leading ~ is the shell's to expand. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
mathieustan
added a commit
to mathieustan/codeburn
that referenced
this pull request
Sep 11, 2026
filterProjectsByName matched every pattern as a raw substring, so --exclude /a/my-company also removed the sibling /a/my-company-kit, and no pattern the caller could type expressed "this project and not its neighbours". A rooted pattern (POSIX, Windows drive, UNC) now keys through normalizeAbsProjectPathKey, the helper getagentseal#1271 added for project identity, and matches the way isProxiedPath matches proxyPaths: equal to the project path, or a prefix of it on a path-segment boundary. Going through that helper keeps one identity rule in the parser: identified Windows paths casefold, POSIX case stays identity, and a Codex-style stripped absolute path ("root/vault") keys the same as the pattern "/root/vault" the user types. A pattern that is not rooted stays the loose substring people type on the command line, so --project my-company keeps covering my-company-kit and worktrees. The rule lives in one closure (makeProjectFilter) applied to the live parse and to the carry-forward day cache alike. The cache path had its own copy, lowercasing and substring-matching, so a filtered headline anchored today's live days while matching every cached day loosely: on a carried day split across /Users/gone/app ($30) and /Users/gone/app-kit ($70), --exclude /Users/gone/app returned 0 instead of 70, and --exclude /users/gone/app excluded both instead of neither. Both shapes are in tests/project-filter-durable-totals.test.ts, the suite that exists to pin that a filter selects the same projects whether it is resolved against a fresh parse or against the cache. The README gains the rules that were not written down: an absolute POSIX path is case-sensitive while a Windows drive or UNC path folds case, and a leading ~ is the shell's to expand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Project summaries can split the same working directory across providers or attach a legacy pathless summary to the wrong project. Session totals can also look exact when the available history cannot establish unique session identities.
This preserves working-directory identity through discovery, parsing, caching and aggregation. It coalesces the same directory across providers, keeps distinct POSIX paths separate, preserves Windows path normalization, leaves ambiguous legacy summaries unallocated, and sums project savings correctly. Project details and charts use the same identities, including collision-safe rows and accessible full-path labels.
Counts now say “At least N” when history only supports a lower bound; unsupported per-session averages are omitted. Combined-device views show “Session count unavailable” when identities cannot be reconciled. The native menu uses the same count qualification and exposes project expansion as an accessible button.
Review order: this branch includes the two test-only prerequisite commits from #1270 because the existing process watchdog smoke test reproduced its startup race during verification. Please review/land #1270 first; I will remove those duplicate prerequisite commits when rebasing. The project/counting change is the separate
f5fd47e8commit.Validation on current main (
0b1cf56f) plus this change:dist/cli.jsexisted: 3,856 passed, 5 skipped. The test now spawns the source CLI with an isolated temporary fixture and preserves the same assertions.Related to #1260. No dependency or workflow changes.
Upgrade handling: invalidate render-5 status snapshots written before the count metadata existed, including same-version rebuilds. Daily/session accounting caches are retained. Independently reproduced the old-snapshot failure, verified the correction with the unchanged reproduction, and passed 50 focused/adjacent CLI tests covering empty zero, nonempty totals, carried historical accounting and subsequent warm snapshot reuse.