Repository navigation
fix(setup): accepting registration terms that say so switches usage sharing on (abilityai/trinity-enterprise#1403) - #4810
Conversation
…refused" (Abilityai/trinity-enterprise#1397) The consent flag is off both for an install that was never asked and for one whose admin switched sharing off. A caller that turns sharing on for the operator had no way to tell them apart. `telemetry_sharing_service.has_opted_out()` answers it from the rows the service already writes: the consent row stored as off, a consent time left from when sharing was on, or the "Don't ask again" mark. Deleting the rows (the reset path) returns the install to never asked. An unreadable store counts as a refusal. No behaviour changes in this repository: the caller is in the private module. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…haring on (abilityai/trinity-enterprise#1403) The self-serve registration terms say usage sharing is on by default and that accepting them switches it on, unless the person already switched it off. Setup recorded the acceptance and nothing else, so sharing stayed off. - setup_registration: a provider's terms may carry usage_sharing_on_accept (only a literal True counts; anything else reads False and never makes the terms unavailable). accepted_terms[_if_applies] return the accepted document, so setup acts on the version actually accepted, read fresh at submit. - telemetry_sharing_service.switch_on_with_terms(actor, via=...): the Settings switch turned on (set_consent, the telemetry_sharing_consent audit line plus via, the backfill share), only for an operator who never chose: the kill switch wins, an install already sharing is left alone, and a refusal on record (has_opted_out, ent#1397) is never overridden. Never raises. - routers/setup: on the registration-terms path, when the accepted terms say so, calls it with via="registration_terms". Never fails setup. No provider, terms without the flag, and the instance-ID form are unchanged. Mutation: removing the setup hand-off turns 4 tests red; removing the has_opted_out guard turns the 3 refusal cases red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Private half: abilityai/trinity-enterprise PR for #1403 (provider marks which registration versions switch sharing on). |
|
/validate-pr (run This PR requires the following changes before merge:
Done by this run: added The code passed every check this run made:
Tier 1 hasn't run yet because the PR is stacked. Merge #4786 first, then retarget. |
…switched sharing on (abilityai/trinity-enterprise#1403) The header said "Off by default ... nothing is shared until you turn this on". Once accepting terms at setup that say so switches sharing on, the panel opens with sharing on and that sentence is false. It now names both ways sharing comes on and that it can be switched off here any time. telemetrySharingPanelHeader.mount.spec.js mounts the panel, on and off; both cases were red against the old sentence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
/validate-pr second validation (run The one change requested last round is fixed:
The delta checks:
Earlier checks re-run on this head:
Merge gate: Tier 1 Cross-tracker reference: set |
#4786 landed on dev as d6629b8 (content-identical to 2d2c17d on this branch). Only conflict: tests/registry.json, both entries kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ff the loop (abilityai/trinity-enterprise#1403) The #4674 ratchet (test_the_ratchet) went red at 253b089: the hand-off added three sync db calls inside async defs. `switch_on_with_terms` now makes the kill-switch / already-on / refusal decision and the `set_consent` write in one worker thread (`_switch_on_with_terms_sync`), and setup's admin lookup for that hand-off goes through `asyncio.to_thread`. Still never raises into setup. Red before (at 253b089): setup.py 10 > baseline 9, telemetry_sharing_service.py 13 > baseline 11. Green after, baseline untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
vybe
left a comment
There was a problem hiding this comment.
Approved by the product agent acting on the operator's standing word of 2026-11-27: independent validation APPROVE at this head (third pass, delta checked, mutations red) and Tier 1 green including the regression diff.
|
Regression details (head_sha: `253b089e57b72cb50a1bb418adf9c1f250197984`)Seed Backend unit-suite regression diffPer-XML totals
❌ New failures introduced by HEAD (1)Tests failing under HEAD that did not fail under BASE in any seed:
Legend: [F] = assertion failure, [E] = collection or fixture error. Seed Backend unit-suite regression diffPer-XML totals
❌ New failures introduced by HEAD (1)Tests failing under HEAD that did not fail under BASE in any seed:
Legend: [F] = assertion failure, [E] = collection or fixture error. Reproduce locally: |
Summary
usage_sharing_on_accept: true. When terms marked that way are accepted at setup, sharing is switched on through the platform's own switch. That only happens if the operator never chose: the kill switch wins, an install that is already sharing is left alone, and a refusal on record (has_opted_out(), abilityai/trinity-enterprise#1397) is never overridden.Stacked on #4786 (ent#1397's
has_opted_out()). The base is that branch, so this diff is only ent#1403. Merge #4786 first. The private half is abilityai/trinity-enterprise PR (linked below).Journey Impact: none: an existing step does not do what its terms say.
Changes
services/setup_registration.py: the optionalusage_sharing_on_acceptfield. Only a literalTruecounts. Any other value readsFalseand never makes the terms unavailable.accepted_terms[_if_applies]()returns the accepted document, re-read at submit.check_accepted[_if_applies]()is unchanged on top of it.services/telemetry_sharing_service.py:switch_on_with_terms(actor, via=...)turns the Settings switch on. It callsset_consent(True), writes the sametelemetry_sharing_consentaudit line plusvia(never the share id), and schedules the backfill share. It returns whether sharing is on and never raises.routers/setup.py: on the registration-terms path, when the accepted terms carry the flag, setup calls it withvia="registration_terms", inside a try block, so setup never fails on it.components/settings/TelemetrySharingPanel.vue: the Usage sharing header said "Off by default … nothing is shared until you turn this on", which is false once accepted terms switched sharing on. It now says sharing is off unless it is turned on there or terms accepted at setup say accepting them switches it on, and that it can be switched off there any time. Pinned bytests/unit/telemetrySharingPanelHeader.mount.spec.js(mounted, on and off; red against the old sentence).docs/memory/requirements/infrastructure.md(PROV-020),tests/registry.json.Fix round after validation. Which terms say so is decided by the provider, and it now compares the accepted text, not only the version: sharing comes on only when the version and the sha256 of the text are a pair it knows. A known version with any other text leaves sharing off and is logged. That is all in the private half. The seam here still acts only on a literal
True.Acceptance criteria
tests/unit/test_ent1403_sharing_on_at_registration.py)test_accepting_terms_that_say_so_leaves_sharing_onDO_NOT_TRACK/TELEMETRY_SHARING_ENABLED=falsetest_a_refusal_on_record_keeps_sharing_off[switched-off, on-then-off, dont-ask-again],test_the_kill_switch_winstest_terms_that_do_not_say_so_leave_sharing_as_it_was[false, absent, string, int],test_no_provider_leaves_sharing_as_it_was,test_the_instance_id_form_is_unchangedtest_accepting_terms_that_say_so_leaves_sharing_on(get_status()),test_switching_it_off_afterwards_works_as_todaytest_the_first_run_step_does_not_ask_again: thetelemetry_sharing_enabledflag thatfirstRunSteps.jsgatespendingon. No frontend change neededtest_the_change_is_audit_logged_naming_the_doortest_a_failing_switch_never_fails_setup,test_a_failing_audit_never_fails_setup_and_sharing_stays_onTest Plan
has_opted_outguard turns the 3 refusal cases red. Both were restored.routers.setup,setup_registrationortelemetry_sharing_service(25 files): 668 passed, 2 skipped.test_ent1403+test_ent1329, 60 passed.Related to abilityai/trinity-enterprise#1403 (closed manually at release).
🤖 Generated with Claude Code
Fixes abilityai/trinity-enterprise#1403