Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 26 Nov 19:58
· 26 commits to main since this release
763e705

0.4.0

Fixes from a second adversarial review (30 confirmed, 15 plausible findings), and the known limits, except Windows-specific work.

Security

  • A project's .mem-harness/harness.json may now set only profile (one of yours), brief and main_agent. profiles, ownership and routes moved to your own config, because a repository could otherwise:
    • hide a feature's owner by replacing the ownership table or defining its own trims;
    • put its own text into the instructions the model reads.
  • A trim is one name ([A-Za-z0-9_-]). A comma or a NUL character used to get past the owner and core checks.
  • Each ownership entry lists the owner's protected groups and tools (protect). Before, the check only worked when a feature's name equalled a group name.
  • Unknown keys are errors inside every object, not only at the top level, so a typo cannot silently turn off env_pass.
  • MEM_HARNESS_CONFIG must be an absolute path. A relative one would have been read from the repository.
  • Command lookup skips files without an execute bit, as the shell does.
  • Command lookup ignores relative and empty PATH entries (since 0.3.0), so a program is never found through the folder the harness was started in.
  • Value::obj with a repeated key keeps one entry, as parsing does.
  • print-config and the usage text point at ~/.mem-harness/harness.json and list MEM_HARNESS_PROFILE.

Backends (Unix; Windows is unchanged)

  • Each server runs in its own process group, which is stopped (TERM, then KILL) when its connection ends. A server started through sh -c or npx no longer survives shutdown, and a process it leaves holding the pipes no longer leaks two threads per restart. Set keep_children to opt out.
  • A connection that ends late no longer overwrites a newer connection's status.
  • Cancelling a call is honoured while its server is still starting.
  • A large reply that arrives just before the server exits is no longer lost.
  • initialize is never cancelled (the spec forbids it).
  • Memory and CPU:
    • the read buffer shrinks after a huge line;
    • ping replies are dropped while the write backlog is large;
    • a server that stops reading stdin is stopped once 32 MiB is waiting;
    • an idle server costs far less polling: 9 idle backends now use about 0.3% of a core.

Proxy

  • Calls waiting on a backend that failed to start share one start and one 60 s deadline, instead of starting it once each.
  • A call is no longer answered "unknown tool" when another fetch replaced its own.
  • A cancelled call stops waiting at once.
  • logging is declared, logging/setLevel works, and relayed log messages below the set level are dropped.
  • Shutdown takes at most about 3 s, down from about 6 s.
  • A message of exactly the 64 MiB cap is accepted.
  • A duplicate in-flight request id gets -32600.
  • Refetches after tools/list_changed are coalesced.
  • The retry timer no longer loses a backend after a thread-spawn failure.

Hooks

  • New hook event prompt-submit (UserPromptSubmit; mem-harness install wires it). It prints {} and records where the working tree stands, so the stop check sees edits made with shell commands too. Re-run mem-harness install and merge the new UserPromptSubmit entry.
  • The stop check, in a git repository: the turn edited files when the tree changed since the turn began (git HEAD, git status and each listed file's size and time) and the turn ran an edit or shell tool. Edits you make in your editor while the agent only reads are not blamed on it. Outside git it still goes by the edit tools in the transcript.
  • The stop nudge is asked once per set of changes. It used to repeat on every later turn started by a background task or a sub-agent's hand-back, for edits it had already asked about.
  • The stop check lets the agent stop when the last prompt is older than the part of the transcript it reads, instead of judging a turn it cannot see.
  • PostCompact retries line by line only when Libellus refused the batch, not after a timeout, and the whole hook stops after 30 seconds, reporting what it did not save. A hanging Libellus used to keep it waiting about 220 seconds.
  • PostCompact reads earlier notes page by page, so the duplicate check works in a store of any size (it was skipped once the listing passed 4 MB), and makes at most 40 libellus get calls. When the check cannot finish, the lines are saved anyway and the report says so.
  • Lines in the "Not yet recorded" list that end in a colon, and bold sub-headings in it, no longer end the list. A line starting with a note kind and a colon is always an item.
  • A text section's output and Chisel's issue lines can no longer start a heading in the brief (## x is shown as [##] x); control characters are dropped. Libellus, Relatum and Adsertio output is unchanged.
  • A symlinked .swarmnotes, which Relatum uses, is no longer called refused. Each tool's own rule applies: Libellus refuses a symlink or file, Adsertio walks past one, Relatum follows a symlink. The brief's rules and its Setup section use the same lookup.
  • The trim marker names the section's tool (chisel_issues, not issues).
  • A section with a small weight keeps its heading and trim marker instead of vanishing when space is short.
  • Hook command timeouts signal through mh-sys, so they no longer need a kill binary. A process that left the command's group (setsid) is found before the kill and stopped too; on Linux the hook process is a subreaper, so one that double-forked out is found as well.