Skip to content

Chore/papi 4701 scheduling payload#479

Open
nahua-aignx wants to merge 9 commits intomainfrom
chore/PAPI-4701-scheduling-payload
Open

Chore/papi 4701 scheduling payload#479
nahua-aignx wants to merge 9 commits intomainfrom
chore/PAPI-4701-scheduling-payload

Conversation

@nahua-aignx
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 10:14
@codecov
Copy link

codecov bot commented Mar 17, 2026

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
745 2 743 15
View the top 2 failed test(s) by shortest run time
tests.aignostics.system.cli_test::test_cli_health_json
Stack Traces | 11s run time
runner = <typer.testing.CliRunner object at 0x7f46333ae150>
record_property = <function record_property.<locals>.append_property at 0x7f46333ae560>

    @pytest.mark.e2e
    @pytest.mark.scheduled
    @pytest.mark.timeout(timeout=60)
    def test_cli_health_json(runner: CliRunner, record_property) -> None:
        """Check health is true."""
        record_property("tested-item-id", "TEST-SYSTEM-CLI-HEALTH-JSON")
        result = runner.invoke(cli, ["system", "health"])
>       assert normalize_output(result.stdout).startswith('{  "status": "UP"')
E       assert False
E        +  where False = <built-in method startswith of str object at 0xd69f4f0>('{  "status": "UP"')
E        +    where <built-in method startswith of str object at 0xd69f4f0> = '{  "status": "DEGRADED",  "reason": "Component \'aignostics.platform._service.Service\' is DEGRADED (Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED)",  "components": {    "aignostics.application._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.bucket._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.dataset._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.notebook._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.platform._service.Service": {      "status": "DEGRADED",      "reason": "Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED",      "components": {        "api_public": {          "status": "DEGRADED",          "reason": "Aignostics Platform API is DEGRADED",          "components": {},          "uptime_statistics": null        },        "api_authenticated": {          "status": "DEGRADED",          "reason": "Aignostics Platform API is DEGRADED",          "components": {},          "uptime_statistics": null        }      },      "uptime_statistics": null    },    "aignostics.qupath._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.wsi._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "network": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    }  },  "uptime_statistics": null}'.startswith
E        +      where '{  "status": "DEGRADED",  "reason": "Component \'aignostics.platform._service.Service\' is DEGRADED (Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED)",  "components": {    "aignostics.application._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.bucket._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.dataset._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.notebook._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.platform._service.Service": {      "status": "DEGRADED",      "reason": "Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED",      "components": {        "api_public": {          "status": "DEGRADED",          "reason": "Aignostics Platform API is DEGRADED",          "components": {},          "uptime_statistics": null        },        "api_authenticated": {          "status": "DEGRADED",          "reason": "Aignostics Platform API is DEGRADED",          "components": {},          "uptime_statistics": null        }      },      "uptime_statistics": null    },    "aignostics.qupath._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "aignostics.wsi._service.Service": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    },    "network": {      "status": "UP",      "reason": null,      "components": {},      "uptime_statistics": null    }  },  "uptime_statistics": null}' = normalize_output('{\n  "status": "DEGRADED",\n  "reason": "Component \'aignostics.platform._service.Service\' is DEGRADED (Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED)",\n  "components": {\n    "aignostics.application._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.bucket._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.dataset._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.notebook._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.platform._service.Service": {\n      "status": "DEGRADED",\n      "reason": "Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED",\n      "components": {\n        "api_public": {\n          "status": "DEGRADED",\n          "reason": "Aignostics Platform API is DEGRADED",\n          "components": {},\n          "uptime_statistics": null\n        },\n        "api_authenticated": {\n          "status": "DEGRADED",\n          "reason": "Aignostics Platform API is DEGRADED",\n          "components": {},\n          "uptime_statistics": null\n        }\n      },\n      "uptime_statistics": null\n    },\n    "aignostics.qupath._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.wsi._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "network": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    }\n  },\n  "uptime_statistics": null\n}\n')
E        +        where '{\n  "status": "DEGRADED",\n  "reason": "Component \'aignostics.platform._service.Service\' is DEGRADED (Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED)",\n  "components": {\n    "aignostics.application._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.bucket._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.dataset._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.notebook._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.platform._service.Service": {\n      "status": "DEGRADED",\n      "reason": "Components \'api_public\' (Aignostics Platform API is DEGRADED), \'api_authenticated\' (Aignostics Platform API is DEGRADED) are DEGRADED",\n      "components": {\n        "api_public": {\n          "status": "DEGRADED",\n          "reason": "Aignostics Platform API is DEGRADED",\n          "components": {},\n          "uptime_statistics": null\n        },\n        "api_authenticated": {\n          "status": "DEGRADED",\n          "reason": "Aignostics Platform API is DEGRADED",\n          "components": {},\n          "uptime_statistics": null\n        }\n      },\n      "uptime_statistics": null\n    },\n    "aignostics.qupath._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "aignostics.wsi._service.Service": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    },\n    "network": {\n      "status": "UP",\n      "reason": null,\n      "components": {},\n      "uptime_statistics": null\n    }\n  },\n  "uptime_statistics": null\n}\n' = <Result okay>.stdout

