Skip to content

feat(memory): wire goal_text from agent context into remember() calls for CraniMem write gate #2483

@bug-ops

Description

@bug-ops

Context

PR implementing #2408 (CraniMem goal-conditioned write gate) added goal_utility as a 6th admission factor and wired with_goal_gate() into AdmissionControl at bootstrap. However, remember() and remember_with_parts() in semantic/recall.rs currently always pass None for goal_text.

Required Change

In zeph-core, derive goal_text per-turn from:

  • The system prompt's task description (if present)
  • The most recent user message (as proxy for immediate intent)

Pass it through the agent context builder into SemanticMemory::remember() / remember_with_parts() so that AdmissionControl::evaluate() receives the goal context and can apply the goal-conditioned gate.

Acceptance Criteria

  • goal_text is computed per-turn in context assembly
  • Passed to remember() calls so goal gate is active when goal_conditioned_write = true
  • Zero behavior change when goal_conditioned_write = false

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityenhancementNew feature or requestmemoryzeph-memory crate (SQLite)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions