forked from Keelrleek/Harbor
re_match_program: the whole-program LTCG build and check; progress counts its exact matches
This commit is contained in:
1 parent
d2c365d531
commit
5a0fb44c7d
3 files changed
+54
-2
No files matched your search
+17
-1
@@ -43,7 +43,8 @@ review queue, presence and stop flags. Protocol:
|
||||
12. Pick functions with next_functions() (easiest first in your bands). Before writing, read re_lookup (it states the
|
||||
calling convention read from the bytes) and re_similar (a readable near-duplicate is a head start). Before
|
||||
submitting, run re_match on your worktree: 'match' or 'arguments in registers' is byte-identical, otherwise
|
||||
similarity shows how close you are. After two failed attempts, defer(address, reason, evidence) instead of
|
||||
similarity shows how close you are; re_match_program (slow, once before submitting) builds the whole
|
||||
program the way the game was built, so register conventions reproduce. After two failed attempts, defer(address, reason, evidence) instead of
|
||||
looping. Use re_struct_audit before changing a struct in types.h."""
|
||||
|
||||
KindName = Literal["note", "question", "answer", "request", "finding", "retraction", "decision", "status", "handoff"]
|
||||
@@ -523,6 +524,21 @@ def re_match(targets: str, decomp: str | None = None) -> dict:
|
||||
raise ToolError(str(error)) from None
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def re_match_program(targets: str = "", decomp: str | None = None) -> dict:
|
||||
"""The exact-match check the way the game was built: every readable function of your worktree (decomp)
|
||||
goes into one /GL + /LTCG image with the game's compiler, so register-argument conventions and inlining
|
||||
reproduce (re_match compiles one file at a time and cannot). Slow (1.5 to 9 minutes): run it once before
|
||||
submitting, with targets = the functions you changed. Statuses: exact, exact-relaxed (identical after
|
||||
dropping leading stack-argument loads), exact-but-targets-differ, differs (with similarity and the
|
||||
register inputs on both sides)."""
|
||||
try:
|
||||
from .reverse import match_program
|
||||
return match_program(harbor().project.reverse, targets, decomp)
|
||||
except (HarborError, projects.ProjectError) as error:
|
||||
raise ToolError(str(error)) from None
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def re_similar(target: str, k: int = 10, min_score: float = 0.7) -> dict:
|
||||
"""Functions whose instructions look like this one (normalized: addresses blanked, registers and small
|
||||
|
||||
Reference in new issue
Block a user