.../aignostics/system/cli_test.py:25: AssertionError
tests.aignostics.application.cli_test::test_cli_run_submit_and_describe_and_cancel_and_download_and_delete
Stack Traces | 281s run time
runner = <typer.testing.CliRunner object at 0x7f18caef8050>
tmp_path = PosixPath('.../pytest-20/popen-gw3/test_cli_run_submit_and_descri0')
silent_logging = None
record_property = <function record_property.<locals>.append_property at 0x7f18cae77320>

    @pytest.mark.e2e
    @pytest.mark.long_running
    @pytest.mark.flaky(retries=3, delay=5)
    @pytest.mark.timeout(timeout=60 * 10)
    def test_cli_run_submit_and_describe_and_cancel_and_download_and_delete(  # noqa: PLR0915
        runner: CliRunner, tmp_path: Path, silent_logging, record_property
    ) -> None:
        """Check run submit command runs successfully."""
        record_property("tested-item-id", "TC-APPLICATION-CLI-02")
        with submitted_run(
            runner,
            tmp_path,
            CSV_CONTENT_SPOT0,
            extra_args=[
                "--note",
                "note_of_this_complex_test",
                "--tags",
                "cli-test,test_cli_run_submit_and_describe_and_cancel_and_download_and_delete,further-tag",
                "--deadline",
                (datetime.now(tz=UTC) + timedelta(minutes=10)).isoformat(),
                "--onboard-to-aignostics-portal",
                "--gpu-type",
                PIPELINE_GPU_TYPE,
                "--force",
            ],
        ) as run_id:
            # Test that we can find this run by it's note via the query parameter
            list_result = runner.invoke(
                cli,
                [
                    "application",
                    "run",
                    "list",
                    "--query",
                    "note_of_this_complex_test",
                ],
            )
            assert list_result.exit_code == 0
            list_output = normalize_output(list_result.stdout)
>           assert run_id in list_output, f"Run ID '{run_id}' not found when filtering by note via query"
E           AssertionError: Run ID 'e758f14f-accf-4242-90d9-8c146ee8d68c' not found when filtering by note via query
E           assert 'e758f14f-accf-4242-90d9-8c146ee8d68c' in "Application Run IDs:- 6a6b788d-8e86-464b-ae39-c174408d0693 of he-tme (1.1.0) (submitted: 2026-03-19 09:30:23 UTC, status: PROCESSING, output: NONE)- 76019ae0-4397-41ea-ba93-3f4d231bbe63 of he-tme (1.1.0) (submitted: 2026-03-19 09:29:16 UTC, status: PROCESSING, output: NONE)- d7102176-2cf3-4f20-a569-ee2a2f94b730 of he-tme (1.1.0) (submitted: 2026-03-19 09:29:06 UTC, status: PROCESSING, output: NONE)- 3f8a6cc8-2c76-4561-b00e-3fb0dcd1adff of he-tme (1.1.0) (submitted: 2026-03-19 09:29:04 UTC, status: PROCESSING, output: NONE)- adbe012d-164c-443a-b104-034419ca1f03 of he-tme (1.1.0) (submitted: 2026-03-19 09:28:24 UTC, status: PROCESSING, output: NONE)- f87c05d1-99c3-48e7-84c6-4aaf9c56f7f6 of he-tme (1.1.0) (submitted: 2026-03-19 09:28:01 UTC, status: TERMINATED (RunTerminationReason.CANCELED_BY_USER), output: NONE)- 327254ea-d16e-4191-8fb2-536fa3494ccb of he-tme (1.1.0) (submitted: 2026-03-19 09:26:44 UTC, status: TERMINATED (RunTerminationReason.CANCELED_BY_USER), output: NONE)- 80b12326-b635-4b7a-9cb1-1cf5d53002d2 of he-tme (1.1.0) (submitted: 2026-03-19 09:26:04 UTC, status: TERMINATED (RunTerminationReason.CANCELED_BY_USER), output: NONE)- 60237bab-4310-4fd9-a040-96385e26d0ec of...d9c-ae76-e1d98d1f7476/items to get the items which where successfully processed before cancellation. (N/A), output: NONE)- aa708d33-8c26-40ac-93f5-4662ac716240 of he-tme (1.0.0-beta.8) (submitted: 2025-10-28 20:27:01 UTC, status: TERMINATED (RunTerminationReason.CANCELED_BY_USER) | error: The run was cancelled by the user. Query .../runs/aa708d33-8c26-40ac-93f5-4662ac716240/items to get the items which where successfully processed before cancellation. (N/A), output: NONE)- 5e2d764e-557a-47bb-be44-9fff479b102b of he-tme (1.0.0-beta.8) (submitted: 2025-10-28 12:20:24 UTC, status: TERMINATED (RunTerminationReason.CANCELED_BY_USER) | error: The run was cancelled by the user. Query .../runs/5e2d764e-557a-47bb-be44-9fff479b102b/items to get the items which where successfully processed before cancellation. (N/A), output: NONE)- a377c238-a5ee-4a31-8b0e-7a6562d0894e of he-tme (1.0.0-beta.8) (submitted: 2025-10-27 12:16:20 UTC, status: TERMINATED (RunTerminationReason.CANCELED_BY_USER) | error: The run was cancelled by the user. Query .../runs/a377c238-a5ee-4a31-8b0e-7a6562d0894e/items to get the items which where successfully processed before cancellation. (N/A), output: NONE)Listed '2732' run(s)."

.../aignostics/application/cli_test.py:523: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to use the Platform API’s first-class scheduling field for run submission/inspection (instead of embedding scheduling into custom_metadata), and regenerates the OpenAPI client to API spec v1.4.0 which introduces scheduling models and additional endpoints/params.

Changes:

  • Pass scheduling as a top-level field when submitting runs (CLI/service + platform runs resource), and display/consume scheduling from run responses (GUI + e2e).
  • Update deadline-exceeded logic to prefer the API response scheduling.deadline, with a fallback to legacy custom_metadata.
  • Regenerate OpenAPI artifacts to v1.4.0 (adds scheduling request/response models, new artifact URL endpoint, and for_organization filter for list runs).

Reviewed changes

