live-compute friends progress in [GOALS] block
the goal record's progress_signal ended with frozen text ("currently: 0")
that phi read as current state but which never updated. phi had in fact
had substantive multi-turn exchanges with donna-ai, agent-tsumugi, kira,
and a few others — she was reasoning against stale author-intent text
instead of current reality.
fix: the record text stays as-is (goal is authoring-intent, mutated via
owner-gated propose_goal_change). at prompt-render time, count handles
in turbopuffer with >=3 stored interactions and append a `current
(computed)` line to the goal block. phi sees both: the definition and
the live count, and can tell which applies.
heuristic: the friends-count appends only to goals whose title contains
"friend" — generalizes to a per-goal computed-progress map later if more
goals accrue that need similar computation.
implementation:
- core/self_state.py: new _compute_friends_progress(memory) that lists
phi-users-* namespaces and counts kind=interaction rows per handle,
excluding phi herself and the operator. _format_goals_block gains a
friends_progress param and appends the computed line.
- get_state_block(client, memory=None) accepts memory for live compute;
falls back silently if memory unavailable (dev/local).
- agent.py inject_self_state passes self.memory through.
102 tests pass.
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>