From cd98c8167a49c638e47e9cc4a6fef50f45a8340c Mon Sep 17 00:00:00 2001 From: Hare Date: Fri, 29 May 2026 14:05:45 +0900 Subject: [PATCH] ticket: close system reminder lane --- .../artifacts/.gitkeep | 0 .../item.md | 4 +- .../resolution.md | 69 +++++++++++++++ .../thread.md | 84 +++++++++++++++++++ .../thread.md | 7 -- 5 files changed, 155 insertions(+), 9 deletions(-) rename work-items/{open => closed}/20260527-000020-system-reminder-injection-generalization/artifacts/.gitkeep (100%) rename work-items/{open => closed}/20260527-000020-system-reminder-injection-generalization/item.md (98%) create mode 100644 work-items/closed/20260527-000020-system-reminder-injection-generalization/resolution.md create mode 100644 work-items/closed/20260527-000020-system-reminder-injection-generalization/thread.md delete mode 100644 work-items/open/20260527-000020-system-reminder-injection-generalization/thread.md diff --git a/work-items/open/20260527-000020-system-reminder-injection-generalization/artifacts/.gitkeep b/work-items/closed/20260527-000020-system-reminder-injection-generalization/artifacts/.gitkeep similarity index 100% rename from work-items/open/20260527-000020-system-reminder-injection-generalization/artifacts/.gitkeep rename to work-items/closed/20260527-000020-system-reminder-injection-generalization/artifacts/.gitkeep diff --git a/work-items/open/20260527-000020-system-reminder-injection-generalization/item.md b/work-items/closed/20260527-000020-system-reminder-injection-generalization/item.md similarity index 98% rename from work-items/open/20260527-000020-system-reminder-injection-generalization/item.md rename to work-items/closed/20260527-000020-system-reminder-injection-generalization/item.md index cc91cff9..3151ca3c 100644 --- a/work-items/open/20260527-000020-system-reminder-injection-generalization/item.md +++ b/work-items/closed/20260527-000020-system-reminder-injection-generalization/item.md @@ -2,12 +2,12 @@ id: 20260527-000020-system-reminder-injection-generalization slug: system-reminder-injection-generalization title: Generalize system-reminder history append lane -status: open +status: closed kind: task priority: P2 labels: [pod, llm-worker, history, system-reminder] created_at: 2026-05-27T00:00:20Z -updated_at: 2026-05-29T04:46:00Z +updated_at: 2026-05-29T05:05:43Z assignee: null legacy_ticket: null --- diff --git a/work-items/closed/20260527-000020-system-reminder-injection-generalization/resolution.md b/work-items/closed/20260527-000020-system-reminder-injection-generalization/resolution.md new file mode 100644 index 00000000..3151ca3c --- /dev/null +++ b/work-items/closed/20260527-000020-system-reminder-injection-generalization/resolution.md @@ -0,0 +1,69 @@ +--- +id: 20260527-000020-system-reminder-injection-generalization +slug: system-reminder-injection-generalization +title: Generalize system-reminder history append lane +status: closed +kind: task +priority: P2 +labels: [pod, llm-worker, history, system-reminder] +created_at: 2026-05-27T00:00:20Z +updated_at: 2026-05-29T05:05:43Z +assignee: null +legacy_ticket: null +--- + +## Background + +`session-todo-reminder` established the first concrete `...` user: Task inactivity reminders are appended through `pending_history_appends` so the reminder is persisted in `worker.history` before the next LLM request. This follows the context-processing rule that new non-volatile input must be appended to history rather than injected only into request context. + +The current implementation should now be generalized so future reminder producers do not each hand-roll XML tags, `SystemItem` construction, source labeling, cooldown/priority plumbing, or history-append integration. + +This ticket is about making the system-reminder append lane a small typed facility. It is not about adding new reminder policies beyond existing Task reminders. + +## Requirements + +- Introduce a typed internal representation for pending system reminders. + - text/body + - source/kind, e.g. task inactivity + - optional priority/order key if needed + - helper that renders the body inside `...` exactly once +- Route reminders through the existing `Interceptor::pending_history_appends` lane. + - The final result must still be `Item::System(SystemItem { kind: InvokeKind::SystemReminder, ... })` or equivalent current protocol type. + - The reminder must be appended to `worker.history`; do not introduce hidden request-only context injection. +- Refactor `session-todo-reminder` to use this typed helper/facility. + - Task reminder behavior, thresholds, cooldown, and tests should remain unchanged. + - The helper should prevent double-wrapping if the body is already tagged, or the API should make double-wrapping impossible. +- Keep `Notify` / `PodEvent` behavior unchanged. + - Do not merge raw notify and system reminder semantics. + - If they share buffering mechanics, keep the public behavior and rendered tags distinct. +- Keep ordering deterministic. + - If multiple reminder producers are added later, ordering should be explicit or stable. + - For now, existing Task reminder order relative to Notify/PodEvent should be preserved unless there is a clear reason to change it. +- Add docs/comments near the facility explaining the rule: + - system reminders are durable input and must be appended through history. + - they are not transient UI notices. + - they are not prompt-cache/context-only injections. + +## Acceptance criteria + +- There is a typed system-reminder helper/facility rather than ad-hoc string construction in Task reminder code. +- Task inactivity reminders still appear as `...` in `pending_history_appends` output. +- The helper emits `InvokeKind::SystemReminder` / current system-reminder item kind. +- Existing Task reminder tests continue to pass. +- New focused tests cover: + - rendering wraps body once. + - source/kind is retained or observable where appropriate. + - Task reminder uses the helper and remains history-append based. + - no hidden context-only injection path is introduced. +- `cargo fmt --check` +- `cargo check -p pod -p llm-worker -p session-store` +- Relevant focused tests, e.g. `cargo test -p pod reminder --no-default-features`. + +## Out of scope + +- Adding a second reminder policy. +- Changing Task reminder thresholds/cooldown. +- Changing Notify/PodEvent user-visible behavior. +- UI actionbar notices. +- Prompt text changes. +- Generic notification center or reminder scheduling service. diff --git a/work-items/closed/20260527-000020-system-reminder-injection-generalization/thread.md b/work-items/closed/20260527-000020-system-reminder-injection-generalization/thread.md new file mode 100644 index 00000000..f12c381f --- /dev/null +++ b/work-items/closed/20260527-000020-system-reminder-injection-generalization/thread.md @@ -0,0 +1,84 @@ + + +## Migrated + +Migrated from TODO.md entry without a legacy ticket file. No legacy review file was present at migration time. + +--- + + + +## Closed + +--- +id: 20260527-000020-system-reminder-injection-generalization +slug: system-reminder-injection-generalization +title: Generalize system-reminder history append lane +status: closed +kind: task +priority: P2 +labels: [pod, llm-worker, history, system-reminder] +created_at: 2026-05-27T00:00:20Z +updated_at: 2026-05-29T05:05:43Z +assignee: null +legacy_ticket: null +--- + +## Background + +`session-todo-reminder` established the first concrete `...` user: Task inactivity reminders are appended through `pending_history_appends` so the reminder is persisted in `worker.history` before the next LLM request. This follows the context-processing rule that new non-volatile input must be appended to history rather than injected only into request context. + +The current implementation should now be generalized so future reminder producers do not each hand-roll XML tags, `SystemItem` construction, source labeling, cooldown/priority plumbing, or history-append integration. + +This ticket is about making the system-reminder append lane a small typed facility. It is not about adding new reminder policies beyond existing Task reminders. + +## Requirements + +- Introduce a typed internal representation for pending system reminders. + - text/body + - source/kind, e.g. task inactivity + - optional priority/order key if needed + - helper that renders the body inside `...` exactly once +- Route reminders through the existing `Interceptor::pending_history_appends` lane. + - The final result must still be `Item::System(SystemItem { kind: InvokeKind::SystemReminder, ... })` or equivalent current protocol type. + - The reminder must be appended to `worker.history`; do not introduce hidden request-only context injection. +- Refactor `session-todo-reminder` to use this typed helper/facility. + - Task reminder behavior, thresholds, cooldown, and tests should remain unchanged. + - The helper should prevent double-wrapping if the body is already tagged, or the API should make double-wrapping impossible. +- Keep `Notify` / `PodEvent` behavior unchanged. + - Do not merge raw notify and system reminder semantics. + - If they share buffering mechanics, keep the public behavior and rendered tags distinct. +- Keep ordering deterministic. + - If multiple reminder producers are added later, ordering should be explicit or stable. + - For now, existing Task reminder order relative to Notify/PodEvent should be preserved unless there is a clear reason to change it. +- Add docs/comments near the facility explaining the rule: + - system reminders are durable input and must be appended through history. + - they are not transient UI notices. + - they are not prompt-cache/context-only injections. + +## Acceptance criteria + +- There is a typed system-reminder helper/facility rather than ad-hoc string construction in Task reminder code. +- Task inactivity reminders still appear as `...` in `pending_history_appends` output. +- The helper emits `InvokeKind::SystemReminder` / current system-reminder item kind. +- Existing Task reminder tests continue to pass. +- New focused tests cover: + - rendering wraps body once. + - source/kind is retained or observable where appropriate. + - Task reminder uses the helper and remains history-append based. + - no hidden context-only injection path is introduced. +- `cargo fmt --check` +- `cargo check -p pod -p llm-worker -p session-store` +- Relevant focused tests, e.g. `cargo test -p pod reminder --no-default-features`. + +## Out of scope + +- Adding a second reminder policy. +- Changing Task reminder thresholds/cooldown. +- Changing Notify/PodEvent user-visible behavior. +- UI actionbar notices. +- Prompt text changes. +- Generic notification center or reminder scheduling service. + + +--- diff --git a/work-items/open/20260527-000020-system-reminder-injection-generalization/thread.md b/work-items/open/20260527-000020-system-reminder-injection-generalization/thread.md deleted file mode 100644 index b93af586..00000000 --- a/work-items/open/20260527-000020-system-reminder-injection-generalization/thread.md +++ /dev/null @@ -1,7 +0,0 @@ - - -## Migrated - -Migrated from TODO.md entry without a legacy ticket file. No legacy review file was present at migration time. - ----