Skip to content

feat(email-writing): build authorized thread context - #1329

Draft
seonghobae wants to merge 11 commits into
feat/llm-email-writing-review-evidence-task3from
feat/llm-email-writing-context-task4
Draft

feat(email-writing): build authorized thread context#1329
seonghobae wants to merge 11 commits into
feat/llm-email-writing-review-evidence-task3from
feat/llm-email-writing-context-task4

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Scope

This Draft PR implements Task 4 only: server-authoritative email/thread/recipient context construction for the writing-review workflow. It excludes contextual-orchestrator/model execution, Candidate/Judge semantics, review API, Inkspan editor integration, sending, policy publication, and release behavior.

The service keeps owner/organization authorization, canonical thread membership and chronology, complete-message budgeting, recipient-role derivation from persisted headers, trust labels for untrusted content, and fail-closed handling for oversized selected content. It does not infer importance, tone, actionability, or intent from keywords, sender domains, recipient counts, language names, nearest-text search, or positional heuristics.

Live stack state — 2026-09-01

Direct parent #1328 is ea61b9de9cd26a26209da36e858510a31486531a. This Task-4 head is 64d1f746723616b0111eb40b130d6f07ed413a86 and contains that exact parent through an ordinary non-destructive two-parent merge. No force-push or destructive rebase was used.

Its unique Task-4 delta remains the context TDD workflow, email_writing_context_service.py, and the two focused context-service test modules. Current root design documents are inherited through the stack and are not Task-4-owned semantic delta. All predecessor-head evidence is stale after this movement.

Authorization/privacy contract retained

  • selected-email and thread lookup remain owner/organization scoped and tenant-indistinguishable on unavailable references;
  • browser-supplied thread text, participant roles, endpoints, credentials and semantic selectors are not trusted authority;
  • messages are selected as complete canonical units; no byte/grapheme/selector truncation or lexical importance heuristic;
  • context-required PII is preserved only under purpose-bound authorization rather than blanket masking;
  • raw context, prompt and model outputs remain excluded from ordinary evidence/log surfaces.

Evidence and continuation

Fresh exact-head authorization/isolation, Python 3.14, coverage/docstrings, SAST/security/dependency/package/provenance and review/thread evidence must be regenerated for 64d1f746723616b0111eb40b130d6f07ed413a86. Child #1356 is reconciled onto this exact Task-4 head as beb28466573b2163df97b027a6d3ac3776773869; later task-owned descendants have likewise been advanced in dependency order. No predecessor evidence transfers.

Merge boundary

Keep Draft while current-head evidence is regenerated. Merge only on an unchanged head satisfying live rulesets/protection, every applicable exact-head gate, zero valid unresolved findings, and any qualifying independent approval actually required after the last push. Pending/queued/skipped-required/cancelled/neutral/failed/absent/stale/predecessor/synthetic/model-only/status-only/author-only evidence is non-passing.

No writing-guidance feature is shipped by this context slice; editing and sending remain available.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: e27b0252-e0f6-4889-8555-392f16bffd2b

📥 Commits

Reviewing files that changed from the base of the PR and between ea61b9d and 64d1f74.

📒 Files selected for processing (4)
  • .github/workflows/email-writing-context-tdd.yml
  • backend/services/email_writing_context_service.py
  • backend/tests/test_email_writing_context_service.py
  • backend/tests/test_email_writing_context_service_coverage.py

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for 64d1f746723616b0111eb40b130d6f07ed413a86:

  • Draft PR: merge automation is paused.

seonghobae and others added 4 commits August 15, 2026 20:54
…idence-task3' into feat/llm-email-writing-context-task4
…idence-task3' into feat/llm-email-writing-context-task4

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the unchanged exact current head 4570747ccebd57ccaab30ffc68239f0c9d2f1ca0 (normal merge of live parent #1328 51fb5e85). Predecessor 0376d0ac evidence does not transfer. Local Task 4: 32 focused context tests passed, 100% coverage. Keep Draft. This comment is not an approval.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@seonghobae I will review the exact current head 4570747ccebd57ccaab30ffc68239f0c9d2f1ca0. The PR remains Draft. This action does not approve or merge the PR.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cursor Bot pushed a commit that referenced this pull request Aug 17, 2026
…ask4' into feat/llm-email-writing-orchestrator-task5

Retarget Task 5 onto live #1329 head 4570747
(merged onto live #1328 51fb5e8 / #1327 fb7c406 / #1322 bfc2df1 / develop@dd8d1519).

Preserve the hardened contextual-orchestrator boundary. Do not restore
write-capable Task 5 promotion/finalize workflows.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@opencode-agent opencode-agent Bot added area: auth Authentication, authorization, identity, or tenant isolation area: ci-cd CI, GitHub Actions, checks, release, or supply chain priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability labels Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.


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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: auth Authentication, authorization, identity, or tenant isolation area: ci-cd CI, GitHub Actions, checks, release, or supply chain enhancement New feature or request priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants