Repository navigation
test(optimizer): add unit tests for appendix note consolidation - #459
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Lanre Shittu (Shizoqua) wants to merge 1 commit into
Conversation
consolidate_appendix_notes compacts the skill-aware Execution Notes Appendix with one optimizer call and must never lose notes when that call fails. It had no tests. Cover the skipped call for fewer than two notes, the request it sends (numbered notes, budget, retries, stage), fenced and note-object replies, and that an exception, a prose or empty reply, an empty or wrong-key result, or a result longer than the input returns the original notes. The optimizer call is a fake, so no model is used.
This branch has not been deployed
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
consolidate_appendix_notesinskillopt/optimizer/skill_aware.pycompacts the skill-aware Execution Notes Appendix with one optimizer call. The trainer calls it when the appendix grows pastskill_aware_consolidate_threshold, and its contract is that a failure never loses notes. It had no tests.Changes
New
tests/test_appendix_consolidation.py(test-only, no source changes). The optimizer call is a fakechat_fn, so no model is contacted.stage="appendix_consolidate",retries=2, the givenmax_completion_tokens, and the stripped notes numbered in the user message{"note": ...}/{"content": ...}objectsCHANGELOG.md: entry under Tests.Verification
17 tests pass. Each of these changes to the function makes at least one test fail: allowing one note through to the model, dropping the length check, making it strict (
<), returning[]on failure, re-raising the exception, and changing the stage, retries or token budget. Full suite: 2446 passed, 12 skipped, 4 xfailed.ruff checkandruff format --checkpass on the new file.