Skip to main content

Module moves

Module moves 

Source
Expand description

Crossing a collective boundary, only ever on the engineer’s word: borg move and borg correct.

Collectives never mix on their own (collective.rs): a session reads and writes only the store its repo routes to. But a lesson can land in the wrong collective, a repo can change collectives, and one session can correct things that belong to two collectives. Each of those is an explicit act the engineer triggers, through the harness skill or a terminal:

  • borg move <lesson-id> --to <collective> appends the lesson’s latest version to the target store as its next version and withdraws it from the source with a tombstone (MOVED) that keeps its episodes, so the source’s own “done” rule never learns them again. The target notes the move in its local PLACED_FILE (never synced: the source’s name never reaches the target’s team), so borg doctor never calls the lesson misplaced. A lesson another engineer is on stays in a team store as it is (copied, never hidden from their team); a local store’s copy is always withdrawn, since no team reads it. A lesson in the source’s personal.jsonl moves to the target’s; --personal puts a lesson there. Moving it again changes nothing.
  • borg move <repo-path> --to <collective> moves the episodes of that repo the stores hold but have not learned into a lesson (with their not-a-lesson marks) to the target store, deduped there, when the repo routes to the target now. Without --from only stores that hold them because the repo routes there (learn.rs held) give them up. Episodes already learned stay with their lessons; borg move <id> moves a lesson.
  • borg correct --collective <name> <words> records a correction of the current session as an episode in that collective’s store (via VIA), learned there at the session’s end like any other. One command per collective the correction concerns, the session’s own included: the raw words the hooks captured in the session’s collective are set aside, so each collective learns only what was said for it. Into another collective goes only what the engineer said: no task, proposal or email of the session’s collective.

Both are dry runs where they change stores (--apply writes), and take each store’s locks (in path order, never one twice). borg doctor lists what may need a move (doctor): evidence held in a store its repo no longer routes to, lessons that name another collective’s repo, and the repair of lessons a borg before 0.7.4 withdrew to a private collective. It only shows the commands; it never moves anything.

Structs§

LessonMove
What moving a lesson does.
RepoFrom
What moving a repo’s evidence takes from one store.
RepoMove
What moving a repo’s evidence does.
Said
One correction borg correct records.
Store
One collective’s store.

Constants§

CORRECTION_CHARS
The most characters of a correction borg correct records. Guard: bounds the episode as the hook bounds a captured correction (learn.rs EXCERPT_CHARS): derived, the same bound.
CORRECT_FLAGS
borg correct’s flags (completions.rs).
MOVED
The question of the tombstone a move leaves in the source store: no text left to deliver or sync.
MOVE_FLAGS
borg move’s flags (completions.rs).
PLACED_FILE
A store’s record of the lessons borg move placed in it ({"id", "from", "ms"} lines): placed by the engineer, so never “misplaced?”. Local: borg-mesh SYNCED does not list it.
VIA
Episode::via of a correction borg correct recorded for a named collective: placed by the engineer, so no routing check ever holds it back or calls it misplaced (learn.rs CORRECT).

Functions§

corrected_homes
The stores borg correct recorded a correction of session into.
doctor
borg doctor’s checks of where lessons and evidence sit (see the module doc); me is this engineer’s git email. Nothing without a config: one store holds everything.
doctor_with
doctor under explicit aliases.
main_correct
borg correct …; returns the exit code.
main_move
borg move …; returns the exit code.
move_lesson
Moves lesson id (plan_lesson), with apply writing it under both stores’ lessons.jsonl locks, planned again under them; the dry run writes nothing.
move_repo
Moves the waiting episodes of repo (a repo name, as episodes carry it) from sources to to, one source at a time under both stores’ episodes.jsonl and lessons.jsonl locks (so a running borg learn on either finishes first and never learns an episode as it leaves); the dry run writes nothing.
named
The store of the collective name.
plan_lesson
Plans moving lesson id from from to to (personal: into the target’s [PERSONAL_FILE]); me is this engineer.
record_correction
Records s as a pushback episode in the store home, once (learn.rs record_new_in, which also counts it); None when the store holds it already.
repo_sources
The stores a borg move <repo-path> --to <to> takes repo’s evidence from when no --from names one: those that hold it waiting only because the repo routes to to now (learn.rs held). A store that may hold another repo of that name, or this one by right, is never a source unasked.
set_aside
Sets aside, in the session’s own store here, the engineer’s latest prompt the hooks recorded as a correction (hook.rs record: #borg-episode <id> in the session’s state file): a borg correct restates it for each collective it concerns, so its raw words are not learned in this collective besides. Only the latest prompt’s episode (newer than the session’s task, which the hook rewrites on every other prompt), and only while unlearned. Marked as settled (episodes-not-lessons.txt) under the store’s learning lock; the episode stays, so transcript capture never records it again. Returns its id.
stores
Every collective’s store under the root store base (without a config, “default” at base).