AntFleet

Anatomy · c0feb3ca-0

Branch field in skills.lock is ignored when fetching latest commits, causing false results on non-default branches

highbugclosed in 4b9b492
repo 6f7fc663·PR #30·reviewed 1 week ago·closed 1 week ago

The vulnerable code

skills/skill-update-check/SKILL.md:22-22

22 "branch": "main",

The reasoning

Opus

gh api commits step constructs an invalid query — `-f path=` is not a list-commits filter that gh forwards correctly

mediumbugmedium
  • skills/skill-update-check/SKILL.md:28-33
`gh api` with `-f` sends form fields as POST body parameters by default for non-GET-default endpoints, but the commits endpoint is GET. In practice gh promotes `-f` to a query string for GET endpoints, however the documented form for list-commits requires `path` as a query parameter — using `-f` here actually works, but only because gh treats `-f` as querystring for GET. More importantly, `{source_repo}` and `{source_path}` are placeholder syntax that the skill never substitutes — there is no instruction (e.g., shell variable expansion or jq templating) telling the operator/agent to interpolate values from the lock file entry into the gh command. A literal execution would call `repos/{source_repo}/commits` and 404. Same issue recurs in steps 5 and 6.

Recommendation

Add an explicit substitution step (e.g., `repo=$(jq -r .source_repo <<<"$entry")` and use `"repos/$repo/commits"`), or state clearly that `{source_repo}` etc. are placeholders to be substituted by the agent before invocation.

GPT-5

Branch field in skills.lock is ignored when fetching latest commits, causing false results on non-default branches

highbughigh
  • skills/skill-update-check/SKILL.md:22
  • skills/skill-update-check/SKILL.md:31-35
  • skills/skill-update-check/SKILL.md:42-44
skills.lock entries include a branch field, but Step 3 queries commits without constraining to that branch. GitHub’s commits API defaults to the repository’s default branch, so skills pinned to a non-default branch (e.g., release, develop) will be compared against the wrong history. This can produce false UP-TO-DATE or CHANGED statuses and incorrect diffs and reports.

Recommendation

In Step 3, filter by the tracked branch: add -f sha={branch} to the gh api repos/{source_repo}/commits call so the latest file commit is resolved on the intended branch. Ensure any subsequent content fetches or comparisons use SHAs from that branch. Also document that branch is required and honored throughout.

The agreement

Both frontier models flagged this within the same line range. AntFleet's unanimous gate fired — the finding posted on the PR. Closed in 4b9b492.

The fix

22 {

Closure

Closed 1 week ago

SHA: 4b9b49251c8c9808bf147d55aa2930352af2e8c0

View closure receipt on GitHub →

Tweet thread template

tweet 1 of 8195 / 280

Two frontier models reviewed PR #30 on 6f7fc663. Both found this bug: high bug: Branch field in skills.lock is ignored when fetching latest commits, causing false results on non-default branches

tweet 2 of 8126 / 280

The vulnerable code (skills/skill-update-check/SKILL.md:22-22): (full snippet at https://www.antfleet.dev/anatomy/c0feb3ca-0)

tweet 3 of 8280 / 280

What Opus saw: "`gh api` with `-f` sends form fields as POST body parameters by default for non-GET-default endpoints, but the commits endpoint is GET. In practice gh promotes `-f` to a query string for GET endpoints, however the documented form for list-commits requires `path`…

tweet 4 of 8280 / 280

What GPT-5 saw: "skills.lock entries include a branch field, but Step 3 queries commits without constraining to that branch. GitHub’s commits API defaults to the repository’s default branch, so skills pinned to a non-default branch (e.g., release, develop) will be compared agai…

tweet 5 of 897 / 280

Both flagged the same line range. AntFleet's unanimous gate fired — the finding posted on the PR.

tweet 6 of 893 / 280

The fix landed in commit 4b9b492: (view diff at https://www.antfleet.dev/anatomy/c0feb3ca-0)

tweet 7 of 881 / 280

AntFleet reviews every PR with two frontier models. Only unanimous findings post.

tweet 8 of 877 / 280

Full anatomy + reasoning + diffs: https://www.antfleet.dev/anatomy/c0feb3ca-0

Paste into X composer one tweet at a time. X has no multi-tweet intent API.