Expand description
Facets: one lesson phrased several ways, so keyword search finds it from different angles (document expansion, “doc2query”; internal evaluation “facets”, not published).
A lesson is written once, in the words of the correction it came from. A drone meets the same
concern in other words: as a symptom it observes, as the edit it is about to make, in German, or
after a rename. One model call per lesson writes 6–8 short facets, each from a fixed angle (ANGLES):
the concept without names, the symptom, the action, the consequence, German, and the identifiers
as aliases. Names churn and concepts persist, so the identifiers are one facet among several,
never the only key. The conscience indexes every facet as its own document of the lesson
(conscience.rs rank); a drone never sees them, and the question and consequence never change.
When: after borg learn and borg assimilate --from-dir --apply, for the lessons they wrote
(fill with their ids), and by borg facets [--apply] for a store learned before facets existed
(a dry run with a cost estimate by default). Every call’s cost is recorded in facets.jsonl beside
the store. Off by default (the pre-registered test failed, internal evaluation “facets”, not published): BORG_FACETS=on turns the
automatic step on; borg facets --apply works either way.
Structs§
- Generated
- One line of
facets.jsonlbeside the store: a lesson’s facets were written, at what cost. - Report
- What
filldid or (dry run) would do.
Constants§
- ANGLES
- The angles, in the order facets are stored.
- EST_
USD_ PER_ LESSON - The cost estimate of a dry run, USD per lesson. Learned (measured once): the mean on the eval
stores, $0.0112 (internal evaluation “facets”, not published), rounded up. Display only: what
borg facetswithout--applysays a run would cost; nothing is capped by it. - FACET_
CHARS - Guard: one facet is a phrase, not a paragraph; a longer one is cut.
- MAX_
FACETS - At most this many facets per lesson, each at most
FACET_CHARScharacters. Guard: bounds what a model answer adds to a lesson (and to the search index) however much it writes; the prompt asks for 6 to 8, so a good answer is never cut. - USAGE
Functions§
- appended_
ids - Ids of the lessons on lines appended to
pathafter bytefrom(len_ofbefore a learn run). - beside
facets.jsonlbeside a lessons file.- enabled
- True only with BORG_FACETS=on:
borg learnandborg assimilatethen write facets (internal evaluation “facets”, not published: off by default). - fill
- Give facets to the lessons of the store at
paththat have none (latest version), limited toonlywhen given. A dry run (applyfalse) asks nothing and writes nothing. Withapply,jobscalls at a time; each lesson with facets is appended as a new line of the same id and version (readers keep the latest line), its question, consequence and every other field unchanged, unless the lesson changed in the store meanwhile. After 3 failures without a success the run stops asking. - generate
- One model call: the lesson’s facets and the call’s cost. None: no usable answer.
- len_of
- The store’s length in bytes (0 if absent).
- main
borg facets [--apply] [--store PATH] [--jobs N]: backfill facets for a store (default: this collective’s,BORG_HOME). The exit code.- parse
- The facets in a model answer: trimmed, clipped, unique, in
ANGLESorder (stable within an angle), at mostMAX_FACETS. None when fewer thanMIN_FACETSremain. - prompt
- The prompt for one lesson: what it says, nothing about where it is stored.
Type Aliases§
- Ask
- The model call: (prompt, JSON schema) -> (answer, cost in USD).
learn::ask_modelin production.