Skip to content

refactor: update memory recall methods to return context as JSON values#16

Merged
senamakel merged 1 commit intotinyhumansai:developfrom
M3gA-Mind:develop
Mar 26, 2026
Merged

refactor: update memory recall methods to return context as JSON values#16
senamakel merged 1 commit intotinyhumansai:developfrom
M3gA-Mind:develop

Conversation

@M3gA-Mind
Copy link
Copy Markdown
Contributor

  • Changed the return type of recall_skill_context to Option<serde_json::Value> for better flexibility.
  • Updated logging to provide clearer insights during memory recall operations.
  • Simplified context handling in chat_send_inner and recall_memory functions to improve readability.

- Changed the return type of `recall_skill_context` to `Option<serde_json::Value>` for better flexibility.
- Updated logging to provide clearer insights during memory recall operations.
- Simplified context handling in `chat_send_inner` and `recall_memory` functions to improve readability.
@senamakel senamakel merged commit 4cf5408 into tinyhumansai:develop Mar 26, 2026
1 of 4 checks passed
sanil-23 added a commit to sanil-23/openhuman that referenced this pull request Apr 28, 2026
…ems)

tinyhumansai#4  gmail unknown bucket — orphan:{id} fallback instead of collapsing
    all no-address messages into one "unknown" source tree; messages with
    neither address nor id are dropped with a warn (skip sentinel).

tinyhumansai#5  PII in gmail/ingest.rs — participants, source_id, and owner wrapped
    with redact() before logging; no email addresses in log output.

tinyhumansai#7  PII in chunker.rs — source_id in debug logs replaced with
    redact(source_id) hash.

tinyhumansai#8  Parent dir fsync after rename in atomic.rs — on Unix, open the parent
    directory and call sync_all() after a successful rename so the dirent
    is durable across a crash; best-effort warn on failure, non-fatal.

tinyhumansai#9  Body verify on re-stage in atomic.rs — when the path already exists,
    read and hash the on-disk body; if sha differs from the new body,
    remove the stale file and re-write atomically so SQLite content_sha256
    always matches the on-disk bytes. New unit test covers the re-write path.

tinyhumansai#10 PII in paths.rs — malformed source_id fallback log now emits
    redact(source_id) instead of the raw string.

tinyhumansai#11 PII in read.rs — sha256 mismatch warn logs now emit
    redact(abs_path) instead of abs_path.display().

tinyhumansai#13 Same-tx enqueue in handle_extract — append_buffer and topic_route
    jobs are built before the transaction opens and enqueued via
    enqueue_tx() inside the same tx that commits the lifecycle update,
    eliminating the crash window where lifecycle commits but jobs are lost.

tinyhumansai#16 PII in score/extract/mod.rs — LLM extractor info! log demoted to
    debug! and endpoint wrapped with redact_endpoint() to strip
    path/query/credentials from the URL.

tinyhumansai#17 Non-email scope slug in bucket_seal.rs — only the gmail: prefix is
    stripped before slugify; all other source kinds (slack:, discord:,
    document:, …) slugify the full scope string so slack:#eng and
    discord:#eng no longer produce the same "eng" slug and collide in
    summaries/source/.

tinyhumansai#18 Don't commit summary on stage_summary failure — bucket_seal.rs,
    global_tree/digest.rs, and global_tree/seal.rs now propagate
    stage_summary errors via .context()?  instead of falling back to a
    NULL content_path row; the seal is retried via the normal job-retry
    path. insert_summary_tx callers in those three paths now always pass
    Some(&staged) instead of Option.

tinyhumansai#20 PII in topic_tree/backfill.rs — all entity_id occurrences in log
    lines (info/debug/warn) replaced with redact(entity_id).

New shared helper: src/openhuman/memory/tree/util/redact.rs
  - redact(s)          → stable 8-hex-char SHA-256 prefix for PII fields
  - redact_endpoint(u) → host:port only (strips scheme, creds, path, query)
  - Full unit-test coverage for both helpers

Items tinyhumansai#14 (lease tokens) and tinyhumansai#19 (preview-vs-disk reader audit)
intentionally deferred to follow-up commits — both have larger blast
radius and need separate review.

Items tinyhumansai#1, tinyhumansai#12, tinyhumansai#15 pushed back on PR thread (verified false positive or
covered by upstream contract).

Items #2, tinyhumansai#3 deferred (pre-existing in slack_backfill.rs, not introduced
by this PR).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants