Repository navigation
microskills: read a wrapper's own options before the command it runs - #239
Open
KVR Vishnu (VISHNU0906) wants to merge 1 commit into
Open
KVR Vishnu (VISHNU0906) wants to merge 1 commit into
KVR Vishnu (VISHNU0906) wants to merge 1 commit into
Conversation
classify_command dropped only the wrapper's name, so in `env -u VAR python -m pytest`, `nice -n 10 pytest` or `sudo -u bob pytest` the first option became the command and the run was not observed. Go past each wrapper's options (the same table loopguard's shell_edits uses), and mark an `env` that changes the environment as typed with an assignment. Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
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.
Hi Saksham Uboweja (@SakshamUboweja), this is the micro-skills side of #237.
classify_commandinmicroskills/observe.pydrops a wrapper in front of a command, but only the wrapper's name. When the wrapper had options of its own, the first option became the "command", so the run was not observed at all:env -u CURSOR_AGENT python -m pytest,nice -n 10 pytest,sudo -u bob pytest,time -o t.txt pytestandtimeout -s KILL 60 pytestgave no observationnice -n 10 python -m pytestafter a failed barepytestnever counted as evidence for the form repair factNow it goes past each wrapper's options, using the same table as
_WRAPPERSinloopguard/shell_edits.py(value-taking options, clusters like-Eu bob, attached values like-n5,--, and timeout's duration). I kept a copy inobserve.pyinstead of importing it, since the mechanisms don't import each other. Happy to move it somewhere shared if you'd rather.An
envthat changes the environment (-u,-i,-,-C,-S) now setso.env, the same wayenv VAR=1already does, so a form that only worked withenv -u VARin front isn't named as the working form.Tests: two new tests in
tests/test_envfacts.py, one onclassify_commandand one throughEnvFactsDistiller(a wrapped repair forms the fact, anenv -uone is not named). Both fail withobserve.pyfrom main.python -m pytest tests experiments/testspasses on Python 3.10 and 3.13, andscripts/dead_code.pyoutput is the same as on main.