Skip to content

fix(bench): refuse an ALGORITHMS key that names no folder (#1283) - #1286

Merged
Birfy merged 1 commit into
mainfrom
agent/1283-algorithm-folder-check
Nov 25, 2026
Merged

Birfy merged 1 commit into
mainfrom
agent/1283-algorithm-folder-check

Conversation

@Birfy

@Birfy Birfy commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Closes #1283

What changed

source_fingerprint used to glob examples/<ALGORITHMS key>/*.py and, when the key named no directory, add zero paths and raise nothing. A port whose name drifted off its folder then stopped changing the fingerprint, so cached results were no longer invalidated by edits to that port.

algorithm_source_dir now requires each key to be a real directory before the glob, and source_fingerprint goes through it. The check is filesystem-only: no dataset load and no build(0). A missing folder fails with FileNotFoundError naming the key and the path.

A second test pins each PROPOSAL_CALLS_PER_CANDIDATE entry to builder(0).proposal_calls_per_candidate. On main that constant is still derived from the policy, so the pin is already true by construction; it is the check #1283 asked for once a port spells the reservation as a separate literal (as #1279 proposes).

Not a goal: changing how the matrix is built, loading less at import, or altering the fingerprint of a valid matrix beyond this file's own bytes.

Verification at the tip

Tip SHA: ae2070a — base a0d70e49d2c09908c04cf352db23b6d3a0572737, 1 commit.

Ran:

  • pytest -q -o addopts='' tests/test_candidate_algorithm_folders.py → 5 passed in 0.97s
  • python -m tools.changelog_fragments check → 48 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date

Not run: full pytest -q — the delta is the helper, its tests, and a changelog fragment; required CI will cover test 3.9–3.13, build, otel-wire.

source_fingerprint now errors when a matrix key is not an examples/
directory, instead of hashing nothing for that port. A test also pins
PROPOSAL_CALLS_PER_CANDIDATE to each policy's reservation.
@github-actions github-actions Bot added risk:T2 Risk tier T2 (package code or an unnamed path), set by the controller from the diff agent-pr Pull request opened by an agent labels Nov 25, 2026
@Birfy

Birfy commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator Author

Review (Birfy)

Tip SHA: ae2070a
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1286 → T2
  • pytest -q -o addopts='' tests/test_candidate_algorithm_folders.py at this tip → 5 passed
  • python -m tools.changelog_fragments check → 48 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
    Not run:
  • Full offline suite locally — the delta is the helper, its tests, and a changelog fragment; required CI will cover test 3.9–3.13, build, otel-wire
    Findings:
  • No actionable defects. A key that names no examples/<key>/ directory now raises FileNotFoundError from source_fingerprint instead of contributing zero paths. The reservation pin compares PROPOSAL_CALLS_PER_CANDIDATE to each policy; on main that constant is still derived, so the pin holds by construction and becomes the fix(bench): list the candidate methods without building every port #1279 residue check if the reservation is later spelled as a literal.
    Verdict: PASS

@Birfy
Birfy enabled auto-merge (squash) November 25, 2026 22:23
@Birfy
Birfy merged commit 3a388a1 into main Nov 25, 2026
12 checks passed
@Birfy
Birfy deleted the agent/1283-algorithm-folder-check branch November 25, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr Pull request opened by an agent risk:T2 Risk tier T2 (package code or an unnamed path), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bench: a port's NAME/PROPOSAL_CALLS are unchecked metadata — a key naming no folder silently drops its sources

1 participant