feat(email-writing): expose bounded advisory review API - #1536
Draft
seonghobae wants to merge 13 commits into
Draft
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
This was referenced Sep 2, 2026
Contributor
|
PR governance metadata gate is not ready for
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Task 10 only: expose the existing Task-9 email-writing review service through an authenticated, owner-scoped HTTP boundary. This is a preparatory Draft stacked on the exact current Task-9 head. It does not consume Inkspan, mutate/send email, resolve provider credentials, publish a Judge policy, or bypass the immutable fast-mlsirm artifact gate.
Exact ancestry and TDD sequence
Parent #1535 is
c958b9964f925b6dca99e4c2c4db671934511a40. Exact current Task-10 head is4c14771acddd150f59b5ce0888d15bae49686b0c. Current head was produced by an ordinary non-force two-parent restack after the Task-5 repair propagated through Tasks 6–9. This PR's semantic delta remains five Task-10 paths; inherited parent repairs are not duplicated as API-owned behavior.Task-10-owned sequence retained in ancestry:
6fdba3c58fc34060d4cab9c69e85e18b9db70fc8defines the HTTP contract beforeapi.email_writing_reviewexists;d88ddbc4310dc00c83b5d185b6082e654e781e82adds the thin advisory API and fail-closed runtime provider boundary;ac05e2680e2f762d8219f9eccf58bb76c844bd86registers the route in the production FastAPI application;5b66e4b1088367e9944c0d789cc732d1fe9e4a74tightens transport/error and production-route acceptance tests;4ef89294b4219029926fb081170d08dc21d6196aadds the Python 3.14 focused workflow;ae6527411c4dee51db753e5576634193f1795878requires unknown internal service-code masking and bounded OpenAPI 403/404/503 error envelopes;275ed74c37830dce30c7fabed4baf83000946be2addsEmailWritingReviewErrorResponse, the public error allowlist, genericreview_unavailablemasking, and OpenAPI error schemas;bdd70deba2c4fead89d34db1ce8a9f0a6bc8f143reconciles the code-current Task-10 contract documentation before the current restack.No Jules/Cursor branch is modified or used as writable ancestry. All predecessor checks/reviews are stale after the current head movement.
API contract
POST /api/email-writing/reviewreusesEmailWritingReviewRequestandEmailWritingReviewResponse; no duplicate semantic review schema is introduced. The route passes only the authenticatedAuthContext, scoped DB session and strict request into the injected Task-9 service.The route remains advisory:
email_unavailable;review_owner_scope_unavailable;review_unavailablerather than becoming browser-visible causal text;EmailWritingReviewErrorResponsecontract;Runtime assembly gate
get_email_writing_review_service()intentionally returns no production runtime yet. The endpoint therefore fails closed with503 {"error_code":"review_runtime_unavailable"}until the exact immutable fast-mlsirm distributable, Task-7 released-symbol consumption and admitted Task-8/Task-9 lineage exist. Tests use FastAPI dependency injection to exercise the real HTTP boundary; they do not create a production fake-success path.No mutable fast-mlsirm or Inkspan branch, Git URL, source copy, local stub or workspace path is consumed.
Current verification state
For exact current head
4c14771acddd150f59b5ce0888d15bae49686b0c, currenttask10-review-apijob100237262613/ run33627082195is queued before executed steps. Same-head sibling job100237248527/ run33627078538terminated cancelled before useful execution. Both are non-passing; every result from prior heads includingbdd70deb…is predecessor evidence.Runner acquisition is tracked through
.github#712; the current leaf head is not churned merely to provoke scheduling. Fresh current-head security/coverage/review evidence remains mandatory after actual runner acquisition.Dependency / merge boundary
Canonical runtime order remains Task 7 Judge → immutable fast-mlsirm dependency admission/pinning → Task 8 policy → Task 9 review service → Task 10 review API → immutable Inkspan consumer → EmailDetail composer → feedback/benchmark/live evaluation → protected release. This PR may be developed and checked in parallel but remains Draft and must be ordinarily reconstructed/restacked after any predecessor movement. Predecessor checks/reviews do not transfer.
Merge requires an unchanged integration-current head satisfying live protection/rulesets and all applicable CI/security/SAST/dependency/coverage/package/SBOM/provenance/review gates. No self-approval, bypass, force push, destructive rebase or gate weakening.