Atlas Claims / Development evidence / 8 September 2026 Source: src/domain/transitions.ts and src/domain/transitions.test.ts AI-assisted prototype, synthetic data only. These excerpts are not a standalone application. The role checks below are simulation rules, not production authentication or authorization. --- Rule --- import type { Claim, EvidenceItem, ProfileId, RequestInformationCommand, RfiTemplate, } from './types' export interface RequestInformationContext { readonly actorProfileId: ProfileId readonly claim: Claim readonly evidence: readonly EvidenceItem[] readonly template?: RfiTemplate readonly command: RequestInformationCommand } export type TransitionDecision = | { readonly allowed: true } | { readonly allowed: false readonly code: | 'out_of_scope' | 'invalid_state' | 'stale_version' | 'unknown_template' | 'missing_selection' | 'invalid_evidence' | 'template_mismatch' } export function evaluateRequestInformation(context: RequestInformationContext): TransitionDecision { const { actorProfileId, claim, evidence, template, command } = context if (claim.assigneeProfileId !== actorProfileId) return { allowed: false, code: 'out_of_scope' } if (claim.status !== 'triage' && claim.status !== 'assessment') { return { allowed: false, code: 'invalid_state' } } if (claim.version !== command.expectedVersion) return { allowed: false, code: 'stale_version' } if (!template || template.id !== command.templateId) return { allowed: false, code: 'unknown_template' } if (command.missingEvidenceIds.length === 0) return { allowed: false, code: 'missing_selection' } const uniqueIds = new Set(command.missingEvidenceIds) if (uniqueIds.size !== command.missingEvidenceIds.length) { return { allowed: false, code: 'invalid_evidence' } } const selected = command.missingEvidenceIds.map((id) => evidence.find((item) => item.id === id)) if ( selected.some( (item) => !item || item.claimId !== claim.id || item.state !== 'missing', ) ) { return { allowed: false, code: 'invalid_evidence' } } if (selected.some((item) => item && !template.permittedEvidenceKinds.includes(item.kind))) { return { allowed: false, code: 'template_mismatch' } } return { allowed: true } } --- Existing tests --- import { fixtureBundle, MAYA_PROFILE_ID } from '../data/fixtures' import type { Claim, RequestInformationCommand } from './types' import { evaluateRequestInformation } from './transitions' const claim = fixtureBundle.claims.find((item) => item.id === 'CLM-DEMO-1001')! const evidence = fixtureBundle.evidence.filter((item) => item.claimId === claim.id) const template = fixtureBundle.rfiTemplates.find((item) => item.id === 'RFI-DEMO-01')! const missing = evidence.filter((item) => item.state === 'missing').map((item) => item.id) const command: RequestInformationCommand = { claimId: claim.id, expectedVersion: claim.version, templateId: template.id, missingEvidenceIds: missing, actionId: 'action-demo-001', } describe('request information transition policy', () => { it('allows the approved officer transition and prerequisites', () => { expect(evaluateRequestInformation({ actorProfileId: MAYA_PROFILE_ID, claim, evidence, template, command })).toEqual({ allowed: true }) }) const invalidCases: readonly { candidateClaim: Claim candidateCommand: RequestInformationCommand expectedCode: string }[] = [ { candidateClaim: { ...claim, status: 'awaiting_information' }, candidateCommand: command, expectedCode: 'invalid_state' }, { candidateClaim: claim, candidateCommand: { ...command, expectedVersion: 99 }, expectedCode: 'stale_version' }, { candidateClaim: claim, candidateCommand: { ...command, missingEvidenceIds: [] }, expectedCode: 'missing_selection' }, { candidateClaim: claim, candidateCommand: { ...command, missingEvidenceIds: [fixtureBundle.evidence.find((item) => item.claimId === 'CLM-DEMO-1002')!.id] }, expectedCode: 'invalid_evidence' }, ] it.each(invalidCases)('rejects $expectedCode without granting a transition', ({ candidateClaim, candidateCommand, expectedCode }) => { expect( evaluateRequestInformation({ actorProfileId: MAYA_PROFILE_ID, claim: candidateClaim, evidence, template, command: candidateCommand, }), ).toEqual({ allowed: false, code: expectedCode }) }) })