fix(graph): reuse local Cursor auto-sync path - #656
Merged
IvGolovach merged 1 commit intoJun 4, 2026
Conversation
Validation * Validation tier: Tier 2 - Narrow runtime change; graph now reuses the existing local-report Cursor sync helper and adds a CLI regression test for the fresh-cache warning path. * Red test: cargo test -p tokscale-cli test_graph_fresh_cursor_cache_skips_auto_sync_warning: FAIL before fix, exposed `Cursor sync failed; using cached data` despite fresh cache. * cargo test -p tokscale-cli test_graph_fresh_cursor_cache_skips_auto_sync_warning: PASS * cargo test -p tokscale-cli cursor_auto_sync: PASS * cargo test -p tokscale-cli graph_cursor: PASS * cargo fmt --all -- --check: PASS * git diff --check: PASS * git diff --cached --check: PASS * Version: PASS, bash scripts/check-version-coherence.sh * Ledger: not applicable - not required for selected validation tier/change family. * Additional lint: cargo clippy -p tokscale-cli -- -D warnings could not run; local cargo-clippy reported rustc 1.86.0 while dependencies require rustc 1.88.0+. * Not run: full test suite - not required for selected validation tier. Rollback * git revert HEAD
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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
tokscale graphreuse the same best-effort Cursor auto-sync helper used by the other local reports.Why
tokscale graphhad its own Cursor sync path instead of using the shared local-report helper. That made graph behavior drift from models/hourly/time reports: a fresh cache could still trigger a sync attempt and a runtime initialization failure could escape the best-effort path. Reusing the shared helper keeps graph consistent with the rest of the CLI and avoids turning optional Cursor refresh into a blocker for local graph generation.Diff scope
crates/tokscale-cli/src/main.rs: replaces the graph-specific Cursor sync block withauto_sync_cursor_for_local_report, preserving setup warnings and benchmark output semantics.crates/tokscale-cli/tests/cli_tests.rs: adds a graph regression for fresh Cursor cache behavior using an explicit Cursor client filter to keep the test focused on the sync path.Branch integrity
main.a86e688d620939d2c973c6d5625baa815ea223d7.0 behind / 1 aheadagainstorigin/main.a86e688d620939d2c973c6d5625baa815ea223d7.origin/mainis an ancestor of this branch.Commit integrity
8e0aecc2cc96e3a9e5369d335543829701c11b8b fix(graph): reuse local Cursor auto-sync path.Diff hygiene
git diff --name-status origin/main...HEAD: onlycrates/tokscale-cli/src/main.rsandcrates/tokscale-cli/tests/cli_tests.rschanged.git diff --check origin/main...HEAD: PASS, no output.Validation mode and proof
Mode 2 - narrow runtime change, because the diff changes one CLI report path and focused CLI tests without touching migrations, auth, deployment tooling, or external contracts.
cargo test -p tokscale-cli test_graph_fresh_cursor_cache_skips_auto_sync_warningfailed before the implementation by exposingCursor sync failed; using cached datadespite a fresh cache.cargo test -p tokscale-cli test_graph_fresh_cursor_cache_skips_auto_sync_warning: PASS, 1 test.cargo test -p tokscale-cli cursor_auto_sync: PASS, 5 tests.cargo test -p tokscale-cli graph_cursor: PASS, 1 test.cargo fmt --all -- --check: PASS, no output.bash scripts/check-version-coherence.sh: PASS,Version coherence OK: 3.0.0.git diff --check origin/main...HEAD: PASS, no output.cargo clippy -p tokscale-cli -- -D warningscould not run in this local environment because installed rustc is1.86.0while resolved dependencies require rustc1.88.0+.Required remote gates
Pending - GitHub Actions and mergeability checks will run after the PR is opened. Remote CI is expected to provide the final lint/build proof on its configured Rust toolchain.
Migration notes
Not applicable - no database migration changed.
Runtime safety
The change reuses an existing best-effort helper rather than introducing a new sync mechanism. Cursor sync remains optional, fresh caches short-circuit refresh, setup warnings are preserved, and graph generation still proceeds from local/cached data when sync is unavailable. No invariant regression introduced.
Documentation integrity
Not applicable - no docs, commands, or runbooks changed.
Rollback plan
Rollback: revert this PR. DB downgrade: not applicable. Data repair: not applicable. Operational caveats: reverting would restore graph-specific Cursor sync behavior that can warn or fail differently from other local reports.
Known residual risks
Remote CI and GitHub mergeability are pending until the PR is opened. Local clippy for
tokscale-clicould not run on this machine because the installed Rust compiler is older than the resolved dependency MSRV; targeted tests and formatting passed locally.Summary by cubic
Makes
tokscale graphreuse the shared best-effort Cursor auto-sync helper used by other local reports. This keeps behavior consistent, avoids unnecessary sync warnings on a fresh cache, and ensures graph generation never blocks on auto-sync.auto_sync_cursor_for_local_reportfor graph.Written for commit 8e0aecc. Summary will update on new commits.