SatisfactionCapture persists <private> spans verbatim into MEMORY/LEARNING on a low rating

Open
#2,626 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend, security

Research direction

Read hooks/SatisfactionCapture.hook.ts, especially captureLowRatingLearning and the explicit and implicit call paths, then check how stripPrivateContent is used in LIFEOS/TOOLS/CaptureEnvelope.ts and the memory writers. Trace captureFailure and the Errata row as the issue suggests. Done when private spans from feedback and response context are not persisted in low-rating learning files, with related writers checked for the same gap.

Written by the indexing model from the issue text.

Description

What happens

On a low rating (< 5), captureLowRatingLearning in hooks/SatisfactionCapture.hook.ts writes the rating comment and the last assistant response straight into MEMORY/LEARNING/<category>/<YYYY-MM>/…_LEARNING_low-rating-N.md. Neither string passes through stripPrivateContent, so any <private>…</private> span in either one is persisted verbatim.

In 8.761.0 (b7efec97):

  • hooks/SatisfactionCapture.hook.ts:427-482: summaryOrComment goes into the **Feedback:** line and detailedContext goes into ## Context, then writeFileSync(filepath, content, 'utf-8').
  • hooks/SatisfactionCapture.hook.ts:530 (explicit) and the implicit path pass explicitResult.comment and getSessionLastResponse(...) unchanged.

Why it matters

LIFEOS/DOCUMENTATION/Memory/CortexContract.md:154 says that private spans are "never persist or export", and stripPrivateContent (LIFEOS/TOOLS/CaptureEnvelope.ts:20) already exists for this. MemoryReviewer.ts and MemorySystem.ts call it before they persist anything. The low-rating learning file is persisted memory as well, but it skips that boundary.

Repro (traced in the code; I did not run it)

  1. Rate a turn low, with a comment that holds a private span, e.g. 3 - <private>secret detail</private> wrong file.
  2. Open the newest MEMORY/LEARNING/*/*/…_LEARNING_low-rating-3.md. The span is there verbatim.

Suggested fix

Inside captureLowRatingLearning, wrap both strings before they are used, which also covers getLearningCategory:

summaryOrComment = stripPrivateContent(summaryOrComment);
detailedContext = stripPrivateContent(detailedContext);

I have not checked the other writers on the same path, captureFailure and the Errata row. They may need the same treatment.

Dominant language
TypeScript
Stars
19.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from danielmiessler/LifeOS

All issues in danielmiessler/LifeOS

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.