@remembrance-ai/mcp-server 0.1.77 → 0.2.0

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.
Files changed (4) hide show
  1. package/README.md +496 -94
  2. package/dist/server.js +62249 -6956
  3. package/package.json +13 -4
  4. package/server.json +2 -2
package/README.md CHANGED
@@ -20,6 +20,16 @@ Remembrance plugin. Claude Code, Codex, Cursor, OpenClaw, VS Code, and OpenCode
20
20
  users should start with their native plugin path because those packages add
21
21
  skills/rules and hooks around the MCP tools.
22
22
 
23
+ **Node.js runtime.** The `command` of a command-based MCP server is looked up on
24
+ a PATH the host provides, so Node.js 18.17.0 or newer and npm must be on it. A
25
+ host started from the Dock, Finder or an IDE may not have your shell's PATH, so
26
+ a Node.js installed by nvm, fnm, volta, asdf, nodenv or mise can be missing from
27
+ it; the symptom is `spawn node ENOENT` or "No such file or directory". `npx`
28
+ starts `node` through PATH, so an absolute `npx` alone is not enough: if the
29
+ host cannot find them, set `command` to the absolute `npx` (`command -v npx` in
30
+ a terminal) and put that directory first in the entry's environment `PATH`, for
31
+ example `/Users/you/.nvm/versions/node/v22.12.0/bin:/usr/bin:/bin`.
32
+
23
33
  At MCP initialization, the server performs a bounded, cached, credential-free
24
34
  release check. If a newer verified version is published, the agent receives
25
35
  locally bundled update guidance and must ask before changing the MCP
@@ -63,10 +73,10 @@ CODEX_CLI="${CODEX_CLI:-$(command -v codex || true)}"
63
73
 
64
74
  The final command opens Codex for secure hook review when Codex requires it. If
65
75
  Codex shows a **Hooks need review** screen, choose **Review hooks** and trust
66
- only the Remembrance `SessionStart`, `UserPromptSubmit`, `PostToolUse`, and
67
- `Stop` hooks. If no review screen appears, continue: Codex may be reusing an
68
- existing valid trust decision. Changed hook definitions show the same review
69
- screen again. Fully restart Codex before verification.
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.
70
80
 
71
81
  If `codex` is not on your shell `PATH`, this checks the current `ChatGPT.app`
72
82
  bundle first and retains the legacy `Codex.app` compatibility path.
@@ -102,6 +112,12 @@ Restart OpenCode after setup. The plugin adds bounded matching guidance before
102
112
  eligible model turns and observes lifecycle, tool, and completion events around
103
113
  the version-matched local MCP server.
104
114
 
115
+ Across native hosts, routine completion recovery is silent: the completion hook
116
+ records bounded pending obligations, allows the current final answer, and adds
117
+ only the exact recovery actions to the next real user prompt. Raw/hosted MCP has
118
+ no native completion hook and must perform the same query-fit, post-use, and
119
+ capture checks explicitly.
120
+
105
121
  Environment:
106
122
 
107
123
  - `REMEMBRANCE_API_URL`: Remembrance API origin. Defaults to `https://remembrance.dev`.
@@ -130,6 +146,12 @@ Environment:
130
146
  degraded-activation issue codes. Local diagnostics remain available.
131
147
  - `REMEMBRANCE_CLIENT_UPDATE_CHECK=0`: disables the credential-free public
132
148
  release-manifest check. Queries and other MCP tools are unaffected.
149
+ - `REMEMBRANCE_ENABLE_LEGACY_BROAD_WRITES=1`: local compatibility mode for a
150
+ client that has not adopted `private-learning-capture-v1`. It restores the
151
+ legacy `submit_remembrance`/`propose_private_skill` tools and the optional
152
+ `submit_feedback.lesson` field, and deliberately stops advertising the new
153
+ capture capability. Current local plugins should leave it unset; restart the
154
+ MCP process after changing it.
133
155
 
134
156
  Before diagnosing authentication, call `run_connection_doctor`. It performs a
135
157
  non-mutating authorized catalog read and reports transport, credential security,
@@ -155,6 +177,117 @@ native plugin declares its host, the result also shows whether its startup,
155
177
  prompt, tool-observer, and completion hooks have been observed. MCP-only
156
178
  installs report that native lifecycle checks are not applicable.
157
179
 
