Skip to content

Queue pericope drafts and track heading suggestions - #326

Open
henrique221 wants to merge 2 commits into
feat/288-section-heading-storagefrom
feat/394-pericope-ai-suggestions
Open

henrique221 wants to merge 2 commits into
feat/288-section-heading-storagefrom
feat/394-pericope-ai-suggestions

Conversation

@henrique221

@henrique221 henrique221 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Pericope drafting needs suggestions for all empty verses in the active and next groups, plus a separate section heading. Add source-backed pericope queueing, heading context/results endpoints, and separate heading suggestion and exposure storage for eten-tech-foundation/fluent-web#394.

The API resolves exact FIA and FCBH group identities from the project's selected set. It includes absent and saved-empty verse rows, preserves saved drafts and authored headings, applies the existing activation threshold and AI toggle, and rejects mismatched or stale-set heading results. Exposure upserts preserve an earlier wasUsed: true when a delayed shown event arrives.

Stacked on #320 (feat/288-section-heading-storage), which provides heading storage. Adds migration 0029_add_pericope_ai_suggestions. Coordinated with eten-tech-foundation/fluent-ai#74 and the web issue above; deploy the migration/API and worker before the web change.

Validation: 644 tests passed across 68 files, including four integration tests against migrated, isolated PostgreSQL. After the final FCBH identity adjustment, 73 focused tests passed, including PostgreSQL and existing pericope routes. Typecheck, lint (no errors), formatting, build and diff checks passed. The local HTTP harness also verified the internal context against real fixture data.

The heading storage dependency #320 currently has a merge conflict against its base; this PR does not modify that dependency branch.

Coordinated web PR: eten-tech-foundation/fluent-web#483. End-to-end browser validation passed through this API, PostgreSQL, queue and the real AI worker with a deterministic model provider, including heading/verse results, separate exposure and title autosave.

The standard API pre-merge workflow only targets main, so it does not run while this PR is stacked on #320. The full local checks above cover this branch.

Screenshot

Local API integration report

This report is generated from the completed local fixture run, not production data. It shows the public queue request, exact pericope/title context resolved by the API, successful internal result calls, PostgreSQL persistence, authored-content preservation, and separate verse/title usage records.

Local API integration report for queueing, context resolution, persistence, and suggestion usage

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 4cbba95f-d720-4e9b-872b-3463b393e301

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread src/domains/ai-suggestions/ai-suggestions.service.ts Outdated
Comment thread src/domains/ai-suggestions/ai-pericope.repository.ts
Comment thread src/domains/ai-suggestions/ai-pericope.repository.ts
Comment thread src/domains/ai-suggestions/ai-suggestions.service.ts Outdated

@kaseywright kaseywright left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes based on 4 correctness findings left as inline comments: sequential await masking partial job-enqueue failure, a heading-suggestion cache key that can shift under re-ingestion, a completed AI result being silently dropped on pericope-set change, and a stale-set guard that is bypassable when pericopeSetId is omitted.

henrique221 added a commit that referenced this pull request Sep 14, 2026
@henrique221
henrique221 force-pushed the feat/394-pericope-ai-suggestions branch from 0521879 to 2d44fa7 Compare September 14, 2026 18:15
Comment thread src/domains/ai-suggestions/ai-pericope.repository.ts
Comment thread src/domains/ai-suggestions/ai-suggestions.repository.ts
Comment thread src/domains/ai-suggestions/ai-suggestions.service.ts

@kaseywright kaseywright left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The previous 4 correctness findings are fixed in this push. Requesting changes on 3 new correctness issues introduced by this push, left as inline comments: logPericopeUsage resolving against the project's current pericope set instead of the set the suggestion was saved under, a monotonic wasUsed upsert silently breaking correction of the unrelated verse-level usage log, and getPericopeSuggestions missing the isAiEnabled gate applied elsewhere.

@github-actions
github-actions Bot deleted the branch feat/288-section-heading-storage September 16, 2026 23:34
henrique221 added a commit that referenced this pull request Sep 17, 2026
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