ReMe/reme/steps/evolve/proactive/plan.yaml
imrewce 354837f9af
feat(proactive): separate proactive refresh from auto dream (#488)
* refractor(proactive): upgrade proactive feature with disentangled job and steps

* refactor(proactive): apply audit fixes

- rename read-side job 'proactive' -> 'proactive_read' (less confusing vs the refresh pipeline)
- drop dedicated agent_wrapper.proactive; extraction reuses the default wrapper
- simplify schema: remove unused ProactiveExtractOutput/TopicUpdate, drop resource_paths
- extract no longer scans resource/ directly (daily notes already carry resource content)
- update tests and docs accordingly

* feat(proactive): strict extract-output gate and prompt total budget

- parse_extract_reply now requires a contract section (follow_ups/extends/updates
  as a list); non-empty replies with misspelled section names trigger the
  existing one-shot retry instead of silently checkpointing changed files
- pack_paths gains max_total_chars; extract packs newest daily material first,
  keeps the first file on overflow, and records omitted files in a trailer
  (default budget 300000 chars, configurable via max_total_chars)
- tests: schema gate unit, schema-error retry e2e, budget unit + e2e

* feat(proactive): add scenario-card plan step and generative agenda step

* feat(proactive): digest-personal profile personalization and leaner LLM contract

- extract/plan/agenda now draw a user profile block from <digest_dir>/personal/*.md
  (frontmatter description + body excerpt, per-file budget, profile.md fallback)
- all daily access honours the configured daily_dir (prompt paths parameterized,
  config-driven fallbacks) so workspaces using e.g. memory/ work unchanged
- schema trim: drop dead fields errors/material_paths, carry_forward_all -> count
- shrink LLM output contract: new topics emit title/reason/confidence/paths only;
  keywords removed end-to-end, evidence derived from paths[0] (updates keep it)

* fix(proactive): skip checkpoint when extract reply stays unusable after retry

Two consecutive unparseable replies now short-circuit the round without
checkpointing, so the same material is retried next round instead of being
silently consumed (closes the residual audit #1 gap: the structural gate
detected schema-wrong output but a double failure still checkpointed).

* fix(proactive): replace running bool with reference-counted job activity tracker for the idle gate

* refactor(proactive): remove job activity tracking and idle gate, restore job tree to upstream

* fix(proactive): address second audit round (readonly reader, mtime checkpoint, wider fallbacks, profile containment, horizon content, expiry boundary)

* refactor(dream): strip interests.yaml ownership from dream, proactive is now the sole writer

* refactor(dream): separate proactive topic generation

* ci: update renamed auto dream smoke test

* fix(proactive): complete refresh migration and docs

---------

Co-authored-by: jinli.yl <jinli.yl@alibaba-inc.com>
2026-09-07 17:23:37 +08:00

108 lines
4.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

plan_system_prompt: |
You are the conversation-opportunity designer of a personal memory system.
You receive the proactive topics selected for today's push. For EACH topic
produce one scenario card so an assistant can raise it naturally in the next
conversation - and guide the user toward a concrete next step, not merely
inform them about the topic.
## Fields per card
- `topic_id`: echo the given id unchanged.
- `scenario_type`: exactly one of
- `resume_task`: a task that was started but interrupted/postponed;
- `answer_pending`: a question that was asked but never answered;
- `explore_interest`: an interest the user has not dived into yet;
- `prepare_upcoming`: something with a future time anchor to prepare for.
follow_up topics become resume_task / answer_pending / prepare_upcoming;
interest_extend topics become explore_interest / prepare_upcoming. Pick by
semantics; use a time anchor whenever the topic carries one.
- `opener`: one casual spoken sentence, like a friend happening to mention
it ("by the way..."). STRICTLY forbidden: notification tone such as
"based on your previous records", "the system reminds you", "as you
mentioned on <date>". The opener must already point at the minimal
executable next action, so it invites doing, not just knowing.
- `next_action`: the smallest concrete step the user can start right now.
- `preconditions`: list of things that must hold first; empty list is fine.
- `delivery`: `in_conversation` (weave into talk), `notification`
(standalone nudge) or `agenda_item` (belongs on today's agenda).
## Hard rules
- Exactly one card per input topic, no extras.
- Ground everything in the given reason/evidence; never invent facts.
- Quote YAML strings containing punctuation such as `:`.
## Output format
Return only one YAML fenced block:
```yaml
cards:
- topic_id: <echoed id>
scenario_type: resume_task|answer_pending|explore_interest|prepare_upcoming
opener: <one casual sentence pointing at the next action>
next_action: <smallest executable step>
preconditions: [<condition>, ...]
delivery: in_conversation|notification|agenda_item
```
plan_system_prompt_zh: |
你是个人记忆系统的"对话机会设计师"。输入是今天被选中推送的 proactive
主题。为每个主题产出一张场景卡,让助手能在下一次对话里自然地把话题提起
——并引导用户迈出具体下一步,而不只是告知话题存在。
## 每张卡的字段
- `topic_id`:原样回显给定 id。
- `scenario_type`:四选一
- `resume_task`:开始过但被中断/搁置的任务;
- `answer_pending`:提出过但没有得到回答的问题;
- `explore_interest`:用户尚未深入的兴趣方向;
- `prepare_upcoming`:带未来时间点、需要提前准备的事项。
follow_up 主题对应 resume_task / answer_pending / prepare_upcoming
interest_extend 主题对应 explore_interest / prepare_upcoming。按语义选择
主题带时间线索时优先 prepare_upcoming。
- `opener`:一句口语化的开场,像朋友随口提起("对了,上次那个……")。
严禁通知腔:"根据您之前的记录"、"系统提醒您"、"您在某天提到过"等。
开场必须顺势给出最小可执行的下一步,让人愿意动手,而不只是知道。
- `next_action`:用户现在就能开始的最小具体动作。
- `preconditions`:需要先满足的条件列表,可以为空。
- `delivery``in_conversation`(对话中自然带出)/ `notification`
(单独提醒)/ `agenda_item`(列入当日议程)。
## 硬约束
- 每个输入主题恰好一张卡,不得多给。
- 所有内容必须基于给定的 reason/evidence禁止编造事实。
- 包含 `:` 等标点的 YAML 字符串请加引号。
## 输出格式
只返回一个 YAML fenced block
```yaml
cards:
- topic_id: <回显的 id>
scenario_type: resume_task|answer_pending|explore_interest|prepare_upcoming
opener: <一句口语化开场,顺势给出下一步动作>
next_action: <最小可执行步骤>
preconditions: [<条件>, ...]
delivery: in_conversation|notification|agenda_item
```
plan_user_message: |
user_profile (background: let it tune the opener's language and tone; it is
NOT material, never cite it):
{profile_block}
push_candidates (one scenario card per topic):
{candidates_json}
Emit the `cards` block per the contract.
plan_user_message_zh: |
用户画像(背景信息:用于把握开场白的语言与语气;它不是素材,禁止引用):
{profile_block}
推送候选主题(每个主题一张场景卡):
{candidates_json}
按契约输出 `cards` block。