Fix #2046: add missing promote_to_l1 steps in SharedLearningStore tests#894
Open
AlexMikhalev wants to merge 3 commits into
Open
Fix #2046: add missing promote_to_l1 steps in SharedLearningStore tests#894AlexMikhalev wants to merge 3 commits into
AlexMikhalev wants to merge 3 commits into
Conversation
added 3 commits
June 3, 2026 07:19
…sts Refs #2046 SharedLearning::new() initialises trust_level to L0 (Extracted). promote_to_l2() requires L1 (Unverified) as a precondition. The 5 failing tests skipped the L0->L1 step before calling promote_to_l2() or asserting TrustLevel::L1, producing silent no-ops and wrong counts. Fix each failing test to follow the documented promotion chain: L0 -> promote_to_l1() -> L1 -> promote_to_l2() -> L2 All 9 SharedLearningStore tests now pass; no regressions in terraphim_types.
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.
Summary
shared_learning_cli_tests.rsfailed because they skipped the requiredL0 → L1promotion step before callingpromote_to_l2()or assertingTrustLevel::L1SharedLearning::new()initialises toTrustLevel::L0(Extracted);promote_to_l2()requiresL1as documented intest_promote_to_l2_requires_l1promote_to_l1()beforepromote_to_l2(), following the documented chain: L0 → L1 → L2Test plan
cargo test -p terraphim_agent --test shared_learning_cli_tests --features shared-learning→ 9/9 passcargo test -p terraphim_types→ no regressionscargo clippy -p terraphim_agent --features shared-learning -- -D warnings→ cleancargo fmt -p terraphim_agent -- --check→ cleanRefs: terraphim/terraphim-ai#2046 (Gitea)
Generated with Terraphim AI