Compare commits
2 Commits
484019e750
...
a8f7147500
| Author | SHA1 | Date | |
|---|---|---|---|
| a8f7147500 | |||
| ce684bc5d1 |
@@ -1,5 +1,5 @@
|
|||||||
# [DEF:backend.tests.test_reports_api:Module]
|
# [DEF:backend.tests.test_reports_api:Module]
|
||||||
# @TIER: CRITICAL
|
# @TIER: STANDARD
|
||||||
# @SEMANTICS: tests, reports, api, contract, pagination, filtering
|
# @SEMANTICS: tests, reports, api, contract, pagination, filtering
|
||||||
# @PURPOSE: Contract tests for GET /api/reports defaults, pagination, and filtering behavior.
|
# @PURPOSE: Contract tests for GET /api/reports defaults, pagination, and filtering behavior.
|
||||||
# @LAYER: Domain (Tests)
|
# @LAYER: Domain (Tests)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# [DEF:backend.tests.test_reports_detail_api:Module]
|
# [DEF:backend.tests.test_reports_detail_api:Module]
|
||||||
# @TIER: CRITICAL
|
# @TIER: STANDARD
|
||||||
# @SEMANTICS: tests, reports, api, detail, diagnostics
|
# @SEMANTICS: tests, reports, api, detail, diagnostics
|
||||||
# @PURPOSE: Contract tests for GET /api/reports/{report_id} detail endpoint behavior.
|
# @PURPOSE: Contract tests for GET /api/reports/{report_id} detail endpoint behavior.
|
||||||
# @LAYER: Domain (Tests)
|
# @LAYER: Domain (Tests)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# [DEF:backend.tests.test_reports_openapi_conformance:Module]
|
# [DEF:backend.tests.test_reports_openapi_conformance:Module]
|
||||||
# @TIER: CRITICAL
|
# @TIER: STANDARD
|
||||||
# @SEMANTICS: tests, reports, openapi, conformance
|
# @SEMANTICS: tests, reports, openapi, conformance
|
||||||
# @PURPOSE: Validate implemented reports payload shape against OpenAPI-required top-level contract fields.
|
# @PURPOSE: Validate implemented reports payload shape against OpenAPI-required top-level contract fields.
|
||||||
# @LAYER: Domain (Tests)
|
# @LAYER: Domain (Tests)
|
||||||
|
|||||||
@@ -6,6 +6,17 @@
|
|||||||
# @RELATION: Depends on PluginLoader to get plugin instances. It is used by the API layer to create and query tasks.
|
# @RELATION: Depends on PluginLoader to get plugin instances. It is used by the API layer to create and query tasks.
|
||||||
# @INVARIANT: Task IDs are unique.
|
# @INVARIANT: Task IDs are unique.
|
||||||
# @CONSTRAINT: Must use belief_scope for logging.
|
# @CONSTRAINT: Must use belief_scope for logging.
|
||||||
|
# @TEST_CONTRACT: TaskManagerModule -> {
|
||||||
|
# required_fields: {plugin_loader: PluginLoader},
|
||||||
|
# optional_fields: {},
|
||||||
|
# invariants: ["Must use belief_scope for logging"]
|
||||||
|
# }
|
||||||
|
# @TEST_FIXTURE: valid_module -> {"manager_initialized": true}
|
||||||
|
# @TEST_EDGE: missing_required_field -> {"plugin_loader": null}
|
||||||
|
# @TEST_EDGE: empty_response -> {"tasks": []}
|
||||||
|
# @TEST_EDGE: invalid_type -> {"plugin_loader": "string_instead_of_object"}
|
||||||
|
# @TEST_EDGE: external_failure -> {"db_unavailable": true}
|
||||||
|
# @TEST_INVARIANT: logger_compliance -> verifies: [valid_module]
|
||||||
|
|
||||||
# [SECTION: IMPORTS]
|
# [SECTION: IMPORTS]
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -28,7 +39,17 @@ from ..logger import logger, belief_scope, should_log_task_level
|
|||||||
# @INVARIANT: Task IDs are unique within the registry.
|
# @INVARIANT: Task IDs are unique within the registry.
|
||||||
# @INVARIANT: Each task has exactly one status at any time.
|
# @INVARIANT: Each task has exactly one status at any time.
|
||||||
# @INVARIANT: Log entries are never deleted after being added to a task.
|
# @INVARIANT: Log entries are never deleted after being added to a task.
|
||||||
class TaskManager:
|
# @TEST_CONTRACT: TaskManager -> {
|
||||||
|
# required_fields: {plugin_id: str, params: dict},
|
||||||
|
# optional_fields: {user_id: str},
|
||||||
|
# invariants: ["Task IDs are unique within the registry", "Each task has exactly one status at any time"]
|
||||||
|
# }
|
||||||
|
# @TEST_FIXTURE: create_valid_task -> {"plugin_id": "migration_plugin", "params": {"source": "A", "target": "B"}}
|
||||||
|
# @TEST_EDGE: missing_required_field -> {"plugin_id": null}
|
||||||
|
# @TEST_EDGE: empty_response -> {"params": {}}
|
||||||
|
# @TEST_EDGE: invalid_type -> {"params": "string_instead_of_dict"}
|
||||||
|
# @TEST_EDGE: external_failure -> {"plugin_not_found": true}
|
||||||
|
# @TEST_INVARIANT: single_status -> verifies: [create_valid_task, external_failure]
|
||||||
"""
|
"""
|
||||||
Manages the lifecycle of tasks, including their creation, execution, and state tracking.
|
Manages the lifecycle of tasks, including their creation, execution, and state tracking.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# [DEF:test_report_models:Module]
|
# [DEF:test_report_models:Module]
|
||||||
# @TIER: CRITICAL
|
# @TIER: STANDARD
|
||||||
# @PURPOSE: Unit tests for report Pydantic models and their validators
|
# @PURPOSE: Unit tests for report Pydantic models and their validators
|
||||||
# @LAYER: Domain
|
# @LAYER: Domain
|
||||||
# @RELATION: TESTS -> backend.src.models.report
|
# @RELATION: TESTS -> backend.src.models.report
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# [DEF:test_encryption_manager:Module]
|
# [DEF:test_encryption_manager:Module]
|
||||||
# @TIER: CRITICAL
|
# @TIER: STANDARD
|
||||||
# @SEMANTICS: encryption, security, fernet, api-keys, tests
|
# @SEMANTICS: encryption, security, fernet, api-keys, tests
|
||||||
# @PURPOSE: Unit tests for EncryptionManager encrypt/decrypt functionality.
|
# @PURPOSE: Unit tests for EncryptionManager encrypt/decrypt functionality.
|
||||||
# @LAYER: Domain
|
# @LAYER: Domain
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# [DEF:backend.tests.test_report_normalizer:Module]
|
# [DEF:backend.tests.test_report_normalizer:Module]
|
||||||
# @TIER: CRITICAL
|
# @TIER: STANDARD
|
||||||
# @SEMANTICS: tests, reports, normalizer, fallback
|
# @SEMANTICS: tests, reports, normalizer, fallback
|
||||||
# @PURPOSE: Validate unknown task type fallback and partial payload normalization behavior.
|
# @PURPOSE: Validate unknown task type fallback and partial payload normalization behavior.
|
||||||
# @LAYER: Domain (Tests)
|
# @LAYER: Domain (Tests)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# [DEF:test_report_service:Module]
|
# [DEF:test_report_service:Module]
|
||||||
# @TIER: CRITICAL
|
# @TIER: STANDARD
|
||||||
# @PURPOSE: Unit tests for ReportsService list/detail operations
|
# @PURPOSE: Unit tests for ReportsService list/detail operations
|
||||||
# @LAYER: Domain
|
# @LAYER: Domain
|
||||||
# @RELATION: TESTS -> backend.src.services.reports.report_service.ReportsService
|
# @RELATION: TESTS -> backend.src.services.reports.report_service.ReportsService
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:frontend.src.components.__tests__.task_log_viewer:Module]
|
// [DEF:frontend.src.components.__tests__.task_log_viewer:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: tests, task-log, viewer, mount, components
|
// @SEMANTICS: tests, task-log, viewer, mount, components
|
||||||
// @PURPOSE: Unit tests for TaskLogViewer component by mounting it and observing the DOM.
|
// @PURPOSE: Unit tests for TaskLogViewer component by mounting it and observing the DOM.
|
||||||
// @LAYER: UI (Tests)
|
// @LAYER: UI (Tests)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:frontend.src.lib.api.__tests__.reports_api:Module]
|
// [DEF:frontend.src.lib.api.__tests__.reports_api:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: tests, reports, api-client, query-string, error-normalization
|
// @SEMANTICS: tests, reports, api-client, query-string, error-normalization
|
||||||
// @PURPOSE: Unit tests for reports API client functions: query string building, error normalization, and fetch wrappers.
|
// @PURPOSE: Unit tests for reports API client functions: query string building, error normalization, and fetch wrappers.
|
||||||
// @LAYER: Infra (Tests)
|
// @LAYER: Infra (Tests)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ describe('AssistantChatPanel integration contract', () => {
|
|||||||
const source = fs.readFileSync(COMPONENT_PATH, 'utf-8');
|
const source = fs.readFileSync(COMPONENT_PATH, 'utf-8');
|
||||||
|
|
||||||
expect(source).toContain('<!-- [DEF' + ':AssistantChatPanel:Component] -->');
|
expect(source).toContain('<!-- [DEF' + ':AssistantChatPanel:Component] -->');
|
||||||
expect(source).toContain('@TIER: CRITICAL');
|
expect(source).toContain('@TIER: STANDARD');
|
||||||
expect(source).toContain('@UX_STATE: LoadingHistory');
|
expect(source).toContain('@UX_STATE: LoadingHistory');
|
||||||
expect(source).toContain('@UX_STATE: Sending');
|
expect(source).toContain('@UX_STATE: Sending');
|
||||||
expect(source).toContain('@UX_STATE: Error');
|
expect(source).toContain('@UX_STATE: Error');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:__tests__/test_sidebar:Module]
|
// [DEF:__tests__/test_sidebar:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @PURPOSE: Unit tests for Sidebar.svelte component
|
// @PURPOSE: Unit tests for Sidebar.svelte component
|
||||||
// @LAYER: UI
|
// @LAYER: UI
|
||||||
// @RELATION: VERIFIES -> frontend/src/lib/components/layout/Sidebar.svelte
|
// @RELATION: VERIFIES -> frontend/src/lib/components/layout/Sidebar.svelte
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:__tests__/test_taskDrawer:Module]
|
// [DEF:__tests__/test_taskDrawer:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @PURPOSE: Unit tests for TaskDrawer.svelte component
|
// @PURPOSE: Unit tests for TaskDrawer.svelte component
|
||||||
// @LAYER: UI
|
// @LAYER: UI
|
||||||
// @RELATION: VERIFIES -> frontend/src/lib/components/layout/TaskDrawer.svelte
|
// @RELATION: VERIFIES -> frontend/src/lib/components/layout/TaskDrawer.svelte
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:__tests__/test_topNavbar:Module]
|
// [DEF:__tests__/test_topNavbar:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @PURPOSE: Unit tests for TopNavbar.svelte component
|
// @PURPOSE: Unit tests for TopNavbar.svelte component
|
||||||
// @LAYER: UI
|
// @LAYER: UI
|
||||||
// @RELATION: VERIFIES -> frontend/src/lib/components/layout/TopNavbar.svelte
|
// @RELATION: VERIFIES -> frontend/src/lib/components/layout/TopNavbar.svelte
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @vitest-environment jsdom
|
* @vitest-environment jsdom
|
||||||
*/
|
*/
|
||||||
// [DEF:frontend.src.lib.components.reports.__tests__.report_card.ux:Module]
|
// [DEF:frontend.src.lib.components.reports.__tests__.report_card.ux:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: reports, ux-tests, card, states, recovery
|
// @SEMANTICS: reports, ux-tests, card, states, recovery
|
||||||
// @PURPOSE: Test UX states and transitions for ReportCard component
|
// @PURPOSE: Test UX states and transitions for ReportCard component
|
||||||
// @LAYER: UI
|
// @LAYER: UI
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:frontend.src.lib.components.reports.__tests__.report_detail.integration:Module]
|
// [DEF:frontend.src.lib.components.reports.__tests__.report_detail.integration:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: tests, reports, detail, recovery-guidance, integration
|
// @SEMANTICS: tests, reports, detail, recovery-guidance, integration
|
||||||
// @PURPOSE: Validate detail-panel behavior for failed reports and recovery guidance visibility.
|
// @PURPOSE: Validate detail-panel behavior for failed reports and recovery guidance visibility.
|
||||||
// @LAYER: UI (Tests)
|
// @LAYER: UI (Tests)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @vitest-environment jsdom
|
* @vitest-environment jsdom
|
||||||
*/
|
*/
|
||||||
// [DEF:frontend.src.lib.components.reports.__tests__.report_detail.ux:Module]
|
// [DEF:frontend.src.lib.components.reports.__tests__.report_detail.ux:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: reports, ux-tests, detail, diagnostics, recovery
|
// @SEMANTICS: reports, ux-tests, detail, diagnostics, recovery
|
||||||
// @PURPOSE: Test UX states and recovery for ReportDetailPanel component
|
// @PURPOSE: Test UX states and recovery for ReportDetailPanel component
|
||||||
// @LAYER: UI
|
// @LAYER: UI
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:frontend.src.lib.components.reports.__tests__.report_type_profiles:Module]
|
// [DEF:frontend.src.lib.components.reports.__tests__.report_type_profiles:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: tests, reports, type-profiles, fallback
|
// @SEMANTICS: tests, reports, type-profiles, fallback
|
||||||
// @PURPOSE: Validate report type profile mapping and unknown fallback behavior.
|
// @PURPOSE: Validate report type profile mapping and unknown fallback behavior.
|
||||||
// @LAYER: UI (Tests)
|
// @LAYER: UI (Tests)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:frontend.src.lib.components.reports.__tests__.reports_page.integration:Module]
|
// [DEF:frontend.src.lib.components.reports.__tests__.reports_page.integration:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: tests, reports, integration, mixed-types, rendering
|
// @SEMANTICS: tests, reports, integration, mixed-types, rendering
|
||||||
// @PURPOSE: Integration-style checks for unified mixed-type reports rendering expectations.
|
// @PURPOSE: Integration-style checks for unified mixed-type reports rendering expectations.
|
||||||
// @LAYER: UI (Tests)
|
// @LAYER: UI (Tests)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// [DEF:frontend.src.lib.stores.__tests__.test_taskDrawer:Module]
|
// [DEF:frontend.src.lib.stores.__tests__.test_taskDrawer:Module]
|
||||||
// @TIER: CRITICAL
|
// @TIER: STANDARD
|
||||||
// @SEMANTICS: task-drawer, store, mapping, tests
|
// @SEMANTICS: task-drawer, store, mapping, tests
|
||||||
// @PURPOSE: Unit tests for task drawer store
|
// @PURPOSE: Unit tests for task drawer store
|
||||||
// @LAYER: UI
|
// @LAYER: UI
|
||||||
|
|||||||
Reference in New Issue
Block a user