Repository navigation
Conversation
Contributor
|
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change introduces critical configuration breakages by adding // comments that make .oxlintrc.json and turbo.json invalid JSON (and sets concurrency to a string), which would cause tooling/config loading to fail.
3 open issues
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
Adds support for saving a compressed event log for each user’s fastest qualifying Time 60 result, including shared event-log types/converters, client upload, server validation/storage, and an admin fetch endpoint.
Changes:
- Introduce new workspace package
@monkeytype/event-logwith v1/v2 formats, zod validation, and version conversion utilities. - Frontend encodes (gzip+base64) and uploads qualifying event logs and migrates engine/viewer typings to the shared package.
- Backend validates/optionally requires event logs, conditionally stores only the fastest per user, and exposes an admin read endpoint with lifecycle cleanup.
| File | Description |
|---|---|
| turbo.json | Adjusts Turborepo configuration, including concurrency settings. |
| pnpm-lock.yaml | Updates the lockfile to include the new workspace package and dependency changes. |
| packages/schemas/src/configuration.ts | Extends the configuration schema with results.savedEventLog settings. |
| packages/event-log/vitest.config.ts | Adds Vitest configuration for the new @monkeytype/event-log package. |
| packages/event-log/tsup.config.js | Adds tsup build configuration for the new event-log package. |
| packages/event-log/tsconfig.json | Adds TypeScript configuration for the new event-log package. |
| packages/event-log/src/v2/types.ts | Defines v2 stored-format TypeScript types for saved event logs. |
| packages/event-log/src/v2/schema.ts | Adds a zod schema and parsing/validation for v2 stored event logs. |
| packages/event-log/src/v2/index.ts | Exports the v2 API surface for the event-log package. |
| packages/event-log/src/v2/convert.ts | Implements conversion utilities between v1 and v2 event log formats. |
| packages/event-log/src/v1/index.ts | Defines the v1 runtime event log types used by the frontend/engine. |
| packages/event-log/src/util.ts | Adds shared helpers such as qualification logic and slot selection for saved logs. |
| packages/event-log/src/keycode.ts | Centralizes the Keycode type into the shared event-log package. |
| packages/event-log/src/input-type.ts | Centralizes input-type unions into the shared event-log package. |
| packages/event-log/src/events.ts | Moves shared event type definitions into the event-log package. |
| packages/event-log/src/convert.ts | Adds a version-agnostic conversion entry point for event logs. |
| packages/event-log/package.json | Creates the package manifest, exports, and scripts for @monkeytype/event-log. |
| packages/event-log/.oxlintrc.json | Adds an oxlint configuration file for the new package. |
| packages/event-log/__test__/v2.spec.ts | Adds tests covering v2 schema acceptance and rejection cases. |
| packages/event-log/__test__/util.spec.ts | Adds tests for saved-event-log qualification and helper utilities. |
| packages/event-log/__test__/tsconfig.json | Adds TypeScript configuration for the event-log package tests. |
| packages/event-log/__test__/fixture.ts | Adds a reusable fixture event log for package-level tests. |
| packages/event-log/__test__/convert.spec.ts | Adds tests for v1↔v2 conversion behavior and roundtrips. |
| packages/contracts/src/results.ts | Extends the results contract to support an optional eventLog on add-result and related statuses. |
| packages/contracts/src/admin.ts | Adds an admin contract for fetching a user’s saved event log. |
| packages/contracts/package.json | Updates contracts package dependencies to include @monkeytype/event-log. |
| GLOSSARY.md | Adds glossary definitions related to event logs and saved event logs. |
| frontend/vite-plugins/workspace-packages.ts | Improves workspace package resolution/aliasing for explicit subpath exports. |
| frontend/src/ts/utils/layout-key-codes.ts | Switches keycode typing/imports to use the shared event-log package. |
| frontend/src/ts/utils/key-converter.ts | Updates key conversion utilities to use the shared Keycode type. |
| frontend/src/ts/test/words-history.ts | Updates words history logic to use shared v1 event log types. |
| frontend/src/ts/test/test-logic.ts | Adds logic to attach/upload the saved event log on qualifying result saves and refactors failure handling. |
| frontend/src/ts/test/shift-tracker.ts | Updates shift tracking to use shared keycode/event-log types. |
| frontend/src/ts/test/saved-event-log.ts | Implements building a gzipped+base64 v2 event log payload for upload. |
| frontend/src/ts/test/result-save-failure.ts | Centralizes result-save failure mapping, retry behavior, and user-facing messaging. |
| frontend/src/ts/test/engine/result-data.ts | Updates engine result data typing to use the shared v1 event log types. |
| frontend/src/ts/test/engine/input-type.ts | Updates engine input-type definitions/imports to the shared package. |
| frontend/src/ts/test/engine/events/stats.ts | Refactors stats event handling to use shared event-log types. |
| frontend/src/ts/test/engine/events/live-cache.ts | Updates live-cache event handling to use shared event types. |
| frontend/src/ts/test/engine/events/helpers.ts | Updates event helpers to import shared event-log types/utilities. |
| frontend/src/ts/test/engine/events/data.ts | Refactors event data construction to use shared v1 event log types and events. |
| frontend/src/ts/states/monkey.ts | Updates state typings/imports to use shared keycode/event-log types. |
| frontend/src/ts/states/event-log-viewer.ts | Updates the event log viewer state to use shared event log types. |
| frontend/src/ts/input/helpers/word-navigation.ts | Updates word navigation helper types to use shared input-type unions. |
| frontend/src/ts/input/helpers/test-event-code.ts | Updates test event code helpers to use the shared Keycode type. |
| frontend/src/ts/input/handlers/keydown.ts | Updates keydown handler typing to use shared event-log types. |
| frontend/src/ts/input/handlers/insert-text.ts | Updates insert-text handling to use shared input-type unions. |
| frontend/src/ts/input/handlers/delete.ts | Updates delete handling to use shared input-type unions. |
| frontend/src/ts/constants/keys.ts | Adjusts key constants/types to rely on the shared Keycode type. |
| frontend/src/ts/components/pages/test/result/ResultWordsHistory.tsx | Updates result page words-history component typings to use shared event log types. |
| frontend/src/ts/components/pages/test/result/ResultMainStats.tsx | Updates result main stats component typings to use shared event log types. |
| frontend/src/ts/components/pages/test/result/ResultChart.tsx | Updates result chart component typings to use shared event log types. |
| frontend/src/ts/components/pages/test/result/replay.ts | Updates replay logic to use shared event log types and events. |
| frontend/src/ts/components/pages/event-log-viewer/EventLogViewerPage.tsx | Updates the event log viewer page to consume the shared event-log types/exports. |
| frontend/package.json | Adds @monkeytype/event-log as a frontend dependency. |
| frontend/__tests__/test/saved-event-log.spec.ts | Adds frontend tests for saved-event-log encoding/upload behavior. |
| frontend/__tests__/test/result-save-failure.spec.ts | Adds tests for centralized save-failure mapping and retry/message rules. |
| frontend/__tests__/test/engine/events/stats.spec.ts | Updates stats event tests to align with shared event-log types/imports. |
| frontend/__tests__/test/engine/events/helpers.spec.ts | Updates event helper tests for the shared event-log imports. |
| frontend/__tests__/test/engine/events/data.spec.ts | Updates event data tests to use the new shared event-log types. |
| frontend/__tests__/input/handlers/insert-text.spec.ts | Updates insert-text handler tests to use shared input-type unions. |
| docs/specs/saved-event-log/spec.md | Adds the specification for the saved event log feature, formats, and rollout plan. |
| backend/src/services/user-deletion.ts | Ensures saved event logs are deleted during account deletion workflows. |
| backend/src/server.ts | Adds server startup initialization for event log storage (including indexes). |
| backend/src/dal/event-logs.ts | Introduces a DAL for saving, retrieving, and deleting saved event logs with conditional upsert behavior. |
| backend/src/constants/monkey-status-codes.ts | Adds new status codes used for saved-event-log validation/requirements. |
| backend/src/constants/base-configuration.ts | Adds default configuration values and admin-facing config fields for saved event logs. |
| backend/src/api/routes/admin.ts | Wires a new admin route for fetching saved event logs by user id. |
| backend/src/api/controllers/user.ts | Adds saved event log cleanup to user reset/clear-PB flows. |
| backend/src/api/controllers/result.ts | Validates/requires event logs per configuration and stores the fastest qualifying saved log on result submission. |
| backend/src/api/controllers/admin.ts | Implements the admin endpoint to read, decompress, validate, and return saved event logs. |
| backend/src/anticheat/index.ts | Adds a validateEventLog entry point used by the saved-event-log flow. |
| backend/package.json | Adds @monkeytype/event-log as a backend dependency. |
| backend/__tests__/api/controllers/user.spec.ts | Updates controller tests to assert saved event logs are deleted in relevant user flows. |
| backend/__tests__/api/controllers/result.spec.ts | Adds tests covering result submission behavior with optional/required saved event logs. |
| backend/__tests__/api/controllers/admin.spec.ts | Adds tests for the admin saved-event-log fetch endpoint behavior and edge cases. |
| backend/__tests__/__integration__/dal/event-logs.spec.ts | Adds integration tests for the event logs DAL behavior (requires Docker). |
Review effort: Balanced
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
Comment on lines
+1
to
+7
| { | ||
| "ignorePatterns": ["node_modules", "dist", ".turbo"], | ||
| "extends": [ | ||
| "../oxlint-config/index.jsonc" | ||
| // "@monkeytype/oxlint-config" | ||
| ] | ||
| } |
Comment on lines
+5
to
+6
| // one persistent dev task per package, plus frontend and backend | ||
| "concurrency": "20", |
Comment on lines
+11
to
+16
| /** | ||
| * Same as V1, but ach event's `testMs` is replaced by `deltaCentiMs`, | ||
| * the integer time since the previous event in hundredths of a ms (the first | ||
| * one's since test start, so it can be negative). Repeating deltas compress far | ||
| * better than absolute timestamps. | ||
| */ |
Miodec
force-pushed
the
feat/saved-event-log
branch
from
December 1, 2026 19:38
17c5b90 to
2f8fb6e
Compare
Miodec
force-pushed
the
feat/saved-event-log
branch
from
December 1, 2026 19:54
2f8fb6e to
ac5326f
Compare
Adds the eligibility check to @monkeytype/event-log. Qualifying results upload a gzipped v2 log, validated by
anticheat and kept per user when faster. Admin endpoint reads it back.
Config results.savedEventLog {enabled, required, minWpm}.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Miodec) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Miodec
force-pushed
the
feat/saved-event-log
branch
from
December 1, 2026 22:14
ac5326f to
d11a0b2
Compare
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.


Summary
Stacked on #8644 (event log package + v2). Spec:
docs/specs/saved-event-log/spec.md. Keeps the saved event log of each user's fastest qualifying time 60 result (wpm ≥minWpm, PB-eligible, lazy allowed).packages/event-log/ +└── util.ts # qualifiesForSavedEventLog, slotConfig
results.savedEventLog {enabled, required, minWpm}, default{false, false, 130}. Rollout: anticheat readability checks →enabled→requiredonce clients have updated.Logs are deleted on account delete, reset, and clear PB.
Evidence
minWpm: 10,required: true): time 60 at 123 wpm → 200; admin endpoint → 1906 events, firsttestMs−4.5; event log viewer loads it.backend/__tests__/__integration__/dal/event-logs.spec.ts(needs Docker).Merge Danger
Door: two-way
Everything is behind
savedEventLog.enabled(off). NeweventLogscollection and index only.Blast Radius: results
Result saving touches the add-result controller; with config off the only change is the extra optional
eventLogbody field.🤖 Generated with Claude Code