github mksglu/context-mode v1.0.158

latest releases: v1.0.162, v1.0.161, v1.0.160...
12 days ago

🧬 v1.0.158 — seed-parity envelope + classified events

7 commits since v1.0.157. Per-event enrichment lands the error/command/duration classifiers, plus a session-level rollup that gives analytics-opt-in users seed-parity coverage. Windows test hardening folded in to keep CI green across all 3 OSes.


✨ Highlights

  • 🧬 Seed-parity envelope (d4c3647) — every event now ships enriched with per-event facts (error category, file paths, session origin, blocker status) plus a session-level rollup snapshot (12 aggregate fields stamped onto every outgoing event). Analytics-opt-in users see seed-grade event payloads on every hook fire.
  • 🏷️ Error / command / duration classifiers (1d7affa) — classifyError 10-category lookup (auth, network, permission, not_found, syntax, …), Bash command verb classification, and PreToolUse-marker-based duration capture. Drives downstream pattern surfaces like error_recovery_lag and tool_latency_outlier.
  • 🪟 Windows test hardening (platform-bridge test suite ×4) — explicit APPDATA/XDG_CONFIG_HOME overrides, drop /bin/bash from execSync calls (Windows incompatibility), platform-aware config-path construction. Brings the bridge test suite to fully cross-platform green.

🐞 Bug Fixes

Hooks & enrichment

  • feat(hooks): seed-parity envelope — per-event enrichment + session rollup (d4c3647) — enrichEventForPlatform derives per-event facts; getSessionRollup aggregates 12 session-level signals; every outbound event payload merges both before crossing the bridge wire.

Classifiers (new)

  • feat(hooks): classifiers for error/command/duration metadata (1d7affa) — src/session/error-classifier.ts (new, 10 categories), deriveBashMetadata (canonical verbs), readLatencyMs (PreToolUse → PostToolUse marker delta). All ride existing event envelope.

Cross-platform tests

  • 4 platform-bridge test hardening commits — Windows runner was leaking real APPDATA into fake config paths, and execSync calls used /bin/bash shell explicitly (POSIX-only). Tests now use platform-aware paths via the runtime resolver, no explicit shell.

🎨 Features

  • SessionDB.getSessionRollup — 12-field aggregate (event_count, error_count, unique_files_edited, max_file_edits, has_commit, commit_message, total_duration_ms, session_origin, …) stamped on every outbound event so downstream analytics doesn't need to JOIN.
  • src/session/error-classifier.ts — 10-category error lookup mirrors seed data: auth, network, permission, not_found, syntax, dependency, timeout, crash, validation, unknown.
  • deriveBashMetadata — algorithmic canonical-verb extraction (no regex) from Bash commands. Powers bash_verb stamping.

⚡ Performance

  • Rollup computed once per batchgetSessionRollup runs as a single SQL aggregate over session_events and spreads onto every event in the batch via {...enriched, ...rollup}. No per-event SQL.

📦 Install / upgrade

# Fresh install (Claude Code plugin marketplace)
/plugin add https://github.com/mksglu/context-mode

# npm global
npm install -g context-mode@1.0.158

# Existing install — in-place upgrade
context-mode upgrade

Then restart your MCP session (or run /reload-plugins in Claude Code).

🔗 Full changelog

v1.0.157...v1.0.158


🤖 Release notes retroactively rewritten in v1.0.152 style — the original body's "broader session-level context" framing hid the actual shipping work (3 new classifier subsystems + cross-platform test green-up).

Don't miss a new context-mode release

NewReleases is sending notifications on new releases.