Copilot reviewed 7 out of 51 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/aignostics/platform/e2e_test.py Adjusts e2e submission to send top-level scheduling and reads deadline from response scheduling field (fallback to legacy metadata).
tests/aignostics/application/utils_test.py Adds/updates unit tests for deadline-exceeded logic with new scheduling-first behavior.
src/aignostics/platform/resources/runs.py Extends runs.submit() to accept and forward top-level scheduling.
src/aignostics/application/_utils.py Changes deadline-exceeded helper to prioritize response scheduling, with legacy metadata fallback.
src/aignostics/application/_service.py Builds and forwards scheduling payload to platform runs submission; updates static run listing to pass scheduling.
src/aignostics/application/_gui/_page_application_run_describe.py Displays due date / deadline from the run response scheduling field.
codegen/out/docs/PublicApi.md Regenerated API docs (v1.4.0), including new artifact URL endpoint and updated list runs params.
codegen/out/aignx/codegen/rest.py Updates generated client header to OpenAPI doc version 1.4.0.
codegen/out/aignx/codegen/models/version_read_response.py Regenerated model (adds stricter version typing/validation).
codegen/out/aignx/codegen/models/validation_error_loc_inner.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/validation_error.py Regenerated model to include input/ctx.
codegen/out/aignx/codegen/models/user_read_response.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/scheduling_response.py New generated model for scheduling fields returned in run responses.
codegen/out/aignx/codegen/models/scheduling_request.py New generated model for scheduling constraints in run creation.
codegen/out/aignx/codegen/models/run_termination_reason.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/run_state.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/run_read_response.py Adds scheduling field to run response model.
codegen/out/aignx/codegen/models/run_output.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/run_item_statistics.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/run_creation_response.py Makes run_id required (per spec).
codegen/out/aignx/codegen/models/run_creation_request.py Adds scheduling to run creation request model.
codegen/out/aignx/codegen/models/output_artifact_visibility.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/output_artifact_scope.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/output_artifact_result_read_response.py Adjusts error fields ordering and marks download_url deprecated in schema representation.
codegen/out/aignx/codegen/models/output_artifact.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/organization_read_response.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/me_read_response.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/item_termination_reason.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/item_state.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/item_result_read_response.py Adds error_code as an explicit nullable field ordering in generated model.
codegen/out/aignx/codegen/models/item_output.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/item_creation_request.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/input_artifact_creation_request.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/input_artifact.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/http_validation_error.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/custom_metadata_update_response.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/custom_metadata_update_request.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/artifact_termination_reason.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/artifact_state.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/artifact_output.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/application_version.py Regenerated model (adds stricter version typing/validation).
codegen/out/aignx/codegen/models/application_read_short_response.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/application_read_response.py Regenerated header/version metadata.
codegen/out/aignx/codegen/models/init.py Updates exported generated models to include scheduling request/response.
codegen/out/aignx/codegen/exceptions.py Regenerated header/version metadata.
codegen/out/aignx/codegen/configuration.py Updates debug report API version to 1.4.0.
codegen/out/aignx/codegen/api_client.py Regenerated header/version metadata.
codegen/out/aignx/codegen/api/public_api.py Updates resource paths and adds new artifact URL endpoint + list runs for_organization param.
codegen/out/.openapi-generator/FILES Adds scheduling request/response files to generator manifest.
codegen/in/openapi.json Updates OpenAPI spec to v1.4.0 and adds scheduling + new endpoint/params.
codegen/in/archive/openapi_1.4.0.json Adds archived OpenAPI 1.4.0 spec snapshot.

@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from e3cd812 to fe73569 Compare March 17, 2026 11:47
@nahua-aignx nahua-aignx marked this pull request as ready for review March 17, 2026 13:24
Copilot AI review requested due to automatic review settings March 17, 2026 13:24
@claude
Copy link

claude bot commented Mar 17, 2026

Claude finished @nahua-aignx's task in 14m 51s —— View job


PR Review: Scheduling Payload Migration (PAPI-4701)

This PR migrates scheduling information from custom_metadata to first-class API fields in the Platform API v1.4.0. I've conducted a thorough review following the Aignostics Python SDK standards.


Summary

✅ What's Good:

  • Clean separation of concerns: scheduling moved from metadata to top-level API field
  • Comprehensive test coverage for new scheduling logic (unit tests added)
  • Backward compatibility maintained with fallback to custom_metadata
  • All tests properly marked (744 tests with unit, integration, or e2e markers)
  • Linting passes (ruff, pyright, mypy all green ✅)
  • Conventional commits followed correctly

⚠️ Issues Found:

3 issues identified (2 from Copilot review confirmed + 1 additional) - see inline comments for details.


Critical Issues (Must Fix Before Merge)

1. 🚨 Breaking Change: Parameter Order in is_not_terminated_with_deadline_exceeded

Location: src/aignostics/application/_utils.py:137

Issue: Function signature changed parameter order, breaking backward compatibility for positional argument callers.

Fix: Make scheduling keyword-only to prevent silent failures. See inline comment for detailed fix.


2. ⚠️ Missing Validation for deadline Parameter

Location: src/aignostics/application/_service.py:1034

Issue: deadline is passed to API without local validation (unlike due_date which is validated).

Fix: Add _validate_deadline() method and call it before submission. See inline comment for implementation guidance.


Minor Issues

3. Typo in Comment

Location: tests/aignostics/platform/e2e_test.py:316

Issue: fiond should be find

Fix: One-liner fix suggested in inline comment.


Architecture & Code Quality Review

✅ Modulith Architecture Compliance

  • Changes properly isolated to platform and application modules
  • Service layer changes only (no CLI/GUI coupling)
  • Dependency hierarchy maintained

✅ Testing Strategy

  • All new tests correctly marked with @pytest.mark.unit
  • Tests cover both new scheduling path and legacy fallback
  • Tests verify precedence (scheduling takes priority over custom_metadata)
  • No unmarked tests found ✅ (critical check passed)

