Trust a verified handoff for general-measures deferral too, not just sona_url
Browse filestask_pe-cu-nicewebrl found and fixed a gap in their own consent-skip logic:
it depended on sona_url reaching the second task's session, which does not
happen when the first task supplies its own sona_url from a Space secret
and does not carry it into the handoff. Checked whether this task's handoff
has the same gap: it does not. other_task_url() carries sona= whenever
app.storage.user["sona_url"] is already resolved, and that resolution
(including the SONA_RETURN_URL fallback) runs before finish_experiment()
can build the handoff, confirmed by reading the code and by calling
other_task_url() directly.
This task's consent gate also does not share their failure shape (it
defaults to not showing consent unless the combined study is confirmed
active, the opposite default from theirs).
The general-measures (demographics/TriPM) deferral does share the same
dependency on _in_combined_study(), so it's hardened the same way: trusts
a directly verified handoff (task_order_source == "handoff" and
task_position == 2) alongside _in_combined_study(), rather than depending
solely on sona_url. Not currently exposed given SONA_RETURN_URL is
configured, but the failure direction would have been the measures never
running, not running twice.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Files changed (2)
- PROJECT_LOG.md+35
- web_app.py+20-2
795 unmodified lines796797798799800801795 unmodified linescould only ever surface by actually playing both tasks in sequence, which nothing beforethis item had done since the reference-code redesign (items 46-47) landed.## 7. In progress / open items- **Is a pilot actually ready to go out? NOT YET — item 48 found a real handoff bug thefirst actual live two-task playthrough surfaced.** The SONA study listing exists (item 43)795 unmodified lines796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836795 unmodified linescould only ever surface by actually playing both tasks in sequence, which nothing beforethis item had done since the reference-code redesign (items 46-47) landed.49. **`task_pe-cu-nicewebrl` found and fixed their own mirror of item 48 (2026-10-13)** --root cause: their consent-skip was gated on their `_in_combined_study()` equivalent, whichrequires `sona_url`. This task supplies its own `sona_url` from `SONA_RETURN_URL` (a Spacesecret) rather than the query string, and a participant arriving at a SECOND task with no`sona_url` in that session's own storage made `_in_combined_study()` false there even on agenuinely verified handoff, so their consent-skip never fired. Their fix trusts a verifiedhandoff directly, regardless of `sona_url`.- **Checked, not assumed, whether this task's own handoff could do the same thing**:`order_link.other_task_url()` carries `sona=` across the handoff whenever`app.storage.user["sona_url"]` is already resolved, and that resolution (including the`SONA_RETURN_URL` fallback) runs on every request before `finish_experiment()` can buildthe handoff -- confirmed by reading the code and by calling `other_task_url()` directlywith a realistic `sona_url` and reading the output. So this task's handoff is notcurrently missing `sona=` in production, and item 48's `62074`/Oct-8 observation thistraced back to does not reproduce via the mechanism `task_pe-cu-nicewebrl` found fortheir own side.- **This task's consent gate does not share the same shape**: it defaults to NOT showingconsent unless `_in_combined_study()` is active (the opposite default from their side,which shows consent unless explicitly skipped), so the specific "shown again" failuremode they found cannot occur here the same way -- confirmed by reading `run_intro()`.- **The general-measures (demographics/TriPM) deferral has the same shape of dependency on`_in_combined_study()` theirs had, hardened anyway**: `finish_experiment()` now alsotrusts a directly verified handoff (`task_order_source == "handoff"` and`task_position == 2`) alongside `_in_combined_study()`, rather than depending solely on`sona_url` having reached this session. Not currently exposed given `SONA_RETURN_URL` isconfigured, but the failure direction here would have been the measures never running(a gap) rather than running twice, since this task's own default (unlike their consentdefault) already fails toward "skip", not "show". Fixed for the same reason their fixwas worth having: nothing participant-facing should depend on a Space secret stayingconfigured when the actual proof -- the verified handoff -- is already in hand.- **Still open**: a fresh session on the effort task (`task-pe-cu-nicewebrl-f9`, distinctfrom the one that reported the above) is running a live combined-study playthrough rightnow, specifically to exercise both this item's fix and item 48's together for the firsttime. Neither fix has a live confirmation yet; this is that test.## 7. In progress / open items- **Is a pilot actually ready to go out? NOT YET — item 48 found a real handoff bug thefirst actual live two-task playthrough surfaced.** The SONA study listing exists (item 43)
888 unmodified lines889890891892893894895896897898899900901902903904905906907888 unmodified lines# See _in_combined_study(): study=="sona" alone is not enough (a stray/stale value must not# half-enter this flow for an ordinary lab session).is_sona = _in_combined_study()# The SONA return URL needs the raw SONA code, not the pseudonymised stored pid (see# _pid_pseudonym) -- SONA itself needs the raw code back to grant credit.survey_code = app.storage.user.get("survey_code") or pid# task_first was resolved once, in index(), via order_link.first_task (network I/O# against the shared allocation log) -- reused here rather than re-querying.sona_first = (app.storage.user.get("task_first") == order_link.THIS_TASK) if is_sona else True# Combined-SONA-study only: general self-report measures (demographics, TriPM) run once,# for whichever task the participant finishes SECOND -- these belong to the combined study,# not to this task specifically (see order_link.py and the matching consent gate in# run_intro()). Collected BEFORE save_data() below so the results land in app.storage.user# in time to be captured by this session's saved metadata like everything else there.if is_sona and not sona_first and not app.storage.user.get("general_measures_done"):with container.style("align-items:center;"):nicewebrl.clear_element(container)ui.markdown("### A couple more things before you're done.")888 unmodified lines889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925888 unmodified lines# See _in_combined_study(): study=="sona" alone is not enough (a stray/stale value must not# half-enter this flow for an ordinary lab session).is_sona = _in_combined_study()# task_pe-cu-nicewebrl found and fixed a gap in their own consent-skip logic: it was gated# on their equivalent of _in_combined_study(), which requires sona_url, but a participant# can arrive as a genuinely verified second task without sona_url ever reaching that# session, because their entry task supplies its own sona_url from a Space secret rather# than the query string and does not carry it into the handoff. Their fix trusts a verified# handoff directly instead of re-deriving the same conclusion from sona_url.## Checked directly rather than assumed: other_task_url() carries sona= across the handoff# whenever app.storage.user["sona_url"] is already resolved, and that resolution (including# the SONA_RETURN_URL secret fallback) runs on every request before this point, so this# task's handoff is not currently missing sona= in production. The general-measures gate# below has the same dependency on _in_combined_study() their consent gate had, with a# different failure direction here (a missing sona_url would skip the measures once rather# than show them twice), hardened the same way regardless, so neither depends on# SONA_RETURN_URL staying configured.really_second_task = (app.storage.user.get("task_order_source") == "handoff"and app.storage.user.get("task_position") == 2)treat_as_combined = is_sona or really_second_task# The SONA return URL needs the raw SONA code, not the pseudonymised stored pid (see# _pid_pseudonym) -- SONA itself needs the raw code back to grant credit.survey_code = app.storage.user.get("survey_code") or pid# task_first was resolved once, in index(), via order_link.first_task (network I/O# against the shared allocation log) -- reused here rather than re-querying.sona_first = (app.storage.user.get("task_first") == order_link.THIS_TASK) if treat_as_combined else True# Combined-SONA-study only: general self-report measures (demographics, TriPM) run once,# for whichever task the participant finishes SECOND -- these belong to the combined study,# not to this task specifically (see order_link.py and the matching consent gate in# run_intro()). Collected BEFORE save_data() below so the results land in app.storage.user# in time to be captured by this session's saved metadata like everything else there.if treat_as_combined and not sona_first and not app.storage.user.get("general_measures_done"):with container.style("align-items:center;"):nicewebrl.clear_element(container)ui.markdown("### A couple more things before you're done.")