Plan: CAPS Two-Parent Activity Rule, Care Waiver and Type of Care (#3071)

Status: Done (2026-11-02) — U1 to U6 (#3182, #3183, #3184, #3185, #3186, #3187) merged
Epic: &58
Issues: #3071 (parent) · #3182 U1 (w5) · #3183 U2 (w5) · #3184 U3 (w3) · #3185 U4 (w3) · #3186 U5 (w3) · #3187 U6 (w3)
Branches: feat/3071-caps-parent-facts, feat/3071-caps-two-parent-rule, feat/3071-caps-worker-forms, feat/3071-caps-signed-operation, feat/3071-caps-orchestrator-dispatch, test/3071-caps-flow

Erratum (2026-11-01): U1 lands each store’s standing_on as #[cfg(test)], because canopy-caps is a binary crate with no production caller until U2 and lint suppressions are banned, and U2 drops the cfg.

Erratum (2026-11-01): U1’s database route tests live in services/canopy-caps/src/api/facts_route_tests/infra_tests.rs, because the lane partition runs a test against the devstack only under a module path segment ending in infra_tests.

Erratum (2026-11-01): U1’s contract tests go in crates/canopy-contracts-caps/tests/roundtrip.rs and its typed ids (CapsParentActivityId, CapsChildCareNeedId) in crates/canopy-common/src/id.rs.

Erratum (2026-11-01): The two fact lists admit READER (a system caller or caseworker+) rather than a new canopy_auth::delegated row, so a case-reader row through canopy-web, if U3’s tab needs one, is U3’s to add.

Erratum (2026-11-01): Both U1 creates refuse an effective_date outside the years 1900-9999 (422 caps_date_out_of_range) or after the legal today (422 caps_effective_date_in_future), as canopy-wic’s breastfeeding create does, so a date PostgreSQL cannot store is never a 500.

Erratum (2026-11-01): U2 also updates canopy-rules' CAPS derivation tests (services/canopy-rules/src/derivation.rs), because expr-activity-test now outputs tested_parents beside activity_eligible.

Erratum (2026-11-01): U2 carries UpdateAuthorizationRequest.scholarship_type in services/canopy-caps/src/api/authorization_writes.rs, where the PUT handler lives; authorization_update.rs is unchanged.

Erratum (2026-11-01): tests/e2e/specs/worker-portal-caps-actions.spec.ts builds no determine body, so U2 leaves it unchanged; it type-checks.

Erratum (2026-11-01): tools/canopy-seed renders SQL rather than a determine body, so U2’s seed change records each CAPS household’s parent activities and children’s care needs, and full_time on its active authorizations.

Erratum (2026-11-01): U2’s integration tests run in-process in services/canopy-caps/src/determine/two_parent_infra_tests.rs (the real router, the georgia pack, an ephemeral schema), because tests/caps_test.rs reaches a devstack that may serve another build and cannot be mutation-checked.

Erratum (2026-11-01): cargo xtask api-docs --update reads the running services, so U2’s CAPS OpenAPI snapshot is generated from ApiDoc with the idempotency addon, as the served document is built.

Erratum (2026-11-01): zen-expression 0.55 evaluates filter, all and len over input.parents as D2 writes them, inside a ternary on context.thresholds.disabled_parent_care_waiver.

Erratum (2026-11-01): U4’s operation_id is a new body field, so U4 also adds its row to compliance/input-requirements/caps.toml, regenerates docs/modules/ROOT/openapi/caps.json and names the field in every CapsApplicationContext literal (the contract round-trip, caps_test.rs, the in-process tests); store/models.rs is unchanged, since CapsDeterminationRow reads by column name.

Erratum (2026-11-01): U4’s integration tests run in-process in services/canopy-caps/src/api/persist/operation_infra_tests.rs, beside the store’s and the held list’s infra_tests, because tests/caps_test.rs reaches a devstack that may serve another build.

Erratum (2026-11-01): with CAPS in signs_its_operation no program signs no operation, so U4 pins the no-operation case of a_signed_basis_without_a_readable_anchor_is_refused (services/canopy-eligibility/tests/quarantine_resolution_test.rs) as provenance_rejected on CAPS, the binding test covers every program, CAPS joins only_an_operation_signing_program_is_dispatched's mapper list in U5, when map_context admits it, and U4 corrects the binding sentence of api/canopy-eligibility.adoc and adds an ADR-002 erratum, both of which said CAPS signs no operation.

Erratum (2026-11-01): U4 writes a request's children in child_person_id order (persist_order in services/canopy-caps/src/api/persist.rs), as canopy-wic writes its participants, so two executions of one operation that list the children in different orders yield the 409 rather than deadlocking into a 500; the first execution's response keeps the request's order.

Erratum (2026-11-01): canopy-web’s edge to canopy-caps is delegation-only and the CAPS tab renders for case readers, so U3 adds the rows CAPS_GET_PARENT_ACTIVITIES and CAPS_GET_CHILD_CARE_NEEDS to crates/canopy-auth/src/delegated.rs and canopy-caps' two lists admit by them.

Erratum (2026-11-01): U3’s tab names the parents and children by D5’s rule from the household bundle projecting parent_child, and its two forms' pickers offer every member, as the WIC forms do.

Erratum (2026-11-01): U3 moves the routed mock’s representative records to services/canopy-web/src/api/mock_upstream/rep_records.rs, so mock_upstream.rs stays under the B1 line with the CAPS surface added.

Erratum (2026-11-01): U5’s mappers::caps::context takes no as_of (the CAPS body carries none), also pends naming parent_child when the relations name no child or no parent among the members (an empty list canopy-caps would refuse), and reads an order run from the context’s trigger, set only on one; the shared helpers persons_gap and household_size move to mappers/mod.rs, and U5 also touches bulk/arm.rs and quarantine.rs (the exhaustive match, the dispatch fixture) and the api/canopy-caps.adoc note.

Erratum (2026-11-02): U6's flow cannot show a full-time scholarship: the orchestrator dispatches each child with no provider (U5), and canopy-caps builds an authorization only for a child with one. The case shows the approved child on the Determination tab and its full-time need on the Authorization tab; the authorization carrying the type of care stays bound to canopy-caps' in-process test, the catalogue row's test_ref.

Erratum (2026-11-02): U6's flow reads the denial as canopy-caps writes it, naming the parent by position ("Parent 2: care waiver claimed but not verified; activity not verified."), and determines again through a second orchestrator run on the same application (redetermineCaps in tests/e2e/lib/given/caps.ts): a new operation, so canopy-caps records a new determination for the child.

Erratum (2026-11-02): U6 changes neither federal-requirements.adoc nor rulesets.adoc: U2 already names the per-parent test in the 45 CFR 98.20(a)(3)(i) row and documents the [caps] key.

This is a Design + Scope plan: GitLab owns tracking, the child issues carry the implementer brief, and the plan freezes when U1 starts.

Context

CAPS evaluates a two-parent unit’s activity as one household scalar. CapsApplicationContext (crates/canopy-contracts-caps/src/determine.rs) carries activity_weekly_hours and activity_verified; the Georgia ruleset’s expr-activity-test (rulesets/georgia/caps-eligibility.json) tests input.activity_verified and input.activity_weekly_hours >= context.thresholds.min_work_hours_per_week; and services/canopy-caps/src/determine.rs copies the household hours into the authorization’s weekly_hours. There is no parent roster, so DECAL CAPS/00-6 §6.8.1.7 ("each parent must meet the activity requirement") and §6.8.1.8 (a disabled parent who cannot provide care is set aside, on verification) cannot apply. The authorization records no type of care, though CAPS/00-10 §10.5.3 says the scholarship "identifies the type of child care authorized based on the child’s need for care" and §10.6 defines the four types by days of care per service week.

Nothing in production builds a CapsApplicationContext. The orchestrator refuses CAPS with input_unsatisfiable (caps_worker_fact_gaps, services/canopy-eligibility/src/mappers/mod.rs) because three policy-material inputs are worker facts with no capture surface: the two activity fields and the per-child has_special_needs (compliance/input-requirements/caps.toml, gap_issue = "#857"). Only tests and the seed post CAPS determinations.

The WIC dispatch plan (Plan: Dispatch WIC determinations from the orchestrator (#2364), D1) settled the pattern for a fact one program alone records: canopy-wic owns wic_breastfeeding_statuses (append-only, worker-recorded, read by person and date at determination), the field left the wire, and the orchestrator could then dispatch WIC. The CAPS worker facts are the same kind of thing: a parent’s activity standing, a parent’s verified inability to provide care, and a child’s documented disability (DECAL’s "children with disabilities", CAPS/00-2, is a licensed-specialist finding, not canopy-persons' disability_status vocabulary) are CAPS findings. ADR-035 Decision 3 and Amendment 1 govern the contract: one POST, the program enumerates its subjects, children[] is the as-built shape.

Scope

In scope:

  • canopy-caps owns two append-only worker-fact records: a parent’s activity standing (hours, verification, care waiver) and a child’s care need (type of care, documented disability), each with a user-only POST and a GET.

  • The determination reads them per subject on the run’s legal day. The activity test is per parent: every parent without a verified care waiver must meet it, and at least one must remain. The type of care is recorded on the authorization. The three worker-fact fields leave the wire.

  • The Georgia, default and test-max rulesets and one [caps] pack key; the two canopy-web forms; canopy-caps signing and deduplicating the dispatch operation (the #3116 ruling); the orchestrator’s CAPS mapper so a filing reaches canopy-caps.

  • Two new catalogue rows bound; the pages and the CHANGELOG.

Out of scope:

  • The hours arithmetic of §6.8.2–6.8.3 (pay-frequency conversion, credit hours, the under-21 exemption): the worker records the weekly figure; the method stays unbound under #840.

  • One scholarship per type of care (§10.5.2.2) and fee distribution across them: one authorization per child keeps one type; the multi-scholarship model is a follow-up issue tied to #842.

  • Reading persons' disability_status or SSI data as a CAPS disability finding; in-loco-parentis caretakers without a parent_child edge (a persons gap, follow-up issue); #3051’s reporting tier.

  • Removing weekly_hours from caps_authorizations (read by reporting, web, seed and rates).

Design

D1 — Two program-owned fact tables (canopy-caps)

Migration services/canopy-caps/migrations/20270308000000_caps_worker_facts.sql, forward-only (ADR-016), mirroring services/canopy-wic/migrations/20270305000000_create_wic_breastfeeding_statuses.sql: no defaults, recorded_by TEXT NOT NULL (the worker’s OIDC subject), created_at TIMESTAMPTZ NOT NULL bound by the writer.

CREATE TABLE caps_parent_activities (
    id UUID PRIMARY KEY,
    person_id UUID NOT NULL,
    weekly_hours INTEGER NOT NULL CHECK (weekly_hours >= 0),
    verified BOOLEAN NOT NULL,
    unable_to_provide_care BOOLEAN NOT NULL,
    care_waiver_verification TEXT
        CHECK (care_waiver_verification IN ('licensed_medical_statement', 'agency_documentation')),
    effective_date DATE NOT NULL,
    recorded_by TEXT NOT NULL,
    created_at TIMESTAMPTZ NOT NULL,
    CONSTRAINT caps_parent_activities_waiver_needs_claim
        CHECK (care_waiver_verification IS NULL OR unable_to_provide_care)
);
CREATE INDEX idx_caps_parent_activities_person
    ON caps_parent_activities (person_id, effective_date DESC, created_at DESC);

CREATE TABLE caps_child_care_needs (
    id UUID PRIMARY KEY,
    person_id UUID NOT NULL,
    scholarship_type TEXT NOT NULL
        CHECK (scholarship_type IN ('full_time', 'part_time', 'before_after_school', 'variable_schedule')),
    has_documented_disability BOOLEAN NOT NULL,
    effective_date DATE NOT NULL,
    recorded_by TEXT NOT NULL,
    created_at TIMESTAMPTZ NOT NULL
);
CREATE INDEX idx_caps_child_care_needs_person
    ON caps_child_care_needs (person_id, effective_date DESC, created_at DESC);

ALTER TABLE caps_authorizations ADD COLUMN scholarship_type TEXT
    CHECK (scholarship_type IN ('full_time', 'part_time', 'before_after_school', 'variable_schedule'));

The standing on a date is the newest row with effective_date ⇐ date, ties by created_at (the status_on read in services/canopy-wic/src/store/breastfeeding.rs). A care waiver applies only when unable_to_provide_care and care_waiver_verification are both set (§6.8.1.8: "Verification … is required"); a claim without verification is recorded, shown, and does not waive. An absent activity row reads as unverified with zero hours; an absent care-need row reads as no documented disability finding and no recorded type. Existing caps_authorizations rows keep scholarship_type NULL.

Contracts in crates/canopy-contracts-caps/src/parent_activity.rs and care_need.rs, after crates/canopy-contracts-wic/src/breastfeeding.rs: CareWaiverVerification and ScholarshipType as closed snake_case enums with ALL, as_str and TryFrom<String>; CreateParentActivity { person_id, weekly_hours: u16, verified, unable_to_provide_care, care_waiver_verification: Option<_>, effective_date } and CreateChildCareNeed { person_id, scholarship_type, has_documented_disability, effective_date }, both deny_unknown_fields, no recorder; response shapes CapsParentActivity and CapsChildCareNeed as the stored rows. Paths in paths.rs: /v1/parent-activities and /v1/child-care-needs, POST and GET (?person_id=), newest first. A body whose care_waiver_verification is set while unable_to_provide_care is false is 422 care_waiver_without_claim.

Admission mirrors create_breastfeeding_status (services/canopy-wic/src/api/handlers/breastfeeding.rs): the handler takes Extension<Principal>, admits WRITER (services/canopy-caps/src/api/handlers.rs), and a user-only subject helper after canopy-wic’s assessor_subject refuses a service bearer with 403 service_class_on_user_only and yields the worker’s OIDC subject for recorded_by. created_at is the request’s DecisionClock instant. handlers.rs is one file today; it gains mod parent_activity; mod care_need; with the children under services/canopy-caps/src/api/handlers/, the same shape canopy-wic’s handlers.rs already has. No log line carries hours, waiver or disability values.

D2 — The wire and the per-parent test

CapsApplicationContext drops activity_weekly_hours and activity_verified; CapsChild drops has_special_needs; a new top-level parents: Vec<CapsParent { person_id: Uuid }> names the parents in the family unit. An empty parents is 422 caps_parents_required (a child always has a parent in the DECAL sense; a household with none is an intake gap). compliance/input-requirements/caps.toml goes to version = "3": the three worker-fact rows go, parents and parents[].person_id arrive as source_class = "persons", and the #857 gap references go with them. cargo xtask policy input-coverage must pass against the regenerated CAPS OpenAPI snapshot (#862).

CapsEligibilityInput (services/canopy-caps/src/determine.rs) replaces the two scalars with parents: Vec<ParentActivityInput { person_id, activity_weekly_hours: i32, activity_verified: bool, care_waived: bool }> and child_has_special_needs with child_has_documented_disability, read from the two stores on effective (the run’s legal day, the same instant the SMI edition uses). The ruleset’s expr-activity-test becomes, in all three packs:

tested_parents    = filter(input.parents, not #.care_waived)
activity_eligible = len(tested_parents) >= 1
                    and all(tested_parents, #.activity_verified
                        and #.activity_weekly_hours >= context.thresholds.min_work_hours_per_week)

filter, all and len are zen-expression 0.55 functions (ClosureFunction in the crate’s functions/mod.rs); some(input.eligible_coas, # == …) and len( are the in-tree precedents, and the derivation fold reads a node’s top-level input keys (node_granular_inputs, services/canopy-rules/src/derivation.rs), so an array input is one key. U2 pins the closure forms with a parity test that evaluates the Georgia JDM locally (services/canopy-caps/src/determine/parity_tests.rs) on a two-parent input, in case a zen bump changes closure semantics. The age test reads input.child_has_documented_disability. CapsGates is unchanged, so the snapshot and firings carry the per-parent input under ADR-028. denial_reasons names each failing parent by position ("Parent 2: activity not verified", "Parent 1: 18 hours below the 24-hour minimum", "no parent remains to meet the activity requirement: every parent holds a care waiver"), and a child at or over child_age_max with no disability finding says so. The caps_eligibility_input_keys_match_ruleset_refs and caps_eligibility_thresholds_match_ruleset_refs tests pin the new keys.

The authorization’s weekly_hours becomes the greatest tested parent’s hours (today’s copy of the household scalar, per parent), and scholarship_type is the child’s recorded type or NULL. UpdateAuthorizationRequest gains scholarship_type: Option<ScholarshipType> so a worker can set or correct it after determination through PUT /v1/authorizations/{id}; authorization_update.rs applies it in the same update and the update’s one "update" note (store/authorizations.rs) covers it as it covers the other fields.

D3 — One pack key

"Each parent must meet the activity requirement" is the federal shape of 45 CFR 98.20(a)(3)(i) ("a parent or parents who are working or attending …"), so it is not a pack key. The state option is the waiver: [caps].disabled_parent_care_waiver = true | false, required (a missing key refuses boot like copayment_tiers, services/canopy-caps/src/params.rs). Georgia: true, cited to §6.8.1.8 in citations.toml; default and test-max: true, cited fixture. test-min has no [caps] section and canopy-caps never loads it. The key travels in context.thresholds beside the age ceilings; when false the ruleset’s tested_parents is every parent. Both arms are pinned: the true arm by the Georgia integration tests, the false arm by a parity test that evaluates the Georgia JDM with disabled_parent_care_waiver: false in its thresholds and sees a waived parent tested. Verification of the waiver is not a key: §6.8.1.8 requires it, and a jurisdiction without the waiver has no verification to relax.

D4 — canopy-caps signs and dedupes the dispatch operation

The orchestrator dispatches only to a service that signs and dedupes the operation (the maintainer’s 2026-10-29 ruling, #3116; quarantine.rs only_an_operation_signing_program_is_dispatched), and signs_its_operation (services/canopy-eligibility/src/quarantine.rs) names SNAP, Medicaid, TANF and WIC. Mirror canopy-wic’s #3158 (Plan: Dispatch WIC determinations from the orchestrator (#2364), D2b), keyed per subject:

  • CapsApplicationContext gains operation_id: Option<DeterminationOperationId> (#[serde(default, skip_serializing_if = "Option::is_none")]). post_determine refuses a body naming one from any caller but canopy-eligibility with 403 (enforce_operation_gate); a direct caller naming none still determines.

  • determine assigns operation_id on every child’s envelope before signing.

  • Migration 20270309000000_caps_determinations_operation.sql: caps_determinations gains operation_id UUID and signed_payload BYTEA, a CHECK operation_id IS NULL OR (signed_payload IS NOT NULL AND jws_token IS NOT NULL), and CREATE UNIQUE INDEX caps_determinations_operation_subject_uq ON caps_determinations (operation_id, child_person_id) WHERE operation_id IS NOT NULL. Older rows carry none and stay readable.

  • A replay answers 200 with the operation’s stored envelopes in child_person_id order and writes nothing; a concurrent second execution trips the index in persist_outputs and answers 409 operation_already_determined (canopy-wic’s OPERATION_SLOT handling in services/canopy-wic/src/api/persist.rs).

  • services/canopy-caps/src/api/held.rs names the row’s operation where it says operation_id: None; signs_its_operation adds CanopyService::Caps, and the quarantine test’s list gains CAPS.

D5 — The orchestrator dispatches CAPS

services/canopy-eligibility/src/mappers/caps.rs, after mappers/wic.rs: context(ctx, as_of) → Result<CapsApplicationContext, ContextError>. Children are the members who are the child in a parent_child edge; parents are the edge parents who are members, deduplicated. age_years comes from MemberContext.age (a member without one is a persons gap naming members[].age); gross_monthly_income reuses wic::gross_monthly_income (moved to mappers/income.rs, the plain monthly sum that refuses an unconverted frequency); provider_id is None; eligibility_type is initial unless the dispatch carries an order or a continued trigger, in which case continued. A household with no edges returns InputUnsatisfiable naming parent_child, source_class = "persons", no gap issue. The mapper carries the claimed operation_id as the WIC mapper does. caps_worker_fact_gaps and its test go. MappedContext gains a Caps(CapsApplicationContext) arm. ADR-035 Amendment 1 gets an erratum: CAPS is no longer refused.

D6 — Catalogue

compliance/action-catalogue/caps.toml: a new row caps.eligibility.apply-two-parent-activity-rule (§6.8.1.7–6.8.1.8; kind = "endpoint", caps POST /determine, test_ref the two-parent integration test) and caps.payments.record-type-of-care-on-scholarship (§10.5.3; the care-need POST, test_ref the authorization-carries-type test). compute-activity-hours loses its two-parent clause and keeps the arithmetic, still allowlisted under #840; select-scholarship-type-by-need keeps the one-per-type mandate under #842. Rows are split, not relabelled, so no binding claims more than its test shows.

Risks

  • An absent activity row reads as unverified with zero hours (fail-closed). A parent nobody recorded fails the activity test and the denial reason names the parent and "no activity recorded"; the CAPS tab shows "no standing recorded" beside the parent (U3). Pinned by the integration test for an unrecorded parent.

  • An absent care-need row reads as no documented disability (silent for a child under the standard ceiling, fail-closed above it). Under 13 the flag cannot change the outcome. From 13 the child is denied on age and the reason says no disability finding is recorded, never a bare age denial. Pinned by the 13-year-old pair of tests.

  • A claimed, unverified waiver does not waive (fail-closed). The parent is tested and fails; the reason says the waiver is unverified. The CHECK forbids a verification without the claim, and 422 care_waiver_without_claim mirrors it on the wire.

  • The orchestrator newly dispatches CAPS to live households (behavioural). A household applying for CAPS that pended as input_unsatisfiable today gets a signed determination; one with no parent_child edge still pends, naming parent_child. The dispatch is gated by the #3116 operation binding (D4), so a retry never doubles a determination.

  • Fixture churn (silent). services/canopy-caps/tests/caps_test.rs, the parity tests, tools/canopy-seed and tests/e2e/specs/worker-portal-caps-actions.spec.ts build the v2 body. U2 changes them mechanically: a fixture that relied on household hours now records a parent row with those hours. The insta snapshots under services/canopy-caps/tests/snapshots/ are the check that no outcome moved unasked.

  • Ruleset sync (fail-closed). caps_eligibility_input_keys_match_ruleset_refs compares the Rust input keys with each pack’s JDM; a pack missed in U2 fails that test.

Units (weights by complexity) — U1 → U2 → (U3 ‖ U4) → U5 → U6

Weights: 1 trivial · 2 small · 3 medium · 5 large · 8 very large. One unit = one independently shippable MR = one child issue.

U1 (w5) — The two worker-fact records

Files: services/canopy-caps/migrations/20270308000000_caps_worker_facts.sql, crates/canopy-contracts-caps/src/{parent_activity,care_need,paths,lib}.rs, services/canopy-caps/src/store/{parent_activities,child_care_needs,models}.rs, services/canopy-caps/src/api/handlers/{parent_activity,care_need}.rs, services/canopy-caps/src/api/mod.rs, services/canopy-caps/src/api/facts_route_tests.rs, docs/modules/ROOT/pages/api/canopy-caps.adoc, docs/modules/ROOT/pages/data-models/canopy-caps.adoc.

D1 in full. Tests (contract and route): a create returns 201 with the bearer’s subject as recorded_by; a service token is 403; an unknown token or an extra field is 422; a waiver without the claim is 422 care_waiver_without_claim; standing_on picks the newest effective row and breaks a tie by created_at; the list is newest first. cargo xtask migrations-lint clean. No determination change yet.

U2 (w5) — The per-parent activity test and the type of care

Files: crates/canopy-contracts-caps/src/{determine,authorizations}.rs, services/canopy-caps/src/{determine,params}.rs, services/canopy-caps/src/determine/parity_tests.rs, services/canopy-caps/src/api/{persist,authorization_update}.rs, services/canopy-caps/src/store/authorizations.rs, rulesets/{georgia,default,test-max}/caps-eligibility.json, rulesets//jurisdiction.toml, rulesets//citations.toml, compliance/input-requirements/caps.toml, services/canopy-caps/tests/caps_test.rs, tools/canopy-seed/src/{datagen,model,sql}.rs, tests/e2e/specs/worker-portal-caps-actions.spec.ts.

D2 and D3. Integration tests through the real Georgia pack (regression, each failed by a mutation): two verified parents at 30 and 24 hours approve; 30 and 18 deny naming parent 2; 30 and an unverified 40 deny; an unrecorded parent denies naming the gap; 30 and a verified-waiver parent approve on parent 1 alone; 30 and a claimed-but-unverified waiver deny; two waived parents deny; a 13-year-old with a disability finding approves and without one denies naming the missing finding; the authorization carries the recorded scholarship_type and NULL when none; PUT /v1/authorizations/{id} sets it. Parity tests (contract): the closure forms on a two-parent input, and the disabled_parent_care_waiver: false arm. The seed and the CAPS e2e spec build the v3 body. cargo xtask policy input-coverage and the snapshot tests pass.

U3 (w3) — The worker forms

Files: services/canopy-web/src/api/actions_caps/{parent_activity,care_need}.rs, services/canopy-web/src/api/case_detail/caps_tab/facts.rs, services/canopy-web/templates/cases/tab_authorization.html, services/canopy-web/src/api/mock_upstream/caps_facts.rs, services/canopy-web/src/api/actions_caps/tests.rs.

Two forms on the CAPS case tab after actions_wic/breastfeeding.rs: WritePermission and ProgramScope<Caps> first, the person proven on the household roster (fact_editor::ensure_household_member), the write on the worker’s delegation, canopy-caps' coded refusals as server-owned copy. The tab lists each parent’s current standing (or "no standing recorded") and each child’s current need, text not colour. Route tests cover the scope gate, the roster proof, each refusal’s copy, and the rendered standing. The authorization form offers scholarship_type.

U4 (w3) — canopy-caps signs and dedupes the operation

Files: services/canopy-caps/migrations/20270309000000_caps_determinations_operation.sql, crates/canopy-contracts-caps/src/determine.rs, services/canopy-caps/src/{determine.rs,api/handlers.rs,api/persist.rs,api/held.rs,store/determinations.rs,store/models.rs}, services/canopy-eligibility/src/quarantine.rs, services/canopy-caps/tests/caps_test.rs.

D4. Tests: a replay of a known operation answers 200 with the stored envelopes and writes no row or event (regression); two concurrent executions of one operation yield one set of rows and one 409 (concurrency, with a barrier, no sleep); a body naming an operation from a non-eligibility caller is 403; a direct caller naming none still determines; the held list names the operation. only_an_operation_signing_program_is_dispatched admits CAPS.

U5 (w3) — The orchestrator dispatches CAPS

Files: services/canopy-eligibility/src/mappers/{caps,income,mod,wic}.rs, services/canopy-eligibility/tests/orchestrator_dispatch_test.rs, docs/modules/ROOT/pages/adrs/adr-035-per-member-determination-and-program-mappers.adoc, docs/modules/ROOT/pages/api/canopy-eligibility.adoc.

D5. Tests (mapper unit, then dispatch integration): a two-child, two-parent household maps to two children and two deduplicated parents; a member without an age is a persons gap; no edges is a parent_child gap; a converted-frequency income sums and an unconverted one refuses (shared with WIC); the dispatch test posts a CAPS filing and reads one signed determination per child through the orchestrator, and a redispatch of the same operation reads the same ids; map_context_caps_errs_with_worker_fact_gaps is replaced, not deleted.

U6 (w3) — Catalogue, e2e flow and pages

Files: compliance/action-catalogue/caps.toml, compliance/action-coverage-allowlist.toml, tests/e2e/specs/flow-caps-two-parent-waiver.spec.ts, tests/e2e/lib/given/caps.ts, docs/modules/ROOT/pages/services.adoc, docs/modules/ROOT/pages/federal-requirements.adoc, docs/modules/ROOT/pages/rulesets.adoc.

D6; cargo xtask policy action-coverage clean. One e2e flow: a worker records two parents (one with a verified waiver) and a child’s full-time need, files, and the case shows an approved child with a full-time scholarship; then records the waiver as unverified, redetermines, and sees the denial name the parent. A flow- prefix, not journey- (#1409).

Verification

  1. cargo xtask test — the unit and integration lanes pass (see Testing).

  2. cargo xtask dev restart (U1 adds a migration; U2 changes packs), then cargo xtask e2e.

  3. cargo xtask policy input-coverage, policy action-coverage, policy audit (caps), rules lints, migrations-lint, quality-budgets.

  4. cargo xtask validate — the pre-push battery is green.

  5. U6’s MR carries Closes #3071; each earlier unit’s MR closes its own child issue and says Relates to #3071. After U6 merges, the plan moves to plans/archive/ with Done.

Documentation Updates

  • api/canopy-caps.adoc (the two records, the v3 determine body, the operation gate and replay, scholarship_type on PUT), data-models/canopy-caps.adoc (two tables, three columns, one index), api/canopy-eligibility.adoc (CAPS dispatch), services.adoc

  • CHANGELOG.adoc — one entry per unit under == Unreleased

  • ADR-035 Amendment 1 erratum (U5); rulesets.adoc for the [caps] key; federal-requirements.adoc 45 CFR 98.20(a)(3)(i) row names the per-parent test

Review log

round vendor resolved model verdict

1

anthropic

claude-fable-5-1 (gadhs/pi plan review at exit_plan_mode)

no-ship (fixed): no Risks section and no issue close; a test-max contradiction; admission misnamed; a two-arm pack key was compatibility scaffolding (cut to one key, both arms pinned)

2

google

gemini-4-argon (second-vendor review)

no-ship (fixed): the #3116 operation signing and dedupe was missing before dispatch (U4 added); the note-history claim was corrected; test categories are labelled per unit

Edit this page · default