180
+ For an authenticated organization with an existing signing identity, the doctor
181
+ also verifies the installation session when organization-write checking is
182
+ enabled. `principal_session` is independent of signing and submission readiness:
183
+ a failed session prevents persistent preference writes, not catalog queries or
184
+ separately authorized private submissions. Safe `reason_code` and remediation
185
+ fields distinguish inactive identities, incompatible identity types, ownership
186
+ conflicts, rate limits, and unavailable or malformed responses without echoing
187
+ server details. Existing active, verified TOFU roots from the older
188
+ `registered_agent` format migrate to `installation` automatically during session
189
+ exchange, preserving their identity and history. This never reactivates a
190
+ disabled identity and requires no key rotation or bulk backfill.
191
+
192
+ Codex startup without a first prompt observation is `pending`, not proof of a
193
+ broken hook: delegated or startup work can precede a direct user prompt. The
194
+ doctor reports this as informational, without claiming that the prompt hook
195
+ ran. Explicit hook-trust failures and invalid or stale lifecycle markers remain
196
+ warnings. Recheck after a direct prompt to verify the prompt lifecycle.
197
+
198
+ Private-lesson storage diagnostics use content-free `reason_code`, `stage`, and
199
+ `remediation` fields. MCP storage errors include these in JSON-RPC `error.data`;
200
+ the doctor includes them in `private_lesson_automation.outbox.diagnostic`.
201
+ An inspection failure reports `encryption_ready: null` (unknown), not evidence
202
+ that a key is absent. Codes distinguish unsafe paths, ownership, permissions,
203
+ disk capacity, invalid keys, and other I/O failures. No raw exception, path,
204
+ credential, encryption key, or retained lesson is included. Preparation repairs
205
+ an existing user-owned config directory from 0755 to 0700 before fallback-key
206
+ bootstrap, without replacing existing keys or drafts; diagnostics do not repair
207
+ permissions. Never delete an outbox or regenerate a key to repair startup.
208
+
209
+ Only writes (capture, reformulation, submit, and retry) create an outbox key.
210
+ Status, doctor, policy, inspection, and the native-context hook never do; before
211
+ the first capture they report `encryption_ready: false` with
212
+ `encryption_source: "uninitialized"`. The doctor
213
+ also reports `fallback_key_present` (`null` when it cannot be determined),
214
+ per-source `retained_key_sources` counts across both private-learning lanes
215
+ and the follow-up payloads and durable-preference arguments the plugin hooks
216
+ keep sealed for unresolved actions (the ledgers `get_pending_action_payload`
217
+ reads: the durable per-user state directory
218
+ `$XDG_STATE_HOME/remembrance/private-learning-lifecycle/retained/`, by default
219
+ under `~/.local/state`, and ledgers an earlier build left in the temporary usage
220
+ directory), `retained_key_inventory`, `fallback_key_guidance` when a fallback
221
+ key file exists beside an active OS keychain key, and
222
+ `unretained_pending_actions`: by count and kind, pending actions whose exact
223
+ arguments were not kept because a pending list was full or they were too large;
224
+ repeat the original request to supply them again. The inventory is `complete`
225
+ only when every retained artifact in both lanes, including temporary,
226
+ quarantined, and recovery files, the private-learning obligations, and every
227
+ hook record, whatever its age, was read and classified; it counts
228
+ `unclassified_artifacts` (unreadable, unsafe, oversized, malformed, or unknown)
229
+ and `unlisted_directories` (including a symlink, which it never follows, and a
230
+ symlinked `private-learning-lifecycle` or `retained` directory) without paths
231
+ or content. It lists at most 4,096 directories and reads at most 8,192 files,
232
+ whatever they hold (a hook record is at most 12 KiB, a lane file at most the
233
+ outbox bound), plus, for `unretained_pending_actions`, at most 4,096 overflow
234
+ counts of at most 4 KiB per ledger root, and counts whatever lies past those
235
+ bounds as unlisted or unclassified. A hook removes a ledger's directory once
236
+ its last record leaves, so only ledgers that still hold records count toward
237
+ the directory bound; empty `<16 hex>.obligations` directories that an earlier
238
+ build left can be removed by hand. It runs synchronously inside initialize,
239
+ status and the doctor and, while no key is readable, inside every outbox read,
240
+ including inspection and the native-context hook: about 30 ms with 1,024 small sealed records and about
241
+ 0.26 s with 8,192 (medians on the development Mac). The worst case is 8,192
242
+ records of the maximum size, 11,459 bytes each (about 90 MiB): the health call
243
+ then took a median of 0.37 s on the development Mac and 0.57 s under heavy load,
244
+ blocking the event loop for up to 0.61 s. It reads the temporary ledgers
245
+ before the durable ones, so a record a hook promotes between the two is
246
+ counted; a subagent's record that moves to its parent's durable ledger while
247
+ those are read can be missed, which matters only while no key is readable. A
248
+ follow-up payload that an unreleased earlier build kept in plaintext is never
249
+ moved or converted: it stays in the temporary usage directory until its action
250
+ is resolved or the operating system cleans that directory (indefinitely when
251
+ `REMEMBRANCE_USAGE_DIR` points at a persistent directory). A hook keeps a sealed payload until
252
+ its action is completed, declined with `decline_pending_action`, or withdrawn;
253
+ age never removes it. Only content-free reminder records keep an inherited
254
+ 7-day cleanup, which no owner decision set. Delete that file only after
255
+ `retained_key_inventory.complete` is true and
256
+ `retained_key_sources.mode_0600_file` reports 0.
257
+
258
+ With no readable key, a capture makes one only for an installation that holds
259
+ nothing a key sealed: the same inventory must be complete and find no retained
260
+ draft, private-learning obligation or hook-kept payload. Otherwise it holds:
261
+ `outbox_key_missing` while retained items need the key (the doctor names them by
262
+ count and kind), `outbox_key_unavailable` while the Keychain cannot answer and
263
+ something is retained, or while the inventory is incomplete. An incomplete
264
+ inventory's hold names each cause and directory with the step that clears it,
265
+ and the hooks show the same text: move aside files Remembrance did not write
266
+ (for example `.DS_Store`), but make a file Remembrance wrote whose owner or mode
267
+ changed a user-owned 0600 file again instead of moving it aside, make an
268
+ unreadable file a user-owned 0600 file again,
269
+ fix or move aside a refused directory, or, past a bound, complete or decline
270
+ pending actions (`decline_pending_action`) so their records leave, and then
271
+ their ledgers' empty directories; it asks for
272
+ the original key only when a retained item uses it. When one does, restore the
273
+ original key, the login Keychain item or the 0600 key file, and the next capture
274
+ proceeds with no other step; a new key cannot read retained items, so none is
275
+ made and none is rotated. Reads (inspection, listing, recovery and the
276
+ native-context hook) never make a key and use the same inventory: while a
277
+ retained item needs the original key they hold with the same counts, and an
278
+ incomplete inventory holds a read only when the read's own lane could not be
279
+ fully read (past a bound, an unreadable file or an unlisted directory).
280
+ Otherwise the read proceeds with nothing it could open, and the doctor names
281
+ the cause. If the original key is lost for good,
282
+ nothing can open what it sealed, and discarding it is a deliberate manual step
283
+ for the user, never automatic: decline each kept action a session still lists
284
+ with `decline_pending_action`, then delete by hand the remaining files the
285
+ doctor counts, the retained drafts in the private-learning outbox directories,
286
+ the kept records under the retained directory above, and the kept records an
287
+ earlier build left in the temporary usage directory that no hook has moved yet
288
+ (the draft deletion tools refuse while the key is missing). Once the doctor's inventory is complete
289
+ and finds nothing, the next capture makes a new key.
290
+
158
291
  If MCP registration itself failed and no Remembrance tool is visible, run:
