Files
2026-05-27 23:29:53 +01:00

36 lines
1.6 KiB
Markdown

# OpenSpec Change: enterprise-dmarc
- **Change ID**: enterprise-dmarc
- **Package**: `@suaveplan/dmarc`
- **Category**: universal
- **Target path**: `universal/email/dmarc`
- **Status**: PROPOSED
- **Date**: 2026-04-19
- **Reference spec**: `/mnt/s/web/suaveplan/enterprise/dmarc.md`
## Summary
Parses DMARC aggregate (RUA) and forensic (RUF) reports into typed structures. Input: raw XML or `application/gzip`-wrapped XML as produced by Google / Microsoft / Yahoo aggregate reporters. Output: `DmarcAggregateReport` / `DmarcForensicReport`. Leaf package — useful to deliverability analytics.
## Current-state audit (genesis)
Package does not exist yet — fresh build.
## Dependencies
- Workspace: none (leaf)
- External (via catalog): `fast-xml-parser`, `fflate`, `zod`, `tslib`, `@opentelemetry/api`
- Dev (via catalog): `vitest`, `@vitest/coverage-istanbul`, `fast-check`, `mitata`
## Preserved public surface
- `parseDmarcAggregate(input, options?): DmarcAggregateReport`
- `parseDmarcForensic(input, options?): DmarcForensicReport`
- Types: `DmarcAggregateReport`, `DmarcForensicReport`, `DmarcRecord`, `DmarcPolicyPublished`, `DmarcAuthResult`, `DmarcDateRange`, `DmarcIdentifier`, `DmarcReportMetadata`, `AlignmentMode`, `DispositionMode`
## New genesis additions
- Codes: `DMARC.PARSE_ERROR`, `DMARC.INVALID_REPORT`, `DMARC.UNSUPPORTED_ENCODING`.
- Zod schemas for each report type.
- OTel counter `dmarc.parse.total{kind}`, histogram `dmarc.parse.duration_ms{kind}`.
- Property tests on random but structurally valid XML trees.
## Impact
- Adds one new package: `universal/email/dmarc`
- Adds one new spec capability: `dmarc`