Skip to content

docs: update README with lean-ctx rules and add new session metrics file - #9

Merged
yvgude merged 1 commit into
yvgude:mainfrom
TarekHamlaoui:docs/ctx-metrics-footer-mdc
Mar 27, 2026
Merged

docs: update README with lean-ctx rules and add new session metrics file#9
yvgude merged 1 commit into
yvgude:mainfrom
TarekHamlaoui:docs/ctx-metrics-footer-mdc

Conversation

@TarekHamlaoui

Copy link
Copy Markdown
Contributor

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.

@yvgude
yvgude merged commit eabba58 into yvgude:main 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>
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
- 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>
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.

2 participants