rename(547): the plugin is grimoire — manifest, MCP key, hooks, env, skills
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / integration (push) Successful in 1m2s
CI & Build / Python tests (push) Failing after 1m26s
CI & Build / Build & push image (push) Skipped
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 14s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / integration (push) Successful in 1m2s
CI & Build / Python tests (push) Failing after 1m26s
CI & Build / Build & push image (push) Skipped
Step 3 of the Scribe -> Grimoire rename. - Plugin `grimoire` in marketplace `grimoire-plugin`, MCP server key `grimoire`, so tools reach a session as mcp__plugin_grimoire_grimoire__*. - hooks/scribe_* -> hooks/grimoire_*, their shell functions and the TMPDIR ledgers with them; SCRIBE_URL / SCRIBE_TOKEN / SCRIBE_HOOK_DIR / SCRIBE_LEDGER_DIRS -> GRIMOIRE_*; the project marker is `.grimoire`. - skills/using-scribe -> using-grimoire, /grimoire:sync, stored processes arrive as grimoire-proc-<slug>; moment_actions names them the same way. - Migration 0124 rewrites stored skill names (rule_moments, rule_moment_judgments, moment_mappings) from scribe:/scribe-proc- to grimoire:/grimoire-proc-, so a rule mounted on a skill keeps firing. - Settings' install commands and MCP-only defaults, the docs and the tests follow. - scripts/check_plugin.py drops the smoke event for a report-check hook that has no file in plugin/hooks. Kept on purpose: the secret-sealing label, and the names that let backups written as Scribe restore and be counted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ touch gets one. The tests read the constant out of the shell and assert the
|
||||
PROPERTY around it, so any TTL works and only a broken comparison fails.
|
||||
|
||||
Runs the real shell, like `test_session_context_ledger` and the after-write
|
||||
hook's tests, and deliberately with no SCRIBE_URL/SCRIBE_TOKEN: ageing is
|
||||
hook's tests, and deliberately with no GRIMOIRE_URL/GRIMOIRE_TOKEN: ageing is
|
||||
local, keyless and networkless, and must work on an instance that is
|
||||
unreachable or was never configured.
|
||||
"""
|
||||
@@ -33,23 +33,23 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
PLUGIN = Path(__file__).resolve().parents[1] / "plugin" / "hooks"
|
||||
DEFS = PLUGIN / "scribe_defs.sh"
|
||||
DEFS = PLUGIN / "grimoire_defs.sh"
|
||||
|
||||
|
||||
def _ttl() -> int:
|
||||
"""The TTL as the shell defines it — never a copy of the number."""
|
||||
m = re.search(r"^_SCRIBE_RULE_TTL=(\d+)", DEFS.read_text(), re.M)
|
||||
assert m, "_SCRIBE_RULE_TTL is gone from scribe_defs.sh"
|
||||
m = re.search(r"^_GRIMOIRE_RULE_TTL=(\d+)", DEFS.read_text(), re.M)
|
||||
assert m, "_GRIMOIRE_RULE_TTL is gone from grimoire_defs.sh"
|
||||
return int(m.group(1))
|
||||
|
||||
|
||||
def _live(ledger: Path) -> list[str]:
|
||||
"""`scribe_rules_live` against a real ledger, as the hooks call it."""
|
||||
"""`grimoire_rules_live` against a real ledger, as the hooks call it."""
|
||||
for tool in ("bash", "awk"):
|
||||
if shutil.which(tool) is None:
|
||||
pytest.skip(f"hook runtime tool {tool!r} not installed")
|
||||
proc = subprocess.run(
|
||||
["bash", "-c", f'. "{DEFS}"; scribe_rules_live "{ledger}"'],
|
||||
["bash", "-c", f'. "{DEFS}"; grimoire_rules_live "{ledger}"'],
|
||||
capture_output=True, text=True, timeout=30,
|
||||
env={"PATH": os.environ["PATH"]}, # no credentials — see the docstring
|
||||
)
|
||||
@@ -119,7 +119,7 @@ def test_a_repeatedly_surfaced_rule_appears_once_in_the_exclusion_list(tmp_path)
|
||||
f"exclusion list, in first-seen order"
|
||||
)
|
||||
raw = subprocess.run(
|
||||
["bash", "-c", f'. "{DEFS}"; scribe_rules_live "{ledger}"'],
|
||||
["bash", "-c", f'. "{DEFS}"; grimoire_rules_live "{ledger}"'],
|
||||
capture_output=True, text=True, timeout=30,
|
||||
env={"PATH": os.environ["PATH"]},
|
||||
).stdout.strip()
|
||||
@@ -142,7 +142,7 @@ def test_a_rule_that_ages_out_and_returns_does_not_ping_pong(tmp_path):
|
||||
_write_ledger(ledger, [("156", ttl + 600)])
|
||||
|
||||
subprocess.run(
|
||||
["bash", "-c", f'. "{DEFS}"; printf \'156\\n\' | scribe_rules_append "{ledger}"'],
|
||||
["bash", "-c", f'. "{DEFS}"; printf \'156\\n\' | grimoire_rules_append "{ledger}"'],
|
||||
capture_output=True, text=True, timeout=30,
|
||||
env={"PATH": os.environ["PATH"]},
|
||||
)
|
||||
@@ -198,7 +198,7 @@ def test_both_hooks_read_the_ledger_through_the_shared_helper():
|
||||
stops calling the helper but still ages correctly some other way is not a
|
||||
defect, and a rename of the helper is not one either.
|
||||
"""
|
||||
for name in ("scribe_prior_art.sh", "scribe_tool_rules.sh"):
|
||||
for name in ("grimoire_prior_art.sh", "grimoire_tool_rules.sh"):
|
||||
src = (PLUGIN / name).read_text()
|
||||
rule_reads = [
|
||||
ln for ln in src.splitlines()
|
||||
@@ -210,7 +210,7 @@ def test_both_hooks_read_the_ledger_through_the_shared_helper():
|
||||
f"ageing, and the two would disagree silently about which rules "
|
||||
f"this session still holds."
|
||||
)
|
||||
assert "scribe_rules_live" in src, (
|
||||
assert "grimoire_rules_live" in src, (
|
||||
f"{name} no longer reads the rule ledger through the shared "
|
||||
f"helper, so the two hooks can drift on the ledger format"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user