Skip to content

grok: first-class session organ, the same gap Codex closed - #11

Open
Xn4m3d wants to merge 1 commit into
AnubisQuantumCipher:mainfrom
Xn4m3d:grok-session-organ
Open

Xn4m3d wants to merge 1 commit into
AnubisQuantumCipher:mainfrom
Xn4m3d:grok-session-organ

Conversation

@Xn4m3d

@Xn4m3d Xn4m3d commented Sep 9, 2026

Copy link
Copy Markdown

MCP already listed Grok as a client (grok mcp add sia). Session evidence did not. This is the Codex coverage gap, left open for the third named harness.

sense_grok is an optional organ (activates when ~/.grok/sessions exists). It tails <encoded-cwd>/<session-id>/updates.jsonl — metadata only (existence, growth, resume, activity). Payloads are never opened. Sibling jsonl files in the same directory are not a second entity.

Tests: payload-unopened; restored nested cwd cannot authorize prune; yanked-then-restored cwd does not false-prune; clean paginated generation prunes stale marks. Facade export pin updated. sia bench probe when live.

Disable: senses.disable: ["grok"].

Local verification before opening: python3 -m unittest discover -s tests -v with PYTHONWARNINGS=error::ResourceWarning — 929 tests OK; py_compile and git diff --check clean.

Summary by CodeRabbit

  • New Features
    • Added optional monitoring for Grok agent sessions, tracking session existence and activity without reading transcript contents.
    • Added Grok session checks to the benchmarking command when available.
    • Added support for disabling Grok monitoring through configuration.
  • Documentation
    • Documented optional Grok and Codex session monitoring and its privacy-preserving metadata-only behavior.
    • Updated supported organ evidence names to include Grok and agents.
  • Bug Fixes
    • Improved session detection and cleanup across renamed, restored, nested, and paginated session data.

MCP already listed Grok as a client. Session evidence did not. Optional
organ sense_grok watches ~/.grok/sessions/<cwd>/<id>/updates.jsonl —
metadata only, never payloads, one entity per session.

Tests match Claude/Codex tree discipline (privacy, nested restore prune,
rename, durable-mark prune) plus the Grok sibling-jsonl invariant.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d376b665-e72e-473a-9c8c-8e597ee819eb

📥 Commits

Reviewing files that changed from the base of the PR and between 8a624ef and aec6367.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • bin/siabench.py
  • bin/sialib.py
  • bin/siasenses.py
  • bin/siatakes.py
  • docs/MANUAL.md
  • tests/test_release.py
  • tests/test_sia.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Adds an optional sense_grok organ that detects Grok sessions from bounded filesystem metadata. It integrates the organ with sensing, benchmarking, evidence collection, façade exports, documentation, and tests for payload isolation and generation-based pruning.

Changes

Grok session sensing

Layer / File(s) Summary
Grok session sensor and validation
bin/siasenses.py, tests/test_sia.py
sense_grok scans only updates.jsonl metadata, treats each session directory as one entity, emits session activity events, and handles generation changes and pruning. Tests cover payload isolation, renamed or restored paths, pagination, and bounded enumeration.
Registry and evidence integration
bin/sialib.py, bin/siabench.py, bin/siatakes.py, tests/test_release.py
The Grok organ is registered, included in daemon sensing, exposed in benchmark questions and evidence collection, and added to the façade export contract.
Release and operator documentation
CHANGELOG.md, docs/MANUAL.md
Documentation describes Grok session activation, disablement, metadata-only sensing, and related command integrations.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to aec63

The Grok session sensor is wired through its optional organ and evidence integrations, while preserving metadata-only collection and bounded pruning behavior. No merge-blocking risk was identified.

Sequence Diagram(s)

sequenceDiagram
  participant Daemon
  participant sense_grok
  participant GrokSessions
  participant Cursor
  Daemon->>sense_grok: run registered Grok sensor
  sense_grok->>GrokSessions: scan bounded session metadata
  GrokSessions-->>sense_grok: return updates.jsonl file metadata
  sense_grok->>Cursor: record session token and generation
  sense_grok-->>Daemon: emit session, resume, activity, or prune events
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding a first-class Grok session organ. The Codex comparison provides relevant context without making the title misleading.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant