Skip to content

feat(analysis): add review classification and topic insights - #28

Merged
thomasorgeval merged 7 commits into
mainfrom
feat/review-analysis
Sep 20, 2026
Merged

thomasorgeval merged 7 commits into
mainfrom
feat/review-analysis

Conversation

@thomasorgeval

@thomasorgeval thomasorgeval commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Add Review Analysis so teams can explore reported severity, recurring topics and the Reviews behind each signal, with human corrections and an App-scoped topic catalogue shared across stores.

Imported Reviews → durable PgBoss jobs → Jev classification
                                       ├─ intents / severity / topic matches
                                       └─ uncovered subjects → generative topic proposals
                                                               → pending / approved / rejected

apps/api/src/routes/analysis/   authenticated queries, corrections and topic lifecycle
apps/web/.../pages/analysis/    Tailwind dashboard, dedicated catalogue, shared correction dialog
packages/ai + apps/worker       provider adapters, history processing, retries and stale-result checks
packages/db + contracts        persistence and validated API contracts

Includes topic renaming/merging with aliases, SQL aggregates and paginated drill-down, English/French UI strings, documentation and marketing-site updates.

Test plan

  • Passed locally: Oxfmt, Oxlint, all 15 project typechecks, full test suite and builds.
  • PostgreSQL integration tests cover tenant isolation, permissions, counts/pagination, topic lifecycle, human overrides, stale results and retry/discovery markers.
  • Classifier tests cover catalogues exceeding 100 topics or 12,000 characters without losing topic criteria.
  • PostgreSQL regressions cover invalidated discovery candidates and simultaneous reply resurfacing / analysis invalidation after sync.
  • Browser checks: light/dark themes, 390 px layout, severity/topic filtering, correction save and reset.
  • Real Jev/generative-provider calls were not exercised; provider behavior uses test fixtures. Remote CI remains asynchronous.

Risk

  • Apply migration 0008_review_analysis.sql; enabling classification backfills the complete imported history.
  • Optional global TYPESAFE_API_KEY is required for classification; topic discovery also uses the existing AI_* configuration. Without the TypeSafe key, stored results remain accessible and dependent jobs are disabled.
  • Classification/discovery usage is recorded separately from reply drafting; Organization BYOK and commercial discovery quotas remain deferred. AI classifications and proposed topics require human judgment.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T19:20:34.437832Z 46cbcd4 New commits
🔒 Security Review ✅ Completed 2026-09-20T18:06:10.887729Z 53d077d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53d077da35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ai/src/classification.ts Outdated
Comment thread apps/api/src/routes/analysis/dashboard-query.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: adbfafcd94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/worker/src/main.ts Outdated
Comment thread apps/web/src/app/pages/analysis/analysis.page.ts
Comment thread apps/web/src/app/pages/analysis/analysis.page.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0af0927e78

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/worker/src/review-analysis-worker.ts Outdated
Comment thread apps/worker/src/main.ts Outdated
Comment thread apps/web/src/app/pages/analysis/analysis.page.ts
Comment thread apps/web/src/app/pages/analysis/analysis-reviews.component.html Outdated
Comment thread apps/web/src/app/pages/analysis/topic-catalogue.page.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8a71adbfe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/worker/src/topic-discovery-worker.ts
Comment thread apps/worker/src/main.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4034ae4915

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/api/src/routes/analysis/dashboard-query.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bbb899537

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@thomasorgeval
thomasorgeval merged commit 1886726 into main Sep 20, 2026
1 check passed
@thomasorgeval
thomasorgeval deleted the feat/review-analysis branch September 20, 2026 19:16

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 46cbcd491a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +160 to +164
inArray(reviews.analysisStatus, ['pending', 'processing']),
and(
eq(reviews.analysisStatus, 'completed'),
eq(reviewAnalyses.catalogVersion, catalogVersion),
eq(reviewAnalyses.criteriaVersion, reviewAnalysisCriteriaVersion),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Treat stale completed classifications as outstanding work

After any Topic mutation increments the catalogue version, Reviews remain completed until their queued reclassification starts, but this predicate only considers completed analyses whose versions already match. If discovery runs in that window, it finds no current candidates, records the run complete, clears a manual request, and imposes the 24-hour cooldown even though enqueuePendingAnalysisJobs() explicitly queues those version-mismatched Reviews. The fresh evidence beyond the earlier pending/processing fix is this still-unhandled completed-but-stale state; include missing or version-mismatched completed analyses as outstanding before completing an empty discovery run.

Useful? React with 👍 / 👎.

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.

1 participant