Repository navigation
fix(harness): reseal the scenarios that load and name the ones that could not be applied (TH-8929) - #324
Draft
KarthikAvinashFI wants to merge 7 commits into
Draft
fix(harness): reseal the scenarios that load and name the ones that could not be applied (TH-8929)#324KarthikAvinashFI wants to merge 7 commits into
KarthikAvinashFI wants to merge 7 commits into
Conversation
…d named on publish, and a failed reseal keeps the change as a draft
… publish so a larger set never refuses the save
…er of a case written in the same save
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.
Why
TH-8929: when a builder turn changed several scenarios and one of them could not be loaded the way a run loads it, the reseal failed and the whole turn failed with it, so every good change was lost. Now the good changes save, the case that could not be applied keeps its last sealed version (or stays out if it was never sealed), and the platform is told which case it was and why.
What changed
src/fi/alk/harness/bundle_author_v2.pyscenario_seal_problems(authoring)loads each scenario folder alone, as a run does (scenario_source._load_one), and returns{key: first line of why}.reseal_scenarios(authoring, skip=...)reseals without the failing keys;_copy_scenarioskeeps a skipped case's last sealed copy, never under a folder name a case written in the same save uses.src/fi/alk/harness/hosted_chat_entrypoint.py_save_changeschecks first, reseals with the failing keys skipped and publishes withfailed_scenarios; the reply adds "Saved, except N scenarios that could not be applied: key: reason." A failure of the whole reseal (contract or seed) no longer fails the turn: the change is kept as the chat's unsaved draft and the reply says so.src/fi/alk/harness/hosted_conversation.pyConversationClient.publish(digest, failed_scenarios=...)sends{"digest", "failed_scenarios": [{"scenario_key", "reason"}]}, at most the platform's 200, and only when there is one.Behavior callouts
fix/TH-8929-partial-applyrefuses the unknown field; the field is sent only when a case failed, so ordinary saves are unaffected.Tests
test_builder_chat.py::test_one_broken_scenario_does_not_block_the_save::test_a_folder_a_run_cannot_load_keeps_its_sealed_version::test_a_held_copy_never_takes_the_folder_of_a_case_written_now::test_a_failed_reseal_keeps_the_change_as_a_draft::test_publish_sends_at_most_the_platform_limit_of_failed_scenariosRun on this branch (the targeted harness modules, one process): 2647 pass; three failures, the same on
dev(0203bdf5). Mutations: reseal withoutskip, and the held-copy folder guard, each fail their test.Break-it attempts: every case failing (each named), a never-sealed failing case (left out, the rest sealed), a held copy whose folder a good case took (fixed here: it raised
FileExistsErrorand failed the whole reseal), 250 failures (capped at 200), a multi-line reason (first line only).Live proof
The platform half is shown live on future-agi
fix/TH-8929-partial-apply(one case of twelve reads "Could not apply" with its reason, the others keep their state, and discard clears it). A builder turn that writes an unloadable folder is not reproducible on purpose: the builder's own gate refuses a broken case before it is written, so the reseal path is shown by the tests above.Stacked on / merge order
feat/TH-8918-scenario-lifecycle(feat(harness): negative controls, leaked-answer check, grounding and suite proving (TH-8918) #321), this PR's basefix/TH-8929-partial-applyLinear: TH-8929