Skip to content

Feat/41 project triage rules versioned templates - #75

Merged
jacksonsr451 merged 2 commits into
mainfrom
feat/41-project-triage-rules-versioned-templates
Oct 20, 2026
Merged

jacksonsr451 merged 2 commits into
mainfrom
feat/41-project-triage-rules-versioned-templates

Conversation

@jacksonsr451

Copy link
Copy Markdown
Owner

Summary

Closes #41
Related to #37

Implements project-specific triage configuration, customizable validation rules, immutable versioned templates, and configurable triage workflows in the EventFlow Work Management bounded context.

The implementation extends the existing Consultation → Triage → Proposal → Approval → WorkItem → BoardCard workflow without introducing a parallel triage system or bypassing approval requirements.

It includes PostgreSQL persistence, template activation, historical snapshots, authorization, optimistic concurrency, durable idempotency, auditability, updated API contracts, and integration tests.

Changes

1. Project-Specific Triage Configuration

  • Added project-scoped triage configuration.
  • Added support for project-specific required fields and validation rules.
  • Integrated custom configuration with existing triage behavior.
  • Preserved compatibility with existing triage categories and contracts.
  • Maintained Workspace and Project isolation.

2. Versioned Triage Templates

  • Added project-specific triage templates.
  • Implemented immutable template versions.
  • Added template publication and activation capabilities.
  • Preserved historical template references through snapshots.
  • Prevented published template versions from being modified.
  • Added PostgreSQL triggers to enforce published-version immutability at the database level.

3. Customizable Triage Workflows

  • Extended existing triage behavior with project-specific workflow configuration.
  • Integrated validation with the established Consultation lifecycle.
  • Preserved existing Proposal and Approval boundaries.
  • Maintained approval requirements before WorkItem and BoardCard creation.

4. API and Contract Updates

Updated the existing Work Management API and schemas to support:

  • Project triage configuration.
  • Versioned template definitions.
  • Template activation.
  • Template preview.
  • Validation behavior.
  • Authorization requirements.
  • ETags and If-Match preconditions.
  • Idempotency.
  • Explicit error responses.

The implementation extends the existing triage contracts rather than creating a separate API model.

5. Security and Reliability

Implemented or extended:

  • Role-based access control (RBAC).
  • Workspace and Project isolation.
  • Optimistic concurrency using ETags and If-Match.
  • Idempotency for critical operations.
  • Audit records for configuration changes.
  • Immutable historical template snapshots.
  • Bounded string-value validation with a 10,000-character limit.
  • PostgreSQL-level immutability protection.

6. PostgreSQL Persistence and Migration

Added Alembic migration:

0012_project_triage_configuration.py

The subsequent hardening commit addressed:

  • Alembic revision identifier overflow.
  • Database constraint naming.
  • Published-template immutability enforcement.
  • Additional PostgreSQL integration coverage.
  • Persistence documentation updates.

Migration validation completed successfully:

  • Upgrade to the current migration head.
  • Repeated upgrade verification.
  • Downgrade.
  • Re-upgrade.
  • Integration tests against PostgreSQL.

7. Documentation

Updated:

  • Work Management API documentation.
  • Work Management workflow documentation.
  • Work Management persistence documentation.
  • Workspace and Project isolation documentation.
  • ADR-010.
  • OpenAPI and schema contracts.

Validation

Automated Tests

Test Suite Result
Work Management with PostgreSQL 224 passed, 1 skipped
New triage integration tests 9 passed
Root contract/security tests 55 passed

The targeted integration tests are reported separately and may overlap with the full service suite.

The single skipped test is an optional Keycloak-dependent test.

Additional Checks

  • PostgreSQL integration environment available.
  • Alembic upgrade passed.
  • Repeated migration upgrade passed.
  • Alembic downgrade passed.
  • Alembic re-upgrade passed.
  • PostgreSQL immutability triggers added.
  • Triage integration tests passed.
  • Contract/security tests passed.
  • Contract validation passed.
  • Pre-commit hooks passed.
  • Local working tree clean.
  • Remote CI verification pending.
  • Code review pending.

Acceptance Criteria

  • Project-specific triage configuration implemented.
  • Custom required fields and validation rules implemented.
  • Versioned triage templates implemented.
  • Published template immutability enforced.
  • Template activation implemented.
  • Historical template snapshots implemented.
  • Customizable triage workflow behavior implemented.
  • Existing approval workflow preserved.
  • RBAC implemented.
  • Workspace and Project isolation implemented.
  • ETags and If-Match supported.
  • Critical operations protected by idempotency.
  • Auditability implemented.
  • API contracts updated.
  • Architecture documentation updated.
  • PostgreSQL migration validated.
  • Integration tests passed.
  • Local quality checks passed.
  • Remote CI passed.
  • PR reviewed and approved.

Related Issue #37

Issue #37 describes overlapping requirements for project-specific triage rules and templates.

This implementation consolidates the functionality into the existing Work Management architecture rather than introducing a duplicate configuration system.

Issue #37 remains open for independent review and disposition.

Review Focus

Please pay particular attention to:

  1. Project and Workspace isolation.
  2. Template publication and version immutability.
  3. PostgreSQL triggers and migration reversibility.
  4. Template activation and historical snapshots.
  5. Required-field validation.
  6. RBAC enforcement.
  7. ETag/If-Match concurrency behavior.
  8. Idempotency and audit consistency.
  9. Compatibility with existing triage contracts.
  10. Preservation of Proposal approval invariants.

Commits

9bef426 — feat(work-management): add project triage rules and versioned templates (#41)

5fe8e92 — fix(work-management): harden triage migration and add PostgreSQL coverage (#41)

Final Status

READY FOR REVIEW

The implementation and PostgreSQL validation are complete according to the local execution report.

No functional blockers were reported.

Remote CI execution and Pull Request approval remain pending.

@jacksonsr451
jacksonsr451 merged commit 5d47ba8 into main Oct 20, 2026
3 checks passed
@jacksonsr451
jacksonsr451 deleted the feat/41-project-triage-rules-versioned-templates branch October 20, 2026 13:51
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.

[FEAT] Permitir regras de triagem e templates customizados por projeto

1 participant