Ver Fonte

docs: plan bare volume numeric guard

Problem: malformed decimal or grouped numbers in existing bare volume syntax can still be truncated and executed.

Risk: the guard must mirror existing bare syntax without rejecting valid integer requests or expanding the language surface.
zhenyu.hu há 2 semanas atrás
pai
commit
9334465fc7
2 ficheiros alterados com 25 adições e 0 exclusões
  1. 24 0
      docs/plans/todo-47.3-bare-volume-numeric-guard.md
  2. 1 0
      docs/plans/todos.md

+ 24 - 0
docs/plans/todo-47.3-bare-volume-numeric-guard.md

@@ -0,0 +1,24 @@
+# Todo 47.3 Bare Volume Numeric Guard Plan
+
+**Status:** in_progress
+
+## Goal
+
+Close the final named volume-token gap by applying the existing malformed-number guard to bare `volume to`, `volume at`, and `volume=` forms.
+
+## Scope
+
+- Add RED tests for `volume to 40.5`, `volume at 1,000`, and `volume=40.5`.
+- Assert no fallback, no port call, and structured invalid arguments.
+- Preserve valid bare integer forms such as `volume to 40`, `volume at 40`, and `volume=40`.
+
+## Files
+
+- Modify: `src/agent_lab/application/events/builtin_plugins.py`
+- Modify: `tests/test_builtin_event_plugins.py`
+
+## Verification
+
+- `UV_CACHE_DIR=.uv-cache uv run pytest tests/test_builtin_event_plugins.py -q`
+- `UV_CACHE_DIR=.uv-cache uv run pytest`
+- `git diff --check`

+ 1 - 0
docs/plans/todos.md

@@ -87,6 +87,7 @@
 | 47 | in_progress | `docs/plans/todo-47-built-in-event-plugins.md` | Add terminate-session, device-volume, schedule, and web-search as built-in plugins on the generic event kernel. | Plugin contract tests cover valid, ambiguous, invalid, idempotent, and failure results for all four events. |
 | 47.1 | in_progress | `docs/plans/todo-47.1-plugin-normalization-and-validation.md` | Share plugin normalization across invocation modes and harden negation, numeric, date/timezone, query, and adapter idempotency boundaries. | Direct/dual canonical results match; negated/oversized volume never executes; invalid calendar/timezone and blank query are rejected; short ID collisions cannot return stale results. |
 | 47.2 | in_progress | `docs/plans/todo-47.2-plugin-token-and-compatibility-boundaries.md` | Reject remaining negated/non-integer volume tokens, canonicalize integral JSON numbers, preserve fallback state, use standard date-time semantics, and restore positional dataclass compatibility. | No negated/decimal/grouped volume side effects; `2.0` becomes canonical `2`; fallback errors retain usage; lowercase RFC3339 works; old positional definitions remain valid. |
+| 47.3 | in_progress | `docs/plans/todo-47.3-bare-volume-numeric-guard.md` | Apply malformed numeric rejection to the existing bare `volume to`, `volume at`, and `volume=` syntaxes. | Decimal/grouped bare volume requests never truncate or call the port; existing integer bare syntax remains valid. |
 | 48 | pending | `docs/plans/todo-48-parallel-event-batches.md` | Execute multiple flat events with bounded parallelism, failure isolation, aggregation, and a terminal barrier. | Runtime tests prove independent concurrency, stable result order, isolated failures, and termination after sibling completion or timeout. |
 | 49 | pending | `docs/plans/todo-49-tool-mode-ui-session-restore.md` | Add UI mode selection, workspace/session restoration, and clear EventAgent applicability feedback. | Static/WebSocket tests prove requests, snapshots, loaded sessions, and audit context preserve the selected mode. |
 | 50 | pending | `docs/plans/todo-50-comparable-model-tool-metrics.md` | Record mode-aware model/tool spans and include EventAgent usage so both architectures can be compared fairly. | Persistence/API tests report agent, call kind, tokens, TTFT, tool latency, fallback usage, and total turn wall time without double counting. |