Skip to content

Safeguarding: SELF DV/SA 999 parity, CHILD_AT_RISK_EXIT wiring, professional regression tests - #21

Merged
camlambert2000 merged 6 commits into
mainfrom
staging
Jun 26, 2026
Merged

Safeguarding: SELF DV/SA 999 parity, CHILD_AT_RISK_EXIT wiring, professional regression tests#21
camlambert2000 merged 6 commits into
mainfrom
staging

Conversation

@camlambert2000

Copy link
Copy Markdown
Collaborator

Safeguarding follow-ups surfaced in the PR #20 review. Three items, all on the DV/SA/child-at-risk exit paths.

Scope

  • Item 75 — SELF DV and SA 999 parity. Adds a 999 emergency line to the nine SELF (direct-experience) DV and SA base exits, so a person disclosing for themselves sees the same emergency line their supporter already does. ⚠️ Behavioural change — flagged for James. Mirrors the __SUPPORTER pattern; uses second-person wording (If you're in immediate danger, call 999.).
  • Item 74 — CHILD_AT_RISK_EXIT wiring. Threads session.userType through the safeguardingExit('CHILD_AT_RISK_EXIT', ...) call site (was passing the isSupporter boolean), matching the DV/SA call sites and completing safeguarding-pathway selector coverage. No behaviour change — there is only a base CHILD_AT_RISK_EXIT entry, so every register resolves to it.
  • Item 77 — professional regression tests. Adds four __PROFESSIONAL regression tests (DV Male, DV LGBTQ+, SA Male, SA LGBTQ+), each asserting professional framing present, supporter framing absent, and the 999 line present, with helpline numbers read from each variant's actual phrasebank entry.

Verification

  • Test count 102 → 110, all green.
  • tsc --noEmit clean.

Commits

  • f274f2a feat(safeguarding): add 999 line to SELF DV and SA exits for parity
  • be11c58 refactor(safeguarding): thread userType through CHILD_AT_RISK_EXIT call site
  • bb73d03 test(safeguarding): add Male and LGBTQ+ professional regression tests for DV and SA exits
  • plus a backlog refresh (VA_BACKLOG.md)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
street-support-va-staging Ready Ready Preview, Comment Jun 16, 2026 9:27am
streetsupport-platform-va Ready Ready Preview, Comment Jun 16, 2026 9:27am

Request Review

@james-cross james-cross left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. I'm happy with the PR as is. There's just a couple of small things for you to take a look at that I've added inline.

Comment on lines +516 to +529
test('CHILD_AT_RISK_EXIT resolves to base entry with 999 line for SELF and PROFESSIONAL', () => {
// The call site passes session.userType (not a boolean). There is only a
// base CHILD_AT_RISK_EXIT entry — no __SUPPORTER or __PROFESSIONAL variant.
// Both registers must fall through to the base entry and still surface the
// 999 line. Guards the wiring so adding a variant later can't silently
// break either register.
const NINE_NINE_NINE = 'If a child is in immediate danger, call 999.';
for (const userType of ['SELF', 'PROFESSIONAL'] as const) {
// B7D_4A option 4 = Child safety -> CHILD_AT_RISK_EXIT
const session = sessionAt('B7D_4A_PREVENTION_SAFEGUARDING_FOLLOW_UP', { userType });
const result = select(session, 4);
expect(result.text).toContain(NINE_NINE_NINE);
}
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test loops ['SELF', 'PROFESSIONAL'] and the comment says "Both registers must fall through to the base entry". There are actually three registers, and SUPPORTER is the one not asserted. It resolves to base by the same path, so behaviour is correct, but since the point of the test is to guard the wiring against a future variant being added, adding 'SUPPORTER' to the loop would lock all three registers rather than two. One-word change to the array.

Comment thread lib/phrasebank.ts

@james-cross james-cross Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is right. The 999 line is added to the SELF base entries (the ones a self-discloser actually receives, since getPhrase returns base for 'SELF'), uses second-person wording to match the audience, sits at the end mirroring the already-approved __SUPPORTER pattern, and isn't duplicated anywhere. 999 is a sanctioned hard-coded safeguarding route and it's phrasebank content, not generated The two new SELF tests enforce that every DV and SA SELF exit includes it, so the parity can't silently regress.

@camlambert2000
camlambert2000 merged commit c950049 into main Jun 26, 2026
4 checks passed
camlambert2000 added a commit that referenced this pull request Jul 2, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants