Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions emrg/server/evolution_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ For each: **merged** → confirm master is healthy after it, with no regression;

#### 1.3 Your own records and the rant queue

Read the last 3–5 cycle records in memory and look for: the same trivial change made repeatedly (batch it), the same feature fixed over and over (refactor it), a change that had no lasting effect, or consecutive "nothing to evolve" cycles while rants are non-empty (re-check — that is a contradiction, not a state). Then read the rant queue with `submit_rant(action="list")` — the tool is the only way it is read (R6).
Read the memory index already embedded in this prompt (§1.5 rules out re-reading it as a file) and look for: the same trivial change made repeatedly (batch it), the same feature fixed over and over (refactor it), a change that had no lasting effect, or consecutive "nothing to evolve" cycles while rants are non-empty (re-check — that is a contradiction, not a state). Then read the rant queue with `submit_rant(action="list")` — the tool is the only way it is read (R6).

#### 1.4 master

Expand Down Expand Up @@ -312,7 +312,7 @@ gh issue comment "$ISSUE" -R {{ owner }}/{{ repo }} --body "Handled by #<PR numb

### 4. Record

Write this cycle into memory: what it found, what it changed, how it was verified, and what it expects — so a later cycle can find the record by cycle id. The record's `id`: `cyc{{ timestamp }}`. Its shape and location are the memory system's business, not this step's (R9) — and a rule it records as the host's is written under R7.
Write this cycle into memory: what it found, what it changed, how it was verified, and what it expects. The cycle id — `cyc{{ timestamp }}` — is how a vote body and a report name this run; it is **not a file name**. A record file per cycle is not a shape but litter: nothing in this tree reads one, and one more appears every cycle for as long as the loop believes it owes one. Where memory keeps what this cycle concluded is the memory system's business, not this step's (R9) — and a rule it records as the host's is written under R7.

The `MEMORY.md` index is not a per-cycle obligation: write it when there is something worth indexing, under R9's rules.

Expand Down
18 changes: 11 additions & 7 deletions tests/test_evolution_prompt_vote_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@
REVIEW_BLOCK_END = "# merge (conditions in R3)"
FOLLOW_UP_ANCHOR = "If you are a Committer on this repo and there are currently <3"

#: The id the same render tells the cycle to write its record with (§4 Record).
RECORD_ID = re.compile(r"`id`: `(?P<id>cyc\d{8}-\d{6})`")
#: The id the same render tells the cycle to name this run by (§4 Record). Anchored on the
#: declaration rather than on a bare ``cyc…`` token: the vote examples below are cycle ids
#: too, and they come before it in the file, so a token scan would read an example as the
#: declaration and check the examples against themselves.
CYCLE_ID = re.compile(r"The cycle id — `(?P<id>cyc\d{8}-\d{6})` —")


def _load_counter():
Expand Down Expand Up @@ -119,11 +122,12 @@ def _instructed_examples(text: str) -> list[str]:
return [m.group("body") for region in regions for m in VOTE_EXAMPLE.finditer(region)]


def _record_id(text: str) -> str:
match = RECORD_ID.search(text)
def _declared_cycle_id(text: str) -> str:
match = CYCLE_ID.search(text)
assert match is not None, (
"the rendered prompt no longer states the cycle record's id (``id``: ``cyc…``) — "
"without it the examples below have nothing to be checked against"
"the rendered prompt no longer declares this run's cycle id "
"(``The cycle id — `cyc…` —``) — without it the examples below have nothing to be "
"checked against"
)
return match.group("id")

Expand All @@ -132,7 +136,7 @@ def test_the_instructed_vote_examples_name_exactly_one_cycle_id(rendered, counte
"""Each example body attributes the vote to exactly one cycle — this cycle."""
examples = _instructed_examples(rendered)
assert len(examples) == 3, f"expected 3 instructed examples, found {len(examples)}"
cycle_id = _record_id(rendered)
cycle_id = _declared_cycle_id(rendered)
for body in examples:
ids = counter.distinct_cycle_ids(body)
assert ids == [cycle_id], (
Expand Down
Loading