Skip to content

PM-6643 - let's talk automated ai classification - #10

Merged
vas3a merged 1 commit into
developfrom
lets-talk-ai-classification
Oct 26, 2026
Merged

vas3a merged 1 commit into
developfrom
lets-talk-ai-classification

Conversation

@vas3a

@vas3a vas3a commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces AI-powered classification of form submissions, primarily for the "Let's talk" form, and integrates this feature throughout the data model, API, and reporting. It adds a new SubmissionClassification table, enables filtering and reporting by classification label, and updates documentation and migration files accordingly.

AI Classification Feature:

  • Added a new SubmissionClassification table to store AI classification results for each submission, including label, status, confidence, review flag, language, rationale, workflow IDs, attempts, and error details, with appropriate constraints and indexing. [1] [2]
  • Updated the Prisma schema and data model to relate Submission to SubmissionClassification and document the new entity and its fields. [1] [2] [3]
  • Seeded processor flows for AI classification and label-based routing, initially disabled, with migration and rollout details provided. [1] [2] [3]

API and Reporting Enhancements:

  • Extended the API to append classification columns to submission reports and CSV exports for forms with AI classification, and to support an optional classification label filter (including UNKNOWN for unclassified submissions). [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated DTOs and validation to support classification label filtering and enforce label format. [1] [2]

Documentation:

  • Updated API and data model documentation to describe the classification system, new fields, filtering, and migration/rollout process. [1] [2] [3] [4]

Testing:

  • Minor formatting update in integration tests for clarity.

@vas3a
vas3a requested review from jmgasper and a balanced review from Copilot October 22, 2026 19:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It introduces a production database migration and changes the submissions report/CSV API contract, which warrant final human review.

1 open issue
What changed in this PR

This PR (PM-6643) introduces AI-powered classification of form submissions, focused on the "Let's talk" form, and wires the result through the data model, reporting API, and documentation. It adds a new SubmissionClassification table (populated externally by forms-processor-v6), appends classification columns to the cross-version submissions report/CSV export for forms that have an ai-classify processor flow, and adds an optional classification label filter. A migration also seeds the Let's talk classify/label-routing flows (all disabled) for a staged rollout.

Changes:

  • New SubmissionClassification model + migration with label/status/confidence constraints and a label index, cascading on submission delete.
  • reportForm appends five classification_* columns/labels and supports a validated classification filter (with UNKNOWN matching unclassified rows) only for forms with an ai-classify flow; the CSV export inherits this via ReportDatesDto.
  • Documentation (api.md, data-model.md, lets-talk.md) and an integration test covering reporting, filtering, CSV export, and cascade deletion.
File Description
prisma/​schema.prisma Adds SubmissionClassification model and the Submission back-relation.
prisma/​migrations/​20261022010000_lets_talk_classification/​migration.sql Creates the table with CHECK constraints/index and seeds seven disabled Let's talk flows.
src/​forms/​forms.service.ts Adds classificationCells/classificationFilter helpers and integrates columns, labels, and filtering into reportForm.
src/​forms/​dto.ts Adds CLASSIFICATION_LABEL_PATTERN and the optional classification filter field on ReportDatesDto.
docs/​api.md Documents the classification columns and filter for report/export routes.
docs/​data-model.md Documents the new entity, relation, and classification-rule routing.
docs/​lets-talk.md Describes the classification feature and rollout (trigger wording flagged).
test/​forms.integration.spec.ts Adds integration coverage for seeded flows, columns, filtering, CSV export, and cascade; minor formatting.

Review effort: Balanced

Comment thread docs/lets-talk.md
Comment on lines +89 to +91
others reply or forward by label. It does not change `lets-talk-sales-email`. Once the
processor enables classification, the reports UI and CSV show a `classification`
column (`UNKNOWN` until classified) and accept a `classification` filter. The rollout
@vas3a
vas3a merged commit 171a560 into develop Oct 26, 2026
3 checks passed
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.

2 participants