Repository navigation
test(app): allow durable learning evidence retry in policy matrix - #2640
Merged
Merged
Conversation
Account for the first evidence-not-ready backoff and force delayed terminal persistence in a regression case. Keep production retry policy and exact policy/publication assertions unchanged. Co-authored-by: Mecatl <[email protected]>
This was referenced Nov 1, 2026
Merged
2 tasks
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
TestUsableAutoSkillsStockBuildPolicyMatrixflake: the test's three-second fake-time wait could expire during the intended five-second evidence-not-ready retry backoff.XDG_CONFIG_HOMEas well as explicit temporaryUserModelDir.Cause and regression
The engine saves the terminal aggregate and admits the durable learning attempt before emitting the terminal result event. This fixture appends streamed events to the durable log. Recovery can discover the admitted attempt before that terminal event has been appended, classify evidence as not ready, and persist its first five-second retry backoff.
Unmodified baseline reproduced empty learned skills with only one model call. Temporary observation of the actual durable attempt showed
running, claim generation 1, no checkpoint, and claim expiry at fake second 5 while the test failed at fake second 3.The regression withholds the terminal append until it observes that first short persisted backoff, confirms reflection has not called the provider, then releases the terminal evidence and requires the normal matrix assertions. Restoring only the old three-second polling budget makes this case fail with the same empty-skills/one-model-call signature.
Related: #2327, #1088, #1223. This fixes the reproduced current missing-skill timing failure only. It does not establish a fix for #1088's historical generic learned-skill RPC error or #1223's distinct inventory-catalog exhaustion warning; those issues should remain open. JSONL catalog consistency and cursor behavior are unchanged.
Verification
go test -race ./internal/app -run '^TestUsableAutoSkillsStockBuildPolicyMatrix$' -count=50 -cpu=1,2,4 -failfast -timeout=10m— passed 150 matrix executions / 1,650 subcase executions.task test— passed.task lint— passed.task test:race— passed.go run ./cmd/mecademo— passed, including tool call/result, permission ask/approval, and terminal result.API compatibility
Test-only change. No remote-observable behavior, exported Go API, protocol fields, stored-data format, API major, or feature identifier changes. No client upgrade required.