Explorar el Código

docs: plan EventPrompt payload singleton

Problem: dual_agent could serialize a generated-signature custom prompt alongside the managed EventPrompt.\n\nRisk: the collector fix must preserve ordinary custom prompt order while filtering only the established generated signature.
zhenyu.hu hace 2 semanas
padre
commit
c343337410
Se han modificado 2 ficheros con 29 adiciones y 0 borrados
  1. 28 0
      docs/plans/todo-53.3-event-prompt-payload-singleton.md
  2. 1 0
      docs/plans/todos.md

+ 28 - 0
docs/plans/todo-53.3-event-prompt-payload-singleton.md

@@ -0,0 +1,28 @@
+# Todo 53.3: EventPrompt Payload Singleton
+
+## Problem
+
+The DOM refresh path removes duplicate generated EventPrompt items, but `collectSystemPrompts()` in `dual_agent` currently serializes every prompt item. A stale or user-edited custom item containing the complete generated EventPrompt signature can therefore be sent alongside the managed EventPrompt.
+
+## Scope
+
+- At the outbound collection boundary, discard generated-signature custom items in both invocation modes.
+- In `dual_agent`, retain only the managed `event_agent_system` item plus ordinary custom prompts.
+- In `chat_agent_tools`, retain ordinary custom prompts only and send no EventPrompt.
+- Preserve prompt order and content for ordinary custom items.
+- Do not alter restore, EventPrompt positioning, backend contracts, or UI layout.
+
+## TDD Steps
+
+1. Change the existing Node behavior test so `dual_agent` expects exactly one generated prompt instead of accepting a generated-signature custom duplicate.
+2. Run the focused test and confirm RED against the current collector.
+3. Apply the minimal filter in `collectSystemPrompts()`.
+4. Verify ordinary custom prompts and managed EventPrompt order remain unchanged.
+5. Run focused/full WebSocket tests, Node syntax, diff checks, and independent review.
+
+## Acceptance
+
+- `dual_agent` serializes ordinary custom prompts and at most one managed EventPrompt.
+- `chat_agent_tools` serializes ordinary custom prompts and zero EventPrompt content.
+- A generated-signature custom item cannot bypass the outbound boundary.
+- EventPrompt visibility, ordering, restore deduplication, and tool-derived content remain unchanged.

+ 1 - 0
docs/plans/todos.md

@@ -117,3 +117,4 @@
 | 53 | in_progress | `docs/plans/todo-53-professional-debug-console-ui.md` | Redesign the static UI as a professional debug console and make EventPrompt visibility/content follow invocation mode and selected tools. | Written design is approved; implementation verification covers focused static/WebSocket regressions, JS syntax, full pytest, and desktop/narrow browser QA. |
 | 53.1 | done | `docs/plans/todo-53.1-event-prompt-order-preservation.md` | Preserve the user-selected EventPrompt position while mode/tool refreshes still deduplicate and regenerate its content. | RED: `3 failed, 5 passed`; GREEN: focused `8 passed`, full WebSocket file `84 passed`; Node syntax and diff checks pass; behavior tests cover refresh, mode round trip, restore position, and duplicate cleanup. |
 | 53.2 | done | `docs/plans/todo-53.2-console-interaction-state.md` | Make the new collapsible control sections and Audit/Usage drawer operable, persistent, and synchronized with session/mode status. | RED: `6 failed, 9 passed`; GREEN: focused `15 passed`, full WebSocket file `94 passed`; Node/diff checks and independent spec/code-quality reviews pass. |
+| 53.3 | in_progress | `docs/plans/todo-53.3-event-prompt-payload-singleton.md` | Enforce the EventPrompt singleton at the outbound payload boundary in both invocation modes, including stale or user-edited generated-signature custom prompts. | A failing behavior test proves `dual_agent` sends one managed EventPrompt and `chat_agent_tools` sends none; focused/full tests and review gates pass. |