docs: update README with lean-ctx rules and add new session metrics file - #9
Merged
Merged
Conversation
yvgude
approved these changes
Mar 27, 2026
yvgude
pushed a commit
that referenced
this pull request
Mar 27, 2026
yvgude
pushed a commit
that referenced
this pull request
Mar 27, 2026
- fix(#7/#11): Windows shell flag — detect POSIX shells (Git Bash) and use -c instead of /C (via PR #8, now merged from GitHub) - fix(#10): excluded_commands config option now actually enforced in shell::exec() — commands matching entries bypass compression entirely - feat(#13): lean-ctx-on / lean-ctx-off / lean-ctx-status shell functions added to init --global hook (bash/zsh/fish); LEAN_CTX_ENABLED env var controls default state - feat(#14): slow query log — commands exceeding slow_command_threshold_ms (default 5s) logged to ~/.lean-ctx/slow-commands.log; new lean-ctx slow-log [list|clear] command - feat(#15): lean-ctx update — self-update from GitHub Releases; detects platform, downloads archive, safely replaces binary; lean-ctx update --check for version check only Also synced docs PR #9 (README + session metrics mdc example).
yvgude
pushed a commit
that referenced
this pull request
Mar 29, 2026
- New mypy.rs pattern module: compresses mypy type-checker output (error grouping by code, severity counts, file counts) - Direct pytest routing in try_specific_pattern (was only caught by generic test.rs fallback before) - 7 new tests (5 mypy unit + 2 routing) Relates to #9 Made-with: Cursor
yvgude
pushed a commit
that referenced
this pull request
Jun 21, 2026
Wire ten neuroscience/physics-motivated mechanisms to real hot-path call sites, deterministic by default (Rule #498 / prompt-cache intact), and make them provable via a new `lean-ctx introspect cognition` activity registry. - Phase 0: introspect registry + CLI + doctor; is_stochastic_enabled() gate - #2 time-variant Phi (EMA re-read); #1 Ebbinghaus decay + spacing effect - #3 Hebbian eviction + CLS consolidation (previously dead code, now wired) - #5 integration-aware Phi (greedy MMR) + content-based dedup fix - #6 global-workspace ignition; #4 learned field weights (bandit, argmax default) - #7 idle replay (sharp-wave-ripple); #9 FEP prefetch (active inference) - #8 immune detector vs context poisoning (coupled to workspace trust) - #10 QUBO selection spike behind LEAN_CTX_EXPERIMENTAL_QUBO (greedy stays default) Stochastic exploration gated behind LEAN_CTX_STOCHASTIC. Docs + CHANGELOG added. GitLab: epic root/lean-ctx#771 + foundation #772 + features #773-#782. 5653 lib tests green, zero clippy warnings. Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
- fix(#7/#11): Windows shell flag — detect POSIX shells (Git Bash) and use -c instead of /C (via PR #8, now merged from GitHub) - fix(#10): excluded_commands config option now actually enforced in shell::exec() — commands matching entries bypass compression entirely - feat(#13): lean-ctx-on / lean-ctx-off / lean-ctx-status shell functions added to init --global hook (bash/zsh/fish); LEAN_CTX_ENABLED env var controls default state - feat(#14): slow query log — commands exceeding slow_command_threshold_ms (default 5s) logged to ~/.lean-ctx/slow-commands.log; new lean-ctx slow-log [list|clear] command - feat(#15): lean-ctx update — self-update from GitHub Releases; detects platform, downloads archive, safely replaces binary; lean-ctx update --check for version check only Also synced docs PR #9 (README + session metrics mdc example).
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
- New mypy.rs pattern module: compresses mypy type-checker output (error grouping by code, severity counts, file counts) - Direct pytest routing in try_specific_pattern (was only caught by generic test.rs fallback before) - 7 new tests (5 mypy unit + 2 routing) Relates to #9 Made-with: Cursor
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
- fix(#7/#11): Windows shell flag — detect POSIX shells (Git Bash) and use -c instead of /C (via PR #8, now merged from GitHub) - fix(#10): excluded_commands config option now actually enforced in shell::exec() — commands matching entries bypass compression entirely - feat(#13): lean-ctx-on / lean-ctx-off / lean-ctx-status shell functions added to init --global hook (bash/zsh/fish); LEAN_CTX_ENABLED env var controls default state - feat(#14): slow query log — commands exceeding slow_command_threshold_ms (default 5s) logged to ~/.lean-ctx/slow-commands.log; new lean-ctx slow-log [list|clear] command - feat(#15): lean-ctx update — self-update from GitHub Releases; detects platform, downloads archive, safely replaces binary; lean-ctx update --check for version check only Also synced docs PR #9 (README + session metrics mdc example).
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
- New mypy.rs pattern module: compresses mypy type-checker output (error grouping by code, severity counts, file counts) - Direct pytest routing in try_specific_pattern (was only caught by generic test.rs fallback before) - 7 new tests (5 mypy unit + 2 routing) Relates to #9 Made-with: Cursor
yvgude
pushed a commit
that referenced
this pull request
Jul 29, 2026
Wire ten neuroscience/physics-motivated mechanisms to real hot-path call sites, deterministic by default (Rule #498 / prompt-cache intact), and make them provable via a new `lean-ctx introspect cognition` activity registry. - Phase 0: introspect registry + CLI + doctor; is_stochastic_enabled() gate - #2 time-variant Phi (EMA re-read); #1 Ebbinghaus decay + spacing effect - #3 Hebbian eviction + CLS consolidation (previously dead code, now wired) - #5 integration-aware Phi (greedy MMR) + content-based dedup fix - #6 global-workspace ignition; #4 learned field weights (bandit, argmax default) - #7 idle replay (sharp-wave-ripple); #9 FEP prefetch (active inference) - #8 immune detector vs context poisoning (coupled to workspace trust) - #10 QUBO selection spike behind LEAN_CTX_EXPERIMENTAL_QUBO (greedy stays default) Stochastic exploration gated behind LEAN_CTX_STOCHASTIC. Docs + CHANGELOG added. GitLab: epic root/lean-ctx#771 + foundation #772 + features #773-#782. 5653 lib tests green, zero clippy warnings. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
PR description
Add a Cursor rule example that asks the model to call ctx_metrics after substantive replies and append a short token / cost footer for the current MCP session (not full Cursor billing).
Changes
Add rust/examples/lean-ctx-session-metrics.mdc (and keep it aligned with the project copy under .cursor/rules/ where applicable).
Makes it obvious how to surface live lean-ctx MCP savings in the agent transcript and reduces confusion about what the numbers represent.
Notes for reviewers
Footer numbers are lean-ctx MCP tool totals for the server session; they do not replace Cursor’s full usage accounting.