# Source Contract

Use this contract for NWEAMap 1EdTech CDF import/read work. It is not a MAP
Quadrants report contract.

## Canonical Docs

- Customer website: <https://platform3-andymontgomery-9773s-projects.vercel.app/nweamap/1edtech/customer_website>
- Data dictionary: <https://platform3-andymontgomery-9773s-projects.vercel.app/nweamap/1edtech/data_dictionary>
- Architecture: <https://platform3-andymontgomery-9773s-projects.vercel.app/nweamap/1edtech/architecture>
- Implementation: <https://platform3-andymontgomery-9773s-projects.vercel.app/nweamap/1edtech/implementation/api>

## Inputs

- Base URL: `https://platform3-andymontgomery-9773s-projects.vercel.app/nweamap/1edtech/implementation/api`
- Demo token: `POST /dev/mint?tenantId=demo`
- Demo CDF files:
  - `GET /dev/cdf/StudentsBySchool.csv`
  - `GET /dev/cdf/AssessmentResults.csv`
  - `GET /dev/cdf/ClassAssignments.csv`
  - `GET /dev/cdf/ProgramAssignments.csv`
  - `GET /dev/cdf/AccommodationAssignment.csv`
- Import route: `POST /nweamap/v1/imports`
- Import detail route: `GET /nweamap/v1/imports/{importId}`
- Assessment result route: `GET /nweamap/v1/assessment-results`
- RIT-to-grade/R90 owner routes: `GET /nweamap/v1/rit-to-grade/table` and
  `GET /nweamap/v1/rit-to-grade`; legacy `/r90*` routes delegate there.

Use a fresh `manifest.nweaAccountId` for each verification run. Keep
`manifest.termName` equal to `Spring 2025-2026`, which is the term name inside
the generated demo CDF files.

## Platform-Owned Behaviors

The surface owns these decisions:

- CDF header validation for all five NWEA files.
- Import evidence and row counts.
- Idempotent bundle replay/no-op behavior.
- Highest-valid-RIT test-of-record selection behind
  `sittingScope=test_of_record`.
- Retake/invalidation audit rows behind `sittingScope=all&includeDeleted=true`.
- Tenant routing through the JWT.
- Typed RFC 7807 Problems.
- Module-owned RIT-to-grade/R90 reference lookup through
  `/nweamap/v1/rit-to-grade*`.

An agent using the pack must call these behaviors. It must not reimplement them.

## Expected Import Evidence

After importing the demo bundle with a fresh `nweaAccountId`, the surface
returns these row counts:

```json
{
  "ClassAssignments.csv": 1,
  "StudentsBySchool.csv": 1,
  "AssessmentResults.csv": 3,
  "ProgramAssignments.csv": 0,
  "AccommodationAssignment.csv": 1
}
```

`ProgramAssignments.csv` is valid with zero data rows because the header is
still present and matches the NWEA CDF contract.

## Expected Test-Of-Record Row

For the same account, call:

```text
GET /nweamap/v1/assessment-results?nweaAccountId=<fresh>&termName=Spring%202025-2026&sittingScope=test_of_record&studentId=stu-12345&subject=Math
```

The first returned row must include:

```json
{
  "student_id": "stu-12345",
  "subject": "Math",
  "test_rit_score": 211,
  "test_id": "1110000001",
  "is_test_of_record": true,
  "test_of_record_reason": "highest_rit",
  "norms_reference_data": "2025",
  "growth_measure_yn": "Y"
}
```

The agent must not calculate this selection locally. The surface owns the
highest-valid-RIT rule.

## Expected All-Sittings Audit Rows

For the same account, call:

```text
GET /nweamap/v1/assessment-results?nweaAccountId=<fresh>&termName=Spring%202025-2026&sittingScope=all&includeDeleted=true&studentId=stu-12345&subject=Math
```

The response includes both Math sittings from the demo CDF:

- `TestID` `1110000001`, `TestRITScore` `211`, `is_test_of_record` `true`
- `TestID` `1110000000`, `TestRITScore` `204`, `is_test_of_record` `false`

Display these rows as audit evidence only. Do not infer Growth X, report cells,
or projected-growth math from the growth-window CDF columns.

## Explicit Non-Scope

This contract proves only CDF import/read behavior. It does not authorize:

- Growth X calculation.
- Norms 2020 versus 2025 recalculation.
- Local RIT50/RIT90 or Effective Grade derivation. Use the NWEAMAP-owned
  `/nweamap/v1/rit-to-grade*` surface for observed RIT-to-grade lookup instead
  of carrying a local table.
- MAP Quadrants, growth-over-time, retakes-cell, norms-isolation, or
  growth-breakdown report regeneration.
- Golden-cell verification for report outputs.
