This repository was archived by the owner on May 26, 2026. It is now read-only.
KR-EMAIL-AUTOREPLY-BRANCH-REMOVAL — cut Lock R3-8 (a)#173
Merged
rafe-walker merged 1 commit intoMay 24, 2026
Merged
Conversation
Operator lock during R3 walkthrough: cut the auto-reply-to-sender branch in EmailInboundHandler. Keep both directions of email but remove the AI-drafted reply path. Removed ------- * `EmailInboundHandler._send_auto_reply` + supporting private methods: `_build_reply_and_meta`, `_call_reasoning_engine`, `_resolve_reasoning_engine`, `_resolve_purelymail_client`. * Module-level `AUTO_REPLY_ENV` / `_auto_reply_enabled` / `_empty_reasoning_meta` / `_reasoning_meta_from_result` / `_email_caller_session_id` / `CANNED_FALLBACK_TEXT`. * `HandlerResult.should_reply` field — consumers now only care about `status` + `should_mark_seen`. * `purelymail_client` + `reasoning_engine` constructor kwargs. * The AUTO_REPLY branch in `_handle_event_inner` (no env read, no engine invocation, no outbound send). * Auto-reply test surface: `test_auto_reply_*` (16 tests), `test_caller_session_id_matches_engine_derivation_shape`. * `KORA_EMAIL_AUTO_REPLY` env from `kora_runtime_doppler_env_mapping.md` + `purelymail_runbook.md` (Part 2 Step 2 secrets + validation, Step 4 + 5 entirely, troubleshooting section). * Dangling AUTO_REPLY comment crumbs in `purelymail_client.py`, `probes/fix_envelopes.py`, `alerts/aggregator.py`, `audit/reasoning_xref.py`. Preserved --------- * 5-step inbound filter precedence + JSONL emission + chain-event `[kora.email_inbound.received]`. * IMAP listener (`email_inbound_imap_listener`) — unchanged. * Outbound `PurelymailClient` for non-inbound-reply paths (Kora emailing artifacts / reports from other modules). * Email-thread context loader. * `cost_telemetry.ROUTE_EMAIL_INBOUND = "email_inbound"` route literal — reserved for the future KR-EMAIL-COST-BILL wiring when KR-INTENT-EMAIL-TO-SEA-TICKET ships a real consumer. Regression coverage ------------------- * Parametrized `test_legacy_auto_reply_env_is_ignored_no_send` pins that any legacy `KORA_EMAIL_AUTO_REPLY` value in operator config is ignored cleanly (reasoning engine + purelymail client accessors are wired to fail loudly if the handler ever calls them post-removal). * `test_handler_constructor_accepts_only_log_path` pins the reduced constructor surface. * `test_handler_result_has_no_should_reply_field` pins the dataclass shape. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
rafe-walker
added a commit
that referenced
this pull request
May 24, 2026
…n + revert (#177) Operator now edits phrasebook from cockpit. PUT + revert + backups list endpoints (BE) + edit-mode UI in PhrasebookPage (FE). Validation: regex compiles, snapshot-path placeholders, catastrophic-backtracking check, no duplicate (pattern, category). Backup-on-write with env-tunable rotation. All 3 spec §4 STOP-ASK candidates resolved inline (static-list snapshot-path validation, audit seam Literal extension, free-form category v1). New audit seam phrasebook.updated with actor field deliberately shaped for future promotion-loop (kora_proposal_approved/pending). Sets UX foundation KR-FE-PROMOTION-REVIEW-PANEL will reuse. Rebased onto current feature/phase2-upgrades (post #173 / #176) to resolve SeamName Literal adjacent-addition conflict — both intent.email_to_sea_ticket (#176) and phrasebook.updated (#177) preserved in sequence. 76/76 phrasebook tests + tsc + vite build clean.
3 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Lock R3-8 (a) execution per operator confirmation during the R3 walkthrough. Cuts the auto-reply-to-sender branch in
EmailInboundHandleralong with theKORA_EMAIL_AUTO_REPLYenv. Both directions of email stay — inbound parsing (for the future KR-INTENT-EMAIL-TO-SEA-TICKET consumer) + outbound send for Kora-originated artifacts. Only the AI-drafted reply path goes.Bucket spec:
17_cc_bucket_prompts/KR-EMAIL-AUTOREPLY-BRANCH-REMOVAL_r3_lock_8a_execution.md.K-DG verification: self-contained?
Yes. All auto-reply helpers cascade from
_send_auto_reply. Grep confirmed no other module importsshould_reply,CANNED_FALLBACK_TEXT,AUTO_REPLY_ENV,_send_auto_reply,_build_reply_and_meta,_call_reasoning_engine,_resolve_reasoning_engine,_resolve_purelymail_client,_email_caller_session_id,_empty_reasoning_meta, or_reasoning_meta_from_resultoutside this handler + its test surface. Safe to excise without unraveling unrelated flow.LOC removed
kora_cli/handlers/email_inbound_handler.pytests/kora_cli/handlers/test_email_inbound_handler.pypurelymail_client.py,probes/fix_envelopes.py,alerts/aggregator.py,audit/reasoning_xref.pytest_email_inbound_imap_listener.py(dropshould_reply=kwargs)Docs swept
Per spec §2(b):
kora_docs/15_status_and_roadmap/kora_runtime_doppler_env_mapping.md— removed theKORA_EMAIL_AUTO_REPLYrow from the env table; added a "Removed" note pointing to Lock R3-8 (a); updatedKORA_EMAIL_JOSHUA_ADDRESSdescription to drop the "drive AUTO_REPLY" phrase.kora_docs/15_status_and_roadmap/purelymail_runbook.md— removed:KORA_EMAIL_AUTO_REPLYDoppler set + validation loop from Part 2 Step 2 (now 7 envs / 3 handler envs instead of 8 / 4)"Inbound emails are received but AUTO_REPLY never sends"troubleshooting section — replaced with a "this is expected" note for legacy env values2026-05-23_eod_phase2_complete.md) but no such file exists in this branch — no update needed.Telemetry route literal — preserved
Confirmed
cost_telemetry.ROUTE_EMAIL_INBOUND = "email_inbound"is intact (3 references inkora_cli/telemetry/cost_telemetry.py). Reserved for future KR-EMAIL-COST-BILL wiring once KR-INTENT-EMAIL-TO-SEA-TICKET ships a real consumer.Test plan
test_auto_reply_*tests deleted; inbound parsing + filter precedence + JSONL emission tests retained verbatim.test_legacy_auto_reply_env_is_ignored_no_send(parametrized overtrue/1/yes/on/TRUE) — handler ignores legacy env cleanly; reasoning engine + purelymail client accessors are wired to fail loudly if the handler ever touches them post-removal.test_handler_constructor_accepts_only_log_path+test_handler_result_has_no_should_reply_fieldpin the reduced API surface.should_reply=kwarg (2 sites).tests/kora_cli/handlers/ tests/kora_cli/audit/ tests/kora_cli/telemetry/ tests/kora_cli/clients/ tests/kora_cli/test_listeners/test_email_inbound_imap_listener.py): 332 passed.ruff checkclean on all changed files.🤖 Generated with Claude Code