Diamant

Needs you

  • Inbox
  • Decisions
  • Plans
  • Code

Pipeline

  • Activity
  • Graph
Sign in
Plans/

Backend: Domain-Modell + Interface (ExecutionFeed.cs, IExecutionFeedService.cs)

Brain review
ADO work item#338195Task

Backend: Domain-Modell + Interface (ExecutionFeed.cs, IExecutionFeedService.cs)

Synced just nowOpen in ADO
State
Done
Assigned
Not set
Area
Diamant Entwicklung\Produkt\Projektteams\Cross Functional Services\Mathildenhoehe\ITP
Project
Diamant Entwicklung
Freshness
Synced just now

Parent

  • #337988PublicFacingInterface: Table with processing status of files(Done)

Children

No child work items.

Siblings

  • #338193Frontend: ExecutionFeedToolbar (Dumb Component + Spec)(Done)
  • #338307Wire ExecutionFeedAdapter to Agent Runtime HTTP client(Done)
  • #338190

Linked PRs

No linked pull requests.

Plan review. The agent proposed a plan. Review it below, then approve so it can start coding — or request changes.

Azure DevOpsAttempt 2
  1. Human review

Implement a narrow validation change in ITP-Agent-Runtime so GET /execution-feed rejects conflicting amount-filter combinations with HTTP 422, while keeping validation logic consistent across API, service, and repository filter usage. Prefer a small surface: route validation plus any minimal supporting validation hook in FeedFilter/ExecutionFeedService needed to make the rule explicit and testable.

medium risk

Dashboard gating requires human approval before any code change and PR creation.The exact FeedFilter implementation details are not present in the packet, so the planner assumes a validation hook exists or can be added with minimal impact.There is ambiguity about where 422 should originate: FastAPI route parsing, FeedFilter model validation, or service-layer guard; reviewers should confirm the preferred architectural layer.Changing shared FeedFilter validation could affect any non-HTTP callers that construct the same filter with previously tolerated combinations.HTTP 422 response shape may depend on existing FastAPI/Pydantic conventions in this codebase and should be reviewed for consistency.

Expected files

  • src/agent_runtime/api/route/execution_feed.py
  • src/agent_runtime/service/execution_feed_service.py
Branch anlegen: feature/337988-execution-feed-table
(Done)
  • #338196Backend: Adapter + Controller + DTOs + MappingExtensions(Done)
  • #338191Frontend: Shared State Infrastruktur (service-state.ts, execution-feed.ts)(Done)
  • #338194Frontend: ExecutionFeed (Smart Component) + Cockpit + Routing + i18n(Done)
  • #338533Pre-Connect Merge-Arbeiten(Done)
  • #338192Frontend: ExecutionFeedService + Spec(Done)
  • #338198CLAUDE.md aktualisieren (Service-Pattern, Smart/Dumb, styleUrl, Backend-Konventionen)(Done)
  • #338197Backend: Tests (Unit + Integration) + DI-Registrierung in Program.cs(Done)
  • src/persistence/repository/task/execution_feed_repository.py
  • tests/unit/agent_runtime/api/test_execution_feed.py
  • Implementation steps

    • 1.Inspect src/agent_runtime/api/route/execution_feed.py to confirm how FeedFilter is currently instantiated and whether FastAPI/Pydantic validation is already used for related query constraints that return 422.
    • 2.Inspect src/persistence/repository/task/execution_feed_repository.py to locate the FeedFilter definition and determine whether it is a dataclass, Pydantic model, or other typed container; use the smallest native validation mechanism available there.
    • 3.Add an explicit conflict rule for amount filters: betrag_equal must not be combined with betrag_above or betrag_below. If repository-level FeedFilter supports model validation, encode the rule there so invalid combinations are rejected consistently wherever the filter is constructed.
    • 4.Thread the validation through src/agent_runtime/service/execution_feed_service.py only as needed: if FeedFilter itself raises/validates, keep service changes minimal; otherwise add a lightweight guard in the service so the business rule is enforced beyond the HTTP layer.
    • 5.Update src/agent_runtime/api/route/execution_feed.py so invalid amount-filter combinations surface as HTTP 422 for GET /execution-feed. Prefer framework-native validation/error mapping already used in this endpoint rather than custom response shaping.
    • 6.Preserve existing valid combinations, especially betrag_above with betrag_below together if currently intended as a range; only reject combinations explicitly called out by the work packet unless repository semantics prove otherwise during inspection.
    • 7.Extend tests/unit/agent_runtime/api/test_execution_feed.py with focused API tests that assert 422 when betrag_equal is combined with betrag_above, and 422 when betrag_equal is combined with betrag_below.
    • 8.Add or update one passthrough test for a valid non-conflicting amount filter combination to confirm the service still receives expected FeedFilter values after the change.
    • 9.If service-level validation is introduced because FeedFilter cannot validate itself, add a targeted unit test in the smallest existing test area available for the service or adjust the API test fixture expectations so the invalid request never reaches mock_service.get_feed.
    • 10.Run only the narrow relevant test subset first, then the broader execution-feed unit tests, and inspect for any existing assumptions about FeedFilter construction or FastAPI validation formatting.

    Test plan

    • ·Run the execution-feed API unit tests: pytest tests/unit/agent_runtime/api/test_execution_feed.py -q
    • ·Verify new negative cases return HTTP 422 for /execution-feed?betrag_equal=100&betrag_above=50 and /execution-feed?betrag_equal=100&betrag_below=150
    • ·Verify a valid amount-only request still succeeds, such as /execution-feed?betrag_equal=100 or an existing above/below combination expected by current behavior
    • ·If service validation was added, run the smallest relevant service test target covering ExecutionFeedService behavior
    • ·Optionally run a focused grep/inspection after tests to ensure no other constructors of FeedFilter now need adaptation

    Repositories

    • ·ITP-Agent-Runtime