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 3
  1. Human review

Implement a minimal validation path in ITP-Agent-Runtime so GET /execution-feed returns HTTP 422 when conflicting amount filters are supplied, specifically when betrag_equal is combined with betrag_above or betrag_below. Keep the change surface limited to the existing execution-feed route, service, repository filter model, and focused unit tests. Because the provided context does not show the repository FeedFilter definition or current validation style, the plan should start with inspection and then thread a single shared validation rule through the API-to-service-to-filter path without expanding scope.

medium risk

PR/code changes are dashboard-gated and must be reviewed before sandbox execution.The repository FeedFilter implementation is not shown in the provided context, so the exact validation insertion point must be confirmed by inspection.HTTP 422 formatting may depend on existing FastAPI/project conventions; reviewers should confirm the planned error translation matches expected API behavior.Threading validation through route, service, and filter layers can introduce accidental duplication or mismatched exception types if not reviewed carefully.The work packet examples define conflicts around betrag_equal with above/below, but reviewers should confirm whether any broader amount-filter combinations should also be rejected.

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/persistence/repository/task/execution_feed_repository.py to confirm how FeedFilter is defined (likely dataclass or Pydantic model), whether it already has any validation hooks, and whether repository logic depends on mutually combinable amount fields today.
    • 2.Inspect src/agent_runtime/api/route/execution_feed.py end-to-end to verify how FeedFilter is instantiated, whether FastAPI exceptions are already raised manually anywhere in this route, and whether there is an existing helper pattern for 422 validation errors that should be reused.
    • 3.Inspect tests/unit/agent_runtime/api/test_execution_feed.py for current conventions around asserting 422 responses and for any nearby amount-filter passthrough tests that should be extended rather than creating a new test module.
    • 4.Add a narrow validation rule for amount filters: betrag_equal may not be combined with betrag_above and may not be combined with betrag_below. Preserve currently valid combinations such as betrag_above with betrag_below unless code inspection reveals an existing broader conflict rule.
    • 5.Thread the validation through the shared FeedFilter layer so the invariant exists below the route boundary as requested by the work packet. Prefer the smallest native mechanism already used by FeedFilter (for example model validator, __post_init__, factory/helper, or explicit validate() method) rather than introducing a new abstraction.
    • 6.Ensure ExecutionFeedService also enforces or invokes the shared FeedFilter validation before repository access, so the business rule is not only an HTTP concern. Reuse the same validation source rather than duplicating rule text in multiple places.
    • 7.Map validation failures at the API route to HTTP 422. If FeedFilter/service validation raises a domain or value error, translate it in src/agent_runtime/api/route/execution_feed.py into FastAPI’s expected 422 behavior using the project’s existing error handling style. Avoid changing unrelated response formats unless tests show a standardized structure is required.
    • 8.Keep repository-facing behavior unchanged for valid filters; the repository should continue to receive FeedFilter with amount fields intact when combinations are allowed, and it should never be called for rejected conflicting combinations when exercised through the route/service path.
    • 9.Add focused API unit tests in tests/unit/agent_runtime/api/test_execution_feed.py covering at least: betrag_equal + betrag_above returns 422, betrag_equal + betrag_below returns 422, and a valid amount-filter request still succeeds and passes expected values through to the service.
    • 10.If the codebase already has service-level unit tests for ExecutionFeedService or direct FeedFilter tests, add one small validation test there instead of broad new coverage. If none exist, keep the mandatory test investment in the API unit test file only to minimize surface area.

    Test plan

    • ·Run the focused execution-feed API unit tests, especially tests/unit/agent_runtime/api/test_execution_feed.py.
    • ·Verify existing pagination/date/status validation tests for GET /execution-feed still pass, confirming no regression in route-level 422 handling.
    • ·Add and run assertions that requests with ?betrag_equal=100&betrag_above=50 return HTTP 422 and do not proceed as successful passthrough.
    • ·Add and run assertions that requests with ?betrag_equal=100&betrag_below=150 return HTTP 422 and do not proceed as successful passthrough.
    • ·Run or add a positive-path test such as ?betrag_above=100&betrag_below=200 (or an existing valid amount case) to confirm allowed combinations still produce 200 and preserve filter values.
    • ·If a direct FeedFilter or service validation test location exists after inspection, run that focused test too to confirm the shared invariant is enforced outside the route layer.

    Repositories

    • ·ITP-Agent-Runtime