Merged
Conversation
Previously app.py mutated the root logger's handlers and level at import time. Any test importing the module (directly or transitively) inherited those handlers, which were closed on teardown and produced spurious 'ValueError: I/O operation on closed file.' noise in every pytest run. Fix: wrap the Uvicorn-handler wiring in configure_logging(), called only from a FastAPI lifespan context manager. The root logger is now left untouched at import time; module-level code only creates the module logger. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace spurious print() calls in four test files: - test/behaviors/test_performance.py: use logger.info/warning for timing output - test/bt/test_case_states/test_conditions.py: remove leftover debug print - test/as_vocab/test_vulnerability_report.py: remove debug print calls - test/as_vocab/test_create_activity.py: remove debug print call 592 tests pass, no stdout noise in uv run pytest -s output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…3-006) Rename VulnerabilityCase.case_status (list) -> case_statuses per CM-03-006. Add read-only case_status property returning current_status (most recent). Rename CaseParticipant.participant_status (list) -> participant_statuses. Add read-only participant_status property returning most recent entry. Update all callers in handlers, behaviors, demo scripts, and tests. All 592 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the API v2 backend handler implementation and the ActivityStreams vocabulary example generator into smaller submodules, while also renaming status-history fields to pluralized names (case_statuses, participant_statuses) and updating tests/docs accordingly.
Changes:
- Split
vultron/api/v2/backend/handlers.pyinto ahandlers/package with focused submodules and a re-exporting__init__.py. - Split
vultron/scripts/vocab_examples.pyintovultron/as_vocab/examples/*and add a compatibility shim for the original import path. - Rename status-history list fields to
case_statuses/participant_statuses, add “latest status” convenience properties, and update usages/tests.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vultron/scripts/vocab_examples.py | Converted to a compatibility shim re-exporting the new examples module. |
| vultron/demo/status_updates_demo.py | Updated demo to use case_statuses. |
| vultron/behaviors/report/nodes.py | Updated participant RM status history usage to participant_statuses. |
| vultron/as_vocab/objects/vulnerability_case.py | Renamed case_status list to case_statuses; added case_status (latest) property. |
| vultron/as_vocab/objects/case_participant.py | Renamed participant_status list to participant_statuses; added participant_status (latest) property. |
| vultron/as_vocab/examples/vocab_examples.py | New entrypoint/re-export module composing the split example submodules. |
| vultron/as_vocab/examples/status.py | New split-out status example builders. |
| vultron/as_vocab/examples/report.py | New split-out report example builders. |
| vultron/as_vocab/examples/participant.py | New split-out participant example builders. |
| vultron/as_vocab/examples/note.py | New split-out note example builders. |
| vultron/as_vocab/examples/embargo.py | New split-out embargo example builders. |
| vultron/as_vocab/examples/case.py | New split-out case example builders. |
| vultron/as_vocab/examples/actor.py | New split-out actor recommendation example builders. |
| vultron/as_vocab/examples/_base.py | New shared helpers/constants for generating examples. |
| vultron/as_vocab/examples/init.py | New package marker for examples module. |
| vultron/api/v2/backend/handlers/_base.py | New shared verify_semantics decorator used by handler submodules. |
| vultron/api/v2/backend/handlers/init.py | Re-exports handler functions from submodules for backward compatibility. |
| vultron/api/v2/backend/handlers/unknown.py | New unknown/unrecognized activity handler. |
| vultron/api/v2/backend/handlers/status.py | New status handlers split out from the former monolith. |
| vultron/api/v2/backend/handlers/report.py | New report handlers split out from the former monolith. |
| vultron/api/v2/backend/handlers/participant.py | New participant handlers split out from the former monolith. |
| vultron/api/v2/backend/handlers/note.py | New note handlers split out from the former monolith. |
| vultron/api/v2/backend/handlers/embargo.py | New embargo handlers split out from the former monolith. |
| vultron/api/v2/backend/handlers/case.py | New case handlers split out from the former monolith. |
| vultron/api/v2/backend/handlers/actor.py | New actor/invite/ownership handlers split out from the former monolith. |
| vultron/api/v2/backend/handlers.py | Removed monolithic handlers module (replaced by handlers/ package). |
| vultron/api/v2/app.py | Moved root-logger mutation into FastAPI lifespan startup to reduce test side effects. |
| test/bt/test_case_states/test_conditions.py | Removed debug print() noise. |
| test/behaviors/test_performance.py | Switched from print() to logger for perf output. |
| test/behaviors/report/test_prioritize_tree.py | Updated tests to use participant_statuses. |
| test/as_vocab/test_vulnerability_report.py | Removed debug print() noise. |
| test/as_vocab/test_vulnerability_case.py | Updated tests to use case_statuses. |
| test/as_vocab/test_vocab_examples.py | Updated tests to use participant_statuses. |
| test/as_vocab/test_create_activity.py | Removed debug print() noise. |
| test/api/v2/routers/test_datalayer_serialization.py | Updated expected JSON field name to caseStatuses. |
| test/api/v2/backend/test_handlers.py | Updated tests and docstrings to use renamed status-history fields. |
| plan/PRIORITIES.md | Updated planning doc content (removed completed PRIORITY 10/20 section text). |
| plan/IMPLEMENTATION_PLAN.md | Updated implementation plan with refreshed gap analysis and task status. |
| plan/IMPLEMENTATION_NOTES.md | Added implementation notes (logging side effects, design questions, gaps). |
| plan/IDEATION.md | Removed large ideation document (replaced by placeholder). |
| plan/IDEAS.md | Added placeholder “Project Ideas” doc. |
| plan/BUGS.md | Reformatted/clarified linkchecker bug note. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR
VulnerabilityCase.case_statustoVulnerabilityCase.case_statusesto indicate that it is a list of status items, not a singular statusCaseParticipant.participant_statustoCaseParticipant.participant_statusesfor the same reasonCopilot Summary
This pull request updates planning and implementation documentation to reflect recent gap analysis, bug fixes, and ongoing architectural decisions. Key changes include a refreshed gap analysis, marking completed and outstanding tasks, and detailed implementation notes on logging, actor independence, triggerable behaviors, and model gaps.
Gap Analysis and Task Status Updates
plan/IMPLEMENTATION_PLAN.mdto version Update CONTRIBUTING.md #10, updating the status of several tasks and markingCM-03-006field rename as complete. New gaps and outstanding tasks are clearly listed, including triggerable behaviors, actor independence, broadcast requirements, missing domain models, embargo policy, and root logger side effects. [1] [2] [3] [4]Implementation Notes and Architectural Decisions
plan/IMPLEMENTATION_NOTES.mdcovering:vultron/api/v2/app.pyand recommendations for test isolation.Documentation and Ideas Organization
plan/IDEAS.mdfile as a placeholder for project ideas.plan/IDEATION.md, likely to be relocated or reorganized for clarity.Minor Bug Documentation
plan/BUGS.md, specifically for linkchecker errors.