refactor(triage): agent-supplied category + exclusion + canonical context + owner-input rule - #8
Merged
Conversation
br4vesirrobin
force-pushed
the
refactor/triage-agent-supplied-category
branch
from
July 14, 2026 10:37
ed8093e to
1e5f9b8
Compare
Contributor
Author
|
Autobahn forward-port completed against current Key repairs in the refreshed head
Local verification on the published head:
Fresh hosted checks are now running; this PR will be merged only if they are all green. |
…l context Pivot triage from a configured-LLM call to an agent-in-the-loop model and add precision controls so important senders alone don't generate Asana tasks. - Remove the in-process LLM categorizer (judge_category/httpx/llm.*) from triage; the agent now reads candidates and supplies the CategoryDecision. classifier.py + llm.* are untouched (they still drive folder classification). - Replace the pipeline auto-hook (can't classify headlessly) with a two-command agent interface: `triage` lists qualifying candidates (with bodies), and `triage-create --email-id --category [--deadline] [--no-dry-run]` creates one idempotent task. Pipeline returns to its pre-triage behavior. - Exclusion rule: is_automated() heuristic (no-reply/notifications/digests/ *.mail.microsoft/Office365Reports/…) + config-driven triage.exclude_senders, so notification/newsletter/platform mail never becomes an action item. - Customer rule now requires content signal (a bare external sender no longer auto-qualifies). The deterministic gate is explicitly a recall net. - Owner-input precision rule: triage.owner_email + SKILL rubric — create a task only when the email genuinely requires the owner's personal input/action; sender importance alone is never sufficient. The agent makes this call. - Canonical-structure context: each candidate carries its taxonomy folder from the deterministic rules engine (lazy, best-effort) to inform categorization. 226 tests pass, coverage 94% (>=90 gate), ruff + mypy strict clean.
…p scan_rebuild Address code-review LOW findings on the agent-supplied-category refactor: - Add CliRunner tests for `triage-create --no-dry-run` (the only Asana write path, asserting dry_run=False flows through) and the disabled-triage guard. - Give triage_enabled a runtime role: `triage` and `triage-create` now refuse with a clear message when triage.enabled is false (previously orphaned). - Remove the vestigial triage.scan_rebuild config (its only consumer, the pipeline rebuild gate, was removed in the refactor) + its tests/examples. 228 tests pass, coverage 94% (>=90 gate), ruff + mypy strict clean.
br4vesirrobin
force-pushed
the
refactor/triage-agent-supplied-category
branch
from
July 14, 2026 10:42
1e5f9b8 to
27aa51e
Compare
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.
Summary
Pivots the triage feature (from #7) to an agent-in-the-loop model and adds precision controls so that being from an important sender is not enough — a task is created only when the email genuinely requires the owner's input.
Built by deep-interview intent → implement → code-review (APPROVE) → live-verified against a real mailbox + Asana.
What changed
judge_category/httpx/llm.*) from triage. The agent reads candidates and supplies theCategoryDecision.classifier.py+llm.*are untouched (they still power folder classification).processcan't classify):kontor-cli triage— lists qualifying candidates (with bodies + canonical folder), read-only.kontor-cli triage-create --email-id --category [--deadline] [--no-dry-run]— creates one idempotent Asana task (dedup markerkontor-id:<message-id|uid>scoped to the target project). Defaults to dry-run.is_automated()heuristic + configtriage.exclude_senders(no-reply/notifications/digests/*.mail.microsoft/Office365Reports/Google/Miro/Azure/…). Notification & platform mail never becomes a task.triage.owner_email+ SKILL rubric: create a task only when the content requires the owner's personal input/action (decision/review/approval/answer). Sender importance alone is never sufficient — this is the agent's judgment.2_Projects/PRJ_Willemen) from the deterministic rules engine (lazy, best-effort) to inform categorization.triage_enablednow gates the CLI; removed the vestigialtriage.scan_rebuild.Live verification (real mailbox → Asana)
skipped_dedup.Tests
228 tests pass, coverage 94% (≥90 gate),
ruff check+ruff format --check+mypy --strictclean. Code-reviewer: APPROVE (2 LOW findings fixed in the follow-up commit).🤖 Generated with Claude Code