Queue pericope drafts and track heading suggestions - #326
henrique221 wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
kaseywright
left a comment
There was a problem hiding this comment.
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.
0521879 to
2d44fa7
Compare
kaseywright
left a comment
There was a problem hiding this comment.
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.
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: truewhen a delayed shown event arrives.Stacked on #320 (
feat/288-section-heading-storage), which provides heading storage. Adds migration0029_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.