Skip to content

fix(core): keep overflow telemetry live and stat mentions asynchronously - #83

Merged
GeekCmore merged 2 commits into
mainfrom
fix/perf-hotpaths-a
Sep 28, 2026
Merged

GeekCmore merged 2 commits into
mainfrom
fix/perf-hotpaths-a

Conversation

@GeekCmore

Copy link
Copy Markdown
Collaborator

Summary

Part of #72 — the two low-risk findings (UX-35 rotation and the UX-33 statSync half). The rest of #72 is intentionally deferred.

  • UX-35: createFileOverflowSink no longer fuses at maxEntries. Once the dedupe window fills it resets, so a width regression that surfaces late in a long session is still recorded. maxEntries keeps its default (200); values below 1 behave as 1. The JSONL schema is unchanged and writes stay synchronous + never-throwing (async batching is out of scope here).
  • UX-33 (partial): listDirectoryMentions resolves symlinks with await stat instead of statSync, matching the sibling scanner and keeping the autocomplete task chain unblocked. Behavior is unchanged — directory symlinks stay directories, broken symlinks stay file candidates.

Changes

  • packages/mayfly/src/core/frame-clamp.ts — dedupe-window rotation + JSDoc contract update.
  • packages/mayfly/src/interaction/file-mention.ts — async stat; drop the now-unused statSync import.
  • packages/mayfly/tests/core/frame-clamp.spec.ts — rotation and sub-1 window tests.

Verification

  • pnpm run verify:changed — passed: 2433 tests passed / 7 skipped; frame-clamp.ts and file-mention.ts at 100% statements/branches/functions/lines.
  • oxlint on the changed files — 0 warnings / 0 errors.
  • Manual acceptance: PROFILE=mayfly-perf-a script/install-dev.sh then dsh --profile mayfly-perf-a — passed (symlink mention drill-down, narrow-width, large-panel arrow navigation).

Deferred

UX-33 candidate caching/TTL, UX-34 control-tree memoization, UX-36 status throttling, async/batched overflow writes, and the audit-doc merge (#77).

- createFileOverflowSink now rotates its dedupe window instead of fusing at
  maxEntries, so a width regression surfacing late in a long session is still
  recorded (values below 1 behave as 1; default 200 unchanged).
- listDirectoryMentions resolves symlinks with await stat instead of statSync,
  matching the sibling scanner and keeping the autocomplete chain unblocked.
- frame-clamp spec covers the rotation and the sub-1 window contract.
The dedupe window keeps late width violations recording, but a changing
over-wide row (spinner, elapsed time, progress) is distinct every frame,
so the log still grew one synchronous write per frame with no bound. Add
maxLines (default 1000): once the total budget is spent the sink stays
silent, so the backstop cannot flood the disk or the render path.
@GeekCmore
GeekCmore merged commit 9065016 into main Sep 28, 2026
7 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