Repository navigation
feat(work-management): implement consultation task proposals (#6) - #69
Merged
Merged
Conversation
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.
Summary
Closes #6
Implements task proposal management for EventFlow's Work Management bounded context, allowing a single triaged Consultation to generate zero, one, or multiple independent Proposals.
Each Proposal has its own identity, lifecycle, revision history, checklist, evidence associations, and review workflow.
This implementation builds on Issues #4 and #5 and preserves the architectural separation between consultations, proposals, approvals, executable tasks, and board cards.
Changes
Proposal Domain
models/proposal.pyto support multiple independent proposals per Consultation.duplicated_fromandsuperseded_byself-referencing relationships.Proposal Management API
Implemented
ProposalServiceandapi/proposal_routes.py, registered in the Work Management application.Supported operations:
The implementation reuses the established
/v1/API conventions.Multiple Proposals per Consultation
A single Consultation can now produce multiple independently managed Proposals.
Example:
Each Proposal maintains its own:
Creating or editing one Proposal does not replace another Proposal associated with the same Consultation.
Immutable Revision History
Introduced:
models/proposal_revision.pyThe migration creates the PostgreSQL trigger:
eventflow_proposal_revisions_block_mutationThis prevents updates and deletions of persisted revision snapshots.
Evidence Associations
Introduced:
models/proposal_evidence.pyProposals can reference supporting evidence associated with their originating Consultation.
The implementation reuses existing Consultation evidence infrastructure rather than duplicating attachment storage.
Controlled Duplication
Added explicit Proposal duplication support.
A duplicated Proposal:
duplicated_from.Proposal Lifecycle
The existing workflow remains:
Proposal creation, preview, editing, and duplication do not automatically create:
Formal approval remains the authoritative boundary for executable work creation.
Persistence
Migration
Added:
0007_proposal_task_proposalsThe migration:
uq_proposals_consultation_version.This resolves the previous conflict between consultation-scoped version uniqueness and the requirement for multiple independent proposals.
Authorization and Security
Extended the existing authorization policy with:
proposal:updateproposal:duplicateThe implementation integrates with existing:
No separate authentication or authorization subsystem was introduced.
API Contracts
Updated:
contracts/openapi/work-management.yamlcontracts/schemas/work_management.yamlChanges include:
The contracts remain compatible with the existing OpenAPI 3.1 validation infrastructure.
Architecture and Documentation
Updated:
ADR-008 Amendment A-01
Documents the architectural amendment separating:
Also records the revised persistence model required for the one-to-many Consultation-to-Proposal relationship.
Open Decision OD-16
Updated the architectural decision tracking associated with Proposal management.
Testing
Local Test Results
The skipped test requires a live Keycloak integration environment.
New Tests
Added:
test_proposal_api_integration.py— 7 integration tests.test_proposal_unit.py— 9 unit tests.Existing tests that depended on consultation-scoped version uniqueness were updated to reflect the new one-to-many model.
Validation
git diff --check: clean.Commands
Review Focus
The following scenarios deserve particular attention during review:
The reported test totals do not independently establish that every one of these scenarios has dedicated coverage.
Backward Compatibility
Scope Exclusions
This PR does not implement:
These capabilities belong to separate workflow stages or client implementations.
Review Checklist
Commit
9425a35— feat(work-management): implement consultation task proposals (#6)Base:
7347e02— feat(work-management): add differentiated consultation triage and reclassification (#5) (#68)Change Statistics
Outcome
Issue #6 introduces complete backend Proposal management for the EventFlow consultation workflow.
A single triaged Consultation can now produce multiple independently versioned Proposals with preview, editing, immutable revision history, controlled duplication, checklists, evidence associations, and authenticated API operations.
The implementation preserves the separation between proposed work and approved executable tasks.
Local verification: 261 passed, 0 failed, 1 skipped.
Status: Ready for review, pending remote CI verification.