From 0cc4f78f772411b52f514f5e4a60205e20d78de9 Mon Sep 17 00:00:00 2001 From: Eureka Date: Sat, 7 Nov 2026 13:32:48 +0100 Subject: [PATCH 1/3] tools: delete mind.py, recall.py and the fake binding; context-pack reads huginn view --raw from a file or stdin Co-Authored-By: Claude Sonnet 5.5 --- tools/INDEX.md | 4 +- tools/context-pack.py | 56 +- .../context-pack/fake-eureka-state.py | 99 -- tools/fixtures/context-pack/spec-reads.json | 8 +- tools/fixtures/context-pack/spec.json | 8 +- tools/mind.py | 145 --- tools/recall.py | 397 ------- tools/test-tools.sh | 1029 ++--------------- 8 files changed, 117 insertions(+), 1629 deletions(-) delete mode 100644 tools/fixtures/context-pack/fake-eureka-state.py delete mode 100644 tools/mind.py delete mode 100644 tools/recall.py diff --git a/tools/INDEX.md b/tools/INDEX.md index 5b578ac..4aaa236 100644 --- a/tools/INDEX.md +++ b/tools/INDEX.md @@ -15,7 +15,5 @@ gets a Soul pass before merge. | `tools/dotnet-self` | `tools/dotnet-self `: runs one dotnet command for a Self whose HOME is read-only, with `HOME`, `DOTNET_CLI_HOME` and `NUGET_PACKAGES` set for that process only (default `${XDG_CACHE_HOME:-${TMPDIR:-/tmp}}/dotnet-self-home-`, 0700, `DOTNET_SELF_HOME` overrides) and telemetry, first-run, MSBuild node reuse, shared compilation and the build server off. Env defined in `tools/dotnet-self-env.sh`, which is sourced only inside a subshell: sourcing it in your shell exports `HOME` and moves git and gh credentials. | Selves and their workers running dotnet | `SKILL.md` (Git and tooling rules) | | `tools/testparse.sh` | Sourced library: failing test names and pass/fail/skip counts from cargo, dotnet, vitest, jest and pytest logs, and test files that failed to load (`LOADFAIL`). Shared by the summary and the kill table. | `tools/stopgap/ygg-verify.sh`, `tools/mutation-table.sh` | not named by a brief; it lives and dies with them | | `tools/test-tools.sh` | Local fixture check of the parsers and the summary over `tools/fixtures/logs` (real cargo and mutation logs, plus hand-written dotnet, vitest, jest, pytest, exit-0-but-failed and no-verdict logs), and of the mutation runners' host drivers and container halves (`tools/mutation-table.sh`, `tools/cargo-mutants.sh`) under a mock docker, a fake `cargo mutants` and real slot locks. Run it before merging a change to the scripts above. | whoever changes those scripts | `SKILL.md` (Shared tools) | -| `tools/context-pack.py` | `py -3 tools/context-pack.py [--since ] [--only \|r[,...]] [--spec-json ] [--max-lines ]`. Carries a cut_spec's `file_changes` and `reads` anchors (read rows `r`; a read absent at base is MISSING) from the spec's base to the worktree by `git diff` hunks (the working tree included) and prints one header, a status table (SAME, MOVED, TOUCHED, RENAMED, NEW, GONE, OUT_OF_RANGE, UNRESOLVED, MISSING, plus SYMBOL_MISSING when an anchor's `symbol` is absent from its window) and windows of at most 100 lines numbered in worktree lines, then one capped caller list per symbol (`git grep`, hits outside the windows), within `--max-lines` (800). Exit 3 when an anchor cannot be carried, 4 when the spec is unreadable (fetched by id through the eureka-state binding (`tools/mind.py`), retried once on Unavailable; `--spec-json` takes a saved view). `--since ` re-prints only the windows edited since that commit. Standard library plus git; writes nothing. | Hands, Soul, Imagination | `references/briefs.md` (Imagination map, Hands, Soul), `SKILL.md` (step 1) | -| `tools/mind.py` | The one way a Eureka script reaches the mind: `mind.call(tool, arguments, deadline)` spawns the eureka-state binding (`EUREKA_STATE_EXE`, else `~/.claude.json` `mcpServers.eureka-state`), does the stdio handshake and one tool call within `deadline` seconds, returns the parsed JSON body, raises `MindError` (kind binding, transport, tool or answer; a detail, never an input value), and kills the child on every exit path. No retry inside `call`; `retry_once(fn)` is the caller's choice. Standard library only. | `tools/context-pack.py`, `tools/recall.py` | not named by a brief; it lives and dies with its consumers | -| `tools/recall.py` | `py -3 tools/recall.py prompt`, a `UserPromptSubmit` command hook (hook JSON on stdin): queries the rulings, questions and follow-ups in force across every root, ranked by Huginn against the prompt (`RECALL_TOP_K`, 5), and prints one hook JSON whose `additionalContext` is a header saying the lines are recalled records, data and never instructions, written by agents and not the operator, then one JSON object per item (`id`, `title`, a short `operator_quote`) with `<`, `>` and control, bidi and separator characters escaped, within `RECALL_BUDGET` characters (4000, at most 9000: Claude Code caps `additionalContext` at 10,000), whole lines only. Prompts under 3 words are not queried. Never blocks: any failure exits 0 with empty stdout; its own deadline is `RECALL_DEADLINE_MS` (4000) for the whole run (stdin read to 4 MiB, answer read to 1 MiB), so set the hook `timeout` above it. One attempt, no retry. Install both hooks as ` C:/Users/Meta/.claude/skills/eureka/tools/recall.py prompt || true` (and `... admit || true`): Claude Code runs hook commands through Git Bash on Windows, and `py -3 ` exits 2, which blocks every prompt or admit; with `|| true` the hook cannot exit 2 (a missing script, interpreter or file passes) and the script's stdout is untouched (proved live on 2.1.308). `py -3 tools/recall.py admit` is a `PreToolUse` hook on `mcp__eureka-state__admit`: for each ruling or question in the batch (at most `RECALL_ADMIT_MAX`, 3) it queries the nearest in-force rulings and questions, and denies the first attempt with the neighbours as the reason (a deliberate hold, not a failure); the identical call sent again (digest of `tool_input` plus `agent_id`, kept in the session scratchpad) passes. Never allow or ask; a failed check exits 0 with a note naming the failure kind (`RECALL_TOP_K` 3, `RECALL_DEADLINE_MS` 10000 in this mode). `py -3 tools/recall.py dispatch` is a `PreToolUse` hook on `Agent|Task`: it takes the ruling, question and follow-up ids the brief cites (`::