# Engram — DeepSeek Harness nudge patch
# =====================================
# Enables dsh's Claude Code hook bridge and points it at Engram's dsh hook
# file (hooks/session-start-dsh.sh emits the JSON additionalContext shape —
# dsh's bridge discards plain SessionStart stdout, so the stock Claude Code
# hook would run but deliver nothing).
#
# Install — THREE steps, order matters, repeat per profile (web, headless):
#
#   1. The bridge and its one out-of-closure peer are NOT in the dsh npm
#      bundle (an override-style patch naming an unknown id fails SILENTLY;
#      the insert form below fails loud — which is what you want):
#        dsh plugin --profile web add @deepseek-ai/dsh-hooks-claude-code
#        dsh plugin --profile web add @deepseek-ai/dsh-hook-protocol
#      (dsh's plugin command needs pnpm on PATH: `npm i -g pnpm` or corepack.)
#   2. Open $DSH_HOME/profiles/web/cordis.patch.yml (created on that
#      profile's first boot), REPLACE the trailing empty list `[]` with the
#      insert block below, substituting your absolute home path — `~` is not
#      expanded. (Replacing the EMPTY `[]` — if you already have patch
#      entries, append this as one more `- insert:` list item instead, and
#      never paste it twice: duplicate `engram-hooks` entries load the bridge
#      twice with no warning and you get two nudges.)
#   3. Restart the profile.
#
# Verify with a hook EVENT, not a clean boot: after your next prompt,
#   grep -l hook $DSH_HOME/sessions/*/*/session.jsonl.zstd  — or simply see
# the due-review line appear in the session. A missing package fails loud at
# boot with the insert form; a clean boot plus a fired hook is the real pair.
- insert:
    - id: engram-hooks
      name: '@deepseek-ai/dsh-hooks-claude-code'
      config:
        configPath: /ABSOLUTE/HOME/.agents/engram/dsh/hooks.json
        pluginRoot: /ABSOLUTE/HOME/.agents/engram
