Add self-reply guard to functions:init scaffold#72
Conversation
Greptile SummaryThis PR hardens the
Confidence Score: 5/5Safe to merge — changes are confined to a code-generation scaffold with no runtime library logic, and the new guard defaults users into the safer shape. The only behaviorally significant addition is the self-reply guard predicate. It uses .includes() rather than strict equality, which is the correct choice for raw RFC 2822 header values, and the accompanying comment documents why. The four new tests pin the exact predicate shape (including a not.toContain assertion against the strict-equality form) and verify the placeholder appears exactly once. No existing tests were modified and the scaffold changes are isolated to template string generation. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Make self-reply guard match RFC 2822 dis..." | Re-trigger Greptile |
event.email.headers.from is the raw header value, so it may carry a display name like "Alice <alice@example.com>". Switch the guard to a substring check so both bare and display-name forms match.
Summary
REPLY_FROMconstant with a clear TODO marker so new authors do not miss the replace-me step.email.receivedbranch so a forwarded outbound reply does not trigger an infinite reply loop.client.sendpointing atevent.email.headers.tofor multi-address fan-out patterns.Test plan
pnpm lintpnpm typecheckpnpm test(168 passed, including 4 new assertions covering the REPLY_FROM const + TODO, the self-reply guard predicate, the recipient-routing comment, and the single-occurrence placeholder count)