agent extracted renewal dates from contracts with day and month swapped: forecast off by months
Fixes an agent that extracted renewal dates from contracts with day and month swapped so forecasts were off by months, by correcting locale-aware date parsing. Use when extracted dates are plausible but wrong. Not for contracts whose dates are genuinely ambiguous and need human reading.
TL;DR
A swapped date never looks broken, the thirteenth of a month is impossible and gets caught, but the fifth of June read as May the sixth sails through every validation and quietly moves a renewal by a month. Contracts mix date conventions by counterparty and country, and an agent parsing all of them with one assumed order will swap every ambiguous date it meets. Detect the pattern from the impossible dates it rejected, parse with the documents own locale evidence, route true ambiguity to humans, and rebuild the forecast from corrected dates.
agent extracted renewal dates from contracts with day and month swapped: forecast off by monthsUse this when
- Extracted renewal dates are systematically off by weeks or months, clustering where day and month values are both small
- Some contracts failed extraction with invalid dates, the visible tip of the same problem
- The contract set spans countries or counterparties with different date conventions
Not for this skill when
- The agent reads dates correctly and the forecast error comes from amendments changing the real dates later
- Contracts use one consistent format and the errors are random OCR misreads of digits, a different defect
Steps
- Measure the swap pattern from evidence. Gather extracted renewal dates and their source contract texts for a sample, compare each against the date as written in the document, and count how many match a day month swap exactly, how many are correct, and how many failed as impossible. The impossible ones, where the day value exceeds twelve in the written order, prove which convention those documents used. Verify: the sample is classified into swapped, correct, and previously impossible with counts
- Find the parsing assumption in the agent. Locate where extracted date strings become dates, identify the single format or locale the parser assumes, and check whether anything upstream, OCR, a template, or a language model extraction step, normalises the written date before parsing, because a helpful normalisation to one format is often where the original convention information is destroyed. Verify: the parsing assumption and any normalising step are pinpointed
- Rebuild parsing on document evidence. Determine each contracts convention from unambiguous clues in the document itself, dates written in words, a governing law or address country, the contracts own date format elsewhere, or an impossible value that reveals the order, and only then parse the renewal date with that convention, recording which evidence decided it alongside the extracted value. Verify: the rebuilt parser classifies the sample correctly with the deciding evidence logged per contract
- Route genuine ambiguity to people. Where a date is ambiguous and no document evidence resolves it, the agent must flag the contract for human reading instead of guessing, and the forecast should show that renewal as date uncertain within a range, because a guessed date presented as fact is worse than an honest range a rep can plan around. Verify: ambiguous test contracts are flagged with a range rather than assigned a guessed date
- Repair the forecast and its history. Re-extract renewal dates across the contract base with the corrected parser, list every date that changed and by how much, rebuild the renewal forecast, and brief the owners of accounts whose renewal moved materially, since some renewals are now months sooner than the plan they are working to. Verify: changed dates are listed and owners of materially moved renewals are briefed
- Add date extraction tests and monitoring. Keep contracts covering each convention and the ambiguous case as regression fixtures, and monitor extracted dates for sanity, renewal dates in the past for active contracts, impossible clustering on the first of a month, and report extraction confidence per contract so forecast consumers can see which dates are solid and which are inferred. Verify: the regression fixtures pass and the sanity report runs on the live extraction
Why it happens
Most of the world writes day before month and one large market writes month before day, and both produce identical looking short dates for most of the month. A parser must choose, and a single global choice is wrong for a mixed contract base roughly whenever the day is twelve or under, which is most renewals. The errors are worst precisely because they are small and plausible, shifting quarters and cohorts without ever triggering a sanity check that looks for broken values rather than wrong ones.
Compatibility: Contract date extraction by agents, OCR and document parsing, locale date conventions, and renewal forecasting, in current document processing tooling.
Variants and edge cases
renewal dates day month swapped contract parsing
['The direct phrasing. Impossible dates in the rejection pile are diagnostic treasure, they reveal the documents true convention without guessing.']
agent extracted wrong renewal dates locale format
['The locale variant. Evidence based per document parsing beats a global setting, mixed portfolios guarantee any single setting is wrong for someone.']
forecast off months contract date extraction
['The forecast variant. List every changed date when you repair it, a silently rebuilt forecast leaves reps working from memorised wrong dates.']
Edge cases to work through before you close the incident:
- Dates written in words are the gold standard in a contract. Where they exist, extract them preferentially and use them to calibrate the numeric dates in the same document.
- A two digit year adds a second ambiguity layer. Handle it explicitly in the parser rules rather than inheriting a library pivot year silently.
- Amendments can carry dates in a different convention from the master agreement if the parties differ. Parse each document on its own evidence, never inherit the account level assumption blindly.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst4nI4pX35R402m9uGFHx4g