159
292
 
160
293
  ```bash
@@ -200,15 +333,38 @@ activate only after the server's consistency/confidence gates and expire after
200
333
  never raw prompt or feedback text. `scope: "auto"` stores a preference for the
201
334
  linked member when available and otherwise for the installation.
202
335
 
336
+ Installation and member preferences reach every runtime on that identity, so a
337
+ preference may come from another agent family or address several. Follow the
338
+ part written for your host, and treat one that names a model, tool, or agent
339
+ your host lacks, with no part for your host, as another family's intent: apply
340
+ the closest equivalent and say which, ask the user when none is safe to assume, and keep an
341
+ adaptation only with `scope: "member_runtime"` under the same key. It outranks
342
+ the shared preference for this runtime alone and needs a linked member.
343
+
203
344
  Private working preferences follow each engineer across approved agents and
204
345
  steer relevant public and team skills without changing shared instructions or
205
346
  weakening organization policy. Profiles, observations, compatibility records,
206
347
  and feedback remain private to the authenticated organization.
207
348
 
208
349
  An explicit instruction governs the current task immediately. Known built-ins
209
- activate durably at once. Custom preferences remain pending until automatic
210
- normalization and validation approves them; unsafe, malformed, or uncertain
211
- custom behavior stays inactive and is never replayed to an agent.
350
+ activate durably at once for a managed-encryption organization.
351
+ Custom preferences remain pending until automatic normalization and validation
352
+ approves them; unsafe, malformed, or uncertain custom behavior stays inactive
353
+ and is never replayed to an agent.
354
+ An organization using customer-held encryption is currently deferred: every substantive preference write and every compatibility-feedback call is refused before persistence with HTTP 422 and code `customer_held_preference_processing_deferred`. Existing records are unchanged, reads and the content-free withdrawal lane keep working, and responses withhold the compatibility-feedback offer there. Read `activated` and `normalized_activation_state` in the
355
+ response instead of assuming a setting is live.
356
+
357
+ `get_effective_preferences` also returns a `personalization` block that says
358
+ which stored-preference scopes were read. `available: true` with
359
+ `reason_code: "resolved"` means every scope applying to this caller was read, so
360
+ an empty `effective_preferences` list is a real empty profile, and
361
+ `resolved_scopes` names them. `available: false` names what was not read:
362
+ `organization_scope_only` (no principal session, so the `installation`, `member`
363
+ and `member_runtime` scopes in `omitted_scopes` were never queried and a stored
364
+ personal preference may simply not be listed), `not_applicable` (anonymous, so
365
+ no organization-scoped storage applies), `preference_storage_unavailable`, or
366
+ `preferences_disabled`. Retrieval, discovery and invocation stay available in
367
+ every case, and none of these states requires authentication or adds a prompt.
212
368
 
213
369
  Native hooks may add a locally derived `client_context.project_key`. It is an
214
370
  installation-keyed opaque project-context digest; the path and
@@ -230,7 +386,9 @@ Use `submit_preference_compatibility_feedback` only after actually using an
230
386
  exact skill version returned with a `preference_compatibility_feedback` offer.
231
387
  Send the offer's exact `query_id`, `result_id`, `skill_version_id`, and
232
388
  server-issued `preference_fingerprint`; the server verifies the correlated
233
- fetch and resolves the active preference itself. The operation requires a
389
+ fetch and resolves the active preference itself. In an MCP `query_skills`
390
+ result the offer lists `preference_fingerprints` only: use the response's
391
+ `query_id` and the result's own `result_id`. The operation requires a
234
392
  verified principal session and never mutates the skill or another
235
393
  organization's ranking.
236
394
 
@@ -251,10 +409,15 @@ registered-provider key when durable trust continuity matters.
251
409
 
252
410
  ## Remote endpoint (no install)
253
411
 
254
- The same proxy tools (everything except the local-only
255
- `bootstrap_agent_identity` and `queue_private_skill_import`) are
256
- hosted at a remote Streamable HTTP endpoint, so most clients need no local
257
- install. An optional org key goes in `Authorization: Bearer <key>`.
412
+ The network-backed proxy tools are also hosted at a remote Streamable HTTP
413
+ endpoint, so most clients need no local install. Hosted MCP excludes every
414
+ local-only capability, including identity bootstrap, `capture_learning`, local
415
+ handoff, outbox inspection, retry, and deletion. It reports
416
+ `auto_capture_supported: false`. The exact private-lesson action remains
417
+ available for callers that supply the strict canonical candidate or content-
418
+ free hold contract; complete skills use the explicit hosted/raw
419
+ `propose_private_skill` compatibility route. An optional org key goes in
420
+ `Authorization: Bearer <key>`.
258
421
 
259
422
  ```bash
260
423
  # Claude Code:
@@ -284,10 +447,11 @@ mode-0600 handoff for an admin dashboard import), which the remote endpoint
284
447
  cannot provide.
285
448
 
286
449
  Every MCP tool publishes `readOnlyHint`, `openWorldHint`, and
