Linear: [AERIE-3017](https://linear.app/builder-team/issue/AERIE-3017/store-an-explicit-w-qualifier-on-due-diligence-scores)
## Business Value
The Conducting Diligence Brainlift defines five diligence scores: 1, 1W, 2, 2W, 3. W means work remains to reach the stated score. Aerie could only store 1, 2 or 3, so the W ended up in comments. The stored value then disagreed with the one Ops actually assigned: Devin's 100 Field Point Road card shows "1W" while Aerie holds 2. After this change the five values are stored as data and shown everywhere the score appears: UI, CSV export, API and agent tools. Values outside the set are rejected, so sorting and filtering stay reliable. Ops leadership (Robbie Forrest, JC Fischer, Devin Bates) asked for this.
## Manual Effort Estimate
Proposed: ~8 hours of focused work (about one day). Keval to confirm or adjust. The concept is small but it touches a lot: four new fields carried through the shared contract, three Convex validators, the approval workflow, the v2 API and OpenAPI, the agent context catalog, two agent/MCP tool schemas, the DD editor, card, matrix, CSV export and dashboard sort, plus test and fixture updates. 30 files in total.
## Testing contract
### What this PR delivers
Each of the four due-diligence scores (Regulatory, Building, Play Area, School Operations) gets an optional W qualifier in its own field: regulatoryScoreQualifier, buildingScoreQualifier, playAreaScoreQualifier, schoolOperationsScoreQualifier. Together with the score, the only possible values are 1, 1W, 2, 2W and 3. The qualifier is shown after the number, e.g. "1W - Green". The diligence dashboard sorts each score column best first: 1, then 1W, 2, 2W, 3.
### Who uses it and where
- Diligence editors (Site writers and admins): the Due Diligence editor on the portfolio site card has a new "<Score> Score Qualifier" picker (W / Clear) under each score.
- Anyone reading diligence: the Due Diligence card, the Diligence dashboard matrix (with sorting) and its CSV export all show "1W - Green".
- API and agent consumers: v2 GET/PATCH /portfolio/sites/{siteRef}/property/due-diligence, the scenario routes, the operations diligence rows, and the agent/MCP DD write tools.
### Conditions needed
- A site with due diligence, edited by a user who can write DD. Either M2 isn't completed, or the user has the emergency override.
- If field approvals are on, the change goes through the normal approval request.
### Expected behavior and examples
- Set Regulatory Score = 1 and qualifier = W, save, and approve if needed. The card and matrix show "1W - Green", and the API returns regulatoryScore: 1, regulatoryScoreQualifier: "W".
- Picking 3 in the editor clears the W. The API rejects { score: 3, qualifier: "W" } with "A score of 3 never carries a W."
- The API rejects any qualifier other than W ("Score qualifier must be W."), and a qualifier with no score ("A score qualifier requires a score.").
- Clearing a score clears its qualifier.
- Sorting a score column ascending gives 1, 1W, 2, 2W, 3, with blanks handled as before.
- Existing records are unchanged: every current score reads with a null qualifier.
### Limits and unanswered questions
- Information status (degraded/complete) is not in this PR. The brainlift gives every score an information status, which is separate from W. A score can be "1W, Degraded". Aerie doesn't store that yet, so it's a follow-up. It also needs a name that won't be confused with diligence status "Complete".
- Existing "1W" notes in comments are not converted automatically. JC and Devin need to agree which sites qualify.
- The dashboard has no score filter today. The fixed value set lets the API and downstream consumers filter on exact values.
- I didn't check this in a running app. It's verified by lint, typecheck, the full contracts suite (1,398 tests) and the 190 affected chat test files (3,039 tests).
- A free-text version was tried and reverted in this branch, because it couldn't be sorted or filtered reliably.
- Follow-up outside this repo: Rhodes-DSS re-syncs its OpenAPI snapshot and documents the values once this is live.
🤖 Generated with [Claude Code](https://claude.com/claude-code)