✅ Type Safety

  • Both MyPy strict and PyRight basic modes pass
  • Type hints present for all new code
  • Generated OpenAPI models properly typed (SchedulingRequest, SchedulingResponse)

✅ Medical Device Security

  • No secrets or tokens in code
  • Proper datetime handling with timezone awareness
  • Sensitive data masking maintained

✅ Documentation

  • Docstrings present for new functions
  • Clear explanation of scheduling precedence
  • OpenAPI docs regenerated (v1.4.0)

Generated Code Review

The bulk of changes (+3000 lines) are in codegen/ - auto-generated from OpenAPI spec v1.4.0:

✅ Key additions:

  • SchedulingRequest model (due_date, deadline as Optional[datetime])
  • SchedulingResponse model (same fields)
  • RunCreationRequest now accepts scheduling field
  • RunReadResponse now returns scheduling field
  • Both models properly handle nullable fields and timezone-aware datetimes

Test Coverage Note

SonarQube reports 0% coverage on new code - this may be because:

  1. Tests were still running during SonarQube scan
  2. New scheduling code paths need additional test coverage
  3. Generated code (codegen/) is counted but excluded from tests

Recommendation: Verify coverage locally after full test suite completes:

uv run pytest tests/aignostics/application/ \
  --cov=src/aignostics/application \
  --cov-report=term-missing

Commit Quality

✅ All commits follow conventional commit format:

  1. chore(python-sdk): Run make codegen to update generated code
  2. chore(python-sdk): Use scheduling payload when creating runs
  3. chore(python-sdk): Update tests

Quick Fix Commands

# 1. Fix typo
sed -i 's/fiond/find/g' tests/aignostics/platform/e2e_test.py

# 2. Verify linting still passes
make lint

# 3. Verify tests pass  
make test_unit && make test_integration

# 4. Check coverage
uv run coverage report --fail-under=85

The other two fixes (parameter order and deadline validation) require code changes - see inline comments for detailed guidance.


Final Verdict

Status: ⚠️ CHANGES REQUESTED

