Skip to content

Trigger tests expect an ended one-off's row; memory eval gets a day-one/day-two condition - #520

Merged
lydakis merged 15 commits into
mainfrom
claude/project-thread-2jed7q
Oct 31, 2026
Merged

lydakis merged 15 commits into
mainfrom
claude/project-thread-2jed7q

Conversation

@lydakis

@lydakis lydakis commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Closes #511. This PR changes tests, evals and docs only; no product code.

Trigger tests: an ended one-off keeps its row

Since #442, a sent one-off keeps its row, marked ended, until its turn is known to have completed. Only Sonny's window and the served tool forget that row (forget_done); the CLI's ls does not. The real-launchd and real-systemd tests still asserted trigger ls == [] right after the one-off ended itself. CI never runs either test, so nobody saw them break. Both now expect exactly one row for that trigger, marked ended.

  • Real launchd, on George's Mac with the Triggers: each HOME has labels of its own #512 release build: the old assertion fails. With this change, the whole test passes in 148s. That covers the one-off firing on time, a file trigger firing on a write, a repeated add read as duplicate, fire by name, rm after a bootout, and rm of a job loaded without its plist.
  • In the same session, Triggers: each HOME has labels of its own #512's orphan check passed by hand. The job had the tagged label me.lydakis.agent.trigger.<tag>.orphan-check, and once its HOME was deleted and the job kickstarted, it unloaded itself.
  • Real systemd: earlier today this test failed at the same assertion and passed everything before it. Since then the container's user manager has lost its bus, so I haven't rerun the rest of the test with the fix.

Memory eval: a learned condition

The day-six review asked whether a fresh lead on day two applies what day one learned. The existing memory condition seeds facts by hand, so it can't answer that. In learned:

  • The memory skill is installed and no facts are saved.
  • Day one: a new agent in the project's main checkout hears the fact from the person in passing, with nothing to change (LEARN).
  • Day two: a fresh agent in the same HOME gets the scenario task.

Only what the first agent chose to save can carry the fact across. stale is left out, since its fact is deliberately wrong. Each row records day_one (status, rounds, tokens, time, and the facts it saved, with their text), and the summary counts day_one_saved.

Day two's turn is found from the run's accepted event: day one and day two share a daemon, so day two isn't turn 1. The first real run found that bug. The synthetic plumbing test now asserts both days completed; it failed before the fix and passes after it (AGENT_TEST_RUNTIME=1 python3 -m unittest tests.test_memory_eval).

The 2026-10-31 run

The run was on George's Mac, on openai/gpt-6.1-sol. All 30 turns completed. docs/MEMORY_EVAL.md has the full table.

decision preference stale
none 0/3 0/3 3/3
memory 3/3 3/3 3/3
learned 3/3 3/3 —

Every day-one agent saved the fact it heard: the decision as a project fact and the preference as a person-level feedback fact, each with its reason. Every day-two agent read that fact and got the task right. Day two cost about what memory costs, roughly 47k input tokens per bot against roughly 31k for none.

🤖 Generated with Claude Code

claude added 13 commits October 31, 2026 06:50
A parallel batch records results in call order, so a later call's outcome
can wait in the batch's buffer, its output file already written, behind an
earlier call still running. Once written, the file names left the cleanup
guard for a plain vector in the outcome: stopping the turn then dropped the
outcome and left the file with no artifact row to find it by, so neither
prune nor delete removed it.

`Outcome.files` is now `Files`, which removes its files when dropped
unless the store recorded them, as a temporary file goes unless kept.
`tool_finish` and the background `process_finish` mark them recorded once
their savepoint commits. Copies share the files through an Arc, so the
held answer a group's rollback snapshot clones doesn't remove them twice;
no files allocates nothing. The keeper's own guard folds into it.

New runtime test: a batch with a slow call beside a large-output one,
stopped after the second wrote its file, leaves no file; it fails on main.

Flaky tests sync on events instead of tight wall-clock bounds:
- #502: the two sandboxed commands each wait for the other's mark, so
  they pass only by running at once, with no 1.1 s bound.
- #484: the lapse test waits for the answered call to start and gives the
  gate two seconds instead of 100 ms.

Closes #484. Closes #502.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
…-2jed7q

# Conflicts:
#	docs/DAEMON_MEASUREMENTS.md
…-2jed7q

# Conflicts:
#	docs/DAEMON_MEASUREMENTS.md
The loss guard reverted the cleanup's whole commit, and with it any fact
another agent saved or removed while the cleanup was open: git kept it in
the refused commit, but memory lost it and nothing told the agent.

`cleanup start` now records which agent runs the cleanup (AGENT_BOT_ID, or
none for the person). A save or removal by anyone else while it is open is
noted in `.cleanup-others` as the fact now stands. When the guard refuses
the cleanup, those facts are put back over the revert, each as its agent
last left it, their folders reindexed and committed, and the refusal says
how many were kept. Snapshot isolation in effect: the guard takes back the
cleanup's writes, never another writer's.

Closes #471.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
…wner, say when kept facts overfill the index

Review fixes on the refused-cleanup put-back:
- A save or rm hands the cleanup journal the fact as it wrote it while
  the folder is still locked, instead of rereading the file after the
  lock is gone, where the cleanup could have changed it in between.
- The cleanup's owner is AGENT_STORE#AGENT_BOT_ID: bot ids are each
  store's own, and stores under one HOME share its memory.
- When the put-back leaves a folder's index past its limit (the
  cleanup's removals made room for saves the revert brings back
  beside), the refusal says so; nothing saved is dropped to fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
…rt and put-back

A save between put_back reading the journal and replaying it was
overwritten with the older noted text, and a save during the revert
itself could be clobbered. The finish now takes every folder's lock,
in sorted order, from its commit to its end; saves and removals wait
and land after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
launchd keeps one domain per user and systemd one user manager, whatever
HOME is, so a test's or an eval's HOME added its triggers beside the
user's own, under the same labels: a same-named trigger replaced or
removed another HOME's, and one left loaded after its HOME was deleted
fired into nothing.

A trigger's label is now me.lydakis.agent.trigger.TAG.NAME, TAG being
eight hex digits of a hash of HOME (FNV-1a 64, folded to 32 bits, trailing
slash left out). Sonny's start moves each trigger made before labels had
the tag to its tagged label, once, rolling back one that will not load.
A fire whose HOME is gone removes its definition and unloads its own job,
by the label launchd (XPC_SERVICE_NAME) or systemd (its cgroup) runs it
under.

Closes #453.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
systemd's unit folder can be shared by several HOMEs (one absolute
XDG_CONFIG_HOME); a trigger whose definition runs with another HOME is
that HOME's to move, at its own Sonny's start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
Since #442 a sent one-shot's row stays, ended, until its turn is known
to have completed; only Sonny's window and the served tool forget it.
The real-launchd and real-systemd tests still expected an empty list
after the one-off ended itself, so both failed there (neither runs in
CI). They now expect the one ended row.

Closes #511.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T15:41:14.993097Z d51e277 New commits
🔒 Security Review ⚠️ Failed 2026-10-31T15:40:24.563622Z
We couldn’t complete this review. Comment @codex security review to try again.
d51e277 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

…lies it

The day-six review asked whether a fresh lead on day two applies what day
one learned. The memory condition seeds facts by hand; learned installs
the skill, saves nothing, and on day one has a new agent in the project
hear the fact from the person in passing, with nothing to change. Day
two's fresh agent, in the same HOME, gets the task: only what the first
agent chose to save can carry it. Rows record day one's status and the
facts it saved; the summary counts day_one_saved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

@lydakis lydakis changed the title Trigger tests: an ended one-off keeps its row until its turn is done Trigger tests expect an ended one-off's row; memory eval gets a day-one/day-two condition Oct 31, 2026
…10-31 run

Day one and day two share a daemon, so day two is not turn 1; the script
waited on /1 and got turn_not_found. Take the turn from the run's
accepted event, record day one's rounds and tokens, and assert both in
the synthetic test (which failed before this change).

docs/MEMORY_EVAL.md gets the 2026-10-31 run on openai/gpt-6.1-sol:
learned 6/6, memory 9/9, none 3/9.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013jkdGFBzSEQmnVuCCNV83g
@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

@lydakis
lydakis merged commit 9998e9e into main Oct 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Real-systemd trigger test expects an ended one-off to leave no row

2 participants