Repository navigation
C13: Add deterministic Backend seed and fixture generator - #1047
Conversation
Maneesh-Kumar-Maddini
left a comment
There was a problem hiding this comment.
The 15 focused generator tests passed during review, and the deterministic generation, fixture tagging, validation, and cleanup safeguards are present. However, the branch does not include the latest main changes. Please update it against current main and rerun the generator tests and a controlled seed/cleanup verification against an isolated test database. Confirm that unrelated records remain untouched. Approval is pending this final integration evidence, after which the dependent #1051 can proceed.
|
Hi Maneesh, I’ve now reconciled C13 with the latest main and completed the final isolated integration verification you requested. Verification completed: 15 passed for tests/test_seed_detections.py This confirms that targeted C13 cleanup only removes C13-tagged fixtures and leaves unrelated records untouched. Could you please re-review the latest branch when you have a chance? Thank you. |
Maneesh-Kumar-Maddini
left a comment
There was a problem hiding this comment.
Reviewed commit c9063e8 and the supplied integration evidence. The earlier update and cleanup-verification requirements are satisfied. All 15 generator tests passed, and the isolated seed/cleanup check removed exactly 12 fixtures while preserving the unrelated control record.
One integration issue remains: the generator defaults to the events collection but validates and generates only DetectionCreate documents. These omit sourceType and use location arrays, whereas the current EventSchema requires sourceType and structured location objects. The generated fixtures fail EventSchema validation and are excluded from both real and simulator source-type filters.
Please generate and validate fixtures against the schema appropriate to the selected collection. Add coverage confirming that event fixtures appear through the intended filtered reads, while detections fixtures and cleanup protections continue to work.
Approval remains pending this correction and its regression tests.
|
Hi Maneesh, I’ve addressed the remaining C13 integration issue and reconciled the branch with the latest remote changes. The generator now handles collection-specific fixtures for both events and detections, with the appropriate schema/structure for each path. I also added regression coverage for the event fixtures and filtered read behaviour. Verification completed: +) pytest tests/test_seed_detections.py -q Could you please re-review the latest changes when you have a chance? Thank you. |
Maneesh-Kumar-Maddini
left a comment
There was a problem hiding this comment.
Reviewed commit 8d97337. The remaining collection-schema issue is resolved: event fixtures now include sourceType and structured location objects validated against EventSchema, while detection fixtures retain the DetectionCreate format.
All 19 supplied tests passed in isolation. Additional mock-database checks verified real/simulator filtering, event-response validation, deterministic generation, and cleanup for both collections. Each cleanup removed exactly 12 generated fixtures while preserving an unrelated control record.
The branch includes current main, and all four GitHub checks pass. All review points have been addressed. This PR is ready to merge.
Summary
Implements Sprint 2 C13 - Backend Seed and Fixture Generator CLI.
The generator creates deterministic, schema-valid Project Echo detection
fixtures for local development, integration testing and downstream Sprint 2
tasks.
Changes
tools/seed_detections.pyDetectionCreateschema for validationValidation
Automated tests: 15 passed
Manual MongoDB integration evidence:
Safety
Cleanup only targets records marked with C13 fixture metadata.
Explicit database/environment/confirmation arguments are required for
destructive cleanup, and production cleanup is rejected.
Related Sprint 2 Work
The fixture generator is reused by B2.4 analytics validation.