3.4 KiB
3.4 KiB
Tasks — email-processing
§0 Pre-flight (worktree isolation)
git worktree listconfirms the agent is inside.claude/worktrees/agent-<id>/and not the main checkout at/home/paul/web/genesis/.- §0a Sync confirms HEAD is at or ahead of
9225d658502add3fb62ef0a8f9ac35563de985ff(post health-check archive). git statusis clean at start; every write lands under the worktree path.
§1 Package shell
packages/communication/emails/email-processing/package.jsonat0.1.0, sideEffects: false, every subpath export listed.tsconfig.lib.jsonextending the root base.vite.config.tswith explicit entry map covering every feature folder.vitest.config.tswith Istanbul 100/100/100/100 thresholds.tests/setup/polyfills.tsinstalling a realInMemoryMetricExporter-backedMeterProvider.
§2 Feature folders (15)
error-codes/—EMAIL_PROCESSING_CODES+EmailProcessingErrorwith public ctor + test + doc.telemetry/— shared meter + 11 instruments + test + doc.types/— flat shared MIME / address / header types.hooks/— localHooks<TMap>pipeline + singleton + test + doc.parser/—parseEmail,parseEmailAddress,decodeEmailWords- Zod option boundary + test + doc.
mime-utils/— eleven libmime wrappers + locallibmime.d.tsambient declaration + test + doc.attachment-processor/—processAttachment(s)+ SHA-256 hash + size / MIME allowlist + duration histogram + test + doc.cid-resolver/— resolve/extract/isReferencedInline + test + doc.calendar-parser/— VEVENT extraction + test + doc.data-extractor/— tracking + receipt + extractData + test + doc.dkim-canonicalize/— relaxed + simple canon + signed-block builder + test + doc.dkim-verifier/— parseDkim + verifyDkim with real Web-Crypto round-trip in tests + test + doc.dmarc-checker/— record parser + alignment evaluator + test + doc.spf-checker/— record parser + ipv4/ipv6 matchers + recursive checkSpf with bounded depth + test + doc.spam-scorer/— 12 default rules + custom-rule merge + test + doc.thread-grouper/— In-Reply-To + References + subject grouping, tree builder + test + doc.
§3 OpenSpec spec delta
openspec/changes/email-processing/specs/email-processing/spec.mdcaptures the ADDED Requirements for parse, attachment processing, hook pipeline, DKIM/SPF/DMARC, spam scoring, threading, and OTel instruments.
§4 Quality gates (run before commit)
bunx turbo lint typecheck test --filter=@suaveplan/email-processinggreen.bunx turbo test:coverage --filter=@suaveplan/email-processingat 100/100/100/100.bunx turbo build --filter=@suaveplan/email-processinggreen.grep -rnE "from ['\"](vitest|bun:test)['\"]" packages/communication/emails/email-processing/src/→ empty.grep -rn "biome-ignore\|TODO\|FIXME\|XXX" packages/communication/emails/email-processing/src/→ empty.bun scripts/lint/check-feature-layout.ts | grep email-processing→ empty.bun scripts/folder-reorg/generate-manifest.tsregeneratesMANIFEST.mdcleanly.
§5 Ship
- Commit on a
feat/email-processingbranch. - Surface SHA + coverage + file count in the agent's final report.