This is a well-structured refactoring with good backward compatibility strategy. However, the breaking change in function signature (issue #1) must be addressed to prevent silent failures in downstream code.

Priority:

  1. CRITICAL: Fix parameter order breaking change
  2. HIGH: Add deadline validation
  3. LOW: Fix typo

Once these issues are addressed, this PR will be ready to merge. Great work on the comprehensive test coverage and maintaining backward compatibility with the fallback logic! 🎉


Standards Applied:

  • ✅ CLAUDE.md architecture principles
  • ✅ Test marker requirements (all 744 tests marked correctly)
  • ✅ Type checking (MyPy strict + PyRight basic both pass)
  • ✅ Conventional commits
  • ✅ Medical device security standards
  • ⏳ 85% coverage requirement (pending final verification)
    | Branch: chore/PAPI-4701-scheduling-payload

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to support a first-class scheduling field in run submission payloads (instead of embedding scheduling under custom_metadata), and updates run consumers (service/UI/tests) to prefer the scheduling field returned by the API while keeping backward compatibility for older runs.

Changes:

  • Add scheduling to run submission (Runs.submit(...)) and update application run submission/service + e2e test payloads accordingly.
  • Update deadline handling logic to prefer run.scheduling.deadline (API response) with fallback to legacy custom_metadata["sdk"]["scheduling"]["deadline"], and expand unit tests around this behavior.
  • Regenerate OpenAPI client artifacts for API v1.4.0 (adds scheduling request/response models and new/updated endpoints).

Reviewed changes

Copilot reviewed 7 out of 51 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/aignostics/platform/e2e_test.py Submits scheduling as a top-level payload field and reads deadline from API scheduling response with legacy fallback.
tests/aignostics/application/utils_test.py Adds unit tests for scheduling-object precedence and updates existing tests to use the new function signature.
src/aignostics/platform/resources/runs.py Extends Runs.submit() to accept an optional scheduling payload field.
src/aignostics/application/_utils.py Updates deadline-exceeded logic to prefer API scheduling response with fallback to legacy custom metadata.
src/aignostics/application/_service.py Builds/forwards scheduling as a top-level run submission field and updates run listing to pass scheduling to deadline helper.
src/aignostics/application/_gui/_page_application_run_describe.py Displays scheduling (due date/deadline) from the API response in the run describe UI.
codegen/out/docs/PublicApi.md Regenerated API docs reflecting v1.4.0 additions/changes.
codegen/out/aignx/codegen/rest.py Bumps generated OpenAPI document version metadata to 1.4.0.
codegen/out/aignx/codegen/models/version_read_response.py Regenerated model (adds validators/typing updates).
codegen/out/aignx/codegen/models/validation_error_loc_inner.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/validation_error.py Regenerated model (adds input/ctx fields).
codegen/out/aignx/codegen/models/user_read_response.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/scheduling_response.py New generated model for scheduling fields in run responses.
codegen/out/aignx/codegen/models/scheduling_request.py New generated model for scheduling constraints in run creation requests.
codegen/out/aignx/codegen/models/run_termination_reason.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/run_state.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/run_read_response.py Regenerated model adding scheduling: Optional[SchedulingResponse].
codegen/out/aignx/codegen/models/run_output.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/run_item_statistics.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/run_creation_response.py Regenerated model (makes run_id required).
codegen/out/aignx/codegen/models/run_creation_request.py Regenerated model adding scheduling: Optional[SchedulingRequest].
codegen/out/aignx/codegen/models/output_artifact_visibility.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/output_artifact_scope.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/output_artifact_result_read_response.py Regenerated model (field ordering/defaults adjusted; download_url marked deprecated in spec).
codegen/out/aignx/codegen/models/output_artifact.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/organization_read_response.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/me_read_response.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/item_termination_reason.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/item_state.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/item_result_read_response.py Regenerated model (adds error_code and adjusts required fields).
codegen/out/aignx/codegen/models/item_output.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/item_creation_request.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/input_artifact_creation_request.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/input_artifact.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/http_validation_error.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/custom_metadata_update_response.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/custom_metadata_update_request.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/artifact_termination_reason.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/artifact_state.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/artifact_output.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/application_version.py Regenerated model (adds validators/typing updates).
codegen/out/aignx/codegen/models/application_read_short_response.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/application_read_response.py Regenerated model header/version metadata.
codegen/out/aignx/codegen/models/init.py Regenerated exports (adds scheduling models and reorders exports).
codegen/out/aignx/codegen/exceptions.py Regenerated header/version metadata.
codegen/out/aignx/codegen/configuration.py Regenerated metadata (API version string updated).
codegen/out/aignx/codegen/api_client.py Regenerated header/version metadata.
codegen/out/aignx/codegen/api/public_api.py Regenerated client (paths updated, adds artifact download endpoint, adds for_organization to list runs).
codegen/out/.openapi-generator/FILES Regenerated file manifest including new scheduling models.
codegen/in/openapi.json Updates stored OpenAPI spec to 1.4.0, including scheduling and new endpoints/fields.
codegen/in/archive/openapi_1.4.0.json Adds archived OpenAPI 1.4.0 spec snapshot.

@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from fe73569 to d445eb0 Compare March 17, 2026 14:44
Copilot AI review requested due to automatic review settings March 18, 2026 07:37
@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from d445eb0 to aa5de65 Compare March 18, 2026 07:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to use the new top-level scheduling payload for run submission (instead of embedding scheduling data in custom_metadata), and refreshes the generated OpenAPI client artifacts to API version 1.4.0.

Changes:

  • Add scheduling support to run submission and propagate it through CLI/service usage and E2E validation.
  • Update deadline-exceeded logic to prefer the API response scheduling field, with legacy fallback to custom_metadata.
  • Regenerate OpenAPI code/docs (API 1.4.0), including new scheduling models and a new artifact download endpoint.

Reviewed changes

Copilot reviewed 8 out of 53 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/aignostics/platform/e2e_test.py Submits runs with top-level scheduling and validates deadlines from API response (with fallback).
tests/aignostics/application/utils_test.py Expands unit tests for deadline handling with a primary scheduling-object path + legacy metadata fallback.
tests/aignostics/application/cli_pipeline_validation_test.py Adjusts CLI submit test deadline to avoid immediate-expiry edge case.
src/aignostics/platform/resources/runs.py Adds optional scheduling param to submit() and forwards it into RunCreationRequest.
src/aignostics/application/_utils.py Updates deadline-exceeded helper to prefer scheduling.deadline over legacy metadata.
src/aignostics/application/_service.py Passes run.scheduling into deadline-exceeded helper when listing runs.
src/aignostics/application/_gui/_page_application_run_describe.py Displays scheduling due date/deadline from run response in the GUI describe view.
codegen/out/docs/PublicApi.md Updates generated public API docs (adds artifact URL endpoint; updates list-runs parameter docs).
codegen/out/aignx/codegen/rest.py Updates generated client header to OpenAPI version 1.4.0.
codegen/out/aignx/codegen/models/version_read_response.py Generated model updates (adds regex validation for semantic version).
codegen/out/aignx/codegen/models/validation_error_loc_inner.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/validation_error.py Generated model updated to include input and ctx fields.
codegen/out/aignx/codegen/models/user_read_response.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/scheduling_response.py New generated model for scheduling fields returned by run responses.
codegen/out/aignx/codegen/models/scheduling_request.py New generated model for scheduling constraints in run creation.
codegen/out/aignx/codegen/models/run_termination_reason.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/run_state.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/run_read_response.py Adds scheduling to run read response model.
codegen/out/aignx/codegen/models/run_output.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/run_item_statistics.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/run_creation_response.py Makes run_id required in the creation response model.
codegen/out/aignx/codegen/models/run_creation_request.py Adds scheduling to run creation request model.
codegen/out/aignx/codegen/models/output_artifact_visibility.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/output_artifact_scope.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/output_artifact_result_read_response.py Generated model updates around error_code and download_url field ordering/defaults.
codegen/out/aignx/codegen/models/output_artifact.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/organization_read_response.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/me_read_response.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/item_termination_reason.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/item_state.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/item_result_read_response.py Generated item result model updates (notably error_code placement/defaults).
codegen/out/aignx/codegen/models/item_output.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/item_creation_request.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/input_artifact_creation_request.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/input_artifact.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/http_validation_error.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/custom_metadata_update_response.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/custom_metadata_update_request.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/artifact_termination_reason.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/artifact_state.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/artifact_output.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/application_version.py Generated model updates (adds regex validation for semantic version).
codegen/out/aignx/codegen/models/application_read_short_response.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/application_read_response.py Generated model header version bump to 1.4.0.
codegen/out/aignx/codegen/models/init.py Updates generated model export list to include new scheduling models.
codegen/out/aignx/codegen/exceptions.py Generated code header version bump to 1.4.0.
codegen/out/aignx/codegen/configuration.py Generated config updates API version shown in debug report.
codegen/out/aignx/codegen/api_client.py Generated code header version bump to 1.4.0.
codegen/out/aignx/codegen/api/public_api.py Adds generated method for artifact URL endpoint; updates list-runs query args.
codegen/out/.openapi-generator/FILES Adds scheduling model files to generator manifest.
codegen/in/openapi.json Updates bundled OpenAPI spec to 1.4.0 (scheduling fields, new endpoint, etc.).
codegen/in/archive/openapi_1.4.0.json Stores archived OpenAPI 1.4.0 spec snapshot.
Makefile Minor formatting tweaks + adjusts sed -i invocation formatting for codegen patch step.

@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from aa5de65 to 92d9a29 Compare March 18, 2026 09:33
Copilot AI review requested due to automatic review settings March 18, 2026 09:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to send run scheduling constraints (due_date, deadline) via the first-class scheduling request field (instead of embedding them under custom_metadata.sdk.scheduling), and refreshes the generated OpenAPI client/models to API version 1.4.0.

Changes:

  • Move scheduling payload to top-level scheduling in run submission flows (SDK, CLI/GUI, and e2e tests), with backward-compatible read fallback to legacy custom_metadata.
  • Add/extend validation utilities (validate_deadline, cross-field scheduling constraints) and broaden unit test coverage for the new scheduling response shape.
  • Regenerate OpenAPI client/docs/models for API v1.4.0 (adds scheduling request/response models and new endpoints/params).

Reviewed changes

Copilot reviewed 10 out of 55 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/aignostics/platform/e2e_test.py Sends scheduling as top-level field and reads deadline from response scheduling with legacy fallback.
tests/aignostics/application/utils_test.py Adds unit tests for deadline-exceeded logic using scheduling response object, plus legacy fallback tests.
tests/aignostics/application/service_test.py Adds unit tests for validate_deadline and cross-field scheduling constraint validation.
tests/aignostics/application/gui_test.py Adjusts GUI scheduling test inputs (due date + deadline).
tests/aignostics/application/cli_pipeline_validation_test.py Avoids deadline=now by pushing CLI deadline slightly into the future.
src/aignostics/platform/resources/runs.py Adds scheduling parameter to runs.submit() and includes it in RunCreationRequest.
src/aignostics/application/_utils.py Adds deadline validation + scheduling helpers; updates deadline-exceeded logic to prefer response scheduling.
src/aignostics/application/_service.py Validates deadline + constraints; submits scheduling as top-level field.
src/aignostics/application/_gui/_page_application_run_describe.py Displays scheduling info from run response scheduling field.
codegen/out/docs/PublicApi.md Regenerated API docs (incl. new artifact URL endpoint, list-runs param changes).
codegen/out/aignx/codegen/rest.py Regenerated client runtime with updated OpenAPI version header.
codegen/out/aignx/codegen/models/version_read_response.py Regenerated model with stricter semver validation.
codegen/out/aignx/codegen/models/validation_error_loc_inner.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/validation_error.py Regenerated ValidationError shape (adds input, ctx).
codegen/out/aignx/codegen/models/user_read_response.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/scheduling_response.py New generated model for scheduling fields in run responses.
codegen/out/aignx/codegen/models/scheduling_request.py New generated model for scheduling constraints in run create requests.
codegen/out/aignx/codegen/models/run_termination_reason.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/run_state.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/run_read_response.py Adds scheduling field to run read response model.
codegen/out/aignx/codegen/models/run_output.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/run_item_statistics.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/run_creation_response.py Makes run_id required (aligns with spec).
codegen/out/aignx/codegen/models/run_creation_request.py Adds scheduling to run creation request model.
codegen/out/aignx/codegen/models/output_artifact_visibility.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/output_artifact_scope.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/output_artifact_result_read_response.py Updates output artifact result fields/order and deprecations per spec.
codegen/out/aignx/codegen/models/output_artifact.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/organization_read_response.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/me_read_response.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/item_termination_reason.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/item_state.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/item_result_read_response.py Updates item result schema (incl. error_code field changes).
codegen/out/aignx/codegen/models/item_output.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/item_creation_request.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/input_artifact_creation_request.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/input_artifact.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/http_validation_error.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/custom_metadata_update_response.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/custom_metadata_update_request.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/artifact_termination_reason.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/artifact_state.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/artifact_output.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/application_version.py Regenerated model with semver validation.
codegen/out/aignx/codegen/models/application_read_short_response.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/application_read_response.py Regenerated model version header updates.
codegen/out/aignx/codegen/models/init.py Regenerated models export list.
codegen/out/aignx/codegen/exceptions.py Regenerated exceptions module version header updates.
codegen/out/aignx/codegen/configuration.py Updates debug report API version string.
codegen/out/aignx/codegen/api_client.py Regenerated client module version header updates.
codegen/out/aignx/codegen/api/public_api.py Adds new endpoint and updates list-runs signature/params per spec.
codegen/out/.openapi-generator/FILES Tracks newly generated files (scheduling models).
codegen/in/openapi.json Updates stored OpenAPI spec to 1.4.0 (adds scheduling and other schema changes).
codegen/in/archive/openapi_1.4.0.json Adds archived OpenAPI 1.4.0 spec snapshot.
Makefile Updates codegen sed invocation (in-place patch step).

@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from 6defed6 to 6f552a0 Compare March 18, 2026 10:12
Copilot AI review requested due to automatic review settings March 18, 2026 10:17
@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from 6f552a0 to f31112d Compare March 18, 2026 10:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to send and consume run scheduling constraints (due_date, deadline) via the API’s first-class scheduling field (instead of embedding it in custom_metadata), and refreshes generated OpenAPI artifacts to Platform API 1.4.0.

Changes:

  • Add scheduling support to run submission (SDK + tests), and update run status/deadline logic to prefer the API response scheduling field with a legacy fallback.
  • Add validation helpers for deadline and cross-field scheduling constraints in the application service layer, plus expanded unit tests.
  • Regenerate OpenAPI client/docs (new scheduling models, new artifact download endpoint, API version bump) and improve make codegen portability.

Reviewed changes

Copilot reviewed 11 out of 55 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/aignostics/platform/e2e_test.py Submit runs with top-level scheduling; read deadline from API response with fallback.
tests/aignostics/application/utils_test.py Expand unit tests for deadline-exceeded logic using scheduling response object + legacy metadata.
tests/aignostics/application/service_test.py Add unit tests for validate_deadline and validate_scheduling_constraints.
tests/aignostics/application/gui_test.py Update GUI E2E scheduling inputs (due date + longer deadline).
tests/aignostics/application/cli_pipeline_validation_test.py Avoid “deadline == now” by using a small future offset.
src/aignostics/platform/resources/runs.py Add scheduling arg to Runs.submit and include it in the create payload.
src/aignostics/application/_utils.py Add deadline validation + cross-field constraints; update deadline-exceeded logic to prefer API scheduling.
src/aignostics/application/_service.py Validate deadline + constraints; submit scheduling as top-level request field.
src/aignostics/application/_gui/_page_application_run_describe.py Display scheduling info from the API response field.
codegen/out/docs/PublicApi.md OpenAPI doc regen; includes new endpoint and parameters.
codegen/out/aignx/codegen/** Regenerated OpenAPI client/models including scheduling request/response models.
codegen/in/openapi.json Update OpenAPI spec to 1.4.0 (scheduling fields, new endpoint, etc.).
codegen/in/archive/openapi_1.4.0.json Archive the 1.4.0 OpenAPI spec snapshot.
Makefile Make the sed patch step portable across GNU/BSD sed.

@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from f31112d to dd80f41 Compare March 19, 2026 07:17
Comment on lines +559 to +567
payload_kwargs: dict[str, Any] = {
"application_id": application_id,
"version_number": application_version,
"custom_metadata": cast("dict[str, Any]", convert_to_json_serializable(custom_metadata)),
"items": items,
}
if scheduling is not None:
payload_kwargs["scheduling"] = scheduling
payload = RunCreationRequest(**payload_kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since scheduling is optional and nullable in the model, why not just add something like this

payload = RunCreationRequest(
    ...
    scheduling = scheduling or None
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted.

Copilot AI review requested due to automatic review settings March 19, 2026 08:01


@pytest.mark.unit
def test_validate_deadline_none() -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are validating functions from the utils so should probably be in application/utils_test.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved now

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK and tests to support the Platform API’s new first-class scheduling field for runs (instead of embedding scheduling constraints under custom_metadata.sdk), alongside an OpenAPI spec/codegen refresh to API version 1.4.0.

Changes:

  • Add scheduling to run submission payloads and update e2e/UI flows to display/measure deadlines via the API response field.
  • Add validation helpers for deadline plus cross-field scheduling constraints (due_date < deadline) and update deadline-exceeded logic to prefer API scheduling.
  • Refresh OpenAPI spec + regenerate client/models/docs (new scheduling models, new artifact URL endpoint, schema tweaks).

Reviewed changes

Copilot reviewed 11 out of 55 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/aignostics/platform/e2e_test.py Switch e2e submission to top-level scheduling; resolve deadline from response scheduling field.
tests/aignostics/application/utils_test.py Add unit tests for deadline-exceeded logic using scheduling object + legacy custom_metadata fallback.
tests/aignostics/application/service_test.py Add unit tests for validate_deadline and validate_scheduling_constraints.
tests/aignostics/application/gui_test.py Update GUI scheduling step inputs (due date + longer deadline).
tests/aignostics/application/cli_pipeline_validation_test.py Adjust CLI tests’ deadline argument to be in the future.
src/aignostics/platform/resources/runs.py Extend Runs.submit() with optional scheduling and include it in RunCreationRequest.
src/aignostics/application/_utils.py Add deadline validation + cross-field constraints; prefer API scheduling.deadline in deadline-exceeded checks.
src/aignostics/application/_service.py Validate deadline + constraints; send scheduling as top-level run submit field.
src/aignostics/application/_gui/_page_application_run_describe.py Display scheduling (due date/deadline) from run response in the describe page.
codegen/out/docs/PublicApi.md Regenerated API docs (includes new artifact URL endpoint and parameter updates).
codegen/out/aignx/codegen/rest.py Regenerated client header/version updates.
codegen/out/aignx/codegen/models/version_read_response.py Regenerated model changes (semver regex validation, typing updates).
codegen/out/aignx/codegen/models/validation_error_loc_inner.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/validation_error.py Regenerated model fields (adds input/ctx).
codegen/out/aignx/codegen/models/user_read_response.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/scheduling_response.py New generated model for scheduling in run responses.
codegen/out/aignx/codegen/models/scheduling_request.py New generated model for scheduling in run creation requests.
codegen/out/aignx/codegen/models/run_termination_reason.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/run_state.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/run_read_response.py Regenerated model adds scheduling field.
codegen/out/aignx/codegen/models/run_output.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/run_item_statistics.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/run_creation_response.py Regenerated model adjusts run_id requiredness/typing.
codegen/out/aignx/codegen/models/run_creation_request.py Regenerated model adds scheduling to request schema.
codegen/out/aignx/codegen/models/output_artifact_visibility.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/output_artifact_scope.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/output_artifact_result_read_response.py Regenerated model field ordering/optional defaults.
codegen/out/aignx/codegen/models/output_artifact.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/organization_read_response.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/me_read_response.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/item_termination_reason.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/item_state.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/item_result_read_response.py Regenerated model field ordering/optional defaults.
codegen/out/aignx/codegen/models/item_output.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/item_creation_request.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/input_artifact_creation_request.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/input_artifact.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/http_validation_error.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/custom_metadata_update_response.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/custom_metadata_update_request.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/artifact_termination_reason.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/artifact_state.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/artifact_output.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/application_version.py Regenerated model adds semver regex validation.
codegen/out/aignx/codegen/models/application_read_short_response.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/application_read_response.py Regenerated model header/version updates.
codegen/out/aignx/codegen/models/init.py Regenerated exports list ordering including scheduling models.
codegen/out/aignx/codegen/exceptions.py Regenerated client header/version updates.
codegen/out/aignx/codegen/configuration.py Regenerated client version string updates.
codegen/out/aignx/codegen/api_client.py Regenerated client header/version updates.
codegen/out/aignx/codegen/api/public_api.py Regenerated API client methods (new artifact URL endpoint, list_runs param updates, etc.).
codegen/out/.openapi-generator/FILES Regenerated file manifest includes scheduling models.
codegen/in/openapi.json Updated OpenAPI input spec to 1.4.0 including scheduling fields.
codegen/in/archive/openapi_1.4.0.json Added archived OpenAPI spec snapshot for 1.4.0.
Makefile Make codegen sed step portable across GNU/BSD sed variants.

@nahua-aignx nahua-aignx force-pushed the chore/PAPI-4701-scheduling-payload branch from b4db3b7 to 46699a6 Compare March 19, 2026 08:14
Copilot AI review requested due to automatic review settings March 19, 2026 08:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SDK to use the Platform’s new first-class scheduling field on run creation (instead of embedding scheduling under custom_metadata.sdk), along with regenerating the OpenAPI client to API version 1.4.0 and adjusting tests/GUI to reflect the new contract.

Changes:

  • Add scheduling to run submission (SDK resources + application service) and validate due_date/deadline including cross-field constraints.
  • Update e2e + unit tests and GUI run description rendering to read scheduling from the API response field.
  • Regenerate OpenAPI client output for API 1.4.0 (adds scheduling models/fields, new endpoint docs, schema tweaks).

Reviewed changes

Copilot reviewed 11 out of 55 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/aignostics/platform/e2e_test.py Sends scheduling in submit + reads deadline from API scheduling, with fallback helper
tests/aignostics/application/utils_test.py Adds/updates unit tests for deadline/scheduling validation + deadline exceeded logic
tests/aignostics/application/service_test.py Removes duplicated validate_due_date tests from service tests
tests/aignostics/application/gui_test.py Adjusts GUI scheduling time inputs used by the test flow
tests/aignostics/application/cli_pipeline_validation_test.py Tweaks CLI deadline test input (adds small future buffer)
src/aignostics/platform/resources/runs.py Extends Runs.submit() to accept scheduling and include it in RunCreationRequest
src/aignostics/application/_utils.py Adds deadline + cross-field scheduling validation and updates deadline-exceeded logic to prefer API scheduling
src/aignostics/application/_service.py Validates due_date/deadline and sends top-level scheduling in run submission
src/aignostics/application/_gui/_page_application_run_describe.py Displays scheduling (due date/deadline) from API response in run describe page
codegen/out/docs/PublicApi.md Regenerated API docs (adds artifact URL endpoint, list_runs param changes, etc.)
codegen/out/aignx/codegen/rest.py Regenerated client metadata for OpenAPI version 1.4.0
codegen/out/aignx/codegen/models/version_read_response.py Regenerated model updates (semver regex validation, typing adjustments)
codegen/out/aignx/codegen/models/validation_error_loc_inner.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/validation_error.py Regenerated validation error schema (adds input/ctx)
codegen/out/aignx/codegen/models/user_read_response.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/scheduling_response.py New generated model for scheduling returned in run responses
codegen/out/aignx/codegen/models/scheduling_request.py New generated model for scheduling request payload
codegen/out/aignx/codegen/models/run_termination_reason.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/run_state.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/run_read_response.py Adds scheduling to run read response model
codegen/out/aignx/codegen/models/run_output.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/run_item_statistics.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/run_creation_response.py Regenerated response schema (run_id required)
codegen/out/aignx/codegen/models/run_creation_request.py Adds scheduling to run creation request model
codegen/out/aignx/codegen/models/output_artifact_visibility.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/output_artifact_scope.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/output_artifact_result_read_response.py Regenerated artifact result schema (field ordering/defaults)
codegen/out/aignx/codegen/models/output_artifact.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/organization_read_response.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/me_read_response.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/item_termination_reason.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/item_state.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/item_result_read_response.py Regenerated item result schema (adds error_code placement/handling)
codegen/out/aignx/codegen/models/item_output.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/item_creation_request.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/input_artifact_creation_request.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/input_artifact.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/http_validation_error.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/custom_metadata_update_response.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/custom_metadata_update_request.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/artifact_termination_reason.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/artifact_state.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/artifact_output.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/application_version.py Regenerated model updates (semver regex validation, typing adjustments)
codegen/out/aignx/codegen/models/application_read_short_response.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/application_read_response.py Regenerated header/version metadata
codegen/out/aignx/codegen/models/init.py Regenerated models export list
codegen/out/aignx/codegen/exceptions.py Regenerated header/version metadata
codegen/out/aignx/codegen/configuration.py Regenerated version string + debug report API version
codegen/out/aignx/codegen/api_client.py Regenerated header/version metadata
codegen/out/aignx/codegen/api/public_api.py Regenerated Public API client (new endpoint + list_runs param changes)
codegen/out/.openapi-generator/FILES Updates generated file manifest
codegen/in/openapi.json Updates OpenAPI spec input (v1.4.0, scheduling schemas, endpoint additions)
codegen/in/archive/openapi_1.4.0.json Adds archived OpenAPI spec snapshot for 1.4.0
Makefile Makes the sed-based codegen patch step portable across GNU/BSD sed

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants