Read and write each record through the store its config names, and open one for agents with project-record
CI / tests (pull_request) Successful in 2m14s
CI / tests (pull_request) Successful in 2m14s
This commit is contained in:
@@ -104,6 +104,7 @@ from release_plan.named_code import named_files
|
||||
from project_config.main import project
|
||||
from transcript_archive.location import project_archive
|
||||
from score_outcomes.reversals import reversal_lines
|
||||
from record_store.stores import store
|
||||
|
||||
# The scores score-outcomes takes, in order.
|
||||
GIVEN = ("L", "E", "I", "S")
|
||||
@@ -167,17 +168,12 @@ def failed(failure: Failure) -> int:
|
||||
|
||||
|
||||
def read_anchors() -> Anchors | Failure:
|
||||
"""The project's anchors as they stand where its config puts them, so a branch that edits them shows its edit; none where it has no such file."""
|
||||
"""The project's anchors as they stand in the store its config names, so a branch that edits them shows its edit; none where it keeps none."""
|
||||
config = project()
|
||||
if isinstance(config, Failure):
|
||||
return config
|
||||
anchors = config.paths["score-anchors"]
|
||||
try:
|
||||
return parse_anchors(anchors.read_text(encoding="utf-8"))
|
||||
except FileNotFoundError:
|
||||
return []
|
||||
except (OSError, UnicodeDecodeError) as failure:
|
||||
return Failure(f"cannot read {anchors}: {failure}")
|
||||
text = store(config, "score-anchors").read()
|
||||
return text if isinstance(text, Failure) else parse_anchors(text)
|
||||
|
||||
|
||||
def read_reversals() -> list[str] | Failure:
|
||||
|
||||
Reference in New Issue
Block a user