Repository navigation
fix(learning): keep the generation when community permissions are saved unchanged (#373) - #33
Merged
Merged
Conversation
…ed unchanged (#373) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync of private jcguo123/Choruz#373, merged as
c0d12a84. The same patch is applied on publicmain; the branch tree equals privatemain's tree.Type
bugfix— fixes a bugAgent Note
New:
.agents/notes/implemented/bug-fix/2026-10-28-unchanged-community-save-keeps-generation.mdSummary
Symptom. A reviewed learning candidate could be orphaned: its automatic evaluation was never queued, it was never applied, and the owner saw no error.
Cause.
configure_behavior_communityincremented the policy generation on every save, including a save of the permissions already stored.pending_experience_optimizationsonly queues candidates from the current generation, so the candidate is never queued.Fix.
configure_behavior_communitynow locks the policy row and compares the stored and requested settings asCommunitySettings. When they are equal it writes nothing. A changed consent still advances the generation, clears the learning lease and releases behavior-event leases.How it was found. The remote learning e2e failed on #372, a CI-only PR.
8e4f27be(included here) makes the activation timeout report the evaluation list and the policy errors.Evaluations when activation timed out: [].Ownership
DbService::configure_behavior_communityremains the single place that decides what a community consent change fences.Tests
tests::experience::reliability::saving_unchanged_community_permissions_keeps_the_learning_generation(new)pending_experience_optimizations()still lists the binding. Savingsearch: truethen advances the generation by one.behavior.rs:left: 2, right: 1, capturedtests::experience, e.g. "revoked consent must fence an already prepared projection"terminal.spec.ts(test-only)Ran locally
On
7e3c28ac:cargo clippy --workspace --all-targets -- -D warnings: 0 findings.cargo test --workspace --no-fail-fast, withsource infra/host/setup_test_database.sh: 64 binaries, 969 passed, 0 failed.cargo fmt --checkandverify_agent_notesboth pass.Remote learning e2e with the fix, 12 runs with 6 workers and no retries: 11 passed.
learning prepareHTTP 409 race. The gateway warn log shows an activation during preparation:binding_changed=true,revision_before=None,revision_after=Some(…).Independent audit: GPT-5.6 Terra used
choruz-pre-simplify-auditonorigin/main..7e3c28acand returned PASS.Risk
A re-save of identical permissions no longer refreshes leases or the generation. Any flow that relied on a no-op save to retry blocked work must use
retry_behavior, which already exists for that purpose.This PR was written by an AI agent (Claude), which ran every command listed above.