fix: handle non-interactive init prompts gracefully#13
Closed
sheetsync wants to merge 1 commit intoMemPalace:mainfrom
Closed
fix: handle non-interactive init prompts gracefully#13sheetsync wants to merge 1 commit intoMemPalace:mainfrom
sheetsync wants to merge 1 commit intoMemPalace:mainfrom
Conversation
Collaborator
|
This was fixed in #123 — |
igorls
added a commit
to igorls/mempalace
that referenced
this pull request
Apr 7, 2026
MCP tool_add_drawer: - Make drawer_id content-based: hash full content instead of content[:100] + timestamp. Same content → same ID, eliminating TOCTOU race conditions - Switch from col.add() to col.upsert() so re-filing with updated content updates the existing drawer miner.add_drawer: - Switch from collection.add() to collection.upsert() so re-mining a modified file updates instead of silently failing - Remove the try/except catching 'already exists' — upsert handles this naturally Findings: MemPalace#11 (HIGH — add ignores updates), MemPalace#6 (MEDIUM — TOCTOU), MemPalace#13 (MEDIUM — non-deterministic IDs) Includes test infrastructure from PR MemPalace#131. 92 tests pass.
igorls
added a commit
to igorls/mempalace
that referenced
this pull request
Apr 7, 2026
MCP tool_add_drawer: - Make drawer_id content-based: hash full content instead of content[:100] + timestamp. Same content → same ID, eliminating TOCTOU race conditions - Switch from col.add() to col.upsert() so re-filing with updated content updates the existing drawer miner.add_drawer: - Switch from collection.add() to collection.upsert() so re-mining a modified file updates instead of silently failing - Remove the try/except catching 'already exists' — upsert handles this naturally Findings: MemPalace#11 (HIGH — add ignores updates), MemPalace#6 (MEDIUM — TOCTOU), MemPalace#13 (MEDIUM — non-deterministic IDs) Includes test infrastructure from PR MemPalace#131. 92 tests pass.
igorls
added a commit
to igorls/mempalace
that referenced
this pull request
Apr 8, 2026
MCP tool_add_drawer: - Make drawer_id content-based: hash full content instead of content[:100] + timestamp. Same content → same ID, eliminating TOCTOU race conditions - Switch from col.add() to col.upsert() so re-filing with updated content updates the existing drawer miner.add_drawer: - Switch from collection.add() to collection.upsert() so re-mining a modified file updates instead of silently failing - Remove the try/except catching 'already exists' — upsert handles this naturally Findings: MemPalace#11 (HIGH — add ignores updates), MemPalace#6 (MEDIUM — TOCTOU), MemPalace#13 (MEDIUM — non-deterministic IDs) Includes test infrastructure from PR MemPalace#131. 92 tests pass.
igorls
added a commit
to igorls/mempalace
that referenced
this pull request
Apr 8, 2026
MCP tool_add_drawer: - Make drawer_id content-based: hash full content instead of content[:100] + timestamp. Same content → same ID, eliminating TOCTOU race conditions - Switch from col.add() to col.upsert() so re-filing with updated content updates the existing drawer miner.add_drawer: - Switch from collection.add() to collection.upsert() so re-mining a modified file updates instead of silently failing - Remove the try/except catching 'already exists' — upsert handles this naturally Findings: MemPalace#11 (HIGH — add ignores updates), MemPalace#6 (MEDIUM — TOCTOU), MemPalace#13 (MEDIUM — non-deterministic IDs) Includes test infrastructure from PR MemPalace#131. 92 tests pass.
igorls
added a commit
to igorls/mempalace
that referenced
this pull request
Apr 8, 2026
MCP tool_add_drawer: - Make drawer_id content-based: hash full content instead of content[:100] + timestamp. Same content → same ID, eliminating TOCTOU race conditions - Switch from col.add() to col.upsert() so re-filing with updated content updates the existing drawer miner.add_drawer: - Switch from collection.add() to collection.upsert() so re-mining a modified file updates instead of silently failing - Remove the try/except catching 'already exists' — upsert handles this naturally Findings: MemPalace#11 (HIGH — add ignores updates), MemPalace#6 (MEDIUM — TOCTOU), MemPalace#13 (MEDIUM — non-deterministic IDs) Includes test infrastructure from PR MemPalace#131. 92 tests pass.
gnusam
pushed a commit
to gnusam/mempalace-pgsql
that referenced
this pull request
Apr 9, 2026
Port of upstream a4149ab (by @igorls, findings MemPalace#6, MemPalace#11, MemPalace#13) adapted to the PG+pgvector backend. 1. MCP/diary path ID is now hash(content), not content[:200]+timestamp. Same content → same deterministic ID. Eliminates TOCTOU races and stops identical content from piling up as distinct duplicate rows. Matches upstream's intent (findings MemPalace#6 TOCTOU, MemPalace#13 non-deterministic IDs). 2. INSERT ... ON CONFLICT (id) DO NOTHING → ON CONFLICT (id) DO UPDATE. Re-mining a modified file previously got the new content silently dropped because the slot ID matched an existing row (upstream finding MemPalace#11 HIGH — "add ignores updates"). True upsert: content, embedding, metadata, and filed_at are all refreshed. 3. add_drawer now always returns the drawer_id (both insert and update paths). The old "return None on conflict" signal implicitly encoded the stagnation bug and is no longer meaningful. Updated tests/test_db.py::test_mine_drawer_reupsert_by_source to assert the new upsert semantics instead of the stagnation assertion it replaced, and added test_mcp_add_drawer_is_idempotent_on_same_content to cover the deterministic-content-ID path. The mtime-based file_already_mined half of bf88daa is in a follow-up commit. Co-Authored-By: Igor Lins e Silva <[email protected]> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
jphein
referenced
this pull request
in jphein/mempalace
Apr 27, 2026
Three new fork-change rows for 2026-04-27 work that wasn't yet
captured in the documented inventory:
29. CLOSET_RANK_BOOSTS hoist + VecRecall ablation finding
(f558d3c → 3cb03f3) — module-level constants + 12-probe A/B
showing closet boost is mostly inert on chat-heavy corpus;
VecRecall's MemPalace#1129 critique didn't reproduce.
30. .claude-plugin/ manifest scrub (8119149 → 9f91e18) — removed
embedded API key + homelab URL from .mcp.json and hooks.json;
daemon routing restored without the literal credential, env
inherits from settings.local.json at runtime.
31. palace-daemon upstream PR push (PRs #7-#13) — seven small/medium
PRs covering most fork-ahead daemon work; pending follow-ups
and needs-generalization items tracked in daemon README.
YAML manifest gets corresponding entries for MemPalace#29 (kind-filter-retired,
closet-boost-ablation) and MemPalace#30 (plugin-manifest-scrub); FORK_CHANGELOG
re-rendered. Lint clean (11 fork hashes resolve, 90 PR refs match
upstream, FORK_CHANGELOG matches YAML).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repro
Before this change, running
mempalace init <dir> < /dev/nullcrashed withEOFErrorwhen room approval prompted for input.Validation
pytest -qpython -m mempalace init <dir> < /dev/nullnow writesmempalace.yamlinstead of crashing