From 79ae28248cc45ff5254f49974d65eb5ad6f0476b Mon Sep 17 00:00:00 2001 From: Mher Shahinyan Date: Fri, 6 Nov 2026 10:07:11 +0400 Subject: [PATCH 1/5] fix: quiet task-journal: strict recall, one-line session start, hooks in the plugin, cleanup-noise --- CHANGELOG.md | 45 + INSTALL.md | 44 +- README.md | 18 +- crates/tj-cli/src/main.rs | 1030 +++++++++++------- crates/tj-cli/tests/cli.rs | 1114 ++++++++++---------- crates/tj-core/src/classifier/heuristic.rs | 63 +- crates/tj-core/src/classifier/mod.rs | 61 ++ crates/tj-core/src/classifier/prompt.rs | 2 +- crates/tj-core/src/db.rs | 14 +- crates/tj-core/src/lib.rs | 1 + crates/tj-core/src/noise.rs | 102 ++ crates/tj-core/src/pack.rs | 14 +- crates/tj-core/src/recall.rs | 446 ++++---- crates/tj-core/src/session/extractor.rs | 41 +- crates/tj-mcp/src/main.rs | 110 +- plugin/hooks/hooks.json | 27 +- plugin/hooks/journal.test.ts | 73 +- plugin/hooks/journal.ts | 55 +- plugin/hooks/register.test.ts | 21 +- plugin/hooks/register.tsx | 41 +- plugin/skills/task-journal/SKILL.md | 6 +- 21 files changed, 1822 insertions(+), 1506 deletions(-) create mode 100644 crates/tj-core/src/noise.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index c0ade52..22a4d8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +Less noise in the agent's context. Measured on 300 sessions: push-recall was +added to tool results 13,696 times, almost never about the work at hand. + +### Changed +- **Push-recall only on a strong match with the session's task.** A hit must be a + rejection or decision the agent or the user recorded (classifier output is not + trusted) on the session's active task or a task of the same module, sharing a + file, issue or commit with the tool call, or at least three meaningful words — + one shared word used to be enough. Paths count as files, not words. No session + task, no recall. At most one hit, at most once per ten tool calls of a session + (`TJ_RECALL_EVERY`), never for the journal's own tools. It arrives as + `additionalContext` for every tool: the async hook's `updatedMCPToolOutput` + never reached the model and rewrote other servers' output. +- **The session start is one line.** It names the open task the session most + likely continues — its own after a resume or compaction, else the one the git + branch names (the branch, or an issue key in it), else the folder's latest — and + how to resume it. Resume packs, honesty scores and chronicle gaps are on request + (`task_pack`, `task-journal check`, `module_list`). +- **No chronicle line in replies or prompts.** `task_create` no longer carries a + `chronicle` field, and the mod no longer adds a chronicle reminder to prompts. +- **Short MCP instructions.** Seven plain lines on what to record and why, without + capitals or "NON-NEGOTIABLE". +- **Hooks ship with the plugin.** `plugin/hooks/hooks.json` wires the session start, + push-recall and model switches (`ingest-hook --from-plugin`, never the classifier + queue). `install-hooks` for Claude Code now only takes the hooks earlier versions + wrote out of `settings.json`, after copying it to + `settings.json.task-journal-backup-