Hydra Engine

Evidence Ledger

Every change has an author, and every answer has a source.

When several agents work on one program, you need to know who changed what, and to undo one of them without undoing the rest. Hydra journals every committed change to a writable program; revisions and fork records tie each result to the exact saved state it came from.

The author journal

Each committed change, in owner or shared mode, gets an entry:

FieldHolds
seqCommit order within the program.
atWhen it was committed.
client, name, harnessWho made it: the connection, and the labels of the request.
cmd, opWhat made it: rename, comment, edit, analyze, script, ...
address, old, newWhere, and the value before and after.
python
1j = s.call("journal", since=120, limit=50)2for e in j["entries"]:3    print(e["seq"], e["name"], e["op"], e["address"], e["old"], "->", e["new"])

info and status show the program's journalSeq, savedSeq and unsavedEdits, so you can tell what has reached disk.

No lost updates

Pass expect, the value you read, with a rename or comment. If someone changed it since, the change is refused with conflict, reason: "changed", the current value and its last editor, and you decide again with the facts in hand.

Undoing one author

discard_edits with an author reverts that client's unsaved renames, labels and comments, newest first, each only while the value is still what that client wrote. Anything someone changed since is left alone and listed in skipped.

python
1s.call("discard_edits", author=7)   # client id, from status or the journal

Where an answer came from

  • Revisions fingerprint what's saved. An answer from a read-only view of revision 5b0c... describes exactly that state, and stale tells you when disk has moved on.
  • Fork records (<name>.fork.json) keep a working copy's source, base revision, author and, for a fork of a fork, the whole lineage.
  • Overlays carry the program's SHA-256 and revision, and promote_overlay refuses a target that isn't the same build.

Claims with sources

Through Hydralysis, agents record conclusions with evidence_add, which won't store a claim without a source, and read them back with evidence_list. A finding about a function stays tied to the build and the query that produced it.

Limits

  • The journal lives in the daemon's memory while the program is open and keeps the last 200,000 entries per program. It isn't saved with the program.
  • A script's run is journalled as one entry, not each change it made.
  • discard_edits reverts renames, labels and comments only, not analysis or script changes.