Phase 2 tests the full handoff chain between the Document Classification Agent and the Retention Schedule Monitor, and between the monitor and the downstream Slack approval workflow and register logging step. All tests run in the sandbox environment. IDs continue from Phase 1.
ID
Scenario
Input
Expected Output
Pass Criteria
T13
Agent handoff: Classification Agent writes register row correctly consumed by Monitor
NDA uploaded to sandbox SharePoint ingestion folder; Classification Agent runs and writes a register row with destruction_date set to today for test purposes.
Retention Schedule Monitor, on its next scheduled run, reads the new register row and sends the correct Slack alert to the test legal manager account.
Monitor correctly reads the Classification Agent output without manual intervention; Slack alert data matches the register row exactly; no duplicate or missing rows in the register.
T14
Handoff: Slack approval response correctly updates register
Sandbox Slack user clicks the approve action on a destruction alert message.
Register row updated to DESTROYED status; approval metadata (user, timestamp) written; audit log entry created. Subsequent Monitor run skips this row.
Register row status is DESTROYED before the next scheduled Monitor run; Monitor does not re-alert on a DESTROYED row; audit log entry persists independently of the row status.
T15
Handoff: Slack approval response for defer
Sandbox Slack user clicks the defer action on a destruction alert message.
Register row status updated to DEFERRED; deferred_until date set to 30 days from today; Monitor will not re-alert until that date.
DEFERRED status written within 30 seconds; deferred_until date calculated correctly; Monitor skips the row on the following daily run; audit log records the deferral event with user and timestamp.
T16
Handoff: Classification Agent output routes file to correct SharePoint folder
Three documents of different types (NDA, Regulatory Filing, Court Correspondence) uploaded in sequence.
Each file moved to the correct taxonomy-defined folder path in sandbox SharePoint; metadata applied before the move; register rows created with correct folder_path values.
All three files land in distinct correct folders; no file lands in the root or ingestion folder after processing; folder_path in the register matches the actual SharePoint location.
T17
Handoff: end-to-end audit trail from ingestion to register entry
Single NDA uploaded; full workflow executes: classification, metadata write, folder move, register log.
Audit log contains four sequential entries: CLASSIFIED, METADATA_WRITTEN, FILE_MOVED, REGISTER_LOGGED; each entry includes document ID, timestamp, and agent or tool that performed the action.
All four audit entries present; timestamps are in ascending chronological order; no gaps in the sequence; document ID is consistent across all four entries.
T18
Handoff: DocuSign trigger fires Classification Agent correctly
Sandbox DocuSign envelope marked as completed; webhook fires to the automation platform.
Classification Agent receives the envelope payload, extracts the PDF attachment, classifies it, and proceeds through the full ingestion chain.
Classification Agent is triggered within 30 seconds of the DocuSign webhook event; classification result is correct for the document type in the test envelope; full handoff chain completes.
T19
Handoff: Dropbox Business trigger fires Classification Agent correctly
File dropped into the monitored sandbox Dropbox Business folder.
Classification Agent receives the new-file event, downloads the file, classifies it, and proceeds through the ingestion chain.
Agent triggered within 60 seconds of file drop; classification result correct; file moved from Dropbox ingestion folder to the correct SharePoint archive path; register row created.
Edge case tests cover scenarios that fall outside the normal happy path but are realistic in legal operations: duplicate submissions, incomplete or missing data, external tool unavailability, and human approval timeouts. These use the E-series ID prefix.
ID
Scenario
Input
Expected Output
Pass Criteria
E01
Duplicate document submitted within 24 hours of original
Identical file (same hash, same filename) re-uploaded to the SharePoint ingestion folder within 24 hours of the first ingestion.
Agent detects the duplicate via hash comparison against the register; file quarantined to duplicates folder; original register entry unchanged; Slack alert sent to legal manager.
No second register row created; no metadata overwrite; duplicate file isolated; Slack alert delivered; audit log records DUPLICATE_DETECTED.
E02
Document arrives with missing matter reference and no inferrable metadata
PDF with no filename matter prefix, no body text matter number, and no DocuSign sender metadata to cross-reference.
Agent classifies the document type if content is readable; matter reference set to UNRESOLVED; responsible party set to default legal manager; Slack alert sent requesting manual matter reference entry.
Classification attempt made and result recorded even if matter reference is UNRESOLVED; UNRESOLVED written explicitly; alert delivered with document name and classification result; audit log entry created.
E03
SharePoint API unavailable during folder move step
Classification and metadata write succeed; SharePoint returns 503 on the folder move API call.
Automation retries the move up to three times with exponential backoff; on final failure, document remains in the ingestion folder with a MOVE_FAILED status tag; Slack alert sent to monitoring channel.
File not lost or silently left in an ambiguous state; MOVE_FAILED status written to the register row; Slack alert includes document name, step that failed, and HTTP error code; retry count logged.
E04
Slack unavailable when destruction alert is due to be sent
Retention Monitor identifies a document due for destruction; Slack API returns 503.
Monitor retries the Slack send up to three times; on final failure, logs the unsent alert as ALERT_FAILED in the execution log and sends a fallback email to the legal manager via Microsoft 365.
Fallback email sent within 10 minutes of the Slack failure; email contains the same document details as the intended Slack message; execution log records ALERT_FAILED with timestamps.
E05
Legal manager does not respond to destruction alert within 5 business days
Slack destruction alert sent; no approve or defer action taken by the legal manager within 5 business days.
Monitor sends a single reminder Slack message on day 5; if still no response after a further 2 business days, the alert is escalated to the Compliance Lead via a second Slack message; register row status set to ESCALATED.
Reminder message sent on day 5 only (not before); escalation sent on day 7 only; register row status updated at each stage; audit log records reminder and escalation events with timestamps.
E06
Document type present in taxonomy but retention period entry is blank in the ruleset
PDF correctly identified as an Employment Contract; the ruleset entry for Employment Contract has a blank retention_period field.
Agent classifies the document type correctly; retention period field set to RULESET_INCOMPLETE; document moved to a pending-review folder rather than the standard archive; Slack alert sent to legal manager and Compliance Lead.
No default or guessed retention period written; RULESET_INCOMPLETE written explicitly; document isolated in pending-review folder; both recipients receive the Slack alert; audit log records the event.