287
- `destructiveHint`. Public submission tools are open-world. The networked
288
- `propose_private_skill` tool is non-read-only but closed-world because it can
289
- write only to the authenticated organization's private review queue and can
290
- never publish publicly. `queue_private_skill_import` is both closed-world and
450
+ `destructiveHint`. Public submission tools are open-world. The exact
451
+ `submit_private_lesson_candidate` and `submit_private_skill_candidate` actions
452
+ are non-read-only but closed-world because they carry only a local draft ID and
453
+ can write only to the authenticated organization's private pipeline.
454
+ `capture_learning` and `queue_private_skill_import` are both closed-world and
291
455
  zero-network. These annotations help hosts review the real operation, but they
292
456
  never override host or tenant policy.
293
457
 
@@ -303,36 +467,183 @@ and generic MCP clients, including host modes that suppress plugin hooks or
303
467
  plugin-provided MCP servers. The same guide is available at
304
468
  <https://remembrance.dev/docs/remembrancer#private-repository-policy>.
305
469
 
306
- The recommended organization inventory covers discovery, invocation, bounded
307
- feedback/outcomes, `submit_remembrance`, `propose_private_skill`, and
308
- `submit_suggestion`. Dual-scope/public, resource, and identity tools are
309
- opt-in. If repository export remains denied, keep the denial, report that
310
- nothing was sent, and do not retry through another transport. Do not create a
311
- handoff automatically. `queue_private_skill_import` remains available only when
312
- an organization admin explicitly requests a local handoff.
313
-
314
- With an organization key, `propose_skill_idea` also stays in the organization
315
- review queue. Never remove or bypass the key to force a public candidate;
316
- submit privately, then use the reviewed public-propagation flow.
317
-
318
- Routine organization lessons use a narrower exact-action approval. Allow
319
- `submit_private_lesson_candidate` persistently without granting every write
320
- tool. The local server first runs `prepare_private_lesson_candidate`, which
321
- canonicalizes and redacts in memory and stores only the encrypted canonical
322
- record in a private local outbox. The separate submit action then sends those
323
- exact bytes. Claude Code's exact permission name is
324
- `mcp__remembrance__submit_private_lesson_candidate`; OpenCode's generated MCP
325
- permission name is `remembrance_submit_private_lesson_candidate`. Cursor and
326
- VS Code can approve the individual tool for all future invocations. OpenClaw
327
- must expose the optional tool and persist its plugin-owned `allow-always`
328
- decision. Keep broader public/admin writes disabled when they are not needed.
329
-
330
- The preparation action never contacts Remembrance. A host denial is retained
331
- locally and is never retried through another transport. The outbox never
332
- expires or evicts drafts; reaching its 64 MiB ceiling pauses capture rather
333
- than deleting data. Only `delete_private_lesson_candidate` with explicit
334
- confirmation removes a selected draft. Hosted MCP exposes policy and the exact
335
- submit action, but no local outbox tools, and reports
470
+ The recommended organization inventory covers discovery, invocation,
471
+ independent query-fit feedback, categorical post-use feedback/outcomes,
472
+ `capture_learning`, its exact private submit actions, preferences, and
473
+ `submit_suggestion`. Broad `submit_remembrance` and `propose_private_skill`
474
+ routes are legacy compatibility tools and are unavailable by default to an
475
+ organization-capable local client. Hosted/raw clients may retain them when they
476
+ deliberately use those schemas. Dual-scope/public, resource, and low-level
477
+ identity tools are opt-in. If repository export remains denied, keep the
478
+ denial, report that nothing was sent, and do not retry through another
479
+ transport. Do not create a handoff automatically.
480
+ `queue_private_skill_import` remains available only when an organization admin
481
+ explicitly requests a local handoff.
482
+
483
+ With an organization key, the legacy/raw `propose_skill_idea` route also stays
484
+ in the organization review queue. Never remove or bypass the key to force a
485
+ public candidate; submit privately, then use the reviewed public-propagation
486
+ flow.
487
+
488
+ ### Routing metadata on complete skill proposals
489
+
490
+ In 0.2.0 a complete skill sent with `propose_skill_idea` or
491
+ `propose_private_skill` (or their REST routes) carries routing metadata
492
+ (contract v1, published at `/schemas/skill-routing-metadata.v1.json`): when
493
+ an agent should pick the skill (`applicability`) and what it does and needs
494
+ (`routing`). Ask for a platform draft first, show it to the author, and send
495
+ the confirmed or edited fields back with the draft's token. The draft call
496
+ stores nothing:
497
+
498
+ ```json
499
+ {
500
+ "title": "Deploy a prepared app to Azure",
501
+ "description": "Deploy an already-prepared app to Azure with azd.",
502
+ "proposed_skill_md": "# Deploy a prepared app to Azure\n\nRun azd up ...",
503
+ "prefill_routing_metadata": true
504
+ }
505
+ ```
506
+
507
+ Its answer holds `example.proposed_metadata` and `routing_draft.token`. The
508
+ submission then sends the confirmed fields:
509
+
510
+ ```json
511
+ {
512
+ "title": "Deploy a prepared app to Azure",
513
+ "description": "Deploy an already-prepared app to Azure with azd.",
514
+ "proposed_skill_md": "# Deploy a prepared app to Azure\n\nRun azd up ...",
515
+ "proposed_metadata": {
516
+ "applicability": {
517
+ "scope": "specialized",
518
+ "use_when": [
519
+ "The user wants to deploy an already-prepared app to Azure",
520
+ "A deployment plan and infrastructure files already exist",
521
+ "The user asks to run azd up or azd deploy"
522
+ ],
523
+ "avoid_when": [
524
+ "The app has no Azure deployment files yet (prepare it first)",
525
+ "The user only wants a readiness check without deploying"
526
+ ],
527
+ "task_examples": [
528
+ "Deploy this prepared app to Azure Container Apps",
529
+ "Run azd up for my project",
530
+ "Push the validated Bicep deployment to production"
531
+ ],
532
+ "not_for": []
533
+ },
534
+ "routing": {
535
+ "capabilities": ["deploy-to-cloud"],
536
+ "domains": ["deployments-cicd", "cloud-platforms"],
537
+ "runtime_requirements": ["repo-checkout", "shell", "cloud-account", "provider-azure"],
538
+ "risk": "cloud-changes"
539
+ }
540
+ },
541
+ "routing_draft_token": "rd1.<token from the draft>"
542
+ }
543
+ ```
544
+
545
+ A complete skill without these fields is refused with 422
546
+ `skill_routing_metadata_incomplete` (`delivery: not_delivered`; nothing is
547
+ stored). The refusal lists every issue and carries the same draft, so fix
548
+ the listed fields and send the request again. Fields taken unchanged are
549
+ recorded as author-confirmed draft values; edits that widen the draft (a
550
+ broader scope, added `use_when` items or capabilities, a lower risk) are
551
+ flagged for review. An organization's text is drafted only through its
552
+ approved semantic-enrichment processing grant; without one the draft is held
553
+ and nothing is sent. A private capture (`capture_learning` with
554
+ `private_skill`) may ask for automatic completion: the skill becomes
555
+ available after acceptance once its routing metadata is complete.
556
+
557
+ Current local clients use one zero-network `capture_learning` router for
558
+ routine reusable learning. Supply exactly one compact `lesson`, complete
559
+ `private_skill`, or structured durable `preference`; the router accepts no
560
+ organization, destination, visibility, credential, or public fallback. Lesson
561
+ and skill drafts are encrypted in separate outboxes, while a preference returns
562
+ the existing `record_preference` action. Invoke only the exact returned action:
563
+ `submit_private_lesson_candidate`, `submit_private_skill_candidate`, or
564
+ `record_preference`.
565
+
566
+ Malformed tool input returns JSON-RPC `-32602` with bounded
567
+ `error.data.code: invalid_tool_arguments` diagnostics derived only from the
568
+ shipped input schema. Each issue identifies a known schema field and constraint;
569
+ array positions use `[]`, and arbitrary record keys stop at the known parent.
570
+ Submitted values, unknown property names, and validator messages are never
571
+ echoed. Correct the indicated fields and retry the same tool. A rejected input
572
+ does not create a draft or consume a reformulation attempt, and does not require
573
+ another approval. Runtime, storage, and remote-response errors do not masquerade
574
+ as input diagnostics.
575
+
576
+ Every complete-skill inspection persists its trusted build-derived
577
+ `inspector_digest` with exactly one outcome: `unchanged`, `redacted`
578
+ (source-redacted), `positive_recovery_need`, or `operational_failure`. Only a
579
+ confirmed source-ownership ambiguity or recognized encrypted private container
580
+ can produce positive recovery and `agent_recovery` instructions. Capacity,
581
+ internal, and inspector-contract faults are operational failures, not semantic
582
+ ambiguity and not permission to reformulate. An unknown exception or copied
583
+ error label also does not qualify. No outcome makes unchecked content safe for
584
+ egress.
585
+
586
+ An opaque encrypted PKCS#12/PFX also requires recovery because its contents are
587
+ uninspectable; this is not proof of private-key presence. Accessible
588
+ certificate-only bags remain unchanged. No decryption password or new key is
589
+ requested. Other Java truststore formats are not assumed to be PFX.
590
+
591
+ For eligible positive recovery, the agent authors a fresh complete candidate
592
+ with `capture_learning.private_skill` and `replacement_of`, using current task
593
+ context or separately inspected partial recovery context. The optional
594
+ `replacement_of.recovery_context_id` selects that exact context; it grants no
595
+ consent or content authority. Each inspector/context epoch permits three
596
+ distinct candidate digests. Duplicate or generated candidate text and elapsed
597
+ time do not open another epoch. Only a new authenticated native-user session
598
+ context or a trusted inspector identity can reopen recovery. The original,
599
+ contexts, and attempts remain encrypted under the same draft until the selected
600
+ candidate is accepted privately. Acceptance completes the draft through the
601
+ existing `private_skill` approval lane, with no additional user approval.
602
+
603
+ On restart, the lifecycle reminder identifies recoverable drafts but does not
604
+ reset an exhausted epoch.
605
+ `inspect_private_learning_outbox.private_skill_draft_id` selects an exact draft
606
+ independently of listing order. Only separately inspected whole-field recovery
607
+ context may be returned; it is partial, non-authoritative, and not a submission.
608
+ The encrypted held original is never returned as recovery context.
609
+ An outline alone does not justify inventing missing instructions. If meaning
610
+ cannot be recovered safely, the draft stays retained for a later lifecycle
611
+ opportunity with sufficient context, never silently discarded or reported as
612
+ submitted. The agent must not invent the missing procedure or ask the user to
613
+ inspect local files. Query-fit and post-use feedback remain available.
614
+
615
+ Accepted lesson and skill content reuses the existing verifier, topology,
616
+ review, versioning, audit, and admin-controlled propagation pipeline. The
617
+ submitting agent never chooses visibility, and the original accepted record
618
+ always remains organization-private.
619
+
620
+ The local server advertises `private-learning-capture-v1` through
621
+ `X-Remembrance-Client-Capabilities` on query, invocation, and feedback calls.
622
+ For an authenticated organization, the server then returns narrow capture
623
+ guidance and enforces categorical post-use feedback. The header never grants
624
+ identity, authorization, organization scope, or a destination; anonymous and
625
+ legacy/raw callers retain their existing contracts.
626
+
627
+ `REMEMBRANCE_ENABLE_LEGACY_BROAD_WRITES=1` is an explicit local downgrade for
628
+ older host integrations. Tool visibility, feedback schema, instructions, and
629
+ the capability header move together; the server never advertises capture while
630
+ serving the legacy contract.
631
+
632
+ Allow the two submit actions persistently without granting every write tool.
633
+ Claude Code's permission names are
634
+ `mcp__remembrance__submit_private_lesson_candidate` and
635
+ `mcp__remembrance__submit_private_skill_candidate`; OpenCode prefixes the same
636
+ tool names with `remembrance_`. Cursor and VS Code can approve each individual
637
+ tool for future invocations. OpenClaw must expose the optional tools and persist
638
+ its plugin-owned exact-action `allow-always` decisions. Keep broader
639
+ public/admin writes disabled when they are not needed.
640
+
641
+ The capture action never contacts Remembrance. A host denial is retained
642
+ locally and is never retried through another transport. Neither outbox expires
643
+ or evicts unresolved drafts; reaching its 64 MiB ceiling pauses capture rather
644
+ than deleting data. Only the matching delete tool with explicit confirmation
645
+ removes a selected draft. Hosted MCP exposes policy and network-backed exact
646
+ submit actions, but no local router or outbox, and reports
336
647
  `auto_capture_supported: false` unless a local plugin is paired with it.
337
648
 
338
649
  ## Claude Desktop (local stdio)
@@ -376,14 +687,51 @@ submit action, but no local outbox tools, and reports
376
687
  short follow-ups must be interpreted from the full conversation. Results
377
688
  include a high/possible/exploratory tier, a concise reason, approximate
378
689
  context tokens, verified-use evidence, risk, and correlation IDs.
690
+ Without an organization key, the server's relevance judge chooses what a
691
+ search is shown from the top 20 public candidates: Jev (TypeSafe, through
692
+ Vercel AI Gateway) rates each candidate first, and a language model decides
693
+ the ones Jev leaves undecided while there is time. It receives the search's
694
+ task text and public skill cards only. Every request asks for zero retention
695
+ and no prompt training; for Jev, zero retention rests on Remembrance's
696
+ account-specific agreement with TypeSafe through Vercel, which the Gateway
697
+ does not confirm. With an organization key, a search is judged only under the
698
+ organization's managed processing grant for semantic search, and Jev rates it
699
+ first only when that grant also approves TypeSafe, under the owner-attested
700
+ zero-retention agreement with TypeSafe (owner decisions 36 and 64), which
701
+ covers this judge stage and no other purpose: its task text and skill cards,
702
+ the organization's own included, go only to the hosts that grant approves,
703
+ each asked for zero retention and no prompt training. Without that grant
704
+ nothing is sent and the search keeps the rule's list.
705
+ A card shows a skill's use and exclusion conditions only where the
706
+ platform generated them or a person reviewed them. A use condition only
707
+ promotes a result, and only an exclusion its author stated or a person
708
+ reviewed makes it `unlikely`; `applicability.provenance` says who stated
709
+ them.
710
+ The MCP result states each working preference once, in the top-level
711
+ `effective_preferences`, and each result refers to it by key or, in its
712
+ `preference_compatibility_feedback` offer, by `preference_fingerprints` used
713
+ with the response's `query_id` and the result's own `result_id`. A
714
+ description longer than 800 characters is summarized and marked
715
+ `description_truncated: true`; `get_skill` returns the full text. Each
716
+ result's `preference_application` omits `blocked_preferences` and
717
+ `overridden_skill_defaults` when they are empty, so an absent list means
718
+ none, and the `preserves` and `instruction` every result repeats appear once
719
+ in the top-level `preference_application_rules`.
379
720
  When a native host plugin supplies `client_context.directive_id`, preserve it
