feat: record a per-machine run ordinal and score delta for evlog map - #565
Closed
evlogai[bot] wants to merge 5 commits into
Closed
feat: record a per-machine run ordinal and score delta for evlog map#565evlogai[bot] wants to merge 5 commits into
evlogai[bot] wants to merge 5 commits into
Conversation
evlog map now records mapRunOrdinal and mapScoreDelta: the run's place in the local sequence and the signed score change since the previous map run on that machine. The counter lives in the CLI's telemetry data directory, keyed by command name only, so it is per machine rather than per project; there is no per-project history to protect anyone from the trade that a per-project trajectory would require. The delta is absent on the first run, both fields are omitted in ephemeral CI and while telemetry is off, and telemetry disable purges the counter so a re-enable starts fresh. The run-state facility lands in @evlog/telemetry as advanceRunState so the consent, ephemeral-CI and opt-out rules are shared with the machine id.
🦋 Changeset detectedLatest commit: 5e945e2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
4 Skipped Deployments
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
commit: |
The counter tests simulate a stable machine, but on a GitHub Actions runner std-env reports CI and the machine id is unset, so the counter is correctly treated as ephemeral and every assertion got undefined. Pinning EVLOG_TELEMETRY_MACHINE_ID makes the stable-machine path deterministic in any environment.
Main gained the per-kind and per-sensitivity map telemetry (EVL-286) while this branch was in flight, plus a docs and dependency change. The merge keeps both features: run-state fields and kind/sensitivity tallies coexist in mapTelemetryFields, the docs page documents both, and the ingest allowlist carries both key sets.
Main moved again (evi sandbox-path and parent-span fixes). The merge is clean: those commits only touch apps/evi, which the map-telemetry change does not overlap with, so the PR stays conflict-free and up to date.
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.
Closes EVL-285.
What
evlog maptoday records the shape of a single scan. This adds the two numbers that turn those isolated snapshots into a trajectory question: does runningevlog mapmake scores go up?mapRunOrdinal— monotonic counter, incremented on every localmaprunmapScoreDelta— signed score change against the previous run on this machine, absent on the first runThe state lives in the CLI's telemetry data directory (
~/.config/evlog-cli/telemetry/run-state.json), keyed by command name only. It is per machine, not per project: nothing about the project, git remote or path is hashed into it (a remote-URL hash would be trivially re-identifiable). The counter resets onevlog telemetry disable, is never written while telemetry is off, and is omitted in ephemeral CI where the machine id is already absent.Both are numbers, so they pass the value-shape rule without any CLI allowlist change.
Implementation
packages/telemetry: newadvanceRunState/purgeRunStateinsrc/run-state.ts. It shares the consent check andisEphemeralCIpredicate (now exported) with the machine id, so the two omissions stay in lockstep.telemetry disablenow purges this state viapurgeTelemetryState(renamed frompurgeOutbox).packages/cli:recordMapRuncallsadvanceRunStateand emits the two fields;mapTelemetryFieldNamesnow covers them.apps/telemetry: registers the two keys in the ingest allowlist. Unknown keys are dropped at ingest, and the repo's guard test (allowed-tools.test.ts→mapTelemetryFieldNames()) was the thing that would have caught a missing entry, so both went in together.apps/docs:cli/telemetrydocuments the fields and says plainly that the counter is per machine.Checks
@evlog/telemetrytests: 69 passed (incl. newrun-state.test.tsandrun-state.ci.test.ts)@evlog/clitests: 454 passedapps/telemetrytests: 190 passed (incl. the allowlist guard)eslintclean onpackages/telemetry,packages/cli,apps/telemetrytsdownbuild (the typecheck path for both packages) passesManual verification
Ran the real CLI against a fixture with a temp config dir and
EVLOG_TELEMETRY_DEBUG=1:mapRunOrdinal: 1, no deltamapRunOrdinal: 2,mapScoreDelta: 0EVLOG_TELEMETRY=0→ no fields, norun-state.jsonevlog telemetry disable→ state file removed; re-enable + next run → ordinal 1 again