27 lines
1.7 KiB
Python
27 lines
1.7 KiB
Python
from loop_claude.project.records import HUMAN_RULES, HUMAN_RULES_DIR, RECORD_FILES
|
|
from markdown_text import quoted
|
|
|
|
# Where the judge may quote an answer from, named as the human and the worker see them; of README.md the judge sees only the premises.
|
|
QUOTE_SOURCES = "README.md's Goals and Audience, " + ", ".join(RECORD_FILES + (HUMAN_RULES,)) + " or " + HUMAN_RULES_DIR
|
|
# Where the worker may write an answer the human typed, so it counts as recorded.
|
|
ANSWER_DESTINATIONS = "README.md's Goals or Audience, " + ", ".join(RECORD_FILES) + ", todo.md or a comment"
|
|
ANSWERS_RECORDED = f"every answer the human typed in it that a later chunk could need is recorded in {ANSWER_DESTINATIONS} at the one place it governs"
|
|
|
|
|
|
def fresh(task: str) -> str:
|
|
return f"{task}\n\nContinue any open draft PR or worktree for the chunk before creating a new one."
|
|
|
|
|
|
def resumed(unfinished_evidence: str) -> str:
|
|
ruled = f" A judge ruled the chunk unfinished, quoting this passage of your transcript as the work remaining:\n\n{quoted(unfinished_evidence)}\n\n" if unfinished_evidence else " "
|
|
return f"Continue the task; the previous run ended before the chunk was finished.{ruled}The chunk is finished once it is merged, or nothing remains that you could do on your own. Even then, it is finished only once {ANSWERS_RECORDED}."
|
|
|
|
|
|
def answered(question: str, answer: str) -> str:
|
|
return f"Your question: {question}\n\n{QUOTE_SOURCES} answers it:\n\n{answer}\n\nContinue the task."
|
|
|
|
|
|
def past_the_cap(question: str, answer: str, cap: int) -> str:
|
|
"""The question a quoted answer puts to the human once the cycle's quoted answers reach the cap."""
|
|
return f"{question}\n\n{QUOTE_SOURCES} says:\n{answer}\n\nThose files have answered {cap} questions this cycle, the most allowed, so this one comes to you."
|