@remembrance-ai/mcp-server 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -60,26 +60,51 @@ command is the equivalent inside a running `claude` session.
60
60
 
61
61
  Codex plugin install:
62
62
 
63
+ **Codex CLI.** The Codex plugin needs a Codex CLI: `codex` on your PATH or, on
64
+ macOS, the CLI bundled in the ChatGPT desktop app. The setup, update and
65
+ hook-review commands run the newest one they find, so an older `codex` on PATH
66
+ cannot shadow the app's newer CLI; set `CODEX_CLI` to a CLI's full path to
67
+ choose one yourself. No other host needs the Codex CLI.
68
+
63
69
  ```bash
64
- CODEX_CLI="${CODEX_CLI:-$(command -v codex || true)}"
65
- [ -x "$CODEX_CLI" ] || CODEX_CLI="/Applications/ChatGPT.app/Contents/Resources/codex"
66
- [ -x "$CODEX_CLI" ] || CODEX_CLI="/Applications/Codex.app/Contents/Resources/codex"
67
- [ -x "$CODEX_CLI" ] || { printf '%s\n' "Codex CLI not found. Install the Codex CLI, or install or update the ChatGPT desktop app on macOS, then try again." >&2; exit 1; }
70
+ (
71
+ set +eu; unalias codex 2>/dev/null || :; unset -f codex 2>/dev/null || :
72
+ if [ -n "$CODEX_CLI" ]; then
73
+ [ -x "$CODEX_CLI" ] || { printf 'CODEX_CLI is set but is not an executable file: %s\n' "$CODEX_CLI" >&2; exit 1; }
74
+ else
75
+ best=-1
76
+ for c in "$(command -v codex 2>/dev/null)" \
77
+ /Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex \
78
+ /Applications/ChatGPT.app/Contents/Resources/codex \
79
+ /Applications/Codex.app/Contents/Resources/codex; do
80
+ case "$c" in /*) [ -x "$c" ] || continue ;; *) continue ;; esac
81
+ out=$("$c" --version </dev/null 2>/dev/null) || continue
82
+ v=$(printf '%s\n' "$out" | awk 'match($0, /[0-9]+[.][0-9]+[.][0-9]+/) { split(substr($0, RSTART, RLENGTH), n, "."); v = n[1] * 1000000 + n[2] * 1000 + n[3]; exit } END { print v + 0 }')
83
+ [ "$v" -gt "$best" ] && best=$v && CODEX_CLI=$c
84
+ done
85
+ [ -n "$CODEX_CLI" ] || { printf '%s\n' "Codex CLI not found. Install the Codex CLI, or install or update the ChatGPT desktop app on macOS, or set CODEX_CLI to a Codex CLI path, then try again." >&2; exit 1; }
86
+ fi
87
+ printf 'Using Codex CLI: %s\n' "$CODEX_CLI" >&2
68
88
  "$CODEX_CLI" plugin marketplace add dreamarkinc/remembrance-skills &&
69
89
  "$CODEX_CLI" plugin marketplace upgrade remembrance &&
70
90
  "$CODEX_CLI" plugin add remembrance@remembrance &&
71
91
  "$CODEX_CLI"
92
+ )
72
93
  ```
73
94
 
74
- The final command opens Codex for secure hook review when Codex requires it. If
75
- Codex shows a **Hooks need review** screen, choose **Review hooks** and trust
76
- only the Remembrance `SessionStart`, `UserPromptSubmit`, `PostToolUse`, `Stop`,
77
- and `SubagentStop` hooks. If no review screen appears, continue: Codex may be
78
- reusing an existing valid trust decision. Changed hook definitions show the
79
- same review screen again. Fully restart Codex before verification.
95
+ The final command opens the Codex CLI for secure hook review when Codex
96
+ requires it. If Codex shows a **Hooks need review** screen, choose **Review
97
+ hooks** and trust only the Remembrance `SessionStart`, `UserPromptSubmit`,
98
+ `PostToolUse`, `Stop`, and `SubagentStop` hooks. If no review screen appears,
99
+ continue: Codex may be reusing an existing valid trust decision. Changed hook
100
+ definitions show the same review screen again. Fully restart Codex before
101
+ verification.
80
102
 
81
- If `codex` is not on your shell `PATH`, this checks the current `ChatGPT.app`
82
- bundle first and retains the legacy `Codex.app` compatibility path.
103
+ The block runs in a subshell, so a failure prints a message and leaves your
104
+ terminal open. It uses `CODEX_CLI` when set; otherwise it runs the newest of
105
+ `codex` on PATH, the ChatGPT desktop app's bundled CLI
106
+ (`/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex`) and the
107
+ older bundle paths, and stops at the first failed step.
83
108
 
84
109
  Cursor plugin install is managed from **Cursor > Customize > Plugins** or a team
85
110
  marketplace that imports `packages/cursor-plugin` from the public mirror. The
@@ -146,6 +171,11 @@ Environment:
146
171
  degraded-activation issue codes. Local diagnostics remain available.
147
172
  - `REMEMBRANCE_CLIENT_UPDATE_CHECK=0`: disables the credential-free public
148
173
  release-manifest check. Queries and other MCP tools are unaffected.
174
+ - `REMEMBRANCE_UNATTENDED=1`: read by the native plugin hooks, not by this
175
+ server. Set it, as the host's README describes, in the environment a run no
176
+ person attends starts with: its hooks then show none of the user decisions
177
+ about retained private drafts, so none is used up, and the run still
178
+ captures and delivers its own lessons.
149
179
  - `REMEMBRANCE_ENABLE_LEGACY_BROAD_WRITES=1`: local compatibility mode for a
150
180
  client that has not adopted `private-learning-capture-v1`. It restores the
151
181
  legacy `submit_remembrance`/`propose_private_skill` tools and the optional
@@ -307,6 +337,11 @@ ask before these tools, every private lesson or skill submission stops for a
307
337
  manual approval, and unattended or headless runs deny it. Public-only use,
308
338
  without an organization key, does not need it.
309
339
 
340
+ An agent asks you (for managed settings, your administrator) before applying
341
+ this step: it never edits host permission or settings files without your
342
+ consent, and never answers the host's approval prompt for its own pending
343
+ action.
344
+
310
345
  Persist host approval for exactly `submit_private_lesson_candidate`,
311
346
  `retry_private_lesson_candidate`, `submit_private_skill_candidate`, and
312
347
  `retry_private_skill_candidate`. Hosted MCP exposes only
@@ -349,7 +384,14 @@ decision: with it, Auto-review never sees the lesson content. Per host:
349
384
  reject the key, and the Gateway then refuses to start until it is removed.
350
385
  - Gemini CLI: one `[[rule]]` per tool, including `capture_learning`, in
351
386
  `~/.gemini/policies/remembrance.toml` with `mcpName = "remembrance"`,
352
- `decision = "allow"`, and `priority = 200`.
387
+ `toolName = "<tool>"`, `toolAnnotations = { destructiveHint = false }`,
388
+ `decision = "allow"`, and `priority = 200`, then one more rule for each of
389
+ those tools and both delete tools: `toolName = "mcp_remembrance_<tool>"`, the
390
+ full name, without `mcpName`, with `decision = "ask_user"` and
391
+ `priority = 150`. Those keep the tools running in plan mode over ACP and both
392
+ delete tools asking in every approval mode, YOLO included. Gemini CLI
393
+ (checked against 0.62.0) skips every rule in a file when one rule has no
394
+ `toolName`.
353
395
  - Claude Desktop: its per-tool **Always allow** has no config key and users
354
396
  report that it resets when the app updates, so do not rely on it for
355
397
  unattended runs.
@@ -721,7 +763,8 @@ is sent only through its exact submit or retry action after the user agrees.
721
763
  The hooks offer drafts no active session is handling as a user decision too,
722
764
  until the user delivers, keeps or deletes them; a kept draft is parked. These
723
765
  decisions go to the next main-thread prompt on the machine, at most once a day,
724
- including unattended runs; the drafts stay listed by
766
+ unless the run sets `REMEMBRANCE_UNATTENDED=1`; set it for unattended runs,
767
+ whose hooks then neither show nor use up a decision. The drafts stay listed by
725
768
  `inspect_private_learning_outbox`, and none is sent or deleted without
726
769
  the user. Neither outbox expires or evicts unresolved drafts; reaching its
727
770
  64 MiB ceiling pauses capture rather than deleting data. Only the matching
@@ -754,6 +797,59 @@ private submissions.
754
797
 
755
798
  ## Tools
756
799
 
800
+ ### Optional administrator review tools
801
+
802
+ `get_review_comparison` and `repair_review_draft` are optional admin-only tools,
803
+ not additions to recommended/default organization or private-learning approval
804
+ profiles. Both require the owning organization's `admin:review` key. The repair
805
+ tool's explicit consent class is `admin_review_repair`; private-learning consent
806
+ or a routine feedback approval is not permission to send a replacement body.
807
+
808
+ - `get_review_comparison`: GET `/api/v1/admin/review-queue/comparison` with
809
+ `job_id` and `review_provenance: "delegated_ai"`. Returns exact linked source,
810
+ parent and current version identities, complete instruction bodies and content
811
+ hashes; an absent role is null. It accepts no arbitrary reference selector,
812
+ route or action and returns no approval capability or decision snapshot.
813
+ Missing, changed, policy-disallowed or safety-held content requires a hold,
814
+ not a summary substitute or another disclosure route.
815
+ - `repair_review_draft`: POST `/api/v1/admin/review-queue/repairs` using
816
+ `private-skill-review-repair-v1`, the pending source `job_id`, a stable
817
+ `request_id` (`psrr_` plus 32 lowercase hexadecimal digits), an unchanged
818
+ inspection-only `expected_review_snapshot` from normal review detail, and a
819
+ complete private-skill `capture`. The tool sends `Idempotency-Key: request_id`.
820
+ The trimmed instruction body is 80–56,000 UTF-16 code units, the snapshot is
821
+ at most 65,536 JSON bytes, and the entire request is at most 262,144 JSON bytes
822
+ or the organization's smaller limit. Reserved `_remembrance_` metadata is
823
+ refused at any depth; nothing is truncated or split.
824
+
825
+ The private-skill generator keeps distinct original input fields as protected
826
+ evidence and requires a complete authored skill for serving instructions. It
827
+ must not synthesize that body by clipping or concatenating the original fields
828
+ under generated headings.
829
+ Selected publication previews can return HTTP 422 with
830
+ `details.code: generated_private_skill_authored_body_required`, `retryable: false`
831
+ and `next_action: { tool: "repair_review_draft", expected_review_snapshot:
832
+ "fresh_unselected_snapshot_required" }`. Read complete protected detail and a
833
+ fresh unselected snapshot before a separately authorized repair. Generic
834
+ `target_blocked` refusals remain possible; this guidance grants neither repair
835
+ nor the source generator's public-propagation authority.
836
+
837
+ Repair creates a new protected organization-private candidate through normal
838
+ admission, routing, verification and review. It supports active managed/QE
839
+ organizations, not a customer-held fallback. A changed snapshot/request/actor
840
+ conflicts; an exact same-identity replay returns the original replacement
841
+ receipt, without another queue dispatch. HTTP 202 creation or 200 replay is not
842
+ skill acceptance. The original remains undisposed. Keep it open until the
843
+ replacement is accepted and an active, tenant-readable version is independently
844
+ confirmed usable; closing the original still requires a separate explicit
845
+ normal decision. An accepted repair continues the verified source lesson's
846
+ separately reviewed public-proposal path only where organization policy allows
847
+ it. Preserve every existing safety, consent, protection, denied
848
+ inspection and uncertain-delivery hold. See the agent OpenAPI review-workflow
849
+ schemas for the request and receipt fields.
850
+
851
+ ### Standard tools
852
+
757
853
  - `get_connection_status`: inspect the active local/hosted transport,
758
854
  credential source, verified registry scope, and any declared native plugin
