#7716 "Prompt-hook context over 10,000 chars is cut to a 2KB preview…": the prompt payload now carries the top two rule lines, then the reply shape, then the rest. After a compaction every rule returns as a first mention, and before this change they pushed the shape out of the budget. Proven by a deliberate break (run 11251 failed the new test with assert [] == ['core']), reverted in 9de0e80.
#8249 "Acceptance — Grimoire's own suite reviewed with the new verdicts": redundant tests folded into their covering tests, and 6 deliberate breaks caught 19 of 19 behaviours.
Merges `dev` into `main` so the instance picks up:
- **#7716 "Prompt-hook context over 10,000 chars is cut to a 2KB preview…"**: the prompt payload now carries the top two rule lines, then the reply shape, then the rest. After a compaction every rule returns as a first mention, and before this change they pushed the shape out of the budget. Proven by a deliberate break (run 11251 failed the new test with `assert [] == ['core']`), reverted in 9de0e80.
- **#8249 "Acceptance — Grimoire's own suite reviewed with the new verdicts"**: redundant tests folded into their covering tests, and 6 deliberate breaks caught 19 of 19 behaviours.
- **#8292**: the detector fix (881e0fd).
- The claims hook test now skips through the shared `need_tools` helper.
CI on the head SHA 9de0e80: run 11254, green.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Review of the signature-flagged tests:
- Four route files each listed service names by hand and checked each takes
user_id. A new service without the caller passed them, and a renamed one
failed them. They become one test over services/{design_systems,systems,
rulebooks,snippets}.py: every public coroutine takes user_id, except eight
named with the reason each needs none, and an exception for a function that
is gone or now takes the caller fails too.
- test_routes_trash was four existence checks: blueprint name, registered,
handlers callable, the service surface, delete's parameter names. It
becomes one check that the three trash routes are on the app; what they do
is proven by test_services_trash and test_mcp_tool_trash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverted by the next commit. CI must go red on
test_service_user_id_contract[systems] and test_routes_trash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The caller-scoping property now covers services/family, family_adoption and
platforms, with the seven reads that need no caller named and why. The
hand-written platform list goes.
- The snippet location keys: one test checks every door (service, MCP tool,
web route) takes them; the route-only copy goes.
- The write-path hook: the payload-shape and skip-list tests searched the
shell script for strings. They now run the hook against a local listener and
check what it sends: the code from each of the four payload field names, and
nothing for a note, JSON or SVG while a YAML file and a .py are still asked about.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A refusal test raises, then checks nothing was written with
assert_not_called. The mock-only signal counted only plain asserts as outcome
checks, so 28 of the 44 tests it flagged in Grimoire's own suite were refusals.
pytest.raises and assertRaises now count.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverted by the next commit. CI must go red on
test_hook_asks_about_code_and_never_about_prose_or_data[README.md],
test_hook_reads_every_write_and_edit_payload_shape[Edit-new_str] and
test_every_public_service_takes_the_caller[platforms].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_write_path_trigger:
- the sync, reuse and rule dedup channels: two string searches become one
run of the hook twice in a session, checking each class of id comes back
on its own parameter;
- "stays a GET": one request to the prior-art route, with no body;
- the route/hook argument contract: the hook runs with every ledger it
keeps already holding something, and every key it sends must be read by
the route (read from the route's AST);
- the "names the shapes" string search goes: two runtime tests already check
the Write and the Edit cases.
- test_rule_moment_signal_hooks: the body the route must read is the body the
hook actually sent.
- test_task_claims: session start is run and must send source and session_id;
session end is run and releases on logout but not on /clear.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverted by the next commit. CI must go red on
test_session_end_releases_claims_but_not_on_clear[clear-False],
test_the_session_start_hook_sends_the_source_and_the_session and
test_each_class_of_hint_is_sent_back_on_its_own_channel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deliberate break 3 renamed exclude_sync_ids in the hook; the channel test
caught it, the argument contract test did not, because its run had no sync
ids to send.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_moment_delivery: the route/hook name check runs the hook with the
rule, opened and shape ledgers filled and checks every key it sends is read
by the route; "leaves Grimoire's own tools alone" runs it with a listed
Grimoire tool and sees no ask.
- test_gate_stop_hooks: the action hook run twice on one checkpoint rule
holds once, and books the rule on the session ledger after the stop. This
replaces two line-window checks in test_pre_act_checkpoint.
- The write hook never stopping a write: the two string guards (one per test
file) are one, which now also forbids the shared deny helper, the call the
old permissionDecision check could not see.
- route_query_args (tests/helpers.py) reads the query keys a route takes from
its AST, shared by both route/hook contract tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverted by the next commit. CI must go red on
test_grimoires_own_tools_are_left_to_their_responses,
test_the_route_reads_every_name_the_hook_sends and
test_a_checkpoint_holds_a_rule_once_and_books_it_as_surfaced_either_way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hook leaves a Grimoire tool before it reads the cached tool list, so the
right check is that no /moment ask is made; the test expected the list fetch.
Caught by CI on the reviewed tree (run 11237).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_prompt_boundary_filter: the prompt hook runs on a client-written turn
and sends nothing, and on a typed one and asks; was "the filter call sits
above the curl line" in the source.
- test_rule_usage_wiring: the write arm runs and is told it named rule 33,
then the tool arm in the same session must send 33 as already named; was
three string searches of each script for the ledger's path.
- test_reply_shape_turn: the hook half of the shape-ledger contract is the
runtime test already there; the remaining test checks the route half from
the route's AST.
- test_contract_around_the_change: its write-gate guard was a copy of
test_hook_never_returns_a_permission_decision, which now checks the same
two things.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverted by the next commit. CI must go red on
test_the_hook_spends_no_request_on_a_client_written_turn[client-written],
test_the_two_pre_tool_arms_share_one_session_rule_ledger and
test_the_route_reads_the_shape_ledger_the_hook_sends_and_returns_its_keys.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_mcp_tool_tasks_kind.py is folded into test_mcp_tool_tasks.py, the
tool's own file: the two "kind passes through" cases are one table, the two
list-filter cases one table; the minted_kind refusals move to the service's
kind tests (test_services_notes_task_kind.py).
- A fresh install reads as empty, not failed: three database tests each ran
retrieval_summary on an empty install and checked one block
(usage, judged, system_usage). One test now checks all three.
- test_reply_shapes::test_the_tool_is_registered_as_a_read: everything it
checked, test_moments::test_the_tools_are_registered_and_classified checks.
- test_shape_ledger::test_classify_and_list_are_mounted_as_mcp_tools: every
classified tool name must be a registered tool
(test_mcp_auth::test_every_registered_tool_is_classified_exactly_once).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_ledger_references_not_silence::test_the_sync_class_still_shows_only_once
checked a subset of test_write_path_trigger::test_sync_dedup_silences_a_sync_nudge_already_shown
(sync_note_ids empty, the id absent from the context); the covering test also
checks the semantic arm excludes it. Its reasoning (why the sync nudge is the
one class shown only once) moves into the covering test's docstring. The
helper's now-unused sync_exclude parameter goes with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_run_hook in test_task_claims.py repeated the shutil.which -> pytest.skip
guard that tests.helpers.need_tools exists to hold once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A compaction sweeps the rule ledger as well as the shape ledger. On the
next prompt every rule the prompt arm reaches and every rule mounted on
reply.report comes back as a first mention with its statement (about 750
characters each), and the route placed all of them ahead of the shape. Six
fill the 4,500-character default budget, so the 2,343-character core was
left out on exactly the turn it is meant to return in full. Seen in a real
session: after 9 of 10 compactions the first prompt payload carried no
reply shape at all.
The prompt payload is now ordered as milestone 639 designed it: the first
two rule lines, the reply shape, the remaining rule lines, the reply's
lessons, the carried note, the records menu. Rules that do not fit stay off
the ledger and arrive on a later call.
The lesson-placement test now pins the lesson after the shape (a lesson
binds nothing; the shape is what the reply is written to). New test: six
full-length rule lines and the real core at the default budget; the shape
is kept and the later rules wait.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Merges
devintomainso the instance picks up:assert [] == ['core']), reverted in9de0e80.881e0fd).need_toolshelper.CI on the head SHA
9de0e80: run 11254, green.🤖 Generated with Claude Code
Review of the signature-flagged tests: - Four route files each listed service names by hand and checked each takes user_id. A new service without the caller passed them, and a renamed one failed them. They become one test over services/{design_systems,systems, rulebooks,snippets}.py: every public coroutine takes user_id, except eight named with the reason each needs none, and an exception for a function that is gone or now takes the caller fails too. - test_routes_trash was four existence checks: blueprint name, registered, handlers callable, the service surface, delete's parameter names. It becomes one check that the three trash routes are on the app; what they do is proven by test_services_trash and test_mcp_tool_trash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>- test_write_path_trigger: - the sync, reuse and rule dedup channels: two string searches become one run of the hook twice in a session, checking each class of id comes back on its own parameter; - "stays a GET": one request to the prior-art route, with no body; - the route/hook argument contract: the hook runs with every ledger it keeps already holding something, and every key it sends must be read by the route (read from the route's AST); - the "names the shapes" string search goes: two runtime tests already check the Write and the Edit cases. - test_rule_moment_signal_hooks: the body the route must read is the body the hook actually sent. - test_task_claims: session start is run and must send source and session_id; session end is run and releases on logout but not on /clear. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>