todo-47.2-plugin-token-and-compatibility-boundaries.md 2.4 KB

Todo 47.2 Plugin Token and Compatibility Boundaries Plan

Status: done

Result

Closed negation and malformed numeric side-effect gaps, canonicalized integral floats, preserved fallback provenance, restored standard RFC3339 behavior, and kept positional definition constructors compatible.

Goal

Close the remaining quality-gate findings without expanding plugin behavior or generic orchestration scope.

Scope

  • Reject 不静音, 不用静音, 无需静音, no mute, and equivalent negations as substantive invalid input with no LLM fallback or port call.
  • Reject decimal/grouped numeric phrases such as 40.5, 10.5, and 1,000 without truncating them into valid integers.
  • Canonicalize JSON Schema integral floats (2.0, 40.0) to Python int for volume, search, and schedule numeric fields before ports/cache keys.
  • Preserve used_fallback=True when a post-fallback normalizer fails.
  • Use the standard jsonschema RFC3339 date-time checker; keep only the custom iana-timezone checker.
  • Move newly added dataclass fields to the end so existing positional EventDefinition and ToolDefinition construction keeps its historical meaning.

Files

  • Modify: src/agent_lab/application/events/models.py
  • Modify: src/agent_lab/application/events/kernel.py
  • Modify: src/agent_lab/application/events/registry.py
  • Modify: src/agent_lab/application/events/builtin_plugins.py
  • Modify: src/agent_lab/application/tools.py
  • Modify: tests/test_event_kernel.py
  • Modify: tests/test_builtin_event_plugins.py

Requirement Execution Loop

Plan

  1. Add RED tests for all named negation and malformed numeric phrases; assert zero fallback and zero port calls.
  2. Add RED canonical-number tests proving ports/cache treat integral floats as integers and equivalent values share cache keys.
  3. Add RED post-fallback normalizer failure and positional-constructor compatibility tests.
  4. Add RED lowercase t/z RFC3339 acceptance while retaining invalid-calendar rejection.
  5. Implement the smallest parser/normalizer/kernel/dataclass changes and run final bounded reviews.

Observe / Update

Close Todo 47 only when no Critical/Important findings remain and all external side effects are protected by canonical validated arguments.

Verification

  • UV_CACHE_DIR=.uv-cache uv run pytest tests/test_event_kernel.py tests/test_builtin_event_plugins.py -q
  • UV_CACHE_DIR=.uv-cache uv run pytest
  • git diff --check