759
855
  lifecycle without exposing key material. Hosted MCP cannot read a local
@@ -888,9 +984,10 @@ current instructions. Catalog browsing and handle reads do not count as use.
888
984
  as feedback; the plugin's completion hook closes that action in the calling
889
985
  agent's own pending list when it observes the call. A declined private draft
890
986
  stays retained and returns later only as a user decision, at the next
891
- main-thread prompt on the machine and at most once a day, unattended runs
892
- included: 1, 7 and 30 days later (each wait counted from the decline or the
893
- last showing); a client update, and for a draft declined with
987
+ main-thread prompt on the machine and at most once a day (a run that sets
988
+ `REMEMBRANCE_UNATTENDED=1` neither shows nor uses it up): 1, 7 and 30 days
989
+ later (each wait counted from the decline or the last showing); a client
990
+ update, and for a draft declined with
894
991
  `host_policy_denied` the host letting that lane through again, makes the next
895
992
  return come right away instead (or adds one more, if all three were shown).
896
993
  - `get_pending_action_payload`: local-only retrieval of the exact payload a
@@ -959,8 +1056,24 @@ current instructions. Catalog browsing and handle reads do not count as use.
959
1056
  retained for explicit compatibility flows. Current local clients call it
960
1057
  through `capture_learning`, not as a competing routine entry point. It
961
1058
  canonicalizes, redacts, validates, encrypts, and queues the post-redaction
962
- record without a network request. Unsafe or ambiguous content enters
963
- `held_safety` instead of being sent.
1059
+ record without a network request. Each unsafe match becomes its
1060
+ `[redacted:category]` marker and a malformed or privacy-sensitive tag is
1061
+ dropped and counted; only a stack trace or zero-width or bidirectional
1062
+ control characters keep the draft in `held_safety` instead of being sent.
1063
+ A held lesson also returns content-free `findings` (field, category, rule,
1064
+ occurrence count, approximate offset and length, never its text) and an
1065
+ `agent_recovery` action: `capture_learning` with
1066
+ `replacement_of: {draft_id}` stores a version written without what the
1067
+ findings name as its own draft, bound to the held draft's destination; a
1068
+ new version written under another API base or credential is refused, so
1069
+ capture it without `replacement_of`, and that session's results mark the
1070
+ held draft `replacement_requires_captured_destination: true` instead of
1071
+ offering `agent_recovery`. The held draft is never sent; it becomes a
1072
+ content-free replaced record only after that version's private receipt is
1073
+ verified, and a failed or denied submission keeps both. Each held draft
1074
+ accepts at most three versions, held
1075
+ ones included, and one retained replacement at a time; an exact replay
1076
+ returns the same replacement, and a refusal stores and sends nothing.
964
1077
  - `submit_private_lesson_candidate`: submit one exact canonical queued draft to
965
1078
  the authenticated organization's private verifier queue, or send one
966
1079
  content-free `held_safety_event` through the same approved action. It verifies
@@ -973,6 +1086,14 @@ current instructions. Catalog browsing and handle reads do not count as use.
973
1086
  public pipeline. Hold telemetry contains only category counts and protocol
974
1087
  metadata, never lesson content, and cannot enter verification, review,
975
1088
  topology, or skill materialization.
1089
+ - `retry_private_lesson_candidate`: retry one retained lesson draft through the
1090
+ same approval lane when its state allows a retry. A draft an earlier client
1091
+ held for a reason the current safety check no longer holds is re-checked
1092
+ locally and marked `safety_recheck: passes_current_rule`; it is sent only
1093
+ when the user chooses delivery and the retry passes
1094
+ `deliver_rechecked_hold: true`, with its stored bytes, payload digest and
1095
+ idempotency key under the current profile. A draft the current check still
1096
+ holds is refused locally with `private_lesson_hold_not_released`.
976
1097
  - `submit_private_skill_candidate`: submit exactly one complete-skill draft ID
977
1098
  returned by `capture_learning.private_skill`. The local MCP sends the
978
1099
  encrypted draft to the existing authenticated private skill idea,