Remove the email pipeline
Test and publish / test (push) Successful in 1m59s
Test and publish / publish (push) Successful in 1m41s

The mailbox sync (Microsoft Graph and IMAP), its Claude classifier, the
/email routes and the Settings page's email section are taken out while
the pipeline is unused. The last commit with it is tagged
email-pipeline-last; reverting this commit brings it back.

The status rules the capture path shares (statusOrder, StatusAdvances,
NormalizeStatus) move to job_status.go with their tests. ProcessedEmail
stays in the migration, marked dormant, so its history survives for a
restored pipeline. golang.org/x/oauth2 is no longer needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-14 22:48:07 +01:00
co-authored by Claude Opus 5.5
parent 6b14a96261
commit b7021ca117
32 changed files with 199 additions and 2284 deletions
+12 -3
View File
@@ -474,10 +474,10 @@ var (
htmlBlankRuns = regexp.MustCompile(`\n[ \t]*(\n[ \t]*)+`)
)
// htmlToText reduces a posting's HTML to readable plain text. Like
// cleanEmailBody it is a regex strip, not a parser, which is enough for text
// htmlToText reduces a posting's HTML to readable plain text, keeping its
// line structure. It is a regex strip, not a parser, which is enough for text
// that is read by a person and by a language model and never rendered as
// HTML. Unlike cleanEmailBody it keeps the whole text and its line structure.
// HTML.
func htmlToText(content string) string {
text := htmlBlockTag.ReplaceAllString(content, "\n")
text = htmlAnyTag.ReplaceAllString(text, "")
@@ -491,6 +491,15 @@ func htmlToText(content string) string {
return strings.TrimSpace(strings.Join(lines, "\n"))
}
// truncate caps a string at maxLen bytes, not runes, so a cut can land
// mid-rune; the one caller stores an error message, where that is harmless.
func truncate(s string, maxLen int) string {
if len(s) <= maxLen {
return s
}
return s[:maxLen]
}
// TruncateRunes cuts s to at most max runes, on a rune boundary so the result
// is still valid UTF-8 for Postgres and for JSON.
func TruncateRunes(s string, max int) string {