Answer stability round 1: count an answer the transcript shows written, give worker and judge one finish rule, cite CLAUDE.md by its heading, test a quoted answer that cannot be archived
This commit is contained in:
@@ -29,11 +29,11 @@ def project_key(root: str, code: pathlib.Path) -> str:
|
||||
return root.removeprefix(f"{code}/").lstrip("/")
|
||||
|
||||
|
||||
def read_checkout_file(root: str, name: str, consequence: str) -> str | Stop:
|
||||
def read_utf8(folder: str, name: str, consequence: str) -> str | Stop:
|
||||
try:
|
||||
return pathlib.Path(root, name).read_text(encoding="utf-8")
|
||||
return pathlib.Path(folder, name).read_text(encoding="utf-8")
|
||||
except OSError as failure:
|
||||
return Stop(1, f"{name} in {root}: {failure.strerror} - {consequence}.")
|
||||
return Stop(1, f"{name} in {folder}: {failure.strerror} - {consequence}.")
|
||||
except UnicodeDecodeError as failure:
|
||||
line = failure.object.count(b"\n", 0, failure.start) + 1
|
||||
return Stop(1, f"{name} in {root} is not UTF-8 on line {line} - {consequence}.")
|
||||
return Stop(1, f"{name} in {folder} is not UTF-8 on line {line} - {consequence}.")
|
||||
|
||||
Reference in New Issue
Block a user