380
721
  so the query correlates and fulfills that plugin instruction. MCP-only clients do not create
381
722
  shown-directive events because no host instruction was injected; this
382
- telemetry never affects ranking.
723
+ telemetry never affects ranking. It is the only tool whose `tools/list`
724
+ entry sets `_meta["anthropic/alwaysLoad"]`, so Claude Code keeps its schema
725
+ in the prompt instead of behind tool search; every other tool stays
726
+ deferred, and clients that do not recognize the key ignore it.
383
727
  Read `skill_access` on every response. Under `org_only`, use only returned
384
728
  organization skills and do not substitute bundled or live public references;
385
729
  an unavailable query with an organization key fails closed for public-skill
386
- fallback because the current policy cannot be confirmed.
730
+ fallback because the current policy cannot be confirmed. The MCP result
731
+ states `skill_access` right after `query_id`, ahead of the `skills`,
732
+ `resources`, and `skill_bundles` arrays, so a host preview of a large result
733
+ shows the policy before any candidate. A result that does not show it leaves
734
+ the policy unconfirmed, and the same fail-closed rule applies.
387
735
  - `get_skill`, `get_resource`: fetch details by slug. `get_skill` also returns
388
736
  the exact reviewed `skill_md`, `version_id`, and public/org source selected
389
737
  by the current authorization policy. First compare the query
@@ -415,21 +763,58 @@ current instructions. Catalog browsing and handle reads do not count as use.
415
763
  Remembrance and never counts as submission; an organization admin uploads
416
764
  the JSON at Dashboard > Skills > Import.
417
765
  - `submit_query_feedback`: report explicit good/partial/poor fit for returned
418
- `result_id` values. Use this when retrieval chose the wrong skill; it trains
766
+ `result_id` values. Use this when retrieval chose the wrong skill; it adjusts
419
767
  organization/public profiles without changing global skill usefulness.
420
768
  Send one complete verdict set per query from the same organization scope or
421
769
  anonymous scope; any active key for that organization is valid. Identical
