journal tools: use NodeType instead of string key matching

- journal_new: create EpisodicSession node with auto-generated key
- journal_tail: query by node_type, not by parsing a monolithic node
- journal_update: find latest EpisodicSession by timestamp
- No string key matching anywhere — all typed
- Fixes journal entries not appearing in 'poc-memory journal tail'
- Also: added --provenance/-p filter to 'poc-memory tail'
- Also: fix early return in surface_observe_cycle store load failure
- Also: scale max_turns by number of steps (50 per step)

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
ProofOfConcept 2026-03-26 18:41:10 -04:00
parent 41fcec58f0
commit 85fa54cba9
5 changed files with 72 additions and 54 deletions

View file

@ -90,6 +90,9 @@ enum Command {
/// Show full content
#[arg(long)]
full: bool,
/// Filter by provenance (substring match, e.g. "surface-observe")
#[arg(long, short)]
provenance: Option<String>,
},
/// Summary of memory state
Status,
@ -782,7 +785,8 @@ impl Run for Command {
Self::Write { key } => cli::node::cmd_write(&key),
Self::Edit { key } => cli::node::cmd_edit(&key),
Self::History { full, key } => cli::node::cmd_history(&key, full),
Self::Tail { n, full } => cli::journal::cmd_tail(n, full),
Self::Tail { n, full, provenance }
=> cli::journal::cmd_tail(n, full, provenance.as_deref()),
Self::Status => cli::misc::cmd_status(),
Self::Query { expr } => cli::misc::cmd_query(&expr),
Self::Used { key } => cli::node::cmd_used(&key),