{"openapi":"3.1.0","info":{"title":"CPIIP — Canadian Procurement Integrity and Intelligence Platform API","version":"1.47.0","description":"Single-writer functional POC with file or PostgreSQL/pg-boss storage. Decimal-string money; source-qualified identifiers; synthetic and live data separated."},"servers":[{"url":"/api/v1"}],"paths":{"/api/v1/public/procurements/{id}/retrospective":{"get":{"summary":"Fresh retrospective public screening and evidence checklist","description":"RetrospectiveReport v1.0. Read-only four public screens, full input-hash freshness against retained public analysis, lifecycle facts, explicit eligibility and deeper method capabilities. No internal packet access, composite score, clearance, completion certification or automatic referral. Download preserves current output; no offline replay package is claimed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mode","in":"query","required":true,"schema":{"type":"string"}},{"name":"language","in":"query","schema":{"enum":["en","fr"],"default":"en"}}],"responses":{"200":{"description":"RetrospectiveReport v1.0 with source, summary, checks, deeperMethods, checklist, evidence, analysis input hash and retainedAnalysis freshness."},"400":{"description":"Invalid mode/language"},"404":{"description":"Record absent from selected dataset"}}}},"/api/v1/public/changes":{"get":{"summary":"Read deterministic changes between retained adjacent procurement revisions","description":"Contract v1.0. Requires LIVE or SYNTHETIC mode. Default CURRENT excludes superseded transitions. Buyer/supplier filters require sourceId; they are source-scoped identities, not corporate groups. No disappearance/cancellation inference. Compatible money deltas are signed exact strings, never savings. Captured, detected and publisher dates are separate; detection is null without a completed import receipt. Downloaded JSON preserves evidence links and pagination.","parameters":[{"name":"mode","in":"query","required":true,"schema":{"type":"string"}},{"name":"procurementId","in":"query","required":false,"schema":{"type":"string"}},{"name":"sourceId","in":"query","required":false,"schema":{"type":"string"}},{"name":"buyerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"supplierId","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"ChangeInbox v1.0: items, total, nextCursor, coverage (records, revisions, missingPredecessors)."},"400":{"description":"Invalid mode, pagination or unscoped buyer/supplier filter"}}}},"/api/v1/public/procurements/{id}/value-brief":{"get":{"summary":"Generate a bilingual, source-linked taxpayer value brief","description":"Contract v1.0. Current source and currently PUBLIC/ACTIVE, non-stale award explanation only. Private price/delivery/savings inputs are not disclosed. generatedAt dates the export; contentHash identifies its deterministic content excluding generation time. Download the response to freeze the evidence presented; this endpoint regenerates current evidence.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mode","in":"query","required":true,"schema":{"type":"string"}},{"name":"language","in":"query","schema":{"enum":["en","fr"],"default":"en"}}],"responses":{"200":{"description":"ValueBrief v1.0: sections with statements/evidence links, actions, source revision, content hash and generation time."},"400":{"description":"Invalid mode or language"},"404":{"description":"Not found in selected dataset"}}}},"/operations/domain-outbox":{"get":{"summary":"Read metadata-only domain events and consumer delivery counts","parameters":[{"name":"after","in":"query","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Committed result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOutboxReport"}}}}}}},"/operations/domain-outbox/consumers":{"post":{"summary":"Register a named consumer; zero replays all retained events, latest sequence starts with future events","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"startAfter":{"type":"integer","minimum":0}},"required":["name","startAfter"]}}}},"responses":{"200":{"description":"Committed result","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"startAfter":{"type":"integer","minimum":0}}}}}},"409":{"description":"Existing consumer has a different starting sequence"}}}},"/operations/domain-outbox/consumers/{name}/claim":{"post":{"summary":"Claim one ordered event for 60 seconds; expired leases are retried up to five attempts","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"}}],"responses":{"200":{"description":"Committed result","content":{"application/json":{"schema":{"type":"object","properties":{"delivery":{"oneOf":[{"type":"null"},{"type":"object","properties":{"event":{"$ref":"#/components/schemas/DomainEvent"},"token":{"type":"string"},"attempt":{"type":"integer","minimum":0},"leaseUntil":{"type":"string","format":"date-time"}}}]},"retryAt":{"type":["string","null"]}}}}}},"404":{"description":"Consumer not found"}}}},"/operations/domain-outbox/consumers/{name}/ack":{"post":{"summary":"Acknowledge with the current lease token; repeating the same acknowledgement is idempotent","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0},"token":{"type":"string"}},"required":["sequence","token"]}}}},"responses":{"200":{"description":"Committed result","content":{"application/json":{"schema":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0},"status":{"enum":["RETRY","DELIVERED","DEAD"]}}}}}},"409":{"description":"Stale lease or incompatible delivery state"}}}},"/operations/domain-outbox/consumers/{name}/fail":{"post":{"summary":"Retry with exponential delay or dead-letter after five attempts","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0},"token":{"type":"string"}},"required":["sequence","token"]}}}},"responses":{"200":{"description":"Committed result","content":{"application/json":{"schema":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0},"status":{"enum":["RETRY","DELIVERED","DEAD"]}}}}}},"409":{"description":"Stale lease or incompatible delivery state"}}}},"/operations/domain-outbox/consumers/{name}/replay":{"post":{"summary":"Replay one dead letter with its original event ID; resets attempt budget","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0}},"required":["sequence"]}}}},"responses":{"200":{"description":"Committed result","content":{"application/json":{"schema":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0},"status":{"enum":["RETRY","DELIVERED","DEAD"]}}}}}},"409":{"description":"Stale lease or incompatible delivery state"}}}},"/operations/domain-storage":{"get":{"summary":"Read-only relational domain manifest reconciliation; file and legacy layouts are explicit","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/internal-analyses":{"post":{"summary":"Analyze a retained internal package and create a deduplicated unranked lead","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Analysis"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["importId"],"properties":{"importId":{"type":"string"}}}}}}}},"/internal-analyses/batch":{"post":{"summary":"Screen latest retained packages in one mode","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","properties":{"ruleVersion":{"type":"string"},"mode":{"type":"string"},"selectedImportIds":{"type":"array","items":{"type":"string"}},"analyses":{"type":"array","items":{"$ref":"#/components/schemas/Analysis"}},"counts":{"type":"object"},"note":{"type":"string"}}}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"enum":["LIVE","SYNTHETIC"]}}}}}}}},"/internal-analyses/template/{procurementId}":{"get":{"summary":"Synthetic review-lead scenario, demo only","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalPacket"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"procurementId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pricing","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"history","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"advanced","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}]}},"/internal-imports":{"get":{"summary":"Internal package history; mode required, optional procurementId","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"mode","in":"query","required":true,"schema":{"type":"string"}},{"name":"procurementId","in":"query","required":false,"schema":{"type":"string"}}]},"post":{"summary":"Validate and retain a replacement internal dataset","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalImport"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["packet","expectedVersion","idempotencyKey","reviewer","reason"],"properties":{"packet":{"$ref":"#/components/schemas/InternalPacket"},"expectedVersion":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string"},"reviewer":{"type":"string"},"reason":{"type":"string"}}}}}}}},"/internal-imports/template/{procurementId}":{"get":{"summary":"Fictional example package; demo records only","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalPacket"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"procurementId","in":"path","required":true,"schema":{"type":"string"}}]}},"/internal-imports/{id}":{"get":{"summary":"Retained package with exact-amount reconciliation","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalReport"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/internal-imports/{id}/evidence":{"get":{"summary":"Original package JSON and snapshot availability","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/rule-versions":{"get":{"summary":"Immutable configurations, active pointer and publication history","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Create an immutable exploratory configuration","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","author","rationale","parameters","idempotencyKey"],"properties":{"title":{"type":"string"},"author":{"type":"string"},"rationale":{"type":"string"},"parameters":{"type":"object","required":["enabled","concentrationPercent","concentrationMinimum","growthPercent","shortWindowDays","singleBidPercent","singleBidMinimum"],"properties":{"enabled":{"type":"array","uniqueItems":true,"items":{"enum":["R014","R015","R017","R018"]}},"concentrationPercent":{"type":"integer","minimum":0,"maximum":100},"concentrationMinimum":{"type":"integer","minimum":5,"maximum":1000},"growthPercent":{"type":"integer","minimum":0,"maximum":1000},"shortWindowDays":{"type":"integer","minimum":1,"maximum":90},"singleBidPercent":{"type":"integer","minimum":0,"maximum":100},"singleBidMinimum":{"type":"integer","minimum":3,"maximum":1000}}},"idempotencyKey":{"type":"string"}}}}}}}},"/rule-versions/{id}":{"get":{"summary":"Retained rule configuration","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/rule-versions/{id}/preview":{"post":{"summary":"Compare selected configuration with active version without alerts","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filter","idempotencyKey"],"properties":{"filter":{"type":"object","required":["mode"],"properties":{"q":{"type":"string"},"level":{"type":"string"},"jurisdiction":{"type":"string"},"source":{"type":"string"},"buyerId":{"type":"string"},"category":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]}}},"idempotencyKey":{"type":"string"}}}}}}}},"/rule-versions/{id}/previews":{"get":{"summary":"Saved preview summaries","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/rule-previews/{id}":{"get":{"summary":"Retained before/after preview results","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/rule-versions/{id}/publish":{"post":{"summary":"Activate a previewed version for future analyses","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["previewId","expectedActiveVersionId","expectedPublicationId","author","reason","idempotencyKey"],"properties":{"previewId":{"type":"string"},"expectedActiveVersionId":{"type":"string"},"expectedPublicationId":{"type":"string","nullable":true},"author":{"type":"string"},"reason":{"type":"string"},"idempotencyKey":{"type":"string"}}}}}}}},"/suppliers":{"get":{"summary":"Paginated source supplier directory; mode required","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"string"}}]}},"/suppliers/{id}/identity":{"get":{"summary":"Reviewer-linked group with retained decisions and source records","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/suppliers/{id}/candidates":{"get":{"summary":"Bounded name-match suggestions; no automatic merge","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/suppliers/{id}/relationships":{"get":{"summary":"Bounded source-scoped buyer relationship table","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/supplier-decisions":{"post":{"summary":"Reversible, versioned and idempotent supplier decision","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierDecision"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["leftId","rightId","status","reviewer","reason","evidenceIds","expectedVersion","idempotencyKey"],"properties":{"leftId":{"type":"string"},"rightId":{"type":"string"},"status":{"enum":["SAME_ENTITY","DIFFERENT_ENTITY","WITHDRAWN"]},"reviewer":{"type":"string"},"reason":{"type":"string"},"evidenceIds":{"type":"array","minItems":1,"items":{"type":"string"}},"expectedVersion":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string"}}}}}}}},"/analysis-batches":{"post":{"summary":"Start a resumable batch with fixed record membership","responses":{"202":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisBatch"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idempotencyKey","filter"],"properties":{"idempotencyKey":{"type":"string"},"filter":{"type":"object","required":["mode"],"properties":{"q":{"type":"string"},"level":{"type":"string"},"jurisdiction":{"type":"string"},"source":{"type":"string"},"buyerId":{"type":"string"},"category":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]}}}}}}}}},"get":{"summary":"Batch history filtered by data mode","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"mode","in":"query","required":false,"schema":{"enum":["LIVE","SYNTHETIC"]}}]}},"/analysis-batches/{id}":{"get":{"summary":"Batch progress and retained analysis IDs","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/analysis-batches/{id}/resume":{"post":{"summary":"Resume a failed batch at its checkpoint","responses":{"202":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalysisBatch"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/alerts":{"get":{"summary":"Paginated exploratory leads and retained explanations","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"jurisdiction","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"buyerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"mode","in":"query","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string"}},{"name":"assignee","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}]}},"/alerts/{id}/triage":{"post":{"summary":"Versioned review, assignment or pinned case creation","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewAlert"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","note"],"properties":{"expectedVersion":{"type":"integer"},"note":{"type":"string"},"assignee":{"type":"string"},"status":{"enum":["NEW","ACKNOWLEDGED","IN_REVIEW","DISMISSED","LINKED_TO_CASE"]}}}}}}}},"/efficiency":{"get":{"summary":"Descriptive buyer and purchasing summaries","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"jurisdiction","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"buyerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"mode","in":"query","required":true,"schema":{"type":"string"}}]}},"/public/efficiency":{"get":{"summary":"Descriptive buyer and purchasing summaries","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"level","in":"query","required":false,"schema":{"type":"string"}},{"name":"jurisdiction","in":"query","required":false,"schema":{"type":"string"}},{"name":"source","in":"query","required":false,"schema":{"type":"string"}},{"name":"buyerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"mode","in":"query","required":true,"schema":{"type":"string"}}]}},"/opportunities":{"get":{"summary":"Mode-separated opportunity ledger and reported outcome totals","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","required":["entries","totals","withheldOutcomes","measurementStatus","note"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/SavingsOpportunity"}},"totals":{"type":"array","items":{"type":"object","properties":{"basis":{"type":"string"},"amount":{"type":"string"}}}},"withheldOutcomes":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"type":"string"},"reason":{"type":"string"}}}},"measurementStatus":{"enum":["REVIEW_REQUIRED","USER_REPORTED_OUTCOMES","NOT_YET_MEASURED"]},"note":{"type":"string"}}}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}]},"post":{"summary":"Record a potential opportunity with explicit assumptions","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavingsOpportunity"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idempotencyKey","procurementId","title","owner","rationale","currency","taxBasis","periodStart","periodEnd"],"properties":{"idempotencyKey":{"type":"string"},"procurementId":{"type":"string"},"title":{"type":"string"},"owner":{"type":"string"},"rationale":{"type":"string"},"currency":{"type":"string"},"taxBasis":{"type":"string"},"estimatedSavings":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"}}}}}}}},"/opportunities/{id}/events":{"post":{"summary":"Versioned reviewer-reported outcome or withdrawal","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavingsOpportunity"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","note","status"],"description":"Confirmed outcomes also require baselineCost, outcomeCost, implementationCost, baselineMethod, confirmedBy and evidenceReference; common tax basis must be known. Overlapping confirmed outcomes for the same source process conflict.","properties":{"expectedVersion":{"type":"integer"},"note":{"type":"string"},"owner":{"type":"string"},"baselineCost":{"type":"string"},"outcomeCost":{"type":"string"},"implementationCost":{"type":"string"},"baselineMethod":{"type":"string"},"confirmedBy":{"type":"string"},"evidenceReference":{"type":"string"},"status":{"enum":["POTENTIAL","VALIDATED_AVOIDED_COST","REALIZED","REJECTED"]}}}}}}}},"/operations/storage-reconciliation":{"get":{"summary":"Read-only committed procurement projection reconciliation; file mode is not applicable","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageReconciliation"}}}}}}},"/health":{"get":{"summary":"Runtime storage and queue status","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/sources":{"get":{"summary":"Source catalogue and last import","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/coverage":{"get":{"summary":"Observed coverage","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/statistics":{"get":{"summary":"Observed contract summaries","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/procurements":{"get":{"summary":"Search and cursor pagination","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Procurement"}},"total":{"type":"integer"},"nextCursor":{"type":["string","null"]}}}}}}},"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"level","in":"query","schema":{"type":"string"}},{"name":"jurisdiction","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string"}},{"name":"supplierId","in":"query","schema":{"type":"string"}},{"name":"mode","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}]}},"/procurements/{id}":{"get":{"summary":"Canonical procurement, process structure and provenance","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Procurement"},{"type":"object","properties":{"structureView":{"$ref":"#/components/schemas/ProcurementStructureView"}}}]}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/procurements/{id}/revisions/{revision}":{"get":{"summary":"Exact retained procurement revision without current process projections","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Procurement"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/sources/{id}/import":{"post":{"summary":"Import canonical records or bounded native source batch","responses":{"202":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestionRun"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRequest"}}}}}},"/ingestion-runs":{"get":{"summary":"Import receipts","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/ingestion-runs/{id}":{"get":{"summary":"Poll import state","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/procurements/{id}/analysis":{"post":{"summary":"Run versioned explainable screens","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Analysis"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"get":{"summary":"Last analysis","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Analysis"},{"type":"null"}]}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/sources/{id}/resources":{"get":{"summary":"Available qualified publisher resources for native source imports","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/ingestion-runs/{id}/retry":{"post":{"summary":"Resume failed import from saved snapshot/checkpoint","responses":{"202":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestionRun"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/rules":{"get":{"summary":"Rule availability","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/cases":{"get":{"summary":"Review cases","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"mode","in":"query","required":false,"schema":{"enum":["LIVE","SYNTHETIC"]}}]},"post":{"summary":"Create case from retained analysis","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCase"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["procurementId","title"],"properties":{"procurementId":{"type":"string"},"title":{"type":"string"}}}}}}}},"/cases/{id}":{"get":{"summary":"Case history","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/cases/{id}/events":{"post":{"summary":"Append note or change state","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCase"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","note"],"properties":{"expectedVersion":{"type":"integer"},"note":{"type":"string"},"assignee":{"type":"string"},"dueDate":{"type":["string","null"],"format":"date"},"priority":{"enum":["NORMAL","HIGH","URGENT"]},"status":{"enum":["OPEN","IN_REVIEW","AWAITING_INFORMATION","CLOSED"]}}}}}}}},"/cases/{id}/export":{"get":{"summary":"Case dossier with retained analysis and evidence rows","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDossier"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/cases/{id}/dossier":{"get":{"summary":"Case dossier with explicit evidence availability","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDossier"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/cases/{id}/evidence":{"post":{"summary":"Attach a retained procurement revision","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCase"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","idempotencyKey","reviewer","note","procurementId","revision"],"properties":{"expectedVersion":{"type":"integer"},"idempotencyKey":{"type":"string"},"reviewer":{"type":"string"},"note":{"type":"string"},"procurementId":{"type":"string"},"revision":{"type":"integer","minimum":1}}}}}}}},"/cases/{id}/evidence/{evidenceId}/withdraw":{"post":{"summary":"Withdraw an attachment without deleting history","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCase"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"evidenceId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","idempotencyKey","reviewer","note"],"properties":{"expectedVersion":{"type":"integer"},"idempotencyKey":{"type":"string"},"reviewer":{"type":"string"},"note":{"type":"string"}}}}}}}},"/cases/{id}/tasks":{"post":{"summary":"Create a follow-up task","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCase"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","idempotencyKey","reviewer","note","title"],"properties":{"expectedVersion":{"type":"integer"},"idempotencyKey":{"type":"string"},"reviewer":{"type":"string"},"note":{"type":"string"},"title":{"type":"string"},"assignee":{"type":"string"},"dueDate":{"type":["string","null"],"format":"date"},"status":{"enum":["OPEN","DONE","CANCELLED"]}}}}}}}},"/cases/{id}/tasks/{taskId}":{"post":{"summary":"Update or reopen a follow-up task","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCase"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","idempotencyKey","reviewer","note"],"properties":{"expectedVersion":{"type":"integer"},"idempotencyKey":{"type":"string"},"reviewer":{"type":"string"},"note":{"type":"string"},"title":{"type":"string"},"assignee":{"type":"string"},"dueDate":{"type":["string","null"],"format":"date"},"status":{"enum":["OPEN","DONE","CANCELLED"]}}}}}}}},"/cases/{id}/outcomes":{"post":{"summary":"Append a cited reviewer outcome","responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewCase"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["expectedVersion","idempotencyKey","reviewer","note","kind","summary","alternativeExplanation","evidenceIds"],"properties":{"expectedVersion":{"type":"integer"},"idempotencyKey":{"type":"string"},"reviewer":{"type":"string"},"note":{"type":"string"},"kind":{"enum":["NO_FURTHER_ACTION","FOLLOW_UP_REQUIRED","PROCESS_IMPROVEMENT"]},"summary":{"type":"string"},"alternativeExplanation":{"type":"string"},"evidenceIds":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Active case evidence anchor IDs, not snapshot IDs"}}}}}}}},"/evidence/{id}":{"get":{"summary":"Source snapshot row","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"row","in":"query","schema":{"type":"integer","minimum":1}}]}},"/evidence/{id}/original":{"get":{"summary":"Retained XLSX/PDF/HTML or NBON JSON capture bundle, verified by originalBytesHash","responses":{"200":{"description":"Original retained PDF/workbook or HTML text attachment, or generated NBON JSON bundle containing exact publisher HTML bytes; originalBytesHash in evidence metadata is SHA-256 of these bytes","content":{"application/json":{"schema":{"type":"object","description":"NBON capture bundle with base64 publisher pages and individual SHA-256 hashes"}},"text/plain":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/suppliers/{id}":{"get":{"summary":"Source-scoped supplier group","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/jurisdictions":{"get":{"summary":"Jurisdiction catalogue","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/analyses/{id}":{"get":{"summary":"Retained analysis snapshot","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/public/procurements":{"get":{"summary":"Search and cursor pagination","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Procurement"}},"total":{"type":"integer"},"nextCursor":{"type":["string","null"]}}}}}}},"parameters":[{"name":"q","in":"query","schema":{"type":"string"}},{"name":"level","in":"query","schema":{"type":"string"}},{"name":"jurisdiction","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string"}},{"name":"supplierId","in":"query","schema":{"type":"string"}},{"name":"mode","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"string"}}]}},"/public/procurements/{id}":{"get":{"summary":"Canonical procurement, process structure and provenance","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Procurement"},{"type":"object","properties":{"structureView":{"$ref":"#/components/schemas/ProcurementStructureView"}}}]}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/public/coverage":{"get":{"summary":"Observed coverage","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/public/statistics":{"get":{"summary":"Observed contract summaries","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{}}}}}}},"/public/procurements/{id}/revisions/{revision}":{"get":{"summary":"Exact retained procurement revision without current process projections","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Procurement"}}}},"400":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/policy-packs":{"get":{"summary":"Policy versions, active IDs, catalogue hash and publication history","parameters":[],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/PolicyPack"}},"activeIds":{"type":"array","items":{"type":"string"}},"catalogHash":{"type":"string"},"publications":{"type":"array","items":{"type":"object"}}},"required":["versions","activeIds","catalogHash","publications"]}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/policy-pack-versions":{"post":{"summary":"Save immutable source-linked draft","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"family":{"type":"string"},"title":{"type":"string"},"instrument":{"type":"string"},"policyType":{"enum":["TRADE_COVERAGE","COMPETITION","PUBLICATION","DELEGATION"]},"governmentLevel":{"enum":["FEDERAL","PROVINCIAL","TERRITORIAL","MUNICIPAL"]},"jurisdictionCode":{"type":"string"},"buyerEntityType":{"enum":["DEPARTMENT","MUNICIPALITY","CROWN","BROADER_PUBLIC_SECTOR"]},"buyerId":{"type":"string"},"buyerIdPrefix":{"type":"string"},"sourceId":{"type":"string"},"comparison":{"enum":["GTE","GT"]},"effectiveFrom":{"type":"string","format":"date"},"effectiveTo":{"type":"string","format":"date"},"dateBasis":{"enum":["TENDER_PUBLICATION"]},"valuationBasis":{"enum":["ESTIMATED_MAXIMUM_WITH_OPTIONS","REVIEWED_MUNICIPAL_EXPENDITURE"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED","REVIEW_REQUIRED"]},"currency":{"enum":["CAD"]},"thresholds":{"type":"object","properties":{"GOODS":{"type":"string"},"SERVICES":{"type":"string"},"CONSTRUCTION":{"type":"string"}},"required":["GOODS","SERVICES","CONSTRUCTION"]},"sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"},"locator":{"type":"string"}},"required":["title","url","locator"]}},"limitations":{"type":"string"},"author":{"type":"string"},"idempotencyKey":{"type":"string"}},"required":["family","title","instrument","policyType","governmentLevel","jurisdictionCode","buyerEntityType","effectiveFrom","effectiveTo","dateBasis","valuationBasis","taxBasis","currency","thresholds","sources","limitations","author","idempotencyKey"]}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPack"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/policy-pack-versions/{id}/preview":{"post":{"summary":"Retain boundary fixtures and prior-input comparisons","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyPreview"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/policy-pack-versions/{id}/publish":{"post":{"summary":"Publish previewed policy without changing retained assessments","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"previewId":{"type":"string"},"expectedCatalogHash":{"type":"string"},"reviewer":{"type":"string"},"reason":{"type":"string"},"idempotencyKey":{"type":"string"}},"required":["previewId","expectedCatalogHash","reviewer","reason","idempotencyKey"]}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/policy-evaluations":{"post":{"summary":"Read-only explicit-facts comparison","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyFacts"}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"type":"object","properties":{"facts":{"$ref":"#/components/schemas/PolicyFacts"},"results":{"type":"array","items":{"$ref":"#/components/schemas/PolicyResult"}},"catalogHash":{"type":"string"}},"required":["facts","results","catalogHash"]}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/procurements/{id}/policy-assessments":{"get":{"summary":"Retained assessments for one procurement","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyAssessment"}}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Retain source revision, facts and exact policy versions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"facts":{"$ref":"#/components/schemas/PolicyFacts"},"expectedRevision":{"type":"integer"},"expectedCatalogHash":{"type":"string"},"reviewer":{"type":"string"},"reason":{"type":"string"},"idempotencyKey":{"type":"string"}},"required":["facts","expectedRevision","expectedCatalogHash","reviewer","reason","idempotencyKey"]}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyAssessment"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/operations/costs":{"get":{"summary":"Monthly reported costs and observed denominators","parameters":[{"name":"month","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostSummary"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Replace monthly currency report with a retained version","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"currency":{"type":"string"},"coverage":{"enum":["PARTIAL","COMPLETE"]},"entries":{"type":"array","items":{"type":"object","properties":{"category":{"enum":["HOSTING","STORAGE","EGRESS","API","OTHER"]},"funding":{"enum":["PAID","DONATED"]},"amount":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,2})?$"},"evidenceReference":{"type":"string"}},"required":["category","funding","amount","evidenceReference"]},"minItems":1,"maxItems":100},"reviewer":{"type":"string"},"note":{"type":"string"},"expectedVersion":{"type":"integer"},"idempotencyKey":{"type":"string"}},"required":["month","currency","coverage","entries","reviewer","note","expectedVersion","idempotencyKey"]}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostReport"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/feedback":{"get":{"summary":"Same-mode correction and feedback queue","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Feedback"}}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Retain a feedback report and optional source revision","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dataMode":{"enum":["LIVE","SYNTHETIC"]},"procurementId":{"type":"string"},"kind":{"enum":["CORRECTION","IDEA","PROBLEM"]},"summary":{"type":"string"},"evidenceReference":{"type":"string"},"idempotencyKey":{"type":"string"}},"required":["dataMode","kind","summary","evidenceReference","idempotencyKey"]}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feedback"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/feedback/{id}/events":{"post":{"summary":"Review or reopen feedback without rewriting source facts","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"},"expectedVersion":{"type":"integer"},"idempotencyKey":{"type":"string"}},"required":["status","reviewer","note","evidenceReference","expectedVersion","idempotencyKey"]}}}},"responses":{"201":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feedback"}}}},"400":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/guest/feedback":{"get":{"summary":"List public reports with exact procurement scope and status counts","description":"Public POC contributions only. No identity verification, confidential reporting, official complaint filing, source amendment or risk-score change. Evidence URLs are retained without fetching. No database/schema migration.","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}},{"name":"cursor","in":"query","schema":{"type":"string","pattern":"^(0|[1-9]\\d{0,8})$"}}],"responses":{"200":{"description":"Public contribution result","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"sourceRevision":{"type":"object","properties":{"retained":{"type":["integer","null"]},"current":{"type":["integer","null"]},"status":{"enum":["NOT_LINKED","SOURCE_NOT_FOUND","UNCHANGED","CHANGED_SINCE_REPORT"]}},"required":["retained","current","status"]},"id":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"kind":{"enum":["CORRECTION","IDEA","PROBLEM"]},"summary":{"type":"string"},"evidenceReference":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"version":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"procurement":{"oneOf":[{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"revision":{"type":"integer"}},"required":["id","title","revision"]}]},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["at","status","reviewer","note","evidenceReference"]}},"verification":{"const":"UNVERIFIED_POC_CONTRIBUTIONS"}},"required":["sourceRevision","id","dataMode","kind","summary","evidenceReference","status","version","createdAt","procurement","events","verification"]}},"total":{"type":"integer"},"nextCursor":{"type":["string","null"]},"counts":{"type":"object","properties":{"OPEN":{"type":"integer"},"IN_REVIEW":{"type":"integer"},"RESOLVED":{"type":"integer"},"DECLINED":{"type":"integer"}},"required":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]}},"required":["items","total","nextCursor","counts"]}}}},"400":{"description":"Invalid mode, acknowledgement, bounded input or URL"},"404":{"description":"Report missing in selected mode"},"409":{"description":"Version or idempotency conflict"}}},"post":{"summary":"Submit an unverified public guest observation and requested follow-up","description":"Public POC contributions only. No identity verification, confidential reporting, official complaint filing, source amendment or risk-score change. Evidence URLs are retained without fetching. No database/schema migration.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dataMode":{"enum":["LIVE","SYNTHETIC"]},"publicAcknowledgement":{"const":true},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128},"evidenceUrls":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"string","format":"uri","pattern":"^https:","maxLength":2000}},"kind":{"enum":["CORRECTION","IDEA","PROBLEM"]},"procurementId":{"type":"string"},"observation":{"type":"string","minLength":1,"maxLength":2000},"requestedAction":{"type":"string","minLength":1,"maxLength":1000}},"required":["dataMode","publicAcknowledgement","idempotencyKey","evidenceUrls","kind","observation","requestedAction"]}}}},"responses":{"201":{"description":"Public contribution result","content":{"application/json":{"schema":{"type":"object","properties":{"sourceRevision":{"type":"object","properties":{"retained":{"type":["integer","null"]},"current":{"type":["integer","null"]},"status":{"enum":["NOT_LINKED","SOURCE_NOT_FOUND","UNCHANGED","CHANGED_SINCE_REPORT"]}},"required":["retained","current","status"]},"id":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"kind":{"enum":["CORRECTION","IDEA","PROBLEM"]},"summary":{"type":"string"},"evidenceReference":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"version":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"procurement":{"oneOf":[{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"revision":{"type":"integer"}},"required":["id","title","revision"]}]},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["at","status","reviewer","note","evidenceReference"]}},"verification":{"const":"UNVERIFIED_POC_CONTRIBUTIONS"}},"required":["sourceRevision","id","dataMode","kind","summary","evidenceReference","status","version","createdAt","procurement","events","verification"]}}}},"400":{"description":"Invalid mode, acknowledgement, bounded input or URL"},"404":{"description":"Report missing in selected mode"},"409":{"description":"Version or idempotency conflict"}}}},"/guest/feedback/{id}":{"get":{"summary":"Read a public report and follow-up history in its dataset","description":"Public POC contributions only. No identity verification, confidential reporting, official complaint filing, source amendment or risk-score change. Evidence URLs are retained without fetching. No database/schema migration.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Public contribution result","content":{"application/json":{"schema":{"type":"object","properties":{"sourceRevision":{"type":"object","properties":{"retained":{"type":["integer","null"]},"current":{"type":["integer","null"]},"status":{"enum":["NOT_LINKED","SOURCE_NOT_FOUND","UNCHANGED","CHANGED_SINCE_REPORT"]}},"required":["retained","current","status"]},"id":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"kind":{"enum":["CORRECTION","IDEA","PROBLEM"]},"summary":{"type":"string"},"evidenceReference":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"version":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"procurement":{"oneOf":[{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"revision":{"type":"integer"}},"required":["id","title","revision"]}]},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["at","status","reviewer","note","evidenceReference"]}},"verification":{"const":"UNVERIFIED_POC_CONTRIBUTIONS"}},"required":["sourceRevision","id","dataMode","kind","summary","evidenceReference","status","version","createdAt","procurement","events","verification"]}}}},"400":{"description":"Invalid mode, acknowledgement, bounded input or URL"},"404":{"description":"Report missing in selected mode"},"409":{"description":"Version or idempotency conflict"}}}},"/guest/feedback/{id}/comments":{"post":{"summary":"Append public evidence without changing the decision; maximum 100 total updates","description":"Public POC contributions only. No identity verification, confidential reporting, official complaint filing, source amendment or risk-score change. Evidence URLs are retained without fetching. No database/schema migration.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dataMode":{"enum":["LIVE","SYNTHETIC"]},"publicAcknowledgement":{"const":true},"idempotencyKey":{"type":"string","minLength":1,"maxLength":128},"evidenceUrls":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"string","format":"uri","pattern":"^https:","maxLength":2000}},"expectedVersion":{"type":"integer","minimum":1},"note":{"type":"string","minLength":1,"maxLength":2000}},"required":["dataMode","publicAcknowledgement","idempotencyKey","evidenceUrls","expectedVersion","note"]}}}},"responses":{"201":{"description":"Public contribution result","content":{"application/json":{"schema":{"type":"object","properties":{"sourceRevision":{"type":"object","properties":{"retained":{"type":["integer","null"]},"current":{"type":["integer","null"]},"status":{"enum":["NOT_LINKED","SOURCE_NOT_FOUND","UNCHANGED","CHANGED_SINCE_REPORT"]}},"required":["retained","current","status"]},"id":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"kind":{"enum":["CORRECTION","IDEA","PROBLEM"]},"summary":{"type":"string"},"evidenceReference":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"version":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"procurement":{"oneOf":[{"type":"null"},{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"revision":{"type":"integer"}},"required":["id","title","revision"]}]},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["at","status","reviewer","note","evidenceReference"]}},"verification":{"const":"UNVERIFIED_POC_CONTRIBUTIONS"}},"required":["sourceRevision","id","dataMode","kind","summary","evidenceReference","status","version","createdAt","procurement","events","verification"]}}}},"400":{"description":"Invalid mode, acknowledgement, bounded input or URL"},"404":{"description":"Report missing in selected mode"},"409":{"description":"Version or idempotency conflict"}}}},"/feedback/{id}/resolution":{"get":{"summary":"Compare report-time and current source fields with workflow timing","description":"Read-only. No independent verification, automatic correction or monetary outcome. Source references and review identities are unverified POC assertions.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Current evidence report; source URLs can be absent and amounts remain exact strings","content":{"application/json":{"schema":{"type":"object","properties":{"methodVersion":{"const":"resolution-evidence-1"},"generatedAt":{"type":"string"},"evidenceHash":{"type":"string"},"report":{"type":"object","properties":{"id":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"summary":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"version":{"type":"integer"},"createdAt":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["id","dataMode","summary","status","version","createdAt","evidenceReference"]},"source":{"type":"object","properties":{"procurementId":{"type":["string","null"]},"title":{"type":["string","null"]},"retainedRevision":{"type":["number","null"]},"currentRevision":{"type":["number","null"]},"retainedUrl":{"type":["string","null"]},"currentUrl":{"type":["string","null"]},"status":{"enum":["NOT_LINKED","SOURCE_NOT_FOUND","UNCHANGED","CHANGED"]},"changes":{"type":"array","items":{"type":"object","properties":{"field":{"enum":["title","buyerName","supplierName","status","category","publishedDate","closingDate","awardDate","amount","originalAmount","bidderCount","procurementMethod","sourceNotes","sourceContract"]},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["field","before","after"]}}},"required":["procurementId","title","retainedRevision","currentRevision","retainedUrl","currentUrl","status","changes"]},"timing":{"type":"object","properties":{"firstReviewAt":{"type":["string","null"]},"firstClosureAt":{"type":["string","null"]},"latestClosureAt":{"type":["string","null"]},"reopenedCount":{"type":"integer"},"currentClosureHours":{"type":["number","null"]},"openAgeHours":{"type":["number","null"]}},"required":["firstReviewAt","firstClosureAt","latestClosureAt","reopenedCount","currentClosureHours","openAgeHours"]},"history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"},"statusChanged":{"type":"boolean"}},"required":["at","status","reviewer","note","evidenceReference","statusChanged"]}},"correctionVerification":{"const":"NOT_INDEPENDENTLY_VERIFIED"},"financialBenefit":{"const":"NOT_ESTABLISHED_BY_THIS_REPORT"}},"required":["methodVersion","generatedAt","evidenceHash","report","source","timing","history","correctionVerification","financialBenefit"]}}}},"400":{"description":"Invalid input or unsupported correction"},"404":{"description":"Report absent in selected mode"},"409":{"description":"Stale report/source evidence or conflicting retry"}}},"post":{"summary":"Retain a public reviewed disposition against the exact displayed source evidence","description":"Appends readable notes and source references to the existing feedback history. CORRECTION_REVIEWED requires a selected changed field in a later revision; evidence URLs are not fetched. Other dispositions require response, rationale and alternative explanation. Existing POC review routes remain available; this is not authenticated role enforcement.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dataMode":{"enum":["LIVE","SYNTHETIC"]},"disposition":{"enum":["FOLLOW_UP_REQUIRED","CORRECTION_REVIEWED","EXPLANATION_ACCEPTED","NOT_SUBSTANTIATED","REOPEN"]},"publicAcknowledgement":{"const":true},"expectedVersion":{"type":"integer"},"expectedEvidenceHash":{"type":"string"},"idempotencyKey":{"type":"string","maxLength":128},"reviewer":{"type":"string","maxLength":120},"response":{"type":"string","maxLength":2000},"responseUrl":{"type":"string","format":"uri","maxLength":2000},"rationale":{"type":"string","maxLength":2000},"alternativeExplanation":{"type":"string","maxLength":2000},"field":{"enum":["title","buyerName","supplierName","status","category","publishedDate","closingDate","awardDate","amount","originalAmount","bidderCount","procurementMethod","sourceNotes","sourceContract"]},"expectedAfter":{"type":["string","null"]}},"required":["dataMode","disposition","publicAcknowledgement","expectedVersion","expectedEvidenceHash","idempotencyKey","reviewer","response","responseUrl","rationale","alternativeExplanation"]}}}},"responses":{"201":{"description":"Current evidence report; source URLs can be absent and amounts remain exact strings","content":{"application/json":{"schema":{"type":"object","properties":{"methodVersion":{"const":"resolution-evidence-1"},"generatedAt":{"type":"string"},"evidenceHash":{"type":"string"},"report":{"type":"object","properties":{"id":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"summary":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"version":{"type":"integer"},"createdAt":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["id","dataMode","summary","status","version","createdAt","evidenceReference"]},"source":{"type":"object","properties":{"procurementId":{"type":["string","null"]},"title":{"type":["string","null"]},"retainedRevision":{"type":["number","null"]},"currentRevision":{"type":["number","null"]},"retainedUrl":{"type":["string","null"]},"currentUrl":{"type":["string","null"]},"status":{"enum":["NOT_LINKED","SOURCE_NOT_FOUND","UNCHANGED","CHANGED"]},"changes":{"type":"array","items":{"type":"object","properties":{"field":{"enum":["title","buyerName","supplierName","status","category","publishedDate","closingDate","awardDate","amount","originalAmount","bidderCount","procurementMethod","sourceNotes","sourceContract"]},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["field","before","after"]}}},"required":["procurementId","title","retainedRevision","currentRevision","retainedUrl","currentUrl","status","changes"]},"timing":{"type":"object","properties":{"firstReviewAt":{"type":["string","null"]},"firstClosureAt":{"type":["string","null"]},"latestClosureAt":{"type":["string","null"]},"reopenedCount":{"type":"integer"},"currentClosureHours":{"type":["number","null"]},"openAgeHours":{"type":["number","null"]}},"required":["firstReviewAt","firstClosureAt","latestClosureAt","reopenedCount","currentClosureHours","openAgeHours"]},"history":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"},"statusChanged":{"type":"boolean"}},"required":["at","status","reviewer","note","evidenceReference","statusChanged"]}},"correctionVerification":{"const":"NOT_INDEPENDENTLY_VERIFIED"},"financialBenefit":{"const":"NOT_ESTABLISHED_BY_THIS_REPORT"}},"required":["methodVersion","generatedAt","evidenceHash","report","source","timing","history","correctionVerification","financialBenefit"]}}}},"400":{"description":"Invalid input or unsupported correction"},"404":{"description":"Report absent in selected mode"},"409":{"description":"Stale report/source evidence or conflicting retry"}}}},"/api/v1/construction/quantity-scenario":{"post":{"summary":"Reproducible fixed-rate bid exposure to revised quantities","description":"Requires every scope line exactly once, matching units and explicit nonnegative quantities or null. Original bid eligibility is preserved. Four-place half-up line extensions; ties share ranks among comparable submitted bids. No contract entitlement, forecast update, misconduct finding or award recommendation. Zero means deliberate omission. Unknown quantities suppress scenario totals and lowest-set change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workbook","name","rationale","quantities"],"properties":{"workbook":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}},"name":{"type":"string","minLength":1,"maxLength":2000},"rationale":{"type":"string","minLength":1,"maxLength":2000},"quantities":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","unit","quantity"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}}}},"responses":{"201":{"description":"Normalized inputs, fingerprints, tie-aware ranks and exact line cost effects","content":{"application/json":{"schema":{"type":"object","required":["methodVersion","baselineFingerprint","fingerprint","workbook","scenario","missingIds","baselineLowestIds","scenarioLowestIds","lowestSetChanged","bids"],"properties":{"methodVersion":{"const":"construction-quantity-scenario-1"},"baselineFingerprint":{"type":"string","minLength":1,"maxLength":2000},"fingerprint":{"type":"string","minLength":1,"maxLength":2000},"workbook":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}},"scenario":{"type":"object","required":["name","rationale","quantities"],"properties":{"name":{"type":"string","minLength":1,"maxLength":2000},"rationale":{"type":"string","minLength":1,"maxLength":2000},"quantities":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","unit","quantity"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"missingIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"baselineLowestIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"scenarioLowestIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"lowestSetChanged":{"type":["boolean","null"]},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","eligible","issues","baselineTotal","scenarioTotal","difference","baselineRank","scenarioRank","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"eligible":{"type":"boolean"},"issues":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"baselineTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"scenarioTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"difference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"baselineRank":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"scenarioRank":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","baselineTotal","scenarioTotal","difference"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"baselineTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"scenarioTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"difference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}}}}}}}}}}},"400":{"description":"Invalid workbook, quantities, units or scenario rationale"}}}},"/api/v1/construction/coverage":{"get":{"summary":"Qualified index coverage for ten provinces and three territories, with reference-only regional sources","responses":{"200":{"description":"Explicit region/vector mapping; no series is not zero cost","content":{"application/json":{"schema":{"type":"object","required":["methodVersion","datasetId","capturedDate","regions","compositeSeriesIds"],"properties":{"methodVersion":{"const":"construction-coverage-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"capturedDate":{"type":"string","minLength":1,"maxLength":2000},"regions":{"type":"array","maxItems":13,"items":{"type":"object","required":["code","name","nameFr","geographies","seriesIds","status","references"],"properties":{"code":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"nameFr":{"type":"string","minLength":1,"maxLength":2000},"geographies":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"seriesIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"status":{"enum":["AVAILABLE","NO_SERIES"]},"references":{"type":"array","maxItems":100,"items":{"type":"object","required":["title","url","note","noteFr"],"properties":{"title":{"type":"string","minLength":1,"maxLength":2000},"url":{"type":"string","minLength":1,"maxLength":2000},"note":{"type":"string","minLength":1,"maxLength":2000},"noteFr":{"type":"string","minLength":1,"maxLength":2000}}}}}}},"compositeSeriesIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}}}}}}}}}},"/api/v1/construction/regional-movement":{"post":{"summary":"Observed same-vector provincial building-price changes, not price-level comparisons","description":"Exact signed percentage = 100 × (target − base) / base, four-place half-up rounding. Thirteen rows; absent provincial series or observations are explicit unknowns. No forecast, historic release-vintage claim or workbook mutation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["datasetId","building","fromPeriod","toPeriod"],"properties":{"datasetId":{"type":"string","minLength":1,"maxLength":2000},"building":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","minLength":1,"maxLength":2000},"toPeriod":{"type":"string","minLength":1,"maxLength":2000}}}}}},"responses":{"201":{"description":"Provincial movement and source evidence","content":{"application/json":{"schema":{"type":"object","required":["methodVersion","datasetId","building","fromPeriod","toPeriod","capturedDate","releaseDate","archiveSha256","sourceUrl","attribution","rows"],"properties":{"methodVersion":{"const":"construction-regional-movement-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"building":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","minLength":1,"maxLength":2000},"toPeriod":{"type":"string","minLength":1,"maxLength":2000},"capturedDate":{"type":"string","minLength":1,"maxLength":2000},"releaseDate":{"type":"string","minLength":1,"maxLength":2000},"archiveSha256":{"type":"string","minLength":1,"maxLength":2000},"sourceUrl":{"type":"string","minLength":1,"maxLength":2000},"attribution":{"type":"string","minLength":1,"maxLength":2000},"rows":{"type":"array","maxItems":13,"items":{"type":"object","required":["code","name","nameFr","status","vector","baseIndex","targetIndex","percentChange","sourceRows"],"properties":{"code":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"nameFr":{"type":"string","minLength":1,"maxLength":2000},"status":{"enum":["AVAILABLE","NO_SERIES","OBSERVATION_UNAVAILABLE"]},"vector":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"baseIndex":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"targetIndex":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"percentChange":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"sourceRows":{"type":"array","maxItems":100,"items":{"type":"integer","minimum":2}}}}}}}}}},"400":{"description":"Unknown dataset/building or invalid/unobserved quarters"}}}},"/api/v1/construction/indices":{"get":{"summary":"Frozen qualified StatCan building index snapshot; not a unit-price catalogue","responses":{"200":{"description":"400 vectors, 5600 source-located observations, 2023Q1–2026Q2","content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","id","archiveSha256","capturedDate","releaseDate","referenceBase","sourceUrl","downloadUrl","licenceUrl","attribution","scope","series"],"properties":{"schemaVersion":{"const":1},"id":{"type":"string","minLength":1,"maxLength":2000},"archiveSha256":{"type":"string","minLength":1,"maxLength":2000},"capturedDate":{"type":"string","minLength":1,"maxLength":2000},"releaseDate":{"type":"string","minLength":1,"maxLength":2000},"referenceBase":{"type":"string","minLength":1,"maxLength":2000},"sourceUrl":{"type":"string","minLength":1,"maxLength":2000},"downloadUrl":{"type":"string","minLength":1,"maxLength":2000},"licenceUrl":{"type":"string","minLength":1,"maxLength":2000},"attribution":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"series":{"type":"array","maxItems":400,"items":{"type":"object","required":["id","geography","building","division","coordinate","observations"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"building":{"type":"string","minLength":1,"maxLength":2000},"division":{"type":"string","minLength":1,"maxLength":2000},"coordinate":{"type":"string","minLength":1,"maxLength":2000},"observations":{"type":"array","maxItems":14,"items":{"type":"object","required":["period","value","status","sourceRow"],"properties":{"period":{"type":"string","minLength":1,"maxLength":2000},"value":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"status":{"type":"string"},"sourceRow":{"type":"integer","minimum":2}}}}}}}}}}}}}}},"/api/v1/construction/rate-sources":{"get":{"summary":"Construction source qualification directory","responses":{"200":{"description":"Qualified temporal index and reference-only sources","content":{"application/json":{"schema":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","title","url","status","reason"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"title":{"type":"string","minLength":1,"maxLength":2000},"url":{"type":"string","minLength":1,"maxLength":2000},"status":{"enum":["QUALIFIED_TEMPORAL_INDEX","REFERENCE_ONLY"]},"reason":{"type":"string","minLength":1,"maxLength":2000}}}}}}}}}},"/api/v1/construction/index-adjust":{"post":{"summary":"Exact same-vector temporal adjustment of a supplied building installed rate","description":"Base rate × target index / base index; four-place half-up. Frozen qualified dataset required. No interpolation, extrapolation, reverse time, cross-vector ratios or synthetic price validation. Evaluate a workbook to additionally check original evidence quarter, rate equality, LIVE installed pricing and estimate date at/after snapshot capture and target quarter end.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}}},"responses":{"201":{"description":"Reproducible calculation with source hash and CSV row provenance","content":{"application/json":{"schema":{"type":"object","required":["adjustment","adjustedRate","difference","baseIndex","targetIndex","geography","building","archiveSha256","releaseDate","sourceUrl","attribution","sourceRows"],"properties":{"adjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"adjustedRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"difference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"baseIndex":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"targetIndex":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"geography":{"type":"string","minLength":1,"maxLength":2000},"building":{"type":"string","minLength":1,"maxLength":2000},"archiveSha256":{"type":"string","minLength":1,"maxLength":2000},"releaseDate":{"type":"string","format":"date"},"sourceUrl":{"type":"string","minLength":1,"maxLength":2000},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceRows":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"integer","minimum":2}}}}}}},"400":{"description":"Ineligible adjustment or unavailable observation"}}}},"/api/v1/construction/professional-template":{"get":{"summary":"Fictional professional review example; no real rates or approval","responses":{"200":{"description":"Schema 1 workbook with professional supplement","content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}}}}}}}},"/api/v1/construction/compare":{"post":{"summary":"Compare two validated same-project construction revisions without persistence","description":"Exact project, geography, mode, currency and tax basis required. Scope/unit changes suppress quantity/rate decomposition. Absent lines contribute zero; present unpriced lines remain unknown. Quantity effect uses old rate and rounded line extensions; rate effect is the exact remainder. Supplement ranges are construction-only scenarios, not confidence intervals; risk exposure is never added automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["baseline","current"],"properties":{"baseline":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}},"current":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}}}}}}},"responses":{"201":{"description":"construction-revision-1 report","content":{"application/json":{"schema":{"type":"object","required":["methodVersion","baselineFingerprint","currentFingerprint","baselineRevision","currentRevision","constructionDifference","projectDifference","lines"],"properties":{"methodVersion":{"const":"construction-revision-1"},"baselineFingerprint":{"type":"string","minLength":1,"maxLength":2000},"currentFingerprint":{"type":"string","minLength":1,"maxLength":2000},"baselineRevision":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"currentRevision":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"constructionDifference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"projectDifference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"lines":{"type":"array","maxItems":200,"items":{"type":"object","required":["id","status","before","after","difference","quantityEffect","rateEffect","issues"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"status":{"enum":["ADDED","REMOVED","COMPARABLE","SCOPE_CHANGED"]},"before":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"after":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"difference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"quantityEffect":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"rateEffect":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"issues":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}}}}}}}}}},"400":{"description":"Invalid workbook or incompatible project context"}}}},"/api/v1/construction/template":{"get":{"summary":"Synthetic construction workbook; all rates fictional","responses":{"200":{"description":"Schema 1 synthetic example","content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}}}}}}}},"/api/v1/construction/evaluate":{"post":{"summary":"Stateless construction estimate, bid and revised-scope comparison; no persistence or savings assertion","description":"CAD excluding sales tax. Exact decimal strings. Unknown costs must be null. Installed and build-up rates are mutually exclusive. Evidence classification must match mode. At most 100 scope lines, bids, changes, and lines per bid. Percentages 0–100. Positive quantities. No unit conversion. Four-place half-up rounding per component/unit/line. Remaining commitments exclude incurred cost; changes are not automatically added to forecasts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}}}}},"responses":{"201":{"description":"Reproducible construction-cost-1 report","content":{"application/json":{"schema":{"type":"object","required":["methodVersion","fingerprint","workbook","lines","pricedSubtotal","constructionTotal","projectTotal","unpricedIds","unknownAllowances","bids","changes","forecast"],"properties":{"methodVersion":{"const":"construction-cost-1"},"fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$"},"workbook":{"type":"object","required":["schemaVersion","mode","project","geography","estimateDate","maturityBasis","scope","currency","taxBasis","lines","allowances","bids","changes","forecast"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"project":{"type":"string","minLength":1,"maxLength":2000},"geography":{"type":"string","minLength":1,"maxLength":2000},"estimateDate":{"type":"string","format":"date"},"maturityBasis":{"type":"string","minLength":1,"maxLength":2000},"scope":{"type":"string","minLength":1,"maxLength":2000},"currency":{"const":"CAD"},"taxBasis":{"const":"EXCLUDED"},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","specification","unit","quantity","basis","rate","resources","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"basis":{"enum":["INSTALLED","BUILD_UP","UNPRICED"]},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"resources":{"anyOf":[{"type":"object","required":["material","wastePercent","labourHours","loadedWage","equipment","overheadProfitPercent"],"properties":{"material":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"wastePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"labourHours":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"loadedWage":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"equipment":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"overheadProfitPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}},{"type":"null"}]},"evidence":{"anyOf":[{"type":"object","required":["source","date","geography","inclusions","classification"],"properties":{"source":{"type":"string","minLength":1,"maxLength":2000},"date":{"type":"string","format":"date"},"geography":{"type":"string","minLength":1,"maxLength":2000},"inclusions":{"type":"string","minLength":1,"maxLength":2000},"classification":{"enum":["PUBLIC","SYNTHETIC"]}}},{"type":"null"}]},"indexAdjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}}}},"minItems":1},"allowances":{"type":"object","required":["ownerDesign","escalation","contingency","nonRecoverableTax","rationale"],"properties":{"ownerDesign":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"escalation":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"contingency":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"nonRecoverableTax":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","reference","lines"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","reference","item"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"reference":{"type":"string","minLength":1,"maxLength":2000},"item":{"type":"object","required":["lineId","specification","unit","quantity","rate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"specification":{"type":"string","minLength":1,"maxLength":2000},"unit":{"type":"string","minLength":1,"maxLength":2000},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}},"forecast":{"type":"object","required":["approvedBudget","incurred","remainingCommitted","uncommitted","remainingRisk","basis"],"properties":{"approvedBudget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"incurred":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingCommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncommitted":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remainingRisk":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000}}},"professional":{"type":"object","required":["revision","preparedBy","documents","assumptions","exclusions","reviewNotes","evidenceAgeDays","items","risks"],"properties":{"revision":{"type":"string","minLength":1,"maxLength":2000},"preparedBy":{"type":"string","minLength":1,"maxLength":2000},"documents":{"type":"string","minLength":1,"maxLength":2000},"assumptions":{"type":"string","minLength":1,"maxLength":2000},"exclusions":{"type":"string","minLength":1,"maxLength":2000},"reviewNotes":{"type":"string","minLength":1,"maxLength":2000},"evidenceAgeDays":{"type":"string","pattern":"^\\d{1,4}$","description":"1–3650 days; estimator-selected review threshold"},"items":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","workPackage","takeoffReference","lowRate","highRate"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"workPackage":{"type":"string","minLength":1,"maxLength":2000},"takeoffReference":{"type":"string","minLength":1,"maxLength":2000},"lowRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"highRate":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","probabilityPercent","impact","basis","mitigation"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","minLength":1,"maxLength":2000},"probabilityPercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"impact":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"type":"string","minLength":1,"maxLength":2000},"mitigation":{"type":"string","minLength":1,"maxLength":2000}}}}}}}},"lines":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","unitRate","total","material","labour","equipment","overheadProfit"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"unitRate":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"total":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"material":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"labour":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"equipment":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"overheadProfit":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}}},"pricedSubtotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"constructionTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"projectTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"unpricedIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"unknownAllowances":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"bids":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","eligible","issues","pricedSubtotal","total","difference"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"eligible":{"type":"boolean"},"issues":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"pricedSubtotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"total":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"difference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}}},"changes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","eligible","issues","proposedTotal","baselineTotal","costDifference","quantityEffect","rateEffect","baselineRate","rateDifference","quantityDifference"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"eligible":{"type":"boolean"},"issues":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"proposedTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"baselineTotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"costDifference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"quantityEffect":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"rateEffect":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"baselineRate":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"rateDifference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"quantityDifference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}}},"forecast":{"type":"object","required":["total","budgetVariance"],"properties":{"total":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"budgetVariance":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}},"professional":{"type":"object","required":["methodVersion","issues","packages","range","risks","expectedExposure","contingencyLessExposure"],"properties":{"methodVersion":{"const":"professional-review-1"},"issues":{"type":"array","maxItems":502,"items":{"type":"string","minLength":1,"maxLength":2000}},"packages":{"type":"array","maxItems":100,"items":{"type":"object","required":["name","lineIds","pricedSubtotal","total"],"properties":{"name":{"type":"string","minLength":1,"maxLength":2000},"lineIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}},"pricedSubtotal":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"total":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}}},"range":{"type":"object","required":["low","high","missingIds"],"properties":{"low":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"high":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"missingIds":{"type":"array","maxItems":100,"items":{"type":"string","minLength":1,"maxLength":2000}}}},"risks":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","exposure"],"properties":{"id":{"type":"string","minLength":1,"maxLength":2000},"exposure":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}}},"expectedExposure":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"contingencyLessExposure":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}},"indexAdjustments":{"type":"array","maxItems":100,"items":{"type":"object","required":["lineId","adjustment","adjustedRate","difference","baseIndex","targetIndex","geography","building","archiveSha256","releaseDate","sourceUrl","attribution","sourceRows"],"properties":{"lineId":{"type":"string","minLength":1,"maxLength":2000},"adjustment":{"type":"object","required":["methodVersion","datasetId","vector","fromPeriod","toPeriod","baseRate","applicability","rationale"],"properties":{"methodVersion":{"const":"construction-index-1"},"datasetId":{"type":"string","minLength":1,"maxLength":2000},"vector":{"type":"string","minLength":1,"maxLength":2000},"fromPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"toPeriod":{"type":"string","pattern":"^\\d{4}-Q[1-4]$"},"baseRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"applicability":{"const":"BUILDING"},"rationale":{"type":"string","minLength":1,"maxLength":2000}}},"adjustedRate":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"difference":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"baseIndex":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"targetIndex":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"geography":{"type":"string","minLength":1,"maxLength":2000},"building":{"type":"string","minLength":1,"maxLength":2000},"archiveSha256":{"type":"string","minLength":1,"maxLength":2000},"releaseDate":{"type":"string","format":"date"},"sourceUrl":{"type":"string","minLength":1,"maxLength":2000},"attribution":{"type":"string","minLength":1,"maxLength":2000},"sourceRows":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"integer","minimum":2}}}}}}}}}},"400":{"description":"Invalid workbook or incompatible reference"}}}},"/api/v1/delivery/competition/template":{"get":{"summary":"Empty LIVE or labelled synthetic construction/IT competition packet","parameters":[{"name":"category","in":"query","schema":{"enum":["CONSTRUCTION","IT_SERVICES"]}},{"name":"mode","in":"query","schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Portable schema1 packet","content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","mode","classification","title","revision","parentFingerprint","correction","procurementReference","applicability","basis","selection","requirements","suppliers","loss","lots"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"classification":{"enum":["PUBLIC","RESTRICTED","SYNTHETIC"]},"title":{"type":"string","maxLength":4000},"revision":{"type":"integer","minimum":1,"maximum":100000},"parentFingerprint":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"correction":{"type":"string","maxLength":4000},"procurementReference":{"type":"string","maxLength":4000},"applicability":{"type":"object","required":["buyer","jurisdiction","category","vehicle","asOf","policyReference","policyFrom","policyTo"],"properties":{"buyer":{"type":"string","maxLength":4000},"jurisdiction":{"type":"string","maxLength":4000},"category":{"enum":["CONSTRUCTION","IT_SERVICES"]},"vehicle":{"type":"string","maxLength":4000},"asOf":{"type":"string","format":"date"},"policyReference":{"type":"string","maxLength":4000},"policyFrom":{"type":"string","format":"date"},"policyTo":{"type":"string","format":"date"}}},"basis":{"type":"object","required":["scope","horizonMonths","currency","taxBasis","priceDate"],"properties":{"scope":{"type":"string","maxLength":4000},"horizonMonths":{"type":"integer","minimum":1,"maximum":100},"currency":{"enum":["CAD"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"}}},"selection":{"type":"object","required":["method","criteriaReference","stage","proofProtocol"],"properties":{"method":{"enum":["LOWEST_RESPONSIVE_PRICE","WEIGHTED_VALUE","LIFECYCLE_VALUE","PHASED"]},"criteriaReference":{"type":"string","maxLength":4000},"stage":{"enum":["PRE_TENDER","OPEN","CLOSED"]},"proofProtocol":{"type":"string","maxLength":4000},"proofApplicability":{"enum":["APPLICABLE","NOT_APPLICABLE","UNASSESSED"]},"takeoverApplicability":{"enum":["APPLICABLE","NOT_APPLICABLE","UNASSESSED"]},"proofBasis":{"type":"string","maxLength":4000},"takeoverBasis":{"type":"string","maxLength":4000}}},"requirements":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","clause","necessity","alternative","statutory","disposition","buyerResponse","source"],"properties":{"id":{"type":"string","maxLength":4000},"clause":{"type":"string","maxLength":4000},"necessity":{"type":"string","maxLength":4000},"alternative":{"type":"string","maxLength":4000},"statutory":{"type":"boolean"},"disposition":{"enum":["PENDING","RETAIN","REVISE"]},"buyerResponse":{"type":"string","maxLength":4000},"source":{"type":"string","maxLength":4000}}}},"suppliers":{"type":"array","maxItems":10,"items":{"type":"object","required":["id","name","size","sizeEvidence","team","capabilityReference","basis","requirements","costs","proof","takeover","instruments","cash"],"properties":{"id":{"type":"string","maxLength":4000},"name":{"type":"string","maxLength":4000},"size":{"enum":["UNKNOWN","DECLARED_SME","VERIFIED_SME","OTHER"]},"sizeEvidence":{"type":"string","maxLength":4000},"team":{"type":"string","maxLength":4000},"capabilityReference":{"type":"string","maxLength":4000},"basis":{"type":"object","required":["scope","horizonMonths","currency","taxBasis","priceDate"],"properties":{"scope":{"type":"string","maxLength":4000},"horizonMonths":{"type":"integer","minimum":1,"maximum":100},"currency":{"enum":["CAD"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"}}},"requirements":{"type":"array","maxItems":100,"items":{"type":"object","required":["requirementId","status","evidence"],"properties":{"requirementId":{"type":"string","maxLength":4000},"status":{"enum":["SUPPORTED","GAP","UNKNOWN"]},"evidence":{"type":"string","maxLength":4000}}}},"costs":{"type":"array","maxItems":100,"items":{"type":"object","required":["kind","amount","basis","source"],"properties":{"kind":{"enum":["DELIVERY","OPERATIONS","ASSURANCE","BUYER_COORDINATION","TRANSITION"]},"amount":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"enum":["QUOTE","ASSUMPTION","UNKNOWN"]},"source":{"type":"string","maxLength":4000}}}},"proof":{"type":"object","required":["protocol","budget","continuation","result","assessor","evidence","attribution"],"properties":{"protocol":{"type":"string","maxLength":4000},"budget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"continuation":{"type":"string","maxLength":4000},"result":{"enum":["PASS","FAIL","NOT_TESTED"]},"assessor":{"type":"string","maxLength":4000},"evidence":{"type":"string","maxLength":4000},"attribution":{"enum":["SUPPLIER","BUYER","SHARED","UNRESOLVED"]}}},"takeover":{"type":"object","required":["result","team","artifacts","rights","evidence","hours","cost"],"properties":{"result":{"enum":["PASS","FAIL","NOT_TESTED"]},"team":{"type":"string","maxLength":4000},"artifacts":{"type":"string","maxLength":4000},"rights":{"type":"string","maxLength":4000},"evidence":{"type":"string","maxLength":4000},"hours":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"cost":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}},"instruments":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","kind","risk","issuer","terms","exclusions","overlapGroup","start","end","renewal","claim","recovery","delayDays"],"properties":{"id":{"type":"string","maxLength":4000},"kind":{"enum":["BID","PERFORMANCE","PAYMENT","WARRANTY","INSURANCE"]},"risk":{"type":"string","maxLength":4000},"issuer":{"type":"string","maxLength":4000},"terms":{"type":"string","maxLength":4000},"exclusions":{"type":"string","maxLength":4000},"overlapGroup":{"type":"string","maxLength":4000},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"renewal":{"enum":["NOT_REQUIRED","CONFIRMED","UNCONFIRMED"]},"claim":{"enum":["CONDITIONAL","DENIED","UNKNOWN"]},"recovery":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"delayDays":{"anyOf":[{"type":"integer","minimum":0,"maximum":3650},{"type":"null"}]}}}},"cash":{"type":"object","required":["opening","delayMonths","months"],"properties":{"opening":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"delayMonths":{"type":"integer","minimum":0,"maximum":24},"months":{"type":"array","maxItems":100,"items":{"type":"object","required":["month","receipts","outflows","evidence"],"properties":{"month":{"type":"integer","minimum":1,"maximum":100},"receipts":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"outflows":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"evidence":{"type":"string","maxLength":4000}}}}}},"capabilityEvidence":{"type":"array","maxItems":100,"items":{"type":"object","required":["profileId","version","capabilityId","description","source","expires"],"properties":{"profileId":{"type":"string","maxLength":4000},"version":{"type":"integer","minimum":1,"maximum":1000000},"capabilityId":{"type":"string","maxLength":4000},"description":{"type":"string","maxLength":4000},"source":{"type":"string","maxLength":4000},"expires":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}}}}}}},"loss":{"type":"object","required":["risk","date","amount","remedyWithinDays","evidence"],"properties":{"risk":{"type":"string","maxLength":4000},"date":{"type":"string","format":"date"},"amount":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remedyWithinDays":{"type":"integer","minimum":0,"maximum":3650},"evidence":{"type":"string","maxLength":4000}}},"lots":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","delivery","coordination","evidence"],"properties":{"id":{"type":"string","maxLength":4000},"description":{"type":"string","maxLength":4000},"delivery":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"coordination":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"evidence":{"type":"string","maxLength":4000}}}}}}}}}}}},"/api/v1/delivery/competition/evaluate":{"post":{"summary":"Recompute SME evidence actions, conditional coverage, delayed cash and comparable premiums; no automatic award","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","mode","classification","title","revision","parentFingerprint","correction","procurementReference","applicability","basis","selection","requirements","suppliers","loss","lots"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"classification":{"enum":["PUBLIC","RESTRICTED","SYNTHETIC"]},"title":{"type":"string","maxLength":4000},"revision":{"type":"integer","minimum":1,"maximum":100000},"parentFingerprint":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"correction":{"type":"string","maxLength":4000},"procurementReference":{"type":"string","maxLength":4000},"applicability":{"type":"object","required":["buyer","jurisdiction","category","vehicle","asOf","policyReference","policyFrom","policyTo"],"properties":{"buyer":{"type":"string","maxLength":4000},"jurisdiction":{"type":"string","maxLength":4000},"category":{"enum":["CONSTRUCTION","IT_SERVICES"]},"vehicle":{"type":"string","maxLength":4000},"asOf":{"type":"string","format":"date"},"policyReference":{"type":"string","maxLength":4000},"policyFrom":{"type":"string","format":"date"},"policyTo":{"type":"string","format":"date"}}},"basis":{"type":"object","required":["scope","horizonMonths","currency","taxBasis","priceDate"],"properties":{"scope":{"type":"string","maxLength":4000},"horizonMonths":{"type":"integer","minimum":1,"maximum":100},"currency":{"enum":["CAD"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"}}},"selection":{"type":"object","required":["method","criteriaReference","stage","proofProtocol"],"properties":{"method":{"enum":["LOWEST_RESPONSIVE_PRICE","WEIGHTED_VALUE","LIFECYCLE_VALUE","PHASED"]},"criteriaReference":{"type":"string","maxLength":4000},"stage":{"enum":["PRE_TENDER","OPEN","CLOSED"]},"proofProtocol":{"type":"string","maxLength":4000},"proofApplicability":{"enum":["APPLICABLE","NOT_APPLICABLE","UNASSESSED"]},"takeoverApplicability":{"enum":["APPLICABLE","NOT_APPLICABLE","UNASSESSED"]},"proofBasis":{"type":"string","maxLength":4000},"takeoverBasis":{"type":"string","maxLength":4000}}},"requirements":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","clause","necessity","alternative","statutory","disposition","buyerResponse","source"],"properties":{"id":{"type":"string","maxLength":4000},"clause":{"type":"string","maxLength":4000},"necessity":{"type":"string","maxLength":4000},"alternative":{"type":"string","maxLength":4000},"statutory":{"type":"boolean"},"disposition":{"enum":["PENDING","RETAIN","REVISE"]},"buyerResponse":{"type":"string","maxLength":4000},"source":{"type":"string","maxLength":4000}}}},"suppliers":{"type":"array","maxItems":10,"items":{"type":"object","required":["id","name","size","sizeEvidence","team","capabilityReference","basis","requirements","costs","proof","takeover","instruments","cash"],"properties":{"id":{"type":"string","maxLength":4000},"name":{"type":"string","maxLength":4000},"size":{"enum":["UNKNOWN","DECLARED_SME","VERIFIED_SME","OTHER"]},"sizeEvidence":{"type":"string","maxLength":4000},"team":{"type":"string","maxLength":4000},"capabilityReference":{"type":"string","maxLength":4000},"basis":{"type":"object","required":["scope","horizonMonths","currency","taxBasis","priceDate"],"properties":{"scope":{"type":"string","maxLength":4000},"horizonMonths":{"type":"integer","minimum":1,"maximum":100},"currency":{"enum":["CAD"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"}}},"requirements":{"type":"array","maxItems":100,"items":{"type":"object","required":["requirementId","status","evidence"],"properties":{"requirementId":{"type":"string","maxLength":4000},"status":{"enum":["SUPPORTED","GAP","UNKNOWN"]},"evidence":{"type":"string","maxLength":4000}}}},"costs":{"type":"array","maxItems":100,"items":{"type":"object","required":["kind","amount","basis","source"],"properties":{"kind":{"enum":["DELIVERY","OPERATIONS","ASSURANCE","BUYER_COORDINATION","TRANSITION"]},"amount":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"enum":["QUOTE","ASSUMPTION","UNKNOWN"]},"source":{"type":"string","maxLength":4000}}}},"proof":{"type":"object","required":["protocol","budget","continuation","result","assessor","evidence","attribution"],"properties":{"protocol":{"type":"string","maxLength":4000},"budget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"continuation":{"type":"string","maxLength":4000},"result":{"enum":["PASS","FAIL","NOT_TESTED"]},"assessor":{"type":"string","maxLength":4000},"evidence":{"type":"string","maxLength":4000},"attribution":{"enum":["SUPPLIER","BUYER","SHARED","UNRESOLVED"]}}},"takeover":{"type":"object","required":["result","team","artifacts","rights","evidence","hours","cost"],"properties":{"result":{"enum":["PASS","FAIL","NOT_TESTED"]},"team":{"type":"string","maxLength":4000},"artifacts":{"type":"string","maxLength":4000},"rights":{"type":"string","maxLength":4000},"evidence":{"type":"string","maxLength":4000},"hours":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"cost":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}},"instruments":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","kind","risk","issuer","terms","exclusions","overlapGroup","start","end","renewal","claim","recovery","delayDays"],"properties":{"id":{"type":"string","maxLength":4000},"kind":{"enum":["BID","PERFORMANCE","PAYMENT","WARRANTY","INSURANCE"]},"risk":{"type":"string","maxLength":4000},"issuer":{"type":"string","maxLength":4000},"terms":{"type":"string","maxLength":4000},"exclusions":{"type":"string","maxLength":4000},"overlapGroup":{"type":"string","maxLength":4000},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"renewal":{"enum":["NOT_REQUIRED","CONFIRMED","UNCONFIRMED"]},"claim":{"enum":["CONDITIONAL","DENIED","UNKNOWN"]},"recovery":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"delayDays":{"anyOf":[{"type":"integer","minimum":0,"maximum":3650},{"type":"null"}]}}}},"cash":{"type":"object","required":["opening","delayMonths","months"],"properties":{"opening":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"delayMonths":{"type":"integer","minimum":0,"maximum":24},"months":{"type":"array","maxItems":100,"items":{"type":"object","required":["month","receipts","outflows","evidence"],"properties":{"month":{"type":"integer","minimum":1,"maximum":100},"receipts":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"outflows":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"evidence":{"type":"string","maxLength":4000}}}}}},"capabilityEvidence":{"type":"array","maxItems":100,"items":{"type":"object","required":["profileId","version","capabilityId","description","source","expires"],"properties":{"profileId":{"type":"string","maxLength":4000},"version":{"type":"integer","minimum":1,"maximum":1000000},"capabilityId":{"type":"string","maxLength":4000},"description":{"type":"string","maxLength":4000},"source":{"type":"string","maxLength":4000},"expires":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}}}}}}},"loss":{"type":"object","required":["risk","date","amount","remedyWithinDays","evidence"],"properties":{"risk":{"type":"string","maxLength":4000},"date":{"type":"string","format":"date"},"amount":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remedyWithinDays":{"type":"integer","minimum":0,"maximum":3650},"evidence":{"type":"string","maxLength":4000}}},"lots":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","delivery","coordination","evidence"],"properties":{"id":{"type":"string","maxLength":4000},"description":{"type":"string","maxLength":4000},"delivery":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"coordination":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"evidence":{"type":"string","maxLength":4000}}}}}}}}},"responses":{"201":{"description":"Reproducible advisory calculation; no official qualification or score","content":{"application/json":{"schema":{"type":"object","required":["methodVersion","fingerprint","packet","policyInPeriod","clarifications","suppliers","premiums","lots","renewalActions"],"properties":{"methodVersion":{"const":"sme-competition-1"},"fingerprint":{"type":"string"},"packet":{"type":"object","required":["schemaVersion","mode","classification","title","revision","parentFingerprint","correction","procurementReference","applicability","basis","selection","requirements","suppliers","loss","lots"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"classification":{"enum":["PUBLIC","RESTRICTED","SYNTHETIC"]},"title":{"type":"string","maxLength":4000},"revision":{"type":"integer","minimum":1,"maximum":100000},"parentFingerprint":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"correction":{"type":"string","maxLength":4000},"procurementReference":{"type":"string","maxLength":4000},"applicability":{"type":"object","required":["buyer","jurisdiction","category","vehicle","asOf","policyReference","policyFrom","policyTo"],"properties":{"buyer":{"type":"string","maxLength":4000},"jurisdiction":{"type":"string","maxLength":4000},"category":{"enum":["CONSTRUCTION","IT_SERVICES"]},"vehicle":{"type":"string","maxLength":4000},"asOf":{"type":"string","format":"date"},"policyReference":{"type":"string","maxLength":4000},"policyFrom":{"type":"string","format":"date"},"policyTo":{"type":"string","format":"date"}}},"basis":{"type":"object","required":["scope","horizonMonths","currency","taxBasis","priceDate"],"properties":{"scope":{"type":"string","maxLength":4000},"horizonMonths":{"type":"integer","minimum":1,"maximum":100},"currency":{"enum":["CAD"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"}}},"selection":{"type":"object","required":["method","criteriaReference","stage","proofProtocol"],"properties":{"method":{"enum":["LOWEST_RESPONSIVE_PRICE","WEIGHTED_VALUE","LIFECYCLE_VALUE","PHASED"]},"criteriaReference":{"type":"string","maxLength":4000},"stage":{"enum":["PRE_TENDER","OPEN","CLOSED"]},"proofProtocol":{"type":"string","maxLength":4000},"proofApplicability":{"enum":["APPLICABLE","NOT_APPLICABLE","UNASSESSED"]},"takeoverApplicability":{"enum":["APPLICABLE","NOT_APPLICABLE","UNASSESSED"]},"proofBasis":{"type":"string","maxLength":4000},"takeoverBasis":{"type":"string","maxLength":4000}}},"requirements":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","clause","necessity","alternative","statutory","disposition","buyerResponse","source"],"properties":{"id":{"type":"string","maxLength":4000},"clause":{"type":"string","maxLength":4000},"necessity":{"type":"string","maxLength":4000},"alternative":{"type":"string","maxLength":4000},"statutory":{"type":"boolean"},"disposition":{"enum":["PENDING","RETAIN","REVISE"]},"buyerResponse":{"type":"string","maxLength":4000},"source":{"type":"string","maxLength":4000}}}},"suppliers":{"type":"array","maxItems":10,"items":{"type":"object","required":["id","name","size","sizeEvidence","team","capabilityReference","basis","requirements","costs","proof","takeover","instruments","cash"],"properties":{"id":{"type":"string","maxLength":4000},"name":{"type":"string","maxLength":4000},"size":{"enum":["UNKNOWN","DECLARED_SME","VERIFIED_SME","OTHER"]},"sizeEvidence":{"type":"string","maxLength":4000},"team":{"type":"string","maxLength":4000},"capabilityReference":{"type":"string","maxLength":4000},"basis":{"type":"object","required":["scope","horizonMonths","currency","taxBasis","priceDate"],"properties":{"scope":{"type":"string","maxLength":4000},"horizonMonths":{"type":"integer","minimum":1,"maximum":100},"currency":{"enum":["CAD"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"}}},"requirements":{"type":"array","maxItems":100,"items":{"type":"object","required":["requirementId","status","evidence"],"properties":{"requirementId":{"type":"string","maxLength":4000},"status":{"enum":["SUPPORTED","GAP","UNKNOWN"]},"evidence":{"type":"string","maxLength":4000}}}},"costs":{"type":"array","maxItems":100,"items":{"type":"object","required":["kind","amount","basis","source"],"properties":{"kind":{"enum":["DELIVERY","OPERATIONS","ASSURANCE","BUYER_COORDINATION","TRANSITION"]},"amount":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"basis":{"enum":["QUOTE","ASSUMPTION","UNKNOWN"]},"source":{"type":"string","maxLength":4000}}}},"proof":{"type":"object","required":["protocol","budget","continuation","result","assessor","evidence","attribution"],"properties":{"protocol":{"type":"string","maxLength":4000},"budget":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"continuation":{"type":"string","maxLength":4000},"result":{"enum":["PASS","FAIL","NOT_TESTED"]},"assessor":{"type":"string","maxLength":4000},"evidence":{"type":"string","maxLength":4000},"attribution":{"enum":["SUPPLIER","BUYER","SHARED","UNRESOLVED"]}}},"takeover":{"type":"object","required":["result","team","artifacts","rights","evidence","hours","cost"],"properties":{"result":{"enum":["PASS","FAIL","NOT_TESTED"]},"team":{"type":"string","maxLength":4000},"artifacts":{"type":"string","maxLength":4000},"rights":{"type":"string","maxLength":4000},"evidence":{"type":"string","maxLength":4000},"hours":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"cost":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}},"instruments":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","kind","risk","issuer","terms","exclusions","overlapGroup","start","end","renewal","claim","recovery","delayDays"],"properties":{"id":{"type":"string","maxLength":4000},"kind":{"enum":["BID","PERFORMANCE","PAYMENT","WARRANTY","INSURANCE"]},"risk":{"type":"string","maxLength":4000},"issuer":{"type":"string","maxLength":4000},"terms":{"type":"string","maxLength":4000},"exclusions":{"type":"string","maxLength":4000},"overlapGroup":{"type":"string","maxLength":4000},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"renewal":{"enum":["NOT_REQUIRED","CONFIRMED","UNCONFIRMED"]},"claim":{"enum":["CONDITIONAL","DENIED","UNKNOWN"]},"recovery":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"delayDays":{"anyOf":[{"type":"integer","minimum":0,"maximum":3650},{"type":"null"}]}}}},"cash":{"type":"object","required":["opening","delayMonths","months"],"properties":{"opening":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"delayMonths":{"type":"integer","minimum":0,"maximum":24},"months":{"type":"array","maxItems":100,"items":{"type":"object","required":["month","receipts","outflows","evidence"],"properties":{"month":{"type":"integer","minimum":1,"maximum":100},"receipts":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"outflows":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"evidence":{"type":"string","maxLength":4000}}}}}},"capabilityEvidence":{"type":"array","maxItems":100,"items":{"type":"object","required":["profileId","version","capabilityId","description","source","expires"],"properties":{"profileId":{"type":"string","maxLength":4000},"version":{"type":"integer","minimum":1,"maximum":1000000},"capabilityId":{"type":"string","maxLength":4000},"description":{"type":"string","maxLength":4000},"source":{"type":"string","maxLength":4000},"expires":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}}}}}}},"loss":{"type":"object","required":["risk","date","amount","remedyWithinDays","evidence"],"properties":{"risk":{"type":"string","maxLength":4000},"date":{"type":"string","format":"date"},"amount":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"remedyWithinDays":{"type":"integer","minimum":0,"maximum":3650},"evidence":{"type":"string","maxLength":4000}}},"lots":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","description","delivery","coordination","evidence"],"properties":{"id":{"type":"string","maxLength":4000},"description":{"type":"string","maxLength":4000},"delivery":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"coordination":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"evidence":{"type":"string","maxLength":4000}}}}}},"policyInPeriod":{"type":"boolean"},"clarifications":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","draft","draftFr","statutory"],"properties":{"id":{"type":"string"},"draft":{"type":"string"},"draftFr":{"type":"string"},"statutory":{"type":"boolean"}}}},"suppliers":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","total","comparable","actions","cash","coverage"],"properties":{"id":{"type":"string"},"total":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{4}$"},{"type":"null"}]},"comparable":{"type":"boolean"},"actions":{"type":"array","maxItems":1000,"items":{"type":"string"}},"cash":{"type":"object","required":["minimum","shortfall","firstNegativeMonth","balances"],"properties":{"minimum":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]},"shortfall":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{4}$"},{"type":"null"}]},"firstNegativeMonth":{"anyOf":[{"type":"integer","minimum":0,"maximum":124},{"type":"null"}]},"balances":{"type":"array","maxItems":124,"items":{"type":"object","required":["month","amount"],"properties":{"month":{"type":"integer","minimum":1,"maximum":124},"amount":{"anyOf":[{"type":"string","pattern":"^-?\\d+\\.\\d{4}$"},{"type":"null"}]}}}}}},"coverage":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","state","reason","recovery","uncovered","timely"],"properties":{"id":{"type":"string"},"state":{"enum":["CONDITIONAL","NOT_COVERED","UNKNOWN"]},"reason":{"type":"string","maxLength":4000},"recovery":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"uncovered":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"timely":{"anyOf":[{"type":"boolean"},{"type":"null"}]}}}}}}},"premiums":{"type":"array","maxItems":100,"items":{"type":"object","required":["lowerId","higherId","amount","question"],"properties":{"lowerId":{"type":"string"},"higherId":{"type":"string"},"amount":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{4}$"},{"type":"null"}]},"question":{"type":"string"}}}},"lots":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","total"],"properties":{"id":{"type":"string"},"total":{"anyOf":[{"type":"string","pattern":"^\\d+\\.\\d{4}$"},{"type":"null"}]}}}},"renewalActions":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":4000}}}}}}},"400":{"description":"Invalid evidence, dates, references, decimal, schema or required fields"}}}},"/api/v1/services-cost/template":{"get":{"summary":"Services workbook v1: labelled demonstration or empty live rates","parameters":[{"name":"mode","in":"query","schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Editable services workbook","content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","mode","title","scope","currency","taxBasis","priceDate","horizonYears","discountRatePercent","alternatives"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"title":{"type":"string","maxLength":4000},"scope":{"type":"string","maxLength":4000},"currency":{"const":"CAD"},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"},"horizonYears":{"type":"integer","minimum":1,"maximum":30},"discountRatePercent":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"alternatives":{"type":"array","maxItems":10,"items":{"type":"object","required":["id","name","model","qualityEvidence","resources"],"properties":{"id":{"type":"string","maxLength":4000},"name":{"type":"string","maxLength":4000},"model":{"enum":["IN_HOUSE","SERVICE_PROVIDER","SAAS","MIXED"]},"qualityEvidence":{"type":"string","maxLength":4000},"resources":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","costKey","label","category","quantity","unit","rateBasis","overheadPercent","rateLow","rateHigh","years","evidenceBasis","source","rationale"],"properties":{"id":{"type":"string","maxLength":4000},"costKey":{"type":"string","maxLength":4000},"label":{"type":"string","maxLength":4000},"category":{"enum":["IMPLEMENTATION","SUPPORT","INTEGRATION","LICENCE","BUYER_LABOUR","TRANSITION","OTHER"]},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"unit":{"type":"string","maxLength":4000},"rateBasis":{"enum":["BASE","LOADED","BILLED"]},"overheadPercent":{"type":"string"},"rateLow":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rateHigh":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"years":{"type":"string","pattern":"^\\d+(\\s*,\\s*\\d+)*$"},"evidenceBasis":{"enum":["QUOTE","ASSUMPTION"]},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string","maxLength":4000},"title":{"type":"string","maxLength":4000},"locator":{"type":"string","maxLength":4000},"excerpt":{"type":"string","maxLength":4000},"observedDate":{"type":"string","format":"date"}}},"rationale":{"type":"string","maxLength":4000}}}}}}}}}}}}}}},"/api/v1/services-cost/evaluate":{"post":{"summary":"Stateless exact services-cost v1 calculation; no invented rates or realized savings","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["schemaVersion","mode","title","scope","currency","taxBasis","priceDate","horizonYears","discountRatePercent","alternatives"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"title":{"type":"string","maxLength":4000},"scope":{"type":"string","maxLength":4000},"currency":{"const":"CAD"},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"},"horizonYears":{"type":"integer","minimum":1,"maximum":30},"discountRatePercent":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"alternatives":{"type":"array","maxItems":10,"items":{"type":"object","required":["id","name","model","qualityEvidence","resources"],"properties":{"id":{"type":"string","maxLength":4000},"name":{"type":"string","maxLength":4000},"model":{"enum":["IN_HOUSE","SERVICE_PROVIDER","SAAS","MIXED"]},"qualityEvidence":{"type":"string","maxLength":4000},"resources":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","costKey","label","category","quantity","unit","rateBasis","overheadPercent","rateLow","rateHigh","years","evidenceBasis","source","rationale"],"properties":{"id":{"type":"string","maxLength":4000},"costKey":{"type":"string","maxLength":4000},"label":{"type":"string","maxLength":4000},"category":{"enum":["IMPLEMENTATION","SUPPORT","INTEGRATION","LICENCE","BUYER_LABOUR","TRANSITION","OTHER"]},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"unit":{"type":"string","maxLength":4000},"rateBasis":{"enum":["BASE","LOADED","BILLED"]},"overheadPercent":{"type":"string"},"rateLow":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rateHigh":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"years":{"type":"string","pattern":"^\\d+(\\s*,\\s*\\d+)*$"},"evidenceBasis":{"enum":["QUOTE","ASSUMPTION"]},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string","maxLength":4000},"title":{"type":"string","maxLength":4000},"locator":{"type":"string","maxLength":4000},"excerpt":{"type":"string","maxLength":4000},"observedDate":{"type":"string","format":"date"}}},"rationale":{"type":"string","maxLength":4000}}}}}}}}}}}},"responses":{"201":{"description":"Normalized workbook, lifecycle line build-ups, exact nominal/discounted ranges, unknown costs and nullable comparison differences. Method services-cost-1 and SHA-256 input fingerprint.","content":{"application/json":{"schema":{"type":"object","required":["methodVersion","fingerprint","workbook","alternatives","totals","comparisons","note"],"properties":{"methodVersion":{"const":"services-cost-1"},"fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$"},"workbook":{"type":"object","required":["schemaVersion","mode","title","scope","currency","taxBasis","priceDate","horizonYears","discountRatePercent","alternatives"],"properties":{"schemaVersion":{"const":1},"mode":{"enum":["LIVE","SYNTHETIC"]},"title":{"type":"string","maxLength":4000},"scope":{"type":"string","maxLength":4000},"currency":{"const":"CAD"},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"priceDate":{"type":"string","format":"date"},"horizonYears":{"type":"integer","minimum":1,"maximum":30},"discountRatePercent":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"alternatives":{"type":"array","maxItems":10,"items":{"type":"object","required":["id","name","model","qualityEvidence","resources"],"properties":{"id":{"type":"string","maxLength":4000},"name":{"type":"string","maxLength":4000},"model":{"enum":["IN_HOUSE","SERVICE_PROVIDER","SAAS","MIXED"]},"qualityEvidence":{"type":"string","maxLength":4000},"resources":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","costKey","label","category","quantity","unit","rateBasis","overheadPercent","rateLow","rateHigh","years","evidenceBasis","source","rationale"],"properties":{"id":{"type":"string","maxLength":4000},"costKey":{"type":"string","maxLength":4000},"label":{"type":"string","maxLength":4000},"category":{"enum":["IMPLEMENTATION","SUPPORT","INTEGRATION","LICENCE","BUYER_LABOUR","TRANSITION","OTHER"]},"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"unit":{"type":"string","maxLength":4000},"rateBasis":{"enum":["BASE","LOADED","BILLED"]},"overheadPercent":{"type":"string"},"rateLow":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"rateHigh":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"years":{"type":"string","pattern":"^\\d+(\\s*,\\s*\\d+)*$"},"evidenceBasis":{"enum":["QUOTE","ASSUMPTION"]},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string","maxLength":4000},"title":{"type":"string","maxLength":4000},"locator":{"type":"string","maxLength":4000},"excerpt":{"type":"string","maxLength":4000},"observedDate":{"type":"string","format":"date"}}},"rationale":{"type":"string","maxLength":4000}}}}}}}}},"alternatives":{"type":"array","maxItems":10,"items":{"type":"object"}},"totals":{"type":"array","maxItems":10,"items":{"type":"object"}},"comparisons":{"type":"array","maxItems":9,"items":{"type":"object"}},"note":{"type":"string","maxLength":4000}}}}}},"400":{"description":"Invalid or incompatible input; overlapping cost/year, double overhead, synthetic source in live or missing evidence"}}}},"/reconciliation":{"get":{"summary":"Cross-source award suggestions, active groups and retained decision history","parameters":[{"in":"query","name":"mode","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractWorkspace"}}}},"400":{"description":"Invalid mode"}}},"post":{"summary":"Review, re-review or release a contract group","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractDecisionInput"}}}},"responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractDecision"}}}},"400":{"description":"Invalid members or decision"},"404":{"description":"Record or group missing"},"409":{"description":"Stale revision/version, overlap or idempotency conflict"}}}},"/source-onboarding/municipal-pilots":{"get":{"summary":"Explicit Toronto and Montréal pilot identity, policy context and expansion recipes","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}}}}},"/source-onboarding/municipal-pilots/{id}":{"get":{"summary":"Reproduce up to 20 retained native LIVE windows and reconcile pilot counts without writes","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object","required":["version","pilot","status","windows","evidenceHash"],"properties":{"version":{"const":"1.0"},"status":{"enum":["PARTIAL_SOURCE_COVERAGE","NO_NATIVE_EVIDENCE"]},"currentRecords":{"type":"integer","minimum":0},"observedSourceKeys":{"type":"integer","minimum":0},"windowKeysPresentNow":{"type":"integer","minimum":0},"omittedWindows":{"type":"integer","minimum":0},"evidenceHash":{"type":"string"},"policyPacks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"family":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveTo":{"type":"string"},"policyType":{"type":"string"}}}},"policyReadiness":{"type":"object","required":["catalogHash","examined","assessedCurrent","rows","omittedRecords","note"],"properties":{"catalogHash":{"type":"string"},"examined":{"type":"integer","minimum":0},"assessedCurrent":{"type":"integer","minimum":0},"omittedRecords":{"type":"integer","minimum":0},"note":{"type":"string"},"rows":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","title","packIds","status","missing"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"publishedDate":{"type":"string"},"packIds":{"type":"array","items":{"type":"string"}},"status":{"enum":["NEEDS_FACTS","RETAINED_ASSESSMENT","STALE_ASSESSMENT"]},"missing":{"type":"array","items":{"type":"string"}},"assessmentId":{"type":"string"},"results":{"type":"array","items":{"$ref":"#/components/schemas/PolicyResult"}}}}}}},"windows":{"type":"array","maxItems":20,"items":{"type":"object"}}}}}}},"404":{"description":"Unknown pilot"}}}},"/source-onboarding":{"get":{"summary":"National source access, native receipts, buyer mappings and retained review history","responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/source-onboarding/reviews":{"post":{"summary":"Retain an evidenced source access observation","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceReviewInput"}}}},"responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input or unsupported qualification"},"404":{"description":"Source or mapping not found"},"409":{"description":"Version, idempotency or effective-date conflict"}}}},"/source-onboarding/buyers":{"post":{"summary":"Create an effective-dated buyer mapping or append a version","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuyerMappingInput"}}}},"responses":{"201":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input or unsupported qualification"},"404":{"description":"Source or mapping not found"},"409":{"description":"Version, idempotency or effective-date conflict"}}}},"/source-onboarding/{sourceId}/template":{"get":{"summary":"Fictional smaller-municipality canonical onboarding recipe","parameters":[{"in":"path","name":"sourceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"jurisdiction","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Unknown province/territory"},"404":{"description":"Unknown source"}}}},"/procurements/{id}/source-history":{"get":{"summary":"Bounded retained CanadaBuys observations, without summing amendments or qualifying uploaded files as publisher access","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retained observations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceHistoryReport"}}}},"404":{"description":"Procurement has no structured source contract"}}}},"/sources/{id}/file-receipt":{"get":{"summary":"Reconcile a LIVE user-supplied native CSV; does not establish publisher acquisition","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativeSourceReceipt"}}}},"404":{"description":"Unknown source"}}}},"/sources/{id}/native-receipt":{"get":{"summary":"Reconcile the latest retained native publisher capture; LIVE only, not a national coverage claim","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Native capture receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativeSourceReceipt"}}}},"404":{"description":"Unknown source"}}}},"/registry/lookups":{"post":{"summary":"Capture bilingual federal registry evidence; live requests use the official endpoint, synthetic payloads stay labelled","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identifier","mode"],"properties":{"identifier":{"type":"string","pattern":"^\\d{1,9}$"},"mode":{"enum":["LIVE","SYNTHETIC"]},"payloads":{"type":"array","minItems":2,"maxItems":2,"description":"Synthetic mode only: English and French official-shaped payloads","items":{}}}}}}},"responses":{"201":{"description":"Retained registry evidence or reviewer link","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid identifier, mode, evidence or dates"},"404":{"description":"Unknown supplier/evidence"},"409":{"description":"Stale version, conflicting dates or idempotency key"}}}},"/registry/links":{"post":{"summary":"Append a dated, reversible supplier registry decision; source supplier groups stay unchanged","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["supplierId","observationId","status","effectiveFrom","expectedVersion","reviewer","reason","idempotencyKey"],"properties":{"id":{"type":"string"},"supplierId":{"type":"string"},"observationId":{"type":"string"},"status":{"enum":["LINKED","WITHDRAWN"]},"effectiveFrom":{"type":"string","format":"date"},"effectiveTo":{"type":["string","null"],"format":"date"},"expectedVersion":{"type":"integer","minimum":0},"reviewer":{"type":"string"},"reason":{"type":"string"},"idempotencyKey":{"type":"string"}}}}}},"responses":{"201":{"description":"Retained registry evidence or reviewer link","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid identifier, mode, evidence or dates"},"404":{"description":"Unknown supplier/evidence"},"409":{"description":"Stale version, conflicting dates or idempotency key"}}}},"/suppliers/{id}/registry":{"get":{"summary":"Latest decisions, full history, observations and active links on an effective date","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"asOf","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Retained registry evidence or reviewer link","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid date"},"404":{"description":"Unknown supplier"}}}},"/registry/observations/{id}":{"get":{"summary":"Exact captured responses and SHA-256 integrity verification","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retained registry evidence or reviewer link","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Unknown observation"},"409":{"description":"Evidence integrity mismatch"}}}},"/ml/identity/demo":{"get":{"summary":"Download 200 fictional supplier pairs; synthetic pipeline qualification only","responses":{"200":{"description":"Input v1.0, always SYNTHETIC","content":{"application/json":{"schema":{"type":"object","required":["version","dataMode","cutoff","reviewer","examples"],"properties":{"version":{"enum":["1.0"]},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"cutoff":{"type":"string","format":"date"},"reviewer":{"type":"string","minLength":1,"maxLength":1000},"examples":{"type":"array","minItems":4,"maxItems":1000,"items":{"type":"object","required":["id","observedDate","left","right","leftEntity","rightEntity","label","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":1000},"observedDate":{"type":"string","format":"date"},"left":{"type":"string","minLength":1,"maxLength":1000},"right":{"type":"string","minLength":1,"maxLength":1000},"leftEntity":{"type":"string","minLength":1,"maxLength":1000},"rightEntity":{"type":"string","minLength":1,"maxLength":1000},"label":{"type":"string","enum":["MATCH","DISTINCT"]},"evidence":{"type":"string","minLength":1,"maxLength":1000}}}}}}}}}}}},"/ml/identity/benchmark":{"post":{"summary":"Stateless reviewed-pair benchmark v1.1; no workspace writes or model deployment","description":"Training observations precede cutoff; holdout observations are on/after cutoff. Both classes and disjoint entities required in both splits. Candidate scores are uncalibrated. Download the input and report to retain an experiment. Runtime costs vary between replays.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["version","dataMode","cutoff","reviewer","examples"],"properties":{"version":{"enum":["1.0"]},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"cutoff":{"type":"string","format":"date"},"reviewer":{"type":"string","minLength":1,"maxLength":1000},"examples":{"type":"array","minItems":4,"maxItems":1000,"items":{"type":"object","required":["id","observedDate","left","right","leftEntity","rightEntity","label","evidence"],"properties":{"id":{"type":"string","minLength":1,"maxLength":1000},"observedDate":{"type":"string","format":"date"},"left":{"type":"string","minLength":1,"maxLength":1000},"right":{"type":"string","minLength":1,"maxLength":1000},"leftEntity":{"type":"string","minLength":1,"maxLength":1000},"rightEntity":{"type":"string","minLength":1,"maxLength":1000},"label":{"type":"string","enum":["MATCH","DISTINCT"]},"evidence":{"type":"string","minLength":1,"maxLength":1000}}}}}}}}},"responses":{"200":{"description":"Report v1.1 with dataset hash, split, fitted weights, baseline/candidate confusion matrices, costs, decision, and per-pair names, features, predictions and evidence","content":{"application/json":{"schema":{"type":"object","required":["version","datasetHash","model","baseline","candidate","predictions","decision","cost"],"properties":{"version":{"enum":["1.1"]},"datasetHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"decision":{"type":"object","properties":{"action":{"enum":["RETAIN_BASELINE","REVIEW_CANDIDATE"]},"deployed":{"enum":[false]}}}}}}}},"400":{"description":"Invalid labels, evidence, dates, split, repeated pairs, entity leakage or interactive size limit"}}}},"/value":{"get":{"summary":"Selected-mode price evidence, stale-aware retained comparisons and latest time studies","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Retained evidence / comparison / measurement","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/value/templates/{id}":{"get":{"summary":"Explicitly fictional price template for a synthetic procurement","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retained evidence / comparison / measurement","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Live procurement cannot receive fictional template"}}}},"/value/prices":{"post":{"summary":"Append versioned line-price evidence; explicit declarations, not inferred award unit prices","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["procurementId","mode","expectedVersion","status","reviewer","rationale","sourceReference","lines","idempotencyKey"],"properties":{"mode":{"enum":["LIVE","SYNTHETIC"]},"expectedVersion":{"type":"integer","minimum":0},"status":{"enum":["ACTIVE","WITHDRAWN"]},"reviewer":{"type":"string"},"rationale":{"type":"string"},"idempotencyKey":{"type":"string"},"procurementId":{"type":"string"},"sourceReference":{"type":"string"},"lines":{"type":"array","maxItems":500,"items":{"type":"object","required":["id","specification","unit","quantity","unitPrice","currency","taxBasis","geography","observedDate","kind","sourceAnchor"],"properties":{"id":{"type":"string"},"specification":{"type":"string"},"unit":{"type":"string"},"quantity":{"type":"string","pattern":"^\\d+(\\.\\d{1,3})?$"},"unitPrice":{"type":"string","pattern":"^\\d+(\\.\\d{1,4})?$"},"currency":{"type":"string"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]},"geography":{"type":"string"},"observedDate":{"type":"string","format":"date"},"kind":{"enum":["BID","AWARD","INVOICE"]},"sourceAnchor":{"type":"string"}}}}}}}}},"responses":{"201":{"description":"Retained evidence / comparison / measurement","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence or scope"},"404":{"description":"Unknown evidence or procurement"},"409":{"description":"Stale version or reused idempotency key"}}}},"/value/comparisons":{"post":{"summary":"Retain deterministic exact-peer comparison; insufficient inputs never produce a savings number","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["evidenceId","lineId"],"properties":{"evidenceId":{"type":"string"},"lineId":{"type":"string"}}}}}},"responses":{"201":{"description":"Retained evidence / comparison / measurement","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence or scope"},"404":{"description":"Unknown evidence or procurement"},"409":{"description":"Stale version or reused idempotency key"}}}},"/value/time-studies":{"post":{"summary":"Append paired analyst-time evidence with explicit failures, sample floors and task order","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode","expectedVersion","status","cohort","task","trials","reviewer","rationale","idempotencyKey"],"properties":{"mode":{"enum":["LIVE","SYNTHETIC"]},"expectedVersion":{"type":"integer","minimum":0},"status":{"enum":["ACTIVE","WITHDRAWN"]},"reviewer":{"type":"string"},"rationale":{"type":"string"},"idempotencyKey":{"type":"string"},"id":{"type":"string"},"cohort":{"type":"string"},"task":{"enum":["SEARCH","EVIDENCE","TRIAGE"]},"trials":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","required":["id","participant","taskReference","manualSeconds","platformSeconds","manualSucceeded","platformSucceeded","order","evidence"],"properties":{"id":{"type":"string"},"participant":{"type":"string"},"observationKind":{"enum":["HUMAN_OBSERVED","AGENT_SIMULATION","SYNTHETIC","UNSPECIFIED"],"description":"Omission is UNSPECIFIED for live trials and excluded from human savings summaries."},"taskReference":{"type":"string"},"manualSeconds":{"type":"integer","minimum":1,"maximum":86400},"platformSeconds":{"type":"integer","minimum":1,"maximum":86400},"manualSucceeded":{"type":"boolean"},"platformSucceeded":{"type":"boolean"},"order":{"enum":["MANUAL_FIRST","PLATFORM_FIRST"]},"evidence":{"type":"string"}}}}}}}}},"responses":{"201":{"description":"Retained evidence / comparison / measurement","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence or scope"},"404":{"description":"Unknown evidence or procurement"},"409":{"description":"Stale version or reused idempotency key"}}}},"/value/prices/{id}/history":{"get":{"summary":"All retained price evidence versions for a procurement","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retained evidence / comparison / measurement","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/value/time-studies/{id}/history":{"get":{"summary":"Retained study versions, including withdrawal","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retained evidence / comparison / measurement","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/opportunity-reviews":{"get":{"summary":"Latest selected-mode reviewer evidence, including internal/withdrawn records; no affiliate propagation","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string","minLength":1}},{"name":"supplierId","in":"query","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Opportunity evidence v1; retained procurement revision, exact identity, sources, screening prompts and stale status","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}},"post":{"summary":"Append an immutable fair-opportunity v1 review; optimistic revision and idempotency checks","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode","procurementId","procurementRevision","procurementHash","expectedVersion","idempotencyKey","visibility","status","reviewer","rationale","outcomes","requirements","funnel"],"properties":{"mode":{"enum":["LIVE","SYNTHETIC"]},"procurementId":{"type":"string","minLength":1},"procurementRevision":{"type":"integer","minimum":0},"procurementHash":{"type":"string","minLength":1},"expectedVersion":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string","minLength":1},"visibility":{"enum":["PUBLIC","INTERNAL"]},"status":{"enum":["ACTIVE","WITHDRAWN"]},"reviewer":{"type":"string","minLength":1},"rationale":{"type":"string","minLength":1},"outcomes":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","phase","supplierId","role","identityEvidence","date","obligation","observation","outcome","attribution","evidenceClass","findingStatus","supplierResponse","responseSource","remedy","source"],"properties":{"id":{"type":"string","minLength":1},"phase":{"type":"string","minLength":1},"supplierId":{"type":"string","minLength":1},"role":{"enum":["PRIME","SUBCONTRACTOR"]},"identityEvidence":{"type":"string","minLength":1},"date":{"type":"string","format":"date"},"obligation":{"type":"string","minLength":1},"observation":{"type":"string","minLength":1},"outcome":{"enum":["MET","MISSED","REMEDIATED","UNKNOWN"]},"attribution":{"enum":["SUPPLIER","BUYER","SHARED","UNRESOLVED"]},"evidenceClass":{"enum":["AUDIT","ADJUDICATED","BUYER_REPORT","SUPPLIER_REPORT","PARLIAMENTARY","SYNTHETIC"]},"findingStatus":{"enum":["REPORTED","DISPUTED","CORRECTED","WITHDRAWN"]},"supplierResponse":{"type":"string","minLength":1},"responseSource":{"anyOf":[{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string","minLength":1,"description":"HTTP(S) source; synthetic: permitted only for synthetic data"},"title":{"type":"string","minLength":1},"locator":{"type":"string","minLength":1},"excerpt":{"type":"string","minLength":1},"observedDate":{"type":"string","format":"date"}}},{"type":"null"}]},"remedy":{"type":"string","minLength":1},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string","minLength":1,"description":"HTTP(S) source; synthetic: permitted only for synthetic data"},"title":{"type":"string","minLength":1},"locator":{"type":"string","minLength":1},"excerpt":{"type":"string","minLength":1},"observedDate":{"type":"string","format":"date"}}}}}},"requirements":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","clause","kind","category","necessity","alternative","decision","buyerResponse","applicability","policyReference","source"],"properties":{"id":{"type":"string","minLength":1},"clause":{"type":"string","minLength":1},"kind":{"enum":["MANDATORY","SCORED"]},"category":{"enum":["EXPERIENCE","FINANCIAL","BRAND","BUNDLING","LOCATION","TIMELINE","TEAM","TECHNICAL","OTHER"]},"necessity":{"type":"string","minLength":1},"alternative":{"type":"string","minLength":1},"decision":{"enum":["PENDING","RETAIN","REVISE","REMOVE"]},"buyerResponse":{"type":"string","minLength":1},"applicability":{"enum":["UNASSESSED","APPLICABLE","NOT_APPLICABLE"]},"policyReference":{"type":"string","minLength":1},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string","minLength":1,"description":"HTTP(S) source; synthetic: permitted only for synthetic data"},"title":{"type":"string","minLength":1},"locator":{"type":"string","minLength":1},"excerpt":{"type":"string","minLength":1},"observedDate":{"type":"string","format":"date"}}}}}},"funnel":{"type":"object","required":["coverage","submitted","mandatoryPassed","technicalPassed","explanation","source"],"properties":{"coverage":{"enum":["UNKNOWN","PARTIAL","COMPLETE"]},"submitted":{"type":["integer","null"],"minimum":0},"mandatoryPassed":{"type":["integer","null"],"minimum":0},"technicalPassed":{"type":["integer","null"],"minimum":0},"explanation":{"type":"string","minLength":1},"source":{"anyOf":[{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string","minLength":1,"description":"HTTP(S) source; synthetic: permitted only for synthetic data"},"title":{"type":"string","minLength":1},"locator":{"type":"string","minLength":1},"excerpt":{"type":"string","minLength":1},"observedDate":{"type":"string","format":"date"}}},{"type":"null"}]}}}}}}}},"responses":{"201":{"description":"Opportunity evidence v1; retained procurement revision, exact identity, sources, screening prompts and stale status","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence, source, identity, count or synthetic/live boundary"},"404":{"description":"Unknown selected-mode procurement"},"409":{"description":"Stale review/procurement or reused idempotency key"}}}},"/public/opportunity-reviews":{"get":{"summary":"Latest ACTIVE PUBLIC reviews only; a later internal or withdrawn revision suppresses previous public versions","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string","minLength":1}},{"name":"supplierId","in":"query","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Opportunity evidence v1; retained procurement revision, exact identity, sources, screening prompts and stale status","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}}},"/opportunity-reviews/{id}/history":{"get":{"summary":"Retained review versions for a procurement and dataset","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Opportunity evidence v1; retained procurement revision, exact identity, sources, screening prompts and stale status","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}}},"/opportunity-reviews/{id}/template":{"get":{"summary":"Current revision template; live starts blank, synthetic may include clearly fictional examples","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Opportunity evidence v1; retained procurement revision, exact identity, sources, screening prompts and stale status","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}}},"/lifecycle":{"get":{"summary":"Latest selected-mode lifecycle scenarios","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Lifecycle v1 retained scenario, exact priced ranges, unknown/excluded costs, baseline premiums and independently evaluated assurance options","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}},"post":{"summary":"Append lifecycle/assurance v1 scenario; exact four-place arithmetic, pinned procurement and optimistic revision checks","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["procurementId","mode","expectedVersion","procurementRevision","procurementHash","idempotencyKey","status","visibility","reviewer","rationale","scope","currency","taxBasis","horizonYears","baseYear","discountRatePercent","alternatives","assurance"],"properties":{"procurementId":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]},"expectedVersion":{"type":"integer","minimum":0},"procurementRevision":{"type":"integer","minimum":0},"procurementHash":{"type":"string"},"idempotencyKey":{"type":"string"},"status":{"enum":["ACTIVE","WITHDRAWN"]},"visibility":{"enum":["PUBLIC","INTERNAL"]},"reviewer":{"type":"string"},"rationale":{"type":"string"},"scope":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"horizonYears":{"type":"integer","minimum":1,"maximum":30},"baseYear":{"type":"integer","minimum":1900,"maximum":2200},"discountRatePercent":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"alternatives":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"object","required":["id","name","kind","scope","qualityEvidence","lines"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"enum":["ACTUAL_BID","COUNTERFACTUAL","CONTINUITY_BASELINE"]},"scope":{"type":"string"},"qualityEvidence":{"type":"string"},"lines":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["id","costKey","label","category","treatment","amountLow","amountHigh","years","source","rationale"],"properties":{"id":{"type":"string"},"costKey":{"type":"string"},"label":{"type":"string"},"category":{"enum":["IMPLEMENTATION","SUPPORT","INTEGRATION","LICENCE","BUYER_LABOUR","TRANSITION","OTHER"]},"treatment":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]},"direction":{"enum":["COST","CREDIT"],"default":"COST"},"estimateBasis":{"anyOf":[{"type":"null"},{"type":"object","required":["quantity","unit","rateLow","rateHigh"],"properties":{"quantity":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"unit":{"type":"string"},"rateLow":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"rateHigh":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"}}}]},"amountLow":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"amountHigh":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"years":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"integer","minimum":0}},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}},"rationale":{"type":"string"}}}}}}},"assurance":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","label","instrument","deliveryExposure","faceValue","recoverableAmount","supplierCashTied","financingRatePercent","days","overlapGroup","conditions","source"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"instrument":{"enum":["ADVANCE","BOND","LETTER_OF_CREDIT","RETENTION","MILESTONE"]},"deliveryExposure":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"faceValue":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"recoverableAmount":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"supplierCashTied":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"financingRatePercent":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"days":{"type":"integer","minimum":0,"maximum":3650},"overlapGroup":{"type":"string"},"conditions":{"type":"string"},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}}}}}}}}}},"responses":{"201":{"description":"Lifecycle v1 retained scenario, exact priced ranges, unknown/excluded costs, baseline premiums and independently evaluated assurance options","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid or incompatible cost, scope, source or assurance assumptions"},"404":{"description":"Unknown selected-mode procurement"},"409":{"description":"Stale revision or reused idempotency key"}}}},"/public/lifecycle":{"get":{"summary":"Latest ACTIVE PUBLIC scenarios only; no internal scenario or historical publication fallback","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Lifecycle v1 retained scenario, exact priced ranges, unknown/excluded costs, baseline premiums and independently evaluated assurance options","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}}},"/lifecycle/{id}/template":{"get":{"summary":"Blank live or fictional synthetic scenario using current procurement/review versions","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lifecycle v1 retained scenario, exact priced ranges, unknown/excluded costs, baseline premiums and independently evaluated assurance options","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}}},"/lifecycle/{id}/history":{"get":{"summary":"Retained scenario history with deterministic v1 calculation","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lifecycle v1 retained scenario, exact priced ranges, unknown/excluded costs, baseline premiums and independently evaluated assurance options","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown procurement"}}}},"/agreements":{"get":{"summary":"Latest agreement reviews; original bytes, exact clauses, obligations, coverage and revision changes","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}},"post":{"summary":"Retain agreement v1; extraction reruns and obligations must cite exact clause IDs","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["procurementId","mode","expectedVersion","procurementRevision","procurementHash","idempotencyKey","status","reviewer","rationale","documents","obligations","missingAnnexes","precedence","completeness"],"properties":{"procurementId":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]},"expectedVersion":{"type":"integer","minimum":0},"procurementRevision":{"type":"integer","minimum":0},"procurementHash":{"type":"string"},"idempotencyKey":{"type":"string"},"status":{"enum":["ACTIVE","WITHDRAWN"]},"reviewer":{"type":"string"},"rationale":{"type":"string"},"documents":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"object","required":["id","name","kind","order","format","content","source"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"enum":["BASE","AMENDMENT","ANNEX"]},"order":{"type":"integer","minimum":0},"format":{"enum":["TEXT","PDF","DOCX"]},"content":{"type":"string","maxLength":1400000,"description":"Original text for TEXT, canonical base64 for PDF/DOCX; maximum 1 MB decoded bytes. No OCR is performed."},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}}}}},"obligations":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","clauseId","description","owner","dueDate","measure","proposedWording","disposition","rationale"],"properties":{"id":{"type":"string"},"clauseId":{"type":"string"},"description":{"type":"string"},"owner":{"enum":["BUYER","SUPPLIER","SHARED"]},"dueDate":{"type":["string","null"],"format":"date"},"measure":{"type":"string"},"proposedWording":{"type":"string"},"disposition":{"enum":["PENDING","ACCEPTED","REJECTED"]},"rationale":{"type":"string"}}}},"missingAnnexes":{"type":"array","maxItems":100,"items":{"type":"string"}},"precedence":{"type":"string"},"completeness":{"enum":["DECLARED_COMPLETE","INCOMPLETE"]}}}}}},"responses":{"201":{"description":"Retained v1 evidence or calculated preview; no external procurement/payment action","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence, scope, measurement or document"},"404":{"description":"Unknown procurement"},"409":{"description":"Stale source/review or conflicting idempotency key"}}}},"/agreements/extract":{"post":{"summary":"Stateless TEXT/PDF/DOCX extraction preview; does not interpret legal adequacy","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["documents"],"properties":{"documents":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"object","required":["id","name","kind","order","format","content","source"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"enum":["BASE","AMENDMENT","ANNEX"]},"order":{"type":"integer","minimum":0},"format":{"enum":["TEXT","PDF","DOCX"]},"content":{"type":"string","maxLength":1400000,"description":"Original text for TEXT, canonical base64 for PDF/DOCX; maximum 1 MB decoded bytes. No OCR is performed."},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}}}}}}}}}},"responses":{"201":{"description":"Retained v1 evidence or calculated preview; no external procurement/payment action","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence, scope, measurement or document"},"404":{"description":"Unknown procurement"},"409":{"description":"Stale source/review or conflicting idempotency key"}}}},"/agreements/{id}/template":{"get":{"summary":"Selected-mode agreement template","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/agreements/{id}/history":{"get":{"summary":"Exact agreement versions and original source content","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/agreements/benchmark/demo":{"get":{"summary":"Synthetic grouped topic-label benchmark","responses":{"200":{"description":"Declared examples, not independently verified labels"}}}},"/agreements/benchmark":{"post":{"summary":"Deterministic topic detection with buyer/template-disjoint holdout; no model deployment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["examples"],"properties":{"examples":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","buyer","template","partition","text","expected","evidence"],"properties":{"id":{"type":"string"},"buyer":{"type":"string"},"template":{"type":"string"},"partition":{"enum":["DEVELOPMENT","HOLDOUT"]},"text":{"type":"string"},"expected":{"type":"array","maxItems":100,"items":{"type":"string"}},"evidence":{"type":"string"}}}}}}}}},"responses":{"201":{"description":"Retained v1 evidence or calculated preview; no external procurement/payment action","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence, scope, measurement or document"},"404":{"description":"Unknown procurement"},"409":{"description":"Stale source/review or conflicting idempotency key"}}}},"/delivery":{"get":{"summary":"Latest delivery plans, acceptance results, linked invoice checks and paid-pilot decisions","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}},"post":{"summary":"Retain delivery v1; accepted obligations, exact measures, invoice scope and paid budget checks","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["procurementId","mode","expectedVersion","procurementRevision","procurementHash","idempotencyKey","status","reviewer","rationale","agreementId","agreementVersion","currency","taxBasis","milestones","pilot"],"properties":{"procurementId":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]},"expectedVersion":{"type":"integer","minimum":0},"procurementRevision":{"type":"integer","minimum":0},"procurementHash":{"type":"string"},"idempotencyKey":{"type":"string"},"status":{"enum":["ACTIVE","WITHDRAWN"]},"reviewer":{"type":"string"},"rationale":{"type":"string"},"agreementId":{"type":"string"},"agreementVersion":{"type":"integer","minimum":0},"currency":{"type":"string"},"taxBasis":{"enum":["INCLUDED","EXCLUDED"]},"milestones":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","obligationId","title","dueDate","dependency","dependencyEvidence","amount","measures","decision","decisionReason","overrideReason","invoice"],"properties":{"id":{"type":"string"},"obligationId":{"type":"string"},"title":{"type":"string"},"dueDate":{"type":"string","format":"date"},"dependency":{"enum":["READY","BUYER_INPUT_PENDING","SUPPLIER_INPUT_PENDING","UNKNOWN"]},"dependencyEvidence":{"type":"string"},"amount":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"measures":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","name","unit","operator","target","observed","source"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string"},"operator":{"enum":["AT_LEAST","AT_MOST","EQUAL"]},"target":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"observed":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"source":{"anyOf":[{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}},{"type":"null"}]}}}},"decision":{"enum":["PENDING","ACCEPT","RETEST","STOP"]},"decisionReason":{"type":"string"},"overrideReason":{"type":["string","null"]},"invoice":{"anyOf":[{"type":"object","required":["importId","invoiceId"],"properties":{"importId":{"type":"string"},"invoiceId":{"type":"string"}}},{"type":"null"}]}}}},"pilot":{"type":"object","required":["paid","budgetCap","continuationCriteria","decision","rationale","lotStrategy","coordinationCost","supplierProfileId","supplierProfileVersion","capabilityMatches","bidHours","hourlyCost"],"properties":{"paid":{"const":true},"budgetCap":{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},"continuationCriteria":{"type":"string"},"decision":{"enum":["PENDING","CONTINUE","RETEST","STOP"]},"rationale":{"type":"string"},"lotStrategy":{"enum":["SINGLE","MODULAR","CONSORTIUM"]},"coordinationCost":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"supplierProfileId":{"type":["string","null"]},"supplierProfileVersion":{"type":["integer","null"]},"capabilityMatches":{"type":"array","maxItems":100,"items":{"type":"object","required":["requirement","capabilityId","assessment","rationale"],"properties":{"requirement":{"type":"string"},"capabilityId":{"type":["string","null"]},"assessment":{"enum":["SUPPORTED","GAP","UNKNOWN"]},"rationale":{"type":"string"}}}},"bidHours":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"hourlyCost":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]}}}}}}}},"responses":{"201":{"description":"Retained v1 evidence or calculated preview; no external procurement/payment action","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence, scope, measurement or document"},"404":{"description":"Unknown procurement"},"409":{"description":"Stale source/review or conflicting idempotency key"}}}},"/delivery/{id}/template":{"get":{"summary":"Prepare milestones only after an active agreement has an accepted obligation","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/delivery/{id}/history":{"get":{"summary":"Retained acceptance and pilot decision versions","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/capabilities":{"get":{"summary":"Latest selected-mode reusable supplier capability profiles","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}},"post":{"summary":"Version capability evidence without inferring SME status or bidder qualification","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode","expectedVersion","idempotencyKey","supplierId","name","smeStatus","statusEvidence","capabilities","supportPlan","portabilityPlan","reviewer","rationale"],"properties":{"mode":{"enum":["LIVE","SYNTHETIC"]},"expectedVersion":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string"},"supplierId":{"type":"string"},"name":{"type":"string"},"smeStatus":{"enum":["UNKNOWN","DECLARED","VERIFIED"]},"statusEvidence":{"type":"string"},"capabilities":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","capability","source","expires"],"properties":{"id":{"type":"string"},"capability":{"type":"string"},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}},"expires":{"type":["string","null"],"format":"date"}}}},"supportPlan":{"type":"string"},"portabilityPlan":{"type":"string"},"reviewer":{"type":"string"},"rationale":{"type":"string"}}}}}},"responses":{"201":{"description":"Retained v1 evidence or calculated preview; no external procurement/payment action","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence, scope, measurement or document"},"404":{"description":"Unknown procurement"},"409":{"description":"Stale source/review or conflicting idempotency key"}}}},"/capabilities/template":{"get":{"summary":"Blank live or explicitly fictional reusable capability template","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/capabilities/{id}/history":{"get":{"summary":"Exact supplier profile history; pinned plans retain original profile versions","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/award-explanations":{"get":{"summary":"Latest analyst award explanations and pinned cost/outcome references","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}},"post":{"summary":"Retain award explanation v1; mandatory criteria separate from weights and unknown award rationale explicit","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["procurementId","mode","expectedVersion","procurementRevision","procurementHash","idempotencyKey","status","reviewer","rationale","visibility","need","awardBasis","awardReason","premiumReason","decisionRole","decisionSource","criteriaCoverage","criteria","timeline","missingEvidence","lifecycleId","lifecycleVersion","outcomeReviewId","outcomeReviewVersion"],"properties":{"procurementId":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]},"expectedVersion":{"type":"integer","minimum":0},"procurementRevision":{"type":"integer","minimum":0},"procurementHash":{"type":"string"},"idempotencyKey":{"type":"string"},"status":{"enum":["ACTIVE","WITHDRAWN"]},"reviewer":{"type":"string"},"rationale":{"type":"string"},"visibility":{"enum":["PUBLIC","INTERNAL"]},"need":{"type":"string"},"awardBasis":{"enum":["PUBLISHED_DECISION","REVIEWER_EXPLANATION","NOT_AVAILABLE"]},"awardReason":{"type":"string"},"premiumReason":{"type":"string"},"decisionRole":{"type":"string"},"decisionSource":{"anyOf":[{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}},{"type":"null"}]},"selectionMethod":{"enum":["UNKNOWN","LOWEST_RESPONSIVE_PRICE","WEIGHTED_VALUE","OTHER"],"description":"Optional; legacy omitted method remains UNKNOWN. Lowest responsive price permits complete mandatory-only criteria."},"selectionBasis":{"anyOf":[{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}},{"type":"null"}]},"criteriaCoverage":{"enum":["COMPLETE","PARTIAL","UNKNOWN"]},"criteria":{"type":"array","maxItems":100,"items":{"type":"object","required":["id","title","kind","weightPercent","source"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"kind":{"enum":["MANDATORY","SCORED"]},"weightPercent":{"anyOf":[{"type":"string","pattern":"^\\d{1,14}(\\.\\d{1,4})?$"},{"type":"null"}]},"source":{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}}}}},"timeline":{"type":"array","maxItems":100,"items":{"type":"object","required":["stage","date","explanation","source"],"properties":{"stage":{"enum":["NEED","TENDER","QUALIFICATION","EVALUATION","AWARD","DELIVERY","CHANGE","RENEWAL"]},"date":{"type":["string","null"],"format":"date"},"explanation":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["url","title","locator","excerpt","observedDate"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"locator":{"type":"string"},"excerpt":{"type":"string"},"observedDate":{"type":"string","format":"date"}}},{"type":"null"}]}}}},"missingEvidence":{"type":"array","maxItems":100,"items":{"type":"string"}},"lifecycleId":{"type":["string","null"]},"lifecycleVersion":{"type":["integer","null"]},"outcomeReviewId":{"type":["string","null"]},"outcomeReviewVersion":{"type":["integer","null"]}}}}}},"responses":{"201":{"description":"Retained v1 evidence or calculated preview; no external procurement/payment action","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid evidence, scope, measurement or document"},"404":{"description":"Unknown procurement"},"409":{"description":"Stale source/review or conflicting idempotency key"}}}},"/award-explanations/{id}/template":{"get":{"summary":"Source-bound explanation template; unknown rationale and bid evidence stay unknown","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/award-explanations/{id}/history":{"get":{"summary":"Analyst explanation version history","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/public/award-explanations":{"get":{"summary":"Only latest ACTIVE PUBLIC explanations; later internal/withdrawn linked evidence is withheld","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"procurementId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/public/award-explanations/{id}/history":{"get":{"summary":"Published explanation revisions only while the current explanation remains public/active","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned review records and explicit completeness/stale states","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid dataset"},"404":{"description":"Unknown selected-mode subject"}}}},"/rule-qualification/contracts":{"get":{"summary":"All R001–R018 required-input contracts, implementation availability and scoring families","responses":{"200":{"description":"Versioned rule contracts, retained source eligibility or replay result","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/rule-qualification":{"get":{"summary":"Retained reports by data mode","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Versioned rule contracts, retained source eligibility or replay result","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"Pin source records, rule version and per-source eligibility; no alerts or empirical-accuracy claim","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filter"],"properties":{"filter":{"$ref":"#/components/schemas/ProcurementFilter"},"ruleVersionId":{"type":"string"}}}}}},"responses":{"201":{"description":"Versioned rule contracts, retained source eligibility or replay result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid filter or explicit report size limit exceeded"},"404":{"description":"Rule version not found"}}}},"/rule-qualification/{id}":{"get":{"summary":"Exact retained inputs, configuration, results, coverage gaps and source evidence","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned rule contracts, retained source eligibility or replay result","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Report not found"}}}},"/rule-qualification/{id}/replay":{"post":{"summary":"Replay retained records and configuration without current sources or alerts","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Versioned rule contracts, retained source eligibility or replay result","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Report not found"},"409":{"description":"Input hash or method version mismatch"}}}},"/internal-backtests":{"get":{"summary":"List retained reports in one data mode","parameters":[{"name":"mode","in":"query","required":true,"schema":{"enum":["LIVE","SYNTHETIC"]}}],"responses":{"200":{"description":"Retained internal source report or replay result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid mode"}}},"post":{"summary":"Retain selected imports, source eligibility and reviewed label comparisons without creating alerts","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode","protocol","labels"],"properties":{"mode":{"enum":["LIVE","SYNTHETIC"]},"sourceId":{"type":"string"},"importIds":{"type":"array","maxItems":200,"uniqueItems":true,"items":{"type":"string"}},"protocol":{"type":"object","required":["population","selectionRationale","labelProtocol"],"properties":{"population":{"type":"string"},"selectionRationale":{"type":"string"},"labelProtocol":{"type":"string"}}},"labels":{"type":"array","maxItems":2000,"items":{"type":"object","required":["importId","ruleId","expected","reviewer","evidenceReference","reason"],"properties":{"importId":{"type":"string"},"ruleId":{"type":"string"},"expected":{"enum":["TRIGGERED","NOT_TRIGGERED","INSUFFICIENT_DATA"]},"reviewer":{"type":"string"},"evidenceReference":{"type":"string"},"reason":{"type":"string"}}}}}}}}},"responses":{"201":{"description":"Retained internal source report or replay result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid selection/labels, duplicate procurement versions, or explicit report bound exceeded"}}}},"/internal-backtests/{id}":{"get":{"summary":"Export retained imports, policy evidence, labels and source metrics","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Retained internal source report or replay result","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Report not found"}}}},"/internal-backtests/{id}/replay":{"post":{"summary":"Replay pinned evidence and compare exact retained results","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Retained internal source report or replay result","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Report not found"},"409":{"description":"Integrity or method mismatch"}}}}},"components":{"schemas":{"DomainEvent":{"type":"object","required":["dataMode","version","sequence","id","recordedAt","domain","recordId","operation","previousHash","currentHash"],"properties":{"dataMode":{"enum":["LIVE","SYNTHETIC","UNKNOWN"]},"version":{"const":"1.0"},"sequence":{"type":"integer","minimum":0},"id":{"type":"string"},"recordedAt":{"type":"string","format":"date-time"},"domain":{"type":"string"},"recordId":{"type":"string"},"operation":{"enum":["CREATED","UPDATED","REMOVED"]},"previousHash":{"type":["string","null"]},"currentHash":{"type":["string","null"]}}},"DomainOutboxReport":{"type":"object","required":["version","startedAt","eventCount","latestSequence","events","nextAfter","consumers","note"],"properties":{"version":{"const":"1.0"},"startedAt":{"type":"string","format":"date-time"},"eventCount":{"type":"integer","minimum":0},"latestSequence":{"type":"integer","minimum":0},"events":{"type":"array","items":{"$ref":"#/components/schemas/DomainEvent"}},"nextAfter":{"type":["integer","null"]},"consumers":{"type":"array","items":{"type":"object","required":["name","startAfter","pending","leased","delivered","dead","deadLetters"],"properties":{"name":{"type":"string"},"startAfter":{"type":"integer","minimum":0},"pending":{"type":"integer","minimum":0},"leased":{"type":"integer","minimum":0},"delivered":{"type":"integer","minimum":0},"dead":{"type":"integer","minimum":0},"deadLetters":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"integer","minimum":0},"attempts":{"type":"integer","minimum":0},"failureCode":{"enum":["CONSUMER_FAILED","LEASE_EXPIRED"]}}}}}}},"note":{"type":"string"}}},"StorageReconciliation":{"type":"object","required":["version","storage","status","checkedAt","workspaceRevision","workspaceRecords","projectionRecords","missing","mismatched","unexpected","sample","note"],"properties":{"version":{"const":"1.0"},"storage":{"enum":["LOCAL_FILE_POC","POSTGRES_SINGLE_WRITER_POC"]},"status":{"enum":["NOT_APPLICABLE","RECONCILED","DRIFT"]},"checkedAt":{"type":"string","format":"date-time"},"workspaceRevision":{"type":["integer","null"],"minimum":0},"workspaceRecords":{"type":"integer","minimum":0},"projectionRecords":{"type":["integer","null"],"minimum":0},"missing":{"type":["integer","null"],"minimum":0},"mismatched":{"type":["integer","null"],"minimum":0},"unexpected":{"type":["integer","null"],"minimum":0},"sample":{"type":"object","required":["missing","mismatched","unexpected"],"properties":{"missing":{"type":"array","maxItems":20,"items":{"type":"string"}},"mismatched":{"type":"array","maxItems":20,"items":{"type":"string"}},"unexpected":{"type":"array","maxItems":20,"items":{"type":"string"}}}},"note":{"type":"string"}}},"ProcurementFilter":{"type":"object","required":["mode"],"properties":{"q":{"type":"string"},"level":{"type":"string"},"jurisdiction":{"type":"string"},"source":{"type":"string"},"buyerId":{"type":"string"},"category":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]}}},"PolicyFacts":{"type":"object","properties":{"governmentLevel":{"enum":["FEDERAL","PROVINCIAL","TERRITORIAL","MUNICIPAL"]},"jurisdictionCode":{"type":"string"},"buyerId":{"type":"string"},"sourceId":{"type":"string"},"valuationReference":{"type":"string"},"buyerEntityType":{"enum":["DEPARTMENT","MUNICIPALITY","CROWN","BROADER_PUBLIC_SECTOR"]},"category":{"enum":["GOODS","SERVICES","CONSTRUCTION"]},"tenderDate":{"type":"string","format":"date"},"dateBasis":{"enum":["TENDER_PUBLICATION"]},"valuationBasis":{"enum":["ESTIMATED_MAXIMUM_WITH_OPTIONS","REVIEWED_MUNICIPAL_EXPENDITURE"]},"estimatedValue":{"type":"object","properties":{"amount":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,2})?$"},"currency":{"type":"string"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN","NET_OF_REBATES"]}},"required":["amount","currency","taxBasis"]},"coverage":{"enum":["CONFIRMED","EXCLUDED","UNKNOWN"]},"coverageReference":{"type":"string"},"context":{"enum":["ORDINARY","EMERGENCY","DIRECT_AWARD","FRAMEWORK_CALL_UP","SET_ASIDE","UNKNOWN"]}},"required":["governmentLevel","jurisdictionCode","buyerId","coverage","context"]},"PolicyPack":{"type":"object","properties":{"family":{"type":"string"},"title":{"type":"string"},"instrument":{"type":"string"},"policyType":{"enum":["TRADE_COVERAGE","COMPETITION","PUBLICATION","DELEGATION"]},"governmentLevel":{"enum":["FEDERAL","PROVINCIAL","TERRITORIAL","MUNICIPAL"]},"jurisdictionCode":{"type":"string"},"buyerEntityType":{"enum":["DEPARTMENT","MUNICIPALITY","CROWN","BROADER_PUBLIC_SECTOR"]},"buyerId":{"type":"string"},"buyerIdPrefix":{"type":"string"},"sourceId":{"type":"string"},"comparison":{"enum":["GTE","GT"]},"effectiveFrom":{"type":"string","format":"date"},"effectiveTo":{"type":"string","format":"date"},"dateBasis":{"enum":["TENDER_PUBLICATION"]},"valuationBasis":{"enum":["ESTIMATED_MAXIMUM_WITH_OPTIONS","REVIEWED_MUNICIPAL_EXPENDITURE"]},"taxBasis":{"enum":["INCLUDED","EXCLUDED","REVIEW_REQUIRED"]},"currency":{"enum":["CAD"]},"thresholds":{"type":"object","properties":{"GOODS":{"type":"string"},"SERVICES":{"type":"string"},"CONSTRUCTION":{"type":"string"}},"required":["GOODS","SERVICES","CONSTRUCTION"]},"sources":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string","format":"uri"},"locator":{"type":"string"}},"required":["title","url","locator"]}},"limitations":{"type":"string"},"author":{"type":"string"},"id":{"type":"string"},"createdAt":{"type":"string"}},"required":["family","title","instrument","policyType","governmentLevel","jurisdictionCode","buyerEntityType","effectiveFrom","effectiveTo","dateBasis","valuationBasis","taxBasis","currency","thresholds","sources","limitations","author","id","createdAt"]},"PolicyResult":{"type":"object","properties":{"family":{"type":"string"},"packIds":{"type":"array","items":{"type":"string"}},"status":{"enum":["AT_OR_ABOVE","BELOW","ABOVE","AT_OR_BELOW","UNKNOWN","NOT_APPLICABLE"]},"threshold":{"type":["string","null"]},"currency":{"type":["string","null"]},"explanation":{"type":"string"}},"required":["family","packIds","status","threshold","currency","explanation"]},"PolicyAssessment":{"type":"object","properties":{"id":{"type":"string"},"procurement":{"$ref":"#/components/schemas/Procurement"},"facts":{"$ref":"#/components/schemas/PolicyFacts"},"results":{"type":"array","items":{"$ref":"#/components/schemas/PolicyResult"}},"packs":{"type":"array","items":{"$ref":"#/components/schemas/PolicyPack"}},"catalogHash":{"type":"string"},"reviewer":{"type":"string"},"reason":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","procurement","facts","results","packs","catalogHash","reviewer","reason","createdAt"]},"PolicyPreview":{"type":"object","properties":{"id":{"type":"string"},"packId":{"type":"string"},"catalogHash":{"type":"string"},"createdAt":{"type":"string"},"rows":{"type":"array","items":{"type":"object","properties":{"facts":{"$ref":"#/components/schemas/PolicyFacts"},"before":{"type":"array","items":{"$ref":"#/components/schemas/PolicyResult"}},"after":{"type":"array","items":{"$ref":"#/components/schemas/PolicyResult"}}},"required":["facts","before","after"]}}},"required":["id","packId","catalogHash","createdAt","rows"]},"CostReport":{"type":"object","properties":{"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"currency":{"type":"string"},"coverage":{"enum":["PARTIAL","COMPLETE"]},"entries":{"type":"array","items":{"type":"object","properties":{"category":{"enum":["HOSTING","STORAGE","EGRESS","API","OTHER"]},"funding":{"enum":["PAID","DONATED"]},"amount":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,2})?$"},"evidenceReference":{"type":"string"}},"required":["category","funding","amount","evidenceReference"]},"minItems":1,"maxItems":100},"reviewer":{"type":"string"},"note":{"type":"string"},"id":{"type":"string"},"version":{"type":"integer"},"createdAt":{"type":"string"}},"required":["month","currency","coverage","entries","reviewer","note","id","version","createdAt"]},"CostSummary":{"type":"object","properties":{"month":{"type":"string"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/CostReport"}},"totals":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"paid":{"type":"string"},"donated":{"type":"string"},"coverage":{"enum":["PARTIAL","COMPLETE"]},"per1000ProcessedRecords":{"type":["string","null"]},"perReviewedCase":{"type":["string","null"]},"perPublicSearch":{"type":["string","null"]}},"required":["currency","paid","donated","coverage","per1000ProcessedRecords","perReviewedCase","perPublicSearch"]}},"denominators":{"type":"object","properties":{"processedRecords":{"type":"integer"},"reviewedCases":{"type":"integer"},"publicSearches":{"type":"integer"},"searchMeterStartedAt":{"type":["string","null"]}},"required":["processedRecords","reviewedCases","publicSearches","searchMeterStartedAt"]},"notes":{"type":"array","items":{"type":"string"}}},"required":["month","reports","totals","denominators","notes"]},"Feedback":{"type":"object","properties":{"id":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"procurement":{"$ref":"#/components/schemas/Procurement"},"kind":{"enum":["CORRECTION","IDEA","PROBLEM"]},"summary":{"type":"string"},"evidenceReference":{"type":"string"},"status":{"enum":["OPEN","IN_REVIEW","RESOLVED","DECLINED"]},"version":{"type":"integer"},"createdAt":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"status":{"type":"string"},"reviewer":{"type":"string"},"note":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["at","status","reviewer","note","evidenceReference"]}}},"required":["id","dataMode","kind","summary","evidenceReference","status","version","createdAt","events"]},"ContractDecisionInput":{"type":"object","required":["mode","action","expectedVersion","reviewer","rationale","evidence","idempotencyKey"],"properties":{"mode":{"enum":["LIVE","SYNTHETIC"]},"action":{"enum":["LINK","RELEASE"]},"groupId":{"type":"string"},"expectedVersion":{"type":"integer","minimum":0},"members":{"type":"array","minItems":2,"maxItems":20,"items":{"type":"object","required":["id","revision"],"properties":{"id":{"type":"string"},"revision":{"type":"integer","minimum":0}}}},"representativeId":{"type":"string"},"amountSourceId":{"type":"string","nullable":true},"reviewer":{"type":"string"},"rationale":{"type":"string"},"evidence":{"type":"string"},"idempotencyKey":{"type":"string"}},"description":"LINK requires current same-mode award members, one per source, representativeId and amountSourceId (null means unresolved). RELEASE requires an active groupId. Both require optimistic expectedVersion and retain immutable evidence."},"ContractDecision":{"type":"object","properties":{"id":{"type":"string"},"groupId":{"type":"string"},"version":{"type":"integer","minimum":0},"action":{"enum":["LINK","RELEASE"]},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"members":{"type":"array","items":{"$ref":"#/components/schemas/Procurement"}},"representativeId":{"type":"string"},"amountSourceId":{"type":"string","nullable":true},"reviewer":{"type":"string"},"rationale":{"type":"string"},"evidence":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"idempotencyKey":{"type":"string"},"requestHash":{"type":"string"}}},"ContractWorkspace":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"decision":{"$ref":"#/components/schemas/ContractDecision"},"members":{"type":"array","items":{"$ref":"#/components/schemas/Procurement"}},"stale":{"type":"boolean"},"conflicts":{"type":"array","items":{"type":"string"}}}}},"candidates":{"type":"array","items":{"type":"object","properties":{"left":{"$ref":"#/components/schemas/Procurement"},"right":{"$ref":"#/components/schemas/Procurement"},"reasons":{"type":"array","items":{"type":"string"}}}}},"candidateLimit":{"type":"integer","minimum":0},"candidatesTruncated":{"type":"boolean"},"history":{"type":"array","items":{"$ref":"#/components/schemas/ContractDecision"}},"scope":{"type":"string"}}},"SourceReviewInput":{"type":"object","required":["sourceId","expectedVersion","status","accessMethod","observedAt","evidenceUrl","rationale","reviewer","idempotencyKey"],"properties":{"sourceId":{"type":"string"},"expectedVersion":{"type":"integer","minimum":0},"status":{"enum":["PARTIAL","UNAVAILABLE","NOT_ONBOARDED"]},"accessMethod":{"enum":["BULK","PUBLIC_PORTAL","CANONICAL_UPLOAD"]},"observedAt":{"type":"string","format":"date"},"evidenceUrl":{"type":"string","format":"uri"},"rationale":{"type":"string"},"reviewer":{"type":"string"},"runId":{"type":"string"},"httpStatus":{"type":"integer","minimum":100,"maximum":599},"idempotencyKey":{"type":"string"}}},"BuyerMappingInput":{"type":"object","required":["sourceId","sourceBuyerName","buyerId","buyerName","governmentLevel","jurisdictionCode","entityType","effectiveFrom","effectiveTo","reviewer","evidence","expectedVersion","idempotencyKey"],"properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"sourceBuyerName":{"type":"string"},"buyerId":{"type":"string"},"buyerName":{"type":"string"},"governmentLevel":{"enum":["FEDERAL","PROVINCIAL","TERRITORIAL","MUNICIPAL"]},"jurisdictionCode":{"type":"string"},"entityType":{"enum":["DEPARTMENT","MUNICIPALITY","CROWN","BROADER_PUBLIC_SECTOR"]},"effectiveFrom":{"type":"string","format":"date"},"effectiveTo":{"type":"string","format":"date"},"parentBuyerId":{"type":"string"},"participatingBuyerIds":{"type":"array","items":{"type":"string"}},"policyFamily":{"type":"string"},"reviewer":{"type":"string"},"evidence":{"type":"string"},"expectedVersion":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string"}}},"SourceQuality":{"type":"object","properties":{"schemaFields":{"type":"array","items":{"type":"string"}},"parsed":{"type":"integer","minimum":0},"duplicateSourceKeys":{"type":"integer","minimum":0},"mappingVersion":{"type":"string"},"missing":{"type":"object","properties":{"amount":{"type":"integer","minimum":0},"supplier":{"type":"integer","minimum":0},"awardDate":{"type":"integer","minimum":0},"bidderCount":{"type":"integer","minimum":0}}}}},"SourceContract":{"type":"object","required":["number","amendmentNumber","amendmentType","instrumentType","currencyBasis"],"properties":{"number":{"type":"string"},"reference":{"type":"string"},"amendmentNumber":{"type":"string"},"amendmentType":{"type":"string"},"instrumentType":{"type":"string"},"entryValue":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]{1,2})?$"},"cumulativeValue":{"type":"string","pattern":"^-?[0-9]+(\\.[0-9]{1,2})?$"},"currency":{"type":"string"},"currencyBasis":{"enum":["EXPLICIT","PUBLISHER_DEFAULT","UNKNOWN"]},"endUserName":{"type":"string"}}},"SourceHistoryReport":{"type":"object","required":["version","procurementId","contractNumber","examinedSnapshots","omittedSnapshots","observations","omittedObservations","note"],"properties":{"version":{"const":"1.0"},"procurementId":{"type":"string"},"contractNumber":{"type":"string"},"examinedSnapshots":{"type":"integer","minimum":0},"omittedSnapshots":{"type":"integer","minimum":0},"omittedObservations":{"type":"integer","minimum":0},"note":{"type":"string"},"observations":{"type":"array","maxItems":200,"items":{"type":"object","required":["contract","title","snapshotId","row"],"properties":{"contract":{"$ref":"#/components/schemas/SourceContract"},"title":{"type":"string"},"supplierName":{"type":"string"},"sourceUpdatedAt":{"type":"string"},"snapshotId":{"type":"string"},"row":{"type":"integer","minimum":0},"captureMethod":{"enum":["PUBLISHER_FETCH","USER_NATIVE_FILE","CANONICAL_UPLOAD"]},"resourceName":{"type":"string"}}}}}},"NativeSourceReceipt":{"type":"object","required":["version","sourceId","status","capturedRows","processedRows","eligibleRows","quarantinedRows","unprocessedRows","distinctSourceKeys","repeatedSourceKeys","currentRecords","captureTruncated","omittedWindows","windows","problems","note"],"properties":{"version":{"const":"1.0"},"sourceId":{"type":"string"},"status":{"enum":["NO_NATIVE_EVIDENCE","RECONCILED_CAPTURE","NO_FILE_EVIDENCE","RECONCILED_FILE","INCOMPLETE"]},"captureMethod":{"enum":["PUBLISHER_FETCH","USER_NATIVE_FILE"]},"snapshotId":{"type":"string"},"resourceName":{"type":"string"},"resourceUrl":{"type":"string"},"parserVersion":{"type":"string"},"publisherRowCount":{"type":"integer","minimum":0},"capturedRows":{"type":"integer","minimum":0},"processedRows":{"type":"integer","minimum":0},"eligibleRows":{"type":"integer","minimum":0},"quarantinedRows":{"type":"integer","minimum":0},"unprocessedRows":{"type":"integer","minimum":0},"distinctSourceKeys":{"type":"integer","minimum":0},"repeatedSourceKeys":{"type":"integer","minimum":0},"currentRecords":{"type":"integer","minimum":0},"captureTruncated":{"type":"boolean"},"omittedWindows":{"type":"integer","minimum":0},"latestAttempt":{"type":"object","required":["runId","status"],"properties":{"runId":{"type":"string"},"status":{"enum":["QUEUED","RUNNING","COMPLETED","FAILED"]},"error":{"type":"string"}}},"windows":{"type":"array","maxItems":100,"items":{"type":"object","required":["runId","offset","total","accepted","unchanged","rejected"],"properties":{"runId":{"type":"string"},"offset":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"accepted":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0},"rejected":{"type":"integer","minimum":0}}}},"problems":{"type":"array","items":{"type":"string"}},"note":{"type":"string"}}},"InternalPacket":{"type":"object","properties":{"schemaVersion":{"const":1},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"accessClassification":{"enum":["INTERNAL","SYNTHETIC"]},"publisher":{"type":"string"},"sourceReference":{"type":"string"},"asOfDate":{"type":"string","format":"date"},"match":{"type":"object","properties":{"sourceId":{"type":"string"},"sourceRecordId":{"type":"string"},"buyerId":{"type":"string"}},"required":["sourceId","sourceRecordId","buyerId"]},"completeness":{"type":"object","properties":{"bids":{"type":"object","properties":{"status":{"enum":["COMPLETE","PARTIAL","NOT_PROVIDED"]},"expectedCount":{"type":"integer","minimum":0}},"required":["status"]},"evaluations":{"type":"object","properties":{"status":{"enum":["COMPLETE","PARTIAL","NOT_PROVIDED"]},"expectedCount":{"type":"integer","minimum":0}},"required":["status"]},"amendments":{"type":"object","properties":{"status":{"enum":["COMPLETE","PARTIAL","NOT_PROVIDED"]},"expectedCount":{"type":"integer","minimum":0}},"required":["status"]},"invoices":{"type":"object","properties":{"status":{"enum":["COMPLETE","PARTIAL","NOT_PROVIDED"]},"expectedCount":{"type":"integer","minimum":0}},"required":["status"]},"payments":{"type":"object","properties":{"status":{"enum":["COMPLETE","PARTIAL","NOT_PROVIDED"]},"expectedCount":{"type":"integer","minimum":0}},"required":["status"]}},"required":["bids","evaluations","amendments","invoices","payments"]},"bids":{"type":"array","maxItems":1000,"items":{"type":"object","properties":{"id":{"type":"string"},"supplierReference":{"type":"string"},"submittedDate":{"type":"string","format":"date"},"amount":{"type":"object","properties":{"amount":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]}},"required":["amount","currency","taxBasis"]}},"required":["id","supplierReference","submittedDate","amount"]}},"evaluations":{"type":"array","maxItems":1000,"items":{"type":"object","properties":{"id":{"type":"string"},"bidId":{"type":"string"},"criterion":{"type":"string"},"score":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"maximumScore":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"evaluatedDate":{"type":"string","format":"date"}},"required":["id","bidId","criterion","score","maximumScore","evaluatedDate"]}},"amendments":{"type":"array","maxItems":1000,"items":{"type":"object","properties":{"id":{"type":"string"},"effectiveDate":{"type":"string","format":"date"},"direction":{"enum":["INCREASE","DECREASE"]},"amount":{"type":"object","properties":{"amount":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]}},"required":["amount","currency","taxBasis"]},"reason":{"type":"string"}},"required":["id","effectiveDate","direction","amount","reason"]}},"invoices":{"type":"array","maxItems":1000,"items":{"type":"object","properties":{"id":{"type":"string"},"supplierReference":{"type":"string"},"issuedDate":{"type":"string","format":"date"},"amount":{"type":"object","properties":{"amount":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]}},"required":["amount","currency","taxBasis"]}},"required":["id","supplierReference","issuedDate","amount"]}},"payments":{"type":"array","maxItems":1000,"items":{"type":"object","properties":{"id":{"type":"string"},"invoiceId":{"type":"string"},"paidDate":{"type":"string","format":"date"},"amount":{"type":"object","properties":{"amount":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]}},"required":["amount","currency","taxBasis"]}},"required":["id","invoiceId","paidDate","amount"]}},"priceSchedule":{"type":"object","properties":{"completeness":{"enum":["COMPLETE","PARTIAL"]},"comparisonBasis":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]},"items":{"type":"array","maxItems":100,"items":{"type":"object","properties":{"id":{"type":"string"},"specification":{"type":"string"},"unit":{"type":"string"},"quantity":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,3})?$"}},"required":["id","specification","unit","quantity"]}},"prices":{"type":"array","maxItems":2000,"items":{"type":"object","properties":{"bidId":{"type":"string"},"itemId":{"type":"string"},"unitPrice":{"type":"string","pattern":"^\\d{1,12}(\\.\\d{1,4})?$"},"evidenceReference":{"type":"string"}},"required":["bidId","itemId","unitPrice","evidenceReference"]}}},"required":["completeness","comparisonBasis","currency","taxBasis","items","prices"]},"competitionHistory":{"type":"object","properties":{"completeness":{"enum":["COMPLETE","PARTIAL"]},"sourceReference":{"type":"string"},"marketBasis":{"type":"string"},"identityStatus":{"enum":["REVIEWED_SOURCE_IDS","UNRESOLVED"]},"identityReference":{"type":"string"},"from":{"type":"string","format":"date"},"through":{"type":"string","format":"date"},"rounds":{"type":"array","maxItems":200,"items":{"type":"object","properties":{"sourceRecordId":{"type":"string"},"decidedDate":{"type":"string","format":"date"},"bidderReferences":{"type":"array","maxItems":20,"uniqueItems":true,"items":{"type":"string"}},"winnerReference":{"type":"string"},"evidenceReference":{"type":"string"}},"required":["sourceRecordId","decidedDate","bidderReferences","winnerReference","evidenceReference"]}}},"required":["completeness","sourceReference","marketBasis","identityStatus","identityReference","from","through","rounds"]},"transactionSeries":{"type":"object","properties":{"completeness":{"enum":["COMPLETE","PARTIAL"]},"sourceReference":{"type":"string"},"requirementReference":{"type":"string"},"aggregationBasis":{"type":"string"},"from":{"type":"string","format":"date"},"through":{"type":"string","format":"date"},"policyAssessmentId":{"type":"string"},"policyPackId":{"type":"string"},"transactions":{"type":"array","maxItems":200,"items":{"type":"object","properties":{"id":{"type":"string"},"sourceRecordId":{"type":"string"},"tenderDate":{"type":"string","format":"date"},"estimatedValue":{"type":"object","properties":{"amount":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]}},"required":["amount","currency","taxBasis"]},"evidenceReference":{"type":"string"}},"required":["id","sourceRecordId","tenderDate","estimatedValue","evidenceReference"]}}},"required":["completeness","sourceReference","requirementReference","aggregationBasis","from","through","transactions"]},"evaluationPanel":{"type":"object","properties":{"completeness":{"enum":["COMPLETE","PARTIAL"]},"rubricVersion":{"type":"string"},"sourceReference":{"type":"string"},"criteria":{"type":"array","maxItems":20,"items":{"type":"object","properties":{"id":{"type":"string"},"maximumScore":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"weightPercent":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"}},"required":["id","maximumScore","weightPercent"]}},"evaluators":{"type":"array","maxItems":20,"items":{"type":"object","properties":{"reference":{"type":"string"},"recusedBidIds":{"type":"array","items":{"type":"string"}}},"required":["reference","recusedBidIds"]}},"scores":{"type":"array","maxItems":5000,"items":{"type":"object","properties":{"bidId":{"type":"string"},"evaluatorReference":{"type":"string"},"criterionId":{"type":"string"},"score":{"type":"string","pattern":"^\\d+(\\.\\d{1,2})?$"},"revision":{"type":"integer","minimum":1},"evidenceReference":{"type":"string"}},"required":["bidId","evaluatorReference","criterionId","score","revision","evidenceReference"]}}},"required":["completeness","rubricVersion","sourceReference","criteria","evaluators","scores"]},"bidDocuments":{"type":"object","properties":{"completeness":{"enum":["COMPLETE","PARTIAL"]},"comparisonBasis":{"type":"string"},"boilerplate":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":10000}},"sections":{"type":"array","maxItems":60,"items":{"type":"object","properties":{"bidId":{"type":"string"},"sectionKey":{"type":"string"},"language":{"enum":["en","fr"]},"extraction":{"enum":["VERIFIED_TEXT","UNVERIFIED"]},"text":{"type":"string","maxLength":10000},"evidenceReference":{"type":"string"}},"required":["bidId","sectionKey","language","extraction","text","evidenceReference"]}}},"required":["completeness","comparisonBasis","boilerplate","sections"]},"bidComparisonBasis":{"type":"string","description":"Importer declaration that all bid totals cover the same lot, specification, quantity and scope"}},"required":["schemaVersion","dataMode","accessClassification","publisher","sourceReference","asOfDate","match","completeness","bids","evaluations","amendments","invoices","payments"]},"InternalImport":{"type":"object","properties":{"id":{"type":"string"},"procurementId":{"type":"string"},"procurement":{"$ref":"#/components/schemas/Procurement"},"version":{"type":"integer"},"createdAt":{"type":"string"},"reviewer":{"type":"string"},"reason":{"type":"string"},"idempotencyKey":{"type":"string"},"requestHash":{"type":"string"},"snapshotId":{"type":"string"},"packet":{"$ref":"#/components/schemas/InternalPacket"},"transactionAssessment":{"type":"object","description":"Immutable retained policy assessment, including facts and effective-dated policy packs; absent without a linked transaction series"}}},"InternalReport":{"type":"object","properties":{"import":{"$ref":"#/components/schemas/InternalImport"},"currentProcurementRevision":{"type":["integer","null"]},"completeness":{"type":"array","items":{"type":"object"}},"totals":{"type":"array","items":{"type":"object"}},"invoiceBalances":{"type":"array","items":{"type":"object"}},"amendedAward":{"type":"object"},"notes":{"type":"array","items":{"type":"string"}}}},"AnalysisBatch":{"type":"object","properties":{"id":{"type":"string"},"filter":{"type":"object","required":["mode"],"properties":{"q":{"type":"string"},"level":{"type":"string"},"jurisdiction":{"type":"string"},"source":{"type":"string"},"buyerId":{"type":"string"},"category":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"mode":{"enum":["LIVE","SYNTHETIC"]}}},"status":{"enum":["QUEUED","RUNNING","COMPLETED","FAILED"]},"checkpoint":{"type":"integer"},"procurementIds":{"type":"array","items":{"type":"string"}},"analysisIds":{"type":"array","items":{"type":"string"}},"errors":{"type":"array","items":{"type":"object","properties":{"procurementId":{"type":"string"},"message":{"type":"string"}}}}}},"ReviewAlert":{"type":"object","properties":{"id":{"type":"string"},"procurementId":{"type":"string"},"analysisId":{"type":"string"},"dataMode":{"type":"string"},"status":{"type":"string"},"version":{"type":"integer"},"assignee":{"type":"string"},"caseId":{"type":"string"},"events":{"type":"array","items":{"type":"object"}}}},"SavingsOpportunity":{"type":"object","properties":{"idempotencyKey":{"type":"string"},"procurementId":{"type":"string"},"title":{"type":"string"},"owner":{"type":"string"},"rationale":{"type":"string"},"currency":{"type":"string"},"taxBasis":{"type":"string"},"estimatedSavings":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"id":{"type":"string"},"status":{"type":"string"},"dataMode":{"type":"string"},"version":{"type":"integer"},"netSavings":{"type":"string","description":"Exact signed decimal: baseline minus outcome minus implementation cost"},"events":{"type":"array","items":{"type":"object"}}}},"Money":{"type":"object","required":["amount","currency","taxBasis","kind"],"properties":{"amount":{"type":"string","pattern":"^[0-9]+(\\.[0-9]{1,2})?$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxBasis":{"enum":["INCLUDED","EXCLUDED","UNKNOWN"]},"kind":{"enum":["AWARD","CEILING"]}}},"ProcurementOrganization":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"governmentLevel":{"enum":["FEDERAL","PROVINCIAL","TERRITORIAL","MUNICIPAL"]},"jurisdictionCode":{"type":"string"},"entityType":{"type":"string"}}},"ProcurementLot":{"type":"object","required":["id","title","status"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"supplierName":{"type":"string"},"supplierIdentifier":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"},"allocationsComplete":{"type":"boolean"},"buyerAllocations":{"type":"array","maxItems":500,"items":{"type":"object","required":["buyerId","amount"],"properties":{"buyerId":{"type":"string"},"amount":{"$ref":"#/components/schemas/Money"}}}}}},"ProcurementStructure":{"type":"object","required":["instrument"],"description":"Source-declared context. Lead buyer remains the record buyer; funding, delivery and publisher do not determine government level. Lot values and buyer allocations do not add to record totals.","properties":{"instrument":{"enum":["CONTRACT","FRAMEWORK","CALL_OFF","UNKNOWN"]},"buyerEntityType":{"type":"string"},"parentBuyer":{"$ref":"#/components/schemas/ProcurementOrganization"},"participatingBuyers":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/ProcurementOrganization"}},"fundingBodies":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/ProcurementOrganization"}},"deliveryLocations":{"type":"array","maxItems":500,"items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"jurisdictionCode":{"type":"string"}}}},"lots":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/ProcurementLot"}},"lotsComplete":{"type":"boolean"},"lotValueRelationship":{"enum":["COMPONENTS_OF_RECORD","INDEPENDENT","UNKNOWN"]},"relatedProcesses":{"type":"array","maxItems":500,"items":{"type":"object","required":["sourceId","sourceProcessId","relationship"],"properties":{"sourceId":{"type":"string"},"sourceProcessId":{"type":"string"},"relationship":{"enum":["CALL_OFF_FROM","REPLACES","RELATED"]}}}}}},"ValueReconciliation":{"type":"object","required":["status"],"properties":{"status":{"enum":["NOT_DECLARED","PARTIAL_LIST","MISSING_VALUES","INCOMPATIBLE","RECONCILED","MISMATCH"]},"expected":{"$ref":"#/components/schemas/Money"},"reportedTotal":{"$ref":"#/components/schemas/Money"},"difference":{"type":"string","description":"Reported components minus expected amount; exact signed decimal, absent unless comparable."}}},"ProcessRecordReference":{"type":"object","required":["id","title","revision","instrument"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"titleFr":{"type":"string"},"revision":{"type":"integer"},"recordKind":{"enum":["TENDER","AWARD"]},"instrument":{"enum":["CONTRACT","FRAMEWORK","CALL_OFF","UNKNOWN"]},"amount":{"$ref":"#/components/schemas/Money"}}},"ProcurementStructureView":{"type":"object","required":["version","processIdentity","processRecords","lotReconciliation","allocationReconciliations","relatedProcesses"],"properties":{"version":{"const":"1.0"},"processIdentity":{"enum":["DECLARED","RECORD_ONLY"]},"processRecords":{"type":"array","items":{"$ref":"#/components/schemas/ProcessRecordReference"}},"lotReconciliation":{"$ref":"#/components/schemas/ValueReconciliation"},"allocationReconciliations":{"type":"array","maxItems":500,"items":{"type":"object","required":["lotId","result"],"properties":{"lotId":{"type":"string"},"result":{"$ref":"#/components/schemas/ValueReconciliation"}}}},"relatedProcesses":{"type":"array","maxItems":500,"items":{"type":"object","required":["sourceId","sourceProcessId","relationship","status","records"],"properties":{"sourceId":{"type":"string"},"sourceProcessId":{"type":"string"},"relationship":{"enum":["CALL_OFF_FROM","REPLACES","RELATED"]},"status":{"enum":["RESOLVED","NOT_IMPORTED","TYPE_UNCONFIRMED"]},"records":{"type":"array","items":{"$ref":"#/components/schemas/ProcessRecordReference"}}}}}}},"ProcurementInput":{"type":"object","required":["sourceRecordId","title","buyerName","buyerId","governmentLevel","jurisdictionCode","category","status"],"properties":{"structure":{"$ref":"#/components/schemas/ProcurementStructure"},"sourceRecordId":{"type":"string"},"title":{"type":"string"},"titleFr":{"type":"string"},"sourceProcessId":{"type":"string"},"sourceUpdatedAt":{"type":"string","format":"date-time"},"sourceNotes":{"type":"string"},"sourceSequence":{"type":"string"},"sourceContract":{"$ref":"#/components/schemas/SourceContract"},"recordKind":{"enum":["TENDER","AWARD"]},"buyerName":{"type":"string"},"buyerId":{"type":"string"},"governmentLevel":{"enum":["FEDERAL","PROVINCIAL","TERRITORIAL","MUNICIPAL"]},"jurisdictionCode":{"type":"string"},"supplierName":{"type":"string"},"supplierIdentifier":{"type":"string"},"category":{"type":"string"},"status":{"type":"string"},"procurementMethod":{"type":"string"},"publishedDate":{"type":"string","format":"date"},"closingDate":{"type":"string","format":"date"},"awardDate":{"type":"string","format":"date"},"amount":{"$ref":"#/components/schemas/Money"},"originalAmount":{"$ref":"#/components/schemas/Money"},"bidderCount":{"type":"integer","minimum":0},"sourceUrl":{"type":"string","format":"uri"}}},"Procurement":{"allOf":[{"$ref":"#/components/schemas/ProcurementInput"},{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"integer"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"provenance":{"$ref":"#/components/schemas/Provenance"}}}]},"Provenance":{"type":"object","properties":{"snapshotId":{"type":"string"},"sourceId":{"type":"string"},"sourceRecordId":{"type":"string"},"sourceHash":{"type":"string"},"row":{"type":"integer"},"retrievedAt":{"type":"string"},"parserVersion":{"type":"string"},"normalizationVersion":{"type":"string"}}},"ImportRequest":{"description":"A new capture accepts ordinary import options. Continuation accepts only continueFrom and reuses the retained snapshot, mode, limit and buyer mappings; it never re-downloads the resource.","type":"object","properties":{"demoScenario":{"enum":["STRUCTURE"],"description":"Fictional lots/joint buyers/framework scenario on demo source only; always SYNTHETIC."},"limit":{"type":"integer","minimum":1,"maximum":500,"default":100},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"offset":{"type":"integer","minimum":0,"maximum":100000,"default":0},"continueFrom":{"type":"string","description":"Completed run ID with nextOffset; exclusive of other properties"},"resourceId":{"type":"string","description":"Publisher resource ID from sources/{id}/resources for SEAO, BC, Manitoba, NWT, NL, Nunavut, WSIB, Saskatchewan, Alberta or CanadaBuys"},"nativeCsv":{"type":"string","maxLength":25000000,"description":"CanadaBuys downloaded native CSV, at most 25 MB UTF-8, mutually exclusive with records and resourceId. Classified USER_NATIVE_FILE, never publisher-fetch qualification."},"fileName":{"type":"string","description":"Required with nativeCsv; retained file label, not an asserted publisher URL."},"records":{"type":"array","maxItems":10000,"items":{"$ref":"#/components/schemas/ProcurementInput"}}}},"IngestionRun":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"dataMode":{"type":"string"},"status":{"enum":["QUEUED","RUNNING","COMPLETED","FAILED"]},"accepted":{"type":"integer"},"unchanged":{"type":"integer"},"rejected":{"type":"integer"},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"},"checkpoint":{"type":"integer"},"continuedFrom":{"type":"string"},"capturedRows":{"type":"integer"},"publisherRowCount":{"type":"integer"},"captureMethod":{"enum":["PUBLISHER_FETCH","USER_NATIVE_FILE","CANONICAL_UPLOAD"]},"captureTruncated":{"type":"boolean"},"quality":{"$ref":"#/components/schemas/SourceQuality"},"mappingHash":{"type":"string"},"nextOffset":{"type":["integer","null"]},"resourceId":{"type":"string"},"resourceUrl":{"type":"string"},"resourceName":{"type":"string"},"parserVersion":{"type":"string"},"snapshotId":{"type":"string"},"error":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer"},"message":{"type":"string"}}}}}},"Analysis":{"type":"object","properties":{"internalImportId":{"type":"string"},"id":{"type":"string"},"procurementId":{"type":"string"},"ruleVersion":{"type":"string"},"inputHash":{"type":"string"},"procurementRevision":{"type":"integer"},"score":{"type":["integer","null"],"minimum":0,"maximum":100},"coverage":{"type":"string"},"eligibleRules":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"explanation":{"type":"string"},"alternative":{"type":"string"},"contribution":{"type":"integer"},"evidenceIds":{"type":"array","items":{"type":"string"}}}}}}},"SupplierDecision":{"type":"object","properties":{"id":{"type":"string"},"leftId":{"type":"string"},"rightId":{"type":"string"},"dataMode":{"enum":["LIVE","SYNTHETIC"]},"status":{"enum":["SAME_ENTITY","DIFFERENT_ENTITY","WITHDRAWN"]},"version":{"type":"integer"},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"reviewer":{"type":"string"},"reason":{"type":"string"},"status":{"type":"string"},"evidenceIds":{"type":"array","items":{"type":"string"}},"idempotencyKey":{"type":"string"},"requestHash":{"type":"string"},"sourceRecords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"integer"},"contentHash":{"type":"string"}}}}}}}}},"CaseEvidence":{"type":"object","properties":{"id":{"type":"string"},"procurement":{"$ref":"#/components/schemas/Procurement"},"role":{"enum":["SUBJECT","RELATED"]},"status":{"enum":["ACTIVE","WITHDRAWN"]},"attachedAt":{"type":"string"},"reviewer":{"type":"string"},"note":{"type":"string"}}},"CaseTask":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"assignee":{"type":"string"},"dueDate":{"type":["string","null"],"format":"date"},"status":{"enum":["OPEN","DONE","CANCELLED"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}},"CaseOutcome":{"type":"object","properties":{"id":{"type":"string"},"kind":{"enum":["NO_FURTHER_ACTION","FOLLOW_UP_REQUIRED","PROCESS_IMPROVEMENT"]},"summary":{"type":"string"},"alternativeExplanation":{"type":"string"},"evidenceIds":{"type":"array","minItems":1,"items":{"type":"string"},"description":"Active case evidence anchor IDs, not snapshot IDs"},"reviewer":{"type":"string"},"at":{"type":"string"},"caseVersion":{"type":"integer"}}},"CaseDossier":{"type":"object","properties":{"internalEvidence":{"type":"object","properties":{"import":{"$ref":"#/components/schemas/InternalImport"},"availability":{"enum":["AVAILABLE","UNAVAILABLE"]},"packet":{}}},"schemaVersion":{"const":1},"dossierVersion":{"const":2},"exportedAt":{"type":"string"},"dossierHash":{"type":"string"},"case":{"$ref":"#/components/schemas/ReviewCase"},"analysis":{"$ref":"#/components/schemas/Analysis"},"evidenceIds":{"type":"array","items":{"type":"string"}},"evidence":{"type":"array","items":{"type":"object","properties":{"anchor":{"$ref":"#/components/schemas/CaseEvidence"},"availability":{"enum":["AVAILABLE","UNAVAILABLE"]},"currentRevision":{"type":["integer","null"]},"record":{}}}},"snapshotAvailability":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"available":{"type":"boolean"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"ReviewCase":{"type":"object","properties":{"evidence":{"type":"array","items":{"$ref":"#/components/schemas/CaseEvidence"}},"tasks":{"type":"array","items":{"$ref":"#/components/schemas/CaseTask"}},"outcomes":{"type":"array","items":{"$ref":"#/components/schemas/CaseOutcome"}},"id":{"type":"string"},"title":{"type":"string"},"procurementId":{"type":"string"},"analysisId":{"type":"string"},"evidenceIds":{"type":"array","items":{"type":"string"}},"status":{"enum":["OPEN","IN_REVIEW","AWAITING_INFORMATION","CLOSED"]},"version":{"type":"integer"},"events":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"action":{"type":"string"},"note":{"type":"string"}}}}}},"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"message":{"type":"string"},"error":{"type":"string"}}}}}}