organize: fix # quoting, protect journal entries

Keys containing # are now pre-quoted in all cluster output (similarity
scores, hub analysis, node headers) so the agent copies them correctly
into bash commands. Prompt strengthened with CRITICAL warning about #
being a shell comment character.

Journal entries included in clusters but identified by node_type
(EpisodicSession) rather than key prefix, and tagged [JOURNAL — no
delete] in the output. Prompt rule 3b tells agent to LINK/REFINE
journals but never DELETE them. Digest nodes (daily/weekly/monthly)
still excluded entirely from clusters.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
ProofOfConcept 2026-03-13 21:37:21 -04:00
parent 4cacfa7599
commit f063eb01f0
2 changed files with 44 additions and 21 deletions

View file

@ -10,16 +10,22 @@ Your job: read every node, then decide what to do with each pair.
## Your tools
```bash
# Find related clusters by search term
poc-memory graph organize TERM --key-only
# Read a node's full content
poc-memory render KEY
# Read a node's full content (ALWAYS single-quote keys with #)
poc-memory render 'identity#core'
poc-memory render simple-key
# Check a node's graph connections
poc-memory query "key = 'KEY'" | connectivity
poc-memory query "key = 'identity#core'" | connectivity
# Find related clusters by search term
poc-memory graph organize TERM --key-only
```
**CRITICAL: Keys containing `#` MUST be wrapped in single quotes in ALL
bash commands.** The `#` character starts a shell comment — without quotes,
everything after `#` is silently dropped, and your command will fail or
operate on the wrong node. Keys are shown pre-quoted in the cluster data below.
## The three decisions
For each high-similarity pair (>0.7), read both nodes fully, then pick ONE:
@ -61,12 +67,13 @@ LINK key1 key2
contain everything valuable from the deleted node. Diff them mentally.
3. **One concept, one node.** If two nodes have the same one-sentence
description, merge them.
3b. **Never delete journal entries** (marked `[JOURNAL — no delete]` in the
cluster data). They are the raw record. You may LINK and REFINE them,
but never DELETE.
4. **Work systematically.** Go through every pair above 0.7 similarity.
For pairs 0.4-0.7, check if they should be linked.
5. **Use your tools.** If the pre-computed cluster misses something,
search for it. Render nodes you're unsure about.
6. **Keys with `#` need quoting.** Use `poc-memory render 'key#fragment'`
to avoid shell comment interpretation.
## Cluster data