Skip to content

tactic search: announce the learned ranking only when it reordered a ladder - #108

Merged
AkiraTamai merged 1 commit into
developfrom
devin/1785129095-history-ranked-log
Jul 27, 2026
Merged

tactic search: announce the learned ranking only when it reordered a ladder#108
AkiraTamai merged 1 commit into
developfrom
devin/1785129095-history-ranked-log

Conversation

@AkiraTamai

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #106. The run-level log line claimed a learned ranking whenever data/tactic_search_history.json was non-empty, even for runs where no obligation's ladder actually moved — the opposite of the per-atom tactic_search.history_ranked field, which #106 fixed to mean "this obligation was reordered" (spec §12.4).

The announcement is now emitted lazily, from the first obligation whose ladder the artifact actually reordered:

-if tactic_search_enabled and not tactic_search_history.is_empty:
-    print(f"tactic search ladder ranked by {args.tactic_search_history} (fingerprint …)")
 ...
 # in _run_tactic_search_stage, per result:
+if result.history_ranked and not any(o.history_ranked for o in results.values()):
+    print(f"tactic search ladder ranked by {history_path} (fingerprint {result.history_fingerprint})")

So it still prints at most once per run and carries the same path/fingerprint, but only when the ranking was applied. _run_tactic_search_stage gains a history_path parameter for the message (defaulting to HISTORY_PATH); no behavioural change to the search itself, and no contract, schema or artifact change.

test_ranking_is_announced_only_when_an_obligation_was_reordered pins both directions: a non-empty artifact scoped to a different (obligation_class, stage) prints nothing, an applicable one prints the line.

Verification

  • PYTHONPATH=scripts MUMEI_LEAN_SKIP_LIVE=1 python -m pytest -q → 307 passed, 10 skipped
  • PYTHONPATH=scripts PATH="$HOME/.elan/bin:$PATH" python -m pytest tests/test_lean_bridge_e2e.py tests/test_tactic_search.py tests/test_tactic_history.py -q (real lake build) → 44 passed

Link to Devin session: https://app.devin.ai/sessions/99669609dea14e2ba7a541689de09a0a
Requested by: @AkiraTamai

…ladder

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AkiraTamai AkiraTamai self-assigned this Jul 27, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@AkiraTamai
AkiraTamai marked this pull request as ready for review July 27, 2026 05:15

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@AkiraTamai
AkiraTamai merged commit 088456e into develop Jul 27, 2026
7 checks passed
@AkiraTamai
AkiraTamai deleted the devin/1785129095-history-ranked-log branch July 27, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant