# Independent review: Nuhet #3416 format correction

Outcome: VERIFIED for the corrected contributor candidate. All four initial findings are resolved in inspected source and focused regressions. Production release, recovery execution and actual customer receipt remain separate root-owned gates. This report is independent and read-only for implementation and live resources. Root retains final acceptance.

## Initial candidate binding (superseded)

Base supplied by owner: 8052ad91c4981ab98be67d9c1a803039ee809957. Fresh native UNC SHA-256 reads matched all four supplied candidates:

- AutomaticReplyClassifier.php: 28f648712f7774fa4ad5cce194fdb9202b2ec93c331e9a784c66d6a3cc52cc11
- AutomaticReplyCorrelation.php: 5e1936cf2f3dd9860e927f358127cf04bfd75182533240d88eb6848a874e45c1
- FetchBounceStats.php: bd4bb4d39e6a9d12d028a7814b0c7e3632d6ddd98d0774a32bcb1c1b01088425
- AutomaticReplyFormatCompatibilityTest.php: 16fa3b9330cf1995967918ec7ff4ce80454bbfbc5c480b25008fe0e81993b58c

## Prioritized findings on initial candidate

1. P1: Retained wrapped DSNs bypass existing reply deduplication on reingestion. FetchBounceStats.php:243-260 selects the newly recognized report and proceeds to event/suppression writes without consulting AutomaticReply. Counterexample: first retain exact wrappedReport() through AutomaticReplyIntake (postmaster mismatch gives review), then process identical raw via spool command. The new route creates a bounce and may suppress the recipient despite that explicit review hold. The existing reingestion test covers only personal replies. Required correction: check the retained reply identity before newly unwrapped effects, preserve every existing retained state, and exercise the exact wrapper through the real spool command.

2. P1: Ambiguous DSN rejection falls through to personal reply effects. AutomaticReplyClassifier.php:53 returns null for multiple report attachments; FetchBounceStats.php:244 then calls personal intake. Counterexample: duplicate the report attachment, retain a valid outer nonce and automatic marker, use the original recipient as outer From, and put an absence sentence in the gateway footer. Personal classification can create an actionable absence/cooldown or pending forward solely from that footer. Required correction: distinguish unsupported/ambiguous report wrappers from ordinary non-DSN replies and quarantine them. Verify through the spool command with no reply action, pause, bounce event or suppression.

3. P2: Traversal limits do not establish uniqueness. attachedOriginals() silently ignores children beyond50 and depth>8. One visible report plus another in child51 or an unvisited nested branch can be accepted as a unique report. Required correction: propagate incomplete traversal and fail closed for report selection; test one report,49 harmless parts, then a conflicting second report, and a visible report alongside an overdeep branch.

4. P2: Newly enabled wrapped-report writes lose the company availability lease formerly supplied by AutomaticReplyIntake. Company::find() at226 excludes already-deleted companies but does not coordinate a deletion between lookup and event/suppression writes. Required correction: keep this bounded new path under CompanyRetention::whileAvailable using fresh company state, preserving legacy top-level scope. Test that the wrapper path enters the guard and refuses writes if availability is lost after initial lookup.

These are source-derived counterexamples, not claimed runtime reproductions. The root accepted finding1 and is preparing corrections. No implementation code was changed by this reviewer.

## Positive findings and limits

Bare Message-ID parsing is constrained to complete whitespace-delimited tokens in top-level In-Reply-To/References, while stored-reference uniqueness and exact company/campaign/stat/profile/recipient proof remain. Newly unwrapped DSNs require outer stored delivery proof rather than numeric bounce tags alone. Actual inner recipient/status parsing is used, and encoded message/rfc822 decoding is covered. Original attachment bytes, once-only personal forwarding and missing-reference review have regression coverage.

The supplied verification receipt was freshly read in automatic-replies-3416-format-correction-20261030.md: PHP8.3.31/PHPUnit11.5.56,113 tests586 assertions, exit0, existing XML deprecation only. No redundant full suite was run. This evidence supports the initial candidate's covered cases but does not demonstrate the counterexamples above or live delivery.

The recovery plan was parsed locally:55 rows,55 unique IDs, all review/zero attempts;51 DSN candidates,2 retirement candidates,1 missing-reference absence and1 plain NDR. The plan is read-only and requires fresh individual evidence and exact recovery approval before any action. It does not claim all55 eligible, successful production parsing or actual Outlook delivery.

Inspected complete files: the four candidate PHP files; AutomaticReplyIntake.php, AutomaticReplySettings.php, CompanyRetention.php, HardBounceRecipientSuppressor.php, OutgoingDeliveryReference.php, tests/Support/AutomaticReplyFixture.php, recovery-plan JSON, implementation recovery receipt and original follow-up report. Relevant SenderProfile/Sendout declarations were inspected. Review used native Windows/UNC reads only; no WSL/Git execution, production operation, credentials, mail, installation or card/session metadata change.

Policy adoption:20261030-bankapp-android015-memory-v1, pointer manifest SHA256 bf380cfb111f2902dadd02455c02786c70a5638094c3e13558e844e6e52e1461 verified. Complete applicable delegation v5.0.0, lifecycle v6.1.0, central AGENTS v7.27.13 and workflow v4.2.1 were read; fresh applicable hashes match the manifest. No policy conflict or task authority expansion.

## Maintenance and ownership

Existing FetchBounceStats.php split recommendation (866 lines at initial candidate,889 at final candidate) remains deferred; this review adds no refactor scope. Owner handles all code corrections, tests, card metadata, worktree preservation and eventual release decision.

Reviewer-owned uncommitted deliverable: this report only. No implementation ownership acquired.

Next actor: root accepts this final contributor review, preserves the candidate and prepares the separately authorized release/recovery decision.


## Corrected candidate resolution

Fresh SHA-256 reads match the final owner-supplied candidate:

- app/Services/Mail/AutomaticReplyClassifier.php: b1697ce7b384ec8358833d93f74d692545bfde1cdd33782b39e7610df023916e
- app/Services/Mail/AutomaticReplyCorrelation.php: 5e1936cf2f3dd9860e927f358127cf04bfd75182533240d88eb6848a874e45c1
- app/Console/Commands/FetchBounceStats.php: 07c6c9117ec2ec7f1d8c2515082481f90fa81a3ff24db082d99238687c711f1c
- tests/Feature/AutomaticReplyFormatCompatibilityTest.php: fe7af16c4171acbfdf240e6c3114cf752de5ddb152624bbfcdb3e1204807d1ff
- tests/Integration/AutomaticReplyWrappedDsnMariaDbTest.php: 1ea760465a730fdda0c4ca9bc40b869694df0fd70f5efbae746ac375592bdbd8

Finding1 resolved: every matching retained AutomaticReply dedupe identity holds the newly unwrapped path before effects, regardless of retained state. Exact spool regressions cover review, forwarded and uncertain records and assert byte-for-byte unchanged database attributes, no event, suppression or pause.

Finding2 resolved: deliveryReportSelection returns an explicit requires_review state. The command quarantines that state before personal intake, so ambiguous/unsupported reports cannot turn a personal From plus absence footer into a cooldown or pending reply. The counterexample now runs through actual spool processing and asserts no effects.

Finding3 resolved: scanning carries completeness across depth8, per-multipart50-part and total100-node limits. Closing delimiters terminate traversal and epilogue is ignored. Malformed declared multipart/message-rfc822 parts without a separator, missing multipart boundaries and missing closing delimiters mark the traversal incomplete. The last review found a missing-boundary edge; the final candidate corrects it and tests a visible report plus malformed sibling through selection and spool processing. Child51, excessive nesting, duplicate reports and report-looking epilogue have focused coverage.

Finding4 resolved: newly unwrapped processing runs inside CompanyRetention::whileAvailable, using fresh company admission and performing retained-row, recipient, delivery and profile checks within that callback. Existing legacy top-level reports retain their previous route. The extracted processDeliveryReport helper explicitly receives retryExpired and derives sendout identity from stat; the relevant retry and event paths were inspected. A deletion-between-read-and-admission regression verifies refusal of effects.

Final focused suite log was freshly read at K:\AI_docs_tmp\nuhet-3416-follow-up-20261030\final-mail-suite.log: PHP8.3.31/PHPUnit11.5.56,120 tests626 assertions, existing XML deprecation only. Owner reports terminal exit0 for approved-runner request20261030-130852-52732-e9784134. Five PHP lints and diffcheck are owner-reported passing. The final focused suite supersedes the historical113/586 and119/617 counts above. Reviewer reused evidence and did not rerun a broad suite.

The opt-in MariaDB test source was completely reviewed. It creates constrained task-owned schemas, uses separate main/statistics PDOs, creates a cross-schema company FK, attempts a competing deletion at event insertion, checks shared-lock contention and successful postcommit deletion, then verifies no postdeletion event and confirms removal of both disposable schemas. This meaningfully qualifies the native transaction boundary that the SQLite fixture cannot prove. The final exact-candidate receipt and captured native log were freshly read: MariaDB10.6.22,1 test11 assertions, terminal exit0 per owner receipt, request20261030-130924-52264-b5ab97c6. Native log374 bytes/SHA25616a35ad97d9acbc2ca2e1d9e6987a8c8c10d84e5e46c4940033d064cd28553c8; focused-suite log458 bytes/SHA2562f0520f6f9f222e1f4fba6db991bf3daa903c25c1b9f61bb8b2448e54129c782; both log hashes were independently verified. Root also records a fresh zero remaining schema-prefix result. No native execution by this reviewer is claimed.

No remaining blocking source finding was identified for this scoped contributor correction. No additional broad suite is recommended solely to repeat accepted checks. Before any later live recovery, apply the plan's existing exact-row/raw-message/current-state/event-history checks and authorization; before claiming the customer outcome, verify the approved destination's actual receipt. These remain later acceptance gates, not failures of the read-only plan or local contributor candidate.

The recovery plan was fresh-parsed again after correction:55 unique IDs,55 review/zero-attempt rows; counts and explicit manual-review distinctions remain intact. All-production-MIME and actual Outlook delivery are not established by this review.

Policy safe-boundary adoption updated to20261030-mistmord-3661-storage-v1: manifest hash53ba6fc83d715843fa2a5024ac71c1b740b9615ff36db28273c4a4e624f4ffea verified. Complete changed central AGENTS v7.27.14 was reread and its8fe888c5f519b493d70e19bdddfe341ace76965fcf2d4dd1dc32eeeaefe15ade hash verified; applicable workflow/delegation/lifecycle manifest hashes remain unchanged. Release transition changes no task authority or previous gate.

Reviewer ownership is released for implementation resources; only this uncommitted review report was written. Root retains candidate custody and final acceptance.
