mirror of
https://github.com/Sea-Haven-Industries/procurement-ingest.git
synced 2026-10-07 16:08:54 +00:00
A1 — AI-fallback comment_id nondeterminism: parsed comment_time is model output and not stable across Lambda async retries, so on the ai_fallback path the comment_id range-key time segment now derives from the email Date header (deterministic per S3 object) instead of the model's comment_time. The template path is unchanged (its comment_time is a pure function of the raw email). Bedrock invoke pins temperature 0 so retries reproduce the same extraction. Closes the #23 reopening on the AI path. A2 — EMF record now carries the spec-required _aws.Timestamp (epoch ms) so CloudWatch reliably extracts the ParseOutcome datapoint that the fallback-rate alarm depends on. A3 — T1 New Comment capture no longer truncates at the first blank line; multi-paragraph comments are captured through internal blanks and terminate at the next label/separator. 17 golden files regenerated from the real fixtures accordingly. Hardening from the sh-security-review pass on this diff: - _header_date_iso is total: OverflowError/OSError from an extreme Date header fall back to 'nocomment' instead of failing the invocation. - _capture_block trims blanks in O(n) (no pop(0)) — removes a quadratic path on a crafted large blank run. - work_order_id is enforced digits-only on BOTH parse paths before it is used as a DynamoDB key, so prompt-injected AI output cannot forge '#' range-key segments or land on an arbitrary WO.
18 lines
944 B
JSON
18 lines
944 B
JSON
{
|
|
"address": "veniam elit dolor lorem enim adipiscing dolor lorem lorem enim ex",
|
|
"assigned_to": null,
|
|
"building": "HBD0",
|
|
"comment_text": "minim elit minim dolore nostrud laboris aliqua exercitation laboris aliqua et consectetur te\n\nOnce the ETA is confirmed AMOC will update accordingly.\n\nPurchase Order: 2D-21279276 NTE for this Purchase Order is $ 16,780.00 USD\n\nPoint(s) Of Contact: Brianna Gordon- 203-233-5089- Site Lead- M-F 7am-3PM\nSelena lopjsele- slack - Area Manager- M-F 7am-3PM\nEd Wallace - RMM - 850 902 6855\n\nPlease provide the best time for this to be scheduled.",
|
|
"comment_time": "2026-07-01T19:52:41",
|
|
"commenter": "elit mi",
|
|
"date_reported": null,
|
|
"description": "eiusmod ut quis elit incididunt amet ipsu",
|
|
"due_date": null,
|
|
"email_type": "comment",
|
|
"priority": null,
|
|
"scheduled_start": null,
|
|
"severity": null,
|
|
"site_code": "HBD0",
|
|
"status": null,
|
|
"work_order_id": "14101235072"
|
|
}
|