422
770
  retries are safe; changed later judgments return a conflict, and receipts
423
771
  expire after 30 days by default.
424
- Explicit same-query better/worse labels can form reranker triplets; only
425
- diverse authenticated organization-key comparisons between public results
426
- train the shared model. Anonymous feedback remains low weight and never
427
- trains that model; self-reported agent IDs do not establish identity. Private
428
- organization comparisons stay organization-scoped.
429
- - `submit_feedback`: submit post-use skill feedback with the originating
430
- `query_id` and `result_id` when the skill came from a durable query; set
431
- `verified_attestation: true` to sign the evidence. Local MCP initializes a
432
- missing opaque identity automatically.
772
+ Organization verdicts shape only that organization's rankings unless its
773
+ admin opts in to shared learning, which shares only weekly counts per public
774
+ skill version. Anonymous feedback remains low weight and never trains a
775
+ shared model; self-reported agent IDs do not establish identity. No learned
776
+ reranker is trained or served.
777
+ - `submit_feedback`: submit categorical post-use usefulness, an optional
778
+ rating, and the originating `query_id` and `result_id` when the skill came
779
+ from a durable query; set `verified_attestation: true` to sign the evidence.
780
+ It deliberately does not accept reusable prose for a capture-capable local
781
+ client. Route a generalized lesson, complete private skill, or durable
782
+ preference through `capture_learning` separately. This never replaces
783
+ `submit_query_feedback`, which remains the only query-result fit path. Local
784
+ MCP initializes a missing opaque identity automatically.
785
+ - `acknowledge_feedback_denial`: local-only acknowledgment of one query-fit or
786
+ post-use feedback action denied by the host before transport. Supply the exact
787
+ `tool`, `query_id`, `result_id` only for `submit_feedback`, and
788
+ `reason: host_policy_denied`. It stops that reminder without sending feedback,
789
+ changing approvals, or affecting other submissions. Only a content-free hashed
790
+ marker is retained, with automatic cleanup after 14 days. Use it when a host
791
+ does not expose a reliable denial event; do not infer denial from API errors.
792
+ - `decline_pending_action`: local-only way to decline one pending action that a
793
+ plugin hook reminder listed and the agent cannot complete. Supply the
794
+ `action_id` shown under that action and one `reason`:
795
+ `not_observed_by_this_agent`, `agent_exited`, `not_reusable`, or
796
+ `duplicate`. It sends and stores nothing and never counts as feedback; the
797
+ plugin's completion hook closes that action in the calling agent's own
798
+ pending list when it observes the call.
799
+ - `get_pending_action_payload`: local-only retrieval of the exact payload a
800
+ pending reusable-evidence action keeps on this device, or the exact
801
+ `record_preference` arguments a pending durable-preference action keeps,
802
+ when a plugin hook reminder names it by `action_id` and `ledger` instead of
803
+ showing it. For an action kept by another ledger than the reminded
804
+ session's own (an exited subagent's that its parent could not take whole or
805
+ that another ledger already pointed to, or one that reached a subagent's
806
+ session after that session handed its debts up), that `ledger` is the one
807
+ still keeping it; the reminded session holds only a content-free pointer to
808
+ it or a content-free association to that ledger, and its reminders name
809
+ every such action, a page at a time. It reads only that ledger, opens the payload with the
810
+ private-learning outbox key its record names (never creating one), verifies
811
+ its kind and digest, and returns it unchanged (a follow-up's as `payload`, a
812
+ preference's as `arguments` with `action_tool: "record_preference"`) with
813
+ `provenance` `first_hand`, `second_hand` (an exited subagent left it), or
814
+ `subagent_identity_unavailable` or `pre_agent_keying` (the record cannot say
815
+ which agent earned it). It sends, submits, records, applies, and changes
816
+ nothing; a payload never kept, unopenable, or mismatched is reported by
817
+ status, never guessed.
433
818
  - `report_task_outcome`: close the query episode after completion or
434
819
  abandonment. Remembrance accepts one terminal outcome per query; retry the
435
820
  same report with the same idempotency key instead of submitting a different
@@ -458,19 +843,27 @@ current instructions. Catalog browsing and handle reads do not count as use.
458
843
  necessarily the key used for the original query, and never enter public
459
844
  cohorts. Raw REST proof retrieval remains unchanged for clients that perform
460
845
  their own verification.
846
+ - `capture_learning`: the only routine reusable-learning entry point for a
847
+ current organization-capable local client. It accepts exactly one compact
848
+ lesson, complete private skill, or structured preference. It performs no
849
+ network request, accepts no destination or visibility choice, encrypts lesson
850
+ and skill drafts in separate outboxes, and returns one exact next action.
851
+ Query-fit judgments are intentionally excluded.
461
852
  - `get_private_lesson_policy`: fetch and verify the signed organization policy
462
- for the private lesson lane. It binds the organization audience, monotonic
463
- policy sequence, enabled safe tiers, exact action and endpoint, 4 KiB limit,
464
- encryption readiness, kill switch, contract/redactor versions, and
465
- `public_fallback: false`.
466
- - `prepare_private_lesson_candidate`: local-only preparation for failure,
467
- correction, or reusable-workflow lessons. It canonicalizes, redacts,
468
- validates, encrypts, and durably queues the post-redaction record without a
469
- network request. Unsafe or ambiguous content enters `held_safety` instead of
470
- being sent. The current policy pins `private-lesson-redaction-v2` and its exact
471
- rules digest; an unsupported version or digest moves the retained encrypted
472
- draft to terminal `superseded_redactor` rather than retrying or re-redacting
473
- it.
853
+ for the private lesson lane. A local client offers a bounded supported-profile
854
+ `private-lesson-redaction-v2` set and the server selects the newest mutual
855
+ redactor profile; a retained
856
+ draft requires its exact bound profile. The policy binds the organization
857
+ audience, monotonic sequence, enabled safe tiers, exact action and endpoint,
858
+ signed `max_payload_bytes` (4096, or 8192 when the client asks for it with
859
+ `supported_max_payload_bytes`), encryption readiness, kill switch,
860
+ selected/supported profiles, and `public_fallback: false`.
861
+ - `prepare_private_lesson_candidate`: lower-level local lesson preparation
862
+ retained for explicit compatibility flows. Current local clients call it
863
+ through `capture_learning`, not as a competing routine entry point. It
864
+ canonicalizes, redacts, validates, encrypts, and queues the post-redaction
865
+ record without a network request. Unsafe or ambiguous content enters
866
+ `held_safety` instead of being sent.
474
867
  - `submit_private_lesson_candidate`: submit one exact canonical queued draft to
475
868
  the authenticated organization's private verifier queue, or send one
476
869
  content-free `held_safety_event` through the same approved action. It verifies
@@ -483,30 +876,37 @@ current instructions. Catalog browsing and handle reads do not count as use.
483
876
  public pipeline. Hold telemetry contains only category counts and protocol
484
877
  metadata, never lesson content, and cannot enter verification, review,
485
878
  topology, or skill materialization.
486
- - `inspect_private_lesson_outbox`, `retry_private_lesson_candidate`, and
487
- `delete_private_lesson_candidate`: inspect content-free local state, retry a
488
- selected eligible draft, or explicitly delete one with confirmation.
489
- Inspection includes terminal count, retained bytes, reason, and deletion
490
- guidance. Unresolved and terminal drafts are never expired, evicted, or
491
- silently discarded, and terminal files still count toward the 64 MiB
492
- ceiling. Once a signed submission receipt is verified, the encrypted lesson
493
- content is removed immediately. A content-free completion marker remains for
494
- replay safety and diagnostics, then is automatically deleted after 14 days.
495
- - Feedback responses may include `next_step.submit_remembrance_payload` for
496
- negative or substantive lessons. With organization authentication, prefer
497
- the private lesson two-stage lane for routine bounded lessons. Use
498
- `submit_remembrance` only when the richer existing evidence contract is
499
- actually required. Local MCP initializes a missing signing identity
500
- automatically.
879
+ - `submit_private_skill_candidate`: submit exactly one complete-skill draft ID
880
+ returned by `capture_learning.private_skill`. The local MCP sends the
881
+ encrypted draft to the existing authenticated private skill idea,
882
+ verification, topology, review, versioning, and admin-controlled propagation
883
+ pipeline. It accepts no visibility or organization override and never falls
884
+ back to public submission.
885
+ - `inspect_private_learning_outbox`: inspect content-free state across both
886
+ encrypted outboxes. Matching lesson/skill retry and confirmed-delete tools
887
+ act on one selected draft. Temporary redactor incompatibility remains
888
+ `awaiting_compatible_profile` with precise update, restart, or server-rollout
889
+ guidance; it is not mislabeled as safety or host denial. An unsupported local
890
+ profile is terminal `superseded_redactor`. Unresolved and terminal drafts are never expired, evicted, or silently discarded and still
891
+ count toward the 64 MiB ceiling. After an acceptance receipt is verified,
892
+ encrypted content is removed immediately and the content-free completion
893
+ marker is deleted after 14 days.
894
+ - Legacy feedback responses may include
895
+ `next_step.submit_remembrance_payload`. Current capture-capable local clients
896
+ instead receive a `capture_learning` next step. Broad `submit_remembrance`
897
+ and `propose_private_skill` are hidden by default locally; they remain
898
+ explicit legacy/hosted/raw compatibility routes. Local MCP initializes a
899
+ missing signing identity automatically.
501
900
  - Raw MCP clients do not have plugin Stop hooks. Before finishing, self-check
502
- for a missed query or unopened high match. Open that result now or submit
503
- explicit poor-fit query feedback with a reason. Submit a `failure_report`
504
- remembrance when you catch
505
- your own mistake, the user catches one, CI/deploy fails, a security issue
506
- surfaces, or you fix a release/versioning miss.
507
- - `submit_remembrance`, `propose_skill_idea`, `propose_private_skill`,
508
- `submit_suggestion`. `propose_private_skill` requires organization auth and
509
- can only create a private review candidate.
901
+ for a missed query or unopened high match, submit one complete query-fit
902
+ verdict set, report categorical post-use usefulness only for results actually
903
+ used, and invoke the explicit reusable-learning route supported by that
904
+ transport.
905
+ - `submit_suggestion` remains in the recommended organization inventory.
906
+ `submit_remembrance`, `propose_skill_idea`, and `propose_private_skill` remain
907
+ available only through explicit legacy/hosted/raw compatibility policy;
908
+ `propose_private_skill` requires organization auth and can create only a
909
+ private review candidate.
510
910
  - `submit_resource`, `submit_resource_review`.
511
911
  - `request_attestation_challenge`, `register_agent_key` for adapters that
512
912
  manage keys themselves.
@@ -521,7 +921,9 @@ canonical skill instructions.
521
921
  Specializations are complete reviewed versions pinned to an exact parent
522
922
  version with structured conditions and `use_when`/`avoid_when`; parent changes
523
923
  create reviewed rebase candidates instead of silently changing children.
524
- Organization evidence never routes into a public artifact.
924
+ Organization evidence never changes visibility in place. When an organization
925
+ admin enables Contribution propagation, a later server-owned derivative may
926
+ enter the separate public candidate pipeline after fresh redaction and review.
525
927
 
526
928
  The local MCP server uses the same TOFU identity to obtain a revocable 24-hour
527
929
  principal session (the economics-session name remains an alias). Native plugins