Repository navigation
feat(preflight): implement --check-repos and gate the batch on it - #38
Merged
Merged
Conversation
Three shipped files told users to run a flag that did not exist. The onboard-benchmark skill names it at two steps and the annotated dataset template at one, so the repo's guided path for a user bringing their own repository died on an argparse error at its first step -- exactly where someone is least able to tell a broken tool from their own mistake. This is the third defect traced to one partial port. aws-samples commit 6daa1bc took `runner_config.py` (+85 lines) and the onboard-benchmark skill from upstream PR #193 without `run-swe-headless.py` or `preflight_check.py`. The same commit is why agent=strands silently ran claude -p (PR #32) and why api_key_env was validated and ignored (PR #36). Declaration without implementation, three times over. What --check-repos does: `git ls-remote` every repo/ref pair in the dataset before any task starts. The harness clones per task, so an unreachable repo or a missing tag otherwise fails once per task, hours into a batch. It transfers no objects, so it costs seconds, and it is the usual first failure on a private or enterprise repo. run-e2e-benchmark.sh now runs it ahead of the existing artifact-folder check and refuses to start the batch if it fails. Ported with it, since the upstream file is one piece: - _diagnose_git_error turns git's stderr into a cause -- missing repo versus missing ref versus untrusted CA versus a credential prompt -- so the failure names what to fix instead of printing a porcelain error. - _assert_inside_root refuses to touch a resolved artifact directory outside the benchmarks root. It is defence-in-depth for --check today and becomes load-bearing now that _existing also counts a failed attempt that left no artifacts, which widens what --clear will remove. - --model is no longer required. It is needed by --check and --clear, which resolve a per-model artifact folder, and meaningless to --check-repos, which reads only the dataset. Requiring it would have forced users to invent one. Verified against real endpoints rather than mocks: hello-world's octocat/Hello-World @ master reports reachable and exits 0; a dataset pointed at a nonexistent repo exits 1 and names the cause. Both commands the onboard-benchmark skill documents now run. 635 tests pass (27 in the preflight suite, up from 12), no new failures. ruff, ruff format and bandit (0 issues at every severity) clean; shell syntax checked.
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.
The bug
Three shipped files told users to run a flag that did not exist.
onboard-benchmark/SKILL.mdnames it at two steps, andbenchmarks/dataset/workshop-template.yamlat one — so the repo's guided path for a user bringing their own repository died on an argparse error at its first step, which is exactly where someone is least able to tell a broken tool from their own mistake.This is the third defect from one partial port
aws-samples commit
6daa1bctookrunner_config.py(+85 lines) and theonboard-benchmarkskill from upstream PR #193 — withoutrun-swe-headless.pyorpreflight_check.py:strands_agent_runner.pyagent: strandssilently ranclaude -papi_key_envinrunner_configlocal--check-reposSame shape three times: the declaration arrived without the implementation, so validation passed and docs read correctly while the behaviour was absent.
What
--check-reposdoesgit ls-remoteon every repo/ref pair in the dataset before any task starts. The harness clones per task, so an unreachable repo or a missing tag otherwise fails once per task, hours into a batch. It transfers no objects, so it costs seconds, and it's the usual first failure on a private or enterprise repo.run-e2e-benchmark.shnow runs it ahead of the existing artifact-folder check and refuses to start the batch if it fails.Ported with it
The upstream file is one piece, so three related things come along:
_diagnose_git_errorturns git's stderr into a cause — missing repo vs missing ref vs untrusted CA vs a credential prompt — so the failure names what to fix instead of printing a porcelain error._assert_inside_rootrefuses to touch a resolved artifact directory outside the benchmarks root. It's defence-in-depth for--checktoday, and becomes load-bearing now that_existingalso counts a failed attempt that left no artifacts, which widens what--clearwill remove.--modelis no longer required. It's needed by--checkand--clear, which resolve a per-model artifact folder, and meaningless to--check-repos, which reads only the dataset. Requiring it would have forced users to invent one.Verification
Against real endpoints, not mocks:
Both commands
onboard-benchmarkdocuments now run.635 tests pass — the preflight suite goes from 12 to 27 — no new failures.
ruff,ruff format,bandit(0 issues at every severity) clean; shell syntax checked. The one failure,test_judge_common.test_lowercase_preferred_on_collision, fails onmaintoo (assumes a case-sensitive filesystem).Checked for divergence before porting
main's version of this file had no aws-samples-specific content — the 35 removed lines are all refactors upstream made while adding the feature (docstring,_ARTIFACT_FILENAMES, task-loading extracted into_load_tasks, the--modelchange). Nothing lost.