Skip to content

Show each email's attachments on rule decision, result and test rows - #820

Merged
etbyrd merged 7 commits into
sdk-3.0.0-previewfrom
decision-row-attachments
Nov 19, 2026
Merged

etbyrd merged 7 commits into
sdk-3.0.0-previewfrom
decision-row-attachments

Conversation

@etbyrd

@etbyrd etbyrd commented Nov 19, 2026

Copy link
Copy Markdown
Member

What

Email rule decision and result rows now say what each email carried, so a reader judging a rule can see that an email had files without opening it.

Spec and clients (synced from the API's served document, attachment fields only):

  • attachments: [{ name, description }] | null and attachment_count: number | null on rule decisions (listEmailRuleDecisions, listEmailRuleDecisionsOnMyMail), once at the top level of listEmailRuleResults, on the emails a compared test lists as changed, and on decided testEmailRule results, where they replace attachment_names and attachment_descriptions.
  • [] means the email has none; null means the caller is not shown whether it has any.

CLI (stderr only; the JSON on stdout is unchanged):

  • email-rules list-decisions and email-rule-oversight list-decisions-on-my-mail: one line under each row, such as 2 attachments: rate-card-2026.pdf (Contractor pay rates by role), logo.png, no attachments for none, and nothing when not known.
  • email-rules list-results: Email: ... with the same summary, after any notes the answer carries.
  • email-rules test: the same line under matched and not matched results and under the emails the changes lists name, replacing the old file-name line.
  • At most three files are named, with a count of the rest. Names are cut at 40 characters and descriptions at 60. A name holding a comma, parenthesis or quote (fullwidth forms included), or starting with a plus, is quoted, so it cannot pass for more files. All text goes through the terminal sanitizer.

No version bump and no publish.

Tests

cli-node/tests/oclif/rule-row-attachments.test.ts (counts, cuts, quoting, unsafe text), plus new cases in email-rule-listings.test.ts (decision rows, list-results report and command) and email-rule-authoring.test.ts (test report and changes lists).

Sync the attachments and attachment_count fields on rule decisions, the rule
results on one email, rule test results and the emails a compared test
changes, regenerate the clients, and print a short attachments line under each
row in list-decisions, list-decisions-on-my-mail, list-results and test.
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issues were found.

Reviews (3) · Last reviewed commit: "Give the Go decision fixture the attachm..." · Reviewed by Greptile

Comment thread sdk-go/api/oas_json_gen.go Resolved
@blacksmith-sh

blacksmith-sh Bot commented Nov 19, 2026

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
github.com/primitivedotdev/sdks/sdk-go/v3/
TestDecisionOnMyMailReencodesDetailWithheldOnlyWhenSet
View Logs
github.com/primitivedotdev/sdks/sdk-go/v3/
TestDecisionOnMyMailReencodesDetailWithheldOnlyWhenSet
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@etbyrd
etbyrd merged commit 1c87cad into sdk-3.0.0-preview Nov 19, 2026
16 checks passed
@etbyrd
etbyrd deleted the decision-row-attachments branch November 19, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant