Support metric_direction: lower in program frontmatter#51
Merged
Conversation
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/8704c8f5-8447-4d4c-be34-14c3e62ab8fe Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for metric_direction: lower in program frontmatter
Support Apr 23, 2026
metric_direction: lower in program frontmatter
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.
Autoloop hard-coded "higher is better" everywhere — the metric-improved check, the halting condition, and the iteration-history delta. Lower-is-better programs (error, latency, cost, fitness ratio) had to invert their metric in the evaluator, which made
target-metricinversions unintuitive and iteration comments hard to read.Scheduler (
workflows/scripts/autoloop_scheduler.py+.github/mirror)parse_program_frontmatterparsesmetric_direction(case-insensitive;metric_direction:andmetric-direction:both accepted; quoted values OK). Invalid values warn and fall back tohigher. Return tuple grew from 3 → 5 elements.select_programreturns a newselected_metric_directionelement;dueitems carrymetric_direction; legacy entries default tohigher./tmp/gh-aw/autoloop.jsongainsselected_metric_direction.Agent prompt (
workflows/autoloop.md)selected_metric_directionin the inputs section and adds a dedicated Metric Direction subsection.new > bestforhigher,new < bestforlower).deltais documented as signed by direction —+deltaimproves underhigher,-deltaimproves underlower.selected_metric_direction(>=vs<=againsttarget-metric).Metric Directionrow (defaults tohigherwhen absent — no migration needed).Tests (
tests/test_scheduling.py)parse_frontmatter_fullhelper exposes direction.select_programunpackings updated for the 7-tuple return.select_programplumbing including the legacy default.Backward compatibility
Programs without the field — and
due/state entries without the key — continue to behave ashigher. No existing program changes shape.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/bogus.invalid/bogus/issues/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py(http block)/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py ic(http block)/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py rget-metric|Machine State|Metric Direction(http block)https://api.github.com/repos/bogus.invalid/bogus/pulls/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py(http block)/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py ic(http block)https://api.github.com/repos/githubnext/autoloop/issues/usr/bin/python3 python3 /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py --destination-port 53 -j ACCEPT(http block)/usr/bin/python3 python3 /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py(http block)https://api.github.com/repos/githubnext/autoloop/pulls/usr/bin/python3 python3 /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py --destination-port 53 -j ACCEPT(http block)/usr/bin/python3 python3 /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py(http block)If you need me to access, download, or install something from one of these locations, you can either: