Skip to main content

Module absorb

Module absorb 

Source
Expand description

Absorbed lessons: long-term knowledge an outside store now holds, so Borg stops delivering it.

A team may keep its settled knowledge somewhere else (a reviewed skills repo, a handbook). Once a lesson is held there, Borg delivering it too is a second copy that drifts. borg memory absorb <id> says so, borg memory release <id> undoes it; borg memory export (memory_export.rs) shows the evidence an engineer decides on. Borg never names, reads or resolves the outside store: the note an absorb carries (“skills/review@2026-10-30”) is an opaque label it stores, syncs and shows.

<store>/absorbed.jsonl (FILE) is append-only, one plain line per id and command: {"id", "kind": "absorb" | "release", "ms", "by", "note"?, "version"?} (Record). by is the engineer’s git email, note (absorb only) is redacted (notes.rs redact) and at most NOTE_CHARS characters, version (absorb only) the lesson’s version when it was absorbed, which borg memory export counts the lesson’s recurrence from. Any member may write it. A lesson’s state is its record that sorts last by (ms, kind with release after absorb, the line’s text) (state), so neither line order nor the order lines arrived in over the mesh decides. An id not in the store (yet) is accepted and applies once the lesson arrives. A malformed line is skipped, and a missing or unreadable file is no absorb: a hook never fails on it.

What an absorb does. It withholds the lesson from every path that hands lessons to a drone, on every harness (withhold, applied by hook.rs lessons, which early and standing delivery, live and stop checks, the queue and the vector shortlist all read, and by borg debug recall, prefilter, vectors --query and borg why). Lessons it hid as their successor stay hidden. An absorbed lesson that a live lesson hides stays in the list, hidden: it is never scored or delivered, and its match still counts for that successor (conscience.rs rank). It never widens a lesson’s reach, applies only in the store it was written to, and in a private collective (share: local) stays on this machine as everything there does. A constraint ratified from the lesson (veto.rs ratify) is its own standing item: absorbing the lesson leaves it delivered. Learning still sees an absorbed lesson: borg learn offers it for merging (learn.rs similar), so a correction of the same concern merges into it and counts as a recurrence, the sign the outside copy did not hold; and the judge still gives a delivery made before the absorb its verdict (hook.rs Work::judged).

A record stamped further ahead of this clock than msg.rs SKEW_MS is ignored (latest), and a command is stamped after the records it sees (stamp), so a skewed or hand-written clock never makes an absorb that no release undoes. The mesh syncs the file signed and quarantined like the other logs (borg-mesh lines.rs SYNCED, protocol borg/mesh/15), and lets a peer’s line in only when written accepts it, the check this module reads by.

Structs§

Record
One line of FILE.

Constants§

ABSORB
Record::kind of an absorb, and of a release.
FILE
The absorbs and releases of a store, beside its lessons.
NOTE_CHARS
Protocol: the longest note an absorb carries, in characters. Guard: a note is a label (a path and a version, a link), not a copy of the knowledge; the mesh refuses a longer one from a peer.
RELEASE

Functions§

beside
The absorbed log beside a lessons file (hook.rs lessons_path, which BORG_CONSCIENCE may move).
latest
Every lesson id’s last record in the log file (written before before_ms, when given): the one that sorts last by (ms, kind with release after absorb, the line’s text), whatever the line order. A record stamped further ahead of this clock than msg.rs SKEW_MS is ignored. Absent or unreadable: empty.
note
The note an absorb stores: trimmed and redacted (notes.rs redact); empty is none. Refused when the note or its redaction is longer than NOTE_CHARS characters.
path
The absorbed log of the store store.
stamp
The ms to stamp a command on ids with at now: after every record of theirs in latest, so the command takes effect over the state it sees, however far ahead (within SKEW_MS) a skewed clock stamped that.
state
The lessons absorbed now in the log file (before before_ms): their absorb record, by id.
withhold
The delivery filter: drops from lessons every absorbed one, and every lesson it hid as the end of its chain of hiding supersessions (trust.rs successors), so the lessons an absorbed one replaced do not come back in its place. An absorbed lesson whose chain ends at a lesson that stays is kept, hidden: no path scores or delivers a hidden lesson, and conscience.rs rank gives its match to that live successor, which an absorb must not weaken. A standing lesson (a ratified constraint) is never dropped, whatever its id. The caller passes the lessons as loaded, with their trust (conscience.rs load). Returns the lessons dropped.
withhold_beside
withhold with the log beside the lessons file lessons_path, as of before_ms.
write
Appends one record per id (in order, each once) to the store’s log, each line in one write (learn.rs append_line). version gives a lesson’s current version for an absorb (None: not in the store yet); a release carries neither note nor version. Returns the records written.
written
A line of FILE as borg writes it, at now: it parses as Record, is well_formed, names by, holds no other field, and is stamped no further ahead of now than msg.rs SKEW_MS. The mesh lets a peer’s line in only through it (borg-mesh lines.rs travels), so a line it stores is one every node folds.