Skip to main content

Crate ljos_cli

Crate ljos_cli 

Source
Expand description

One seat over the habitats. It does not own them.

Cards are read-only. Remember/Prefer POST /v1/atoms and never extract on write. Consensus is a different crate, then the tracker verb. Policyd is argv law: this process does not reload a pack as a check.

Structs§

ConsensusStep
Event
One dated event on an issue’s timeline, from whichever store holds it.
Habitat
One habitat and whether it answers.
Harness
One agent runner, as the seat’s own configuration describes it. The seat ships no runner’s name: the file at harnesses_path names them, one table each, and onboard and doctor read it.
Harnesses
The whole file: [[harness]] tables.
HookCall
What the runner’s hook hands the seat: the event, and the text worth asking the pack about. From a tool call, the command about to run; from a prompt, the prompt.
Persona
A voter with a view of its own: a persona. anchor in [0, 1] is how far it moves off its ballot in a settle; 0 never moves, 1 is a plain DeGroot voter. entities are the domains it speaks to.
Prediction
One voter’s forecast on one issue: what share the others give each option, or the option it expects to win.
Rule
Argv law kept in the pack: a glob over the command line, a verdict, and the reason a reader sees when it fires. deny stops the action at the runner and under ljos policy; ask hands it to the person.
Said
What a habitat printed, kept for a caller that has to hand it on. A non-zero exit is an error carrying stderr.
Step
One step an onboarding took, or would take.
Trust
One row of the influence graph: from listens to to with weight. about scopes the row to the domains it speaks to: a row with none applies everywhere, a row with some applies when one of them meets the issue at hand (its title, or the entities of the island it activates).

Constants§

BROAD_EPSILON
The confidence bound a broad issue settles under: voters within this L1 distance of each other’s opinion listen to each other.
BROAD_TAG
The tag on an issue that asks for bounded confidence: a panel for a broad audience is allowed to settle into clusters, and the settle says how far apart they are, where a single-position model would average them away. Without it the anchored model runs.
CARD_NAMES
Working-core files this seat will print. Nothing else, and never write.
CORRECTION_CUES
Phrases a person uses when the agent has forgotten something it was told. A prompt that opens this way is a preference or a lesson the pack does not hold yet, and the moment to write it is now, before the work that follows.
HARNESSES_EXAMPLE
An example of the file, with placeholder names. ljos onboard --example prints it; the two shapes are a registering command and a config file.
HOOK_EVENTS
The events the memory hook fires on when a runner’s table names none: the prompt, which carries the task in the person’s words. A tool call carries the command about to run and is a cue too; a runner asks for it with hook_events. The default came out of a panel of this seat’s personas: a turn issues many shell commands and one prompt.
HOOK_MATCHERS
The events the hook knows a matcher for; any other event takes *.
HOOK_SCORE_FLOOR
The floor a hit must reach, as a share of the strongest hit’s score, to be injected. A command line matches many claims weakly; only the ones that match it as well as the best does are worth the agent’s context.
LEARN_BETA
The factor a refuted voter’s rows shrink by (Hedge, doi:10.1006/jcss.1997.1504).
POLICY_TCB
Printed on stderr. ljos-policyd is the TCB when it exists.
PROTOCOL
The sitting protocol: which store answers which question, the order of verbs before, during and after the work, and the refusals worth knowing. ljos protocol prints it, ljos onboard installs it as a skill, and the server serves it at ljos://protocol. Harness agnostic on purpose.
REQUIRED
The habitats the seat needs.
SEAT_WORKSPACE
The workspace the seat’s memory lives in when nothing names one. The pack’s command line keys a workspace to the repository it stands in; a seat is one memory across every repository it works in, so the seat pins one. PACKSET_WORKSPACE overrides it.
TRUST_FLOOR
The least a row can fall to, so a voter who is right again is heard again.

Functions§

age_of
How long ago a stamp was, in words a reader can place: today, yesterday, N days ago, then weeks, months and years once the count stops fitting the smaller unit. Empty when the stamp is missing or unreadable, in N days for a stamp ahead of now.
anchors_json
Anchors as the settles take them: {"name": anchor, ...}.
atom_body
Explicit claim body. The text is stored as given; never harvested.
atom_kind
Remember → lesson, Prefer → preference. Trust rows go through trust_atom.
ballots_from_json
(agent, choice) pairs from a tracker’s vote --json.
brief
The brief a subagent playing a persona starts from: the persona’s view and domains, what the seat knows on those domains (preferences first), and the issue’s working set. One text, so a panel member reads the same seat the rest do and still reads it its own way.
calibrate
Turn a project’s voting history into trust rows without anyone naming an outcome: Dawid and Skene’s accuracy per voter (doi:10.2307/2346806), from ljos-consensus reliability, turned into the weight every other voter gives that voter by calibration_weights: log odds, so a voter right nine times in ten outweighs one right six times in ten by five to one, not three to two. Rows are complete and floored at TRUST_FLOOR, so the settle sees the whole graph.
calibration_weights
The weight a voter of estimated accuracy p earns: the log odds ln(p / (1 - p)), the optimal weight for independent voters on a two-way choice (Nitzan and Paroush, doi:10.2307/2526438; a weighted majority under these weights is the maximum-likelihood decision), with p held inside [0.01, 0.99] so a perfect record does not become an infinite vote, and a voter at or under chance at TRUST_FLOOR. The weights are scaled so the most reliable voter stands at one, which is the scale the trust rows live on; the ratios between voters are the rule’s.
card_paths
cards
Read-only cards. Only CARD_NAMES, never created, never written.
claim
Take a session node, and when the claim graph refuses because the assignee still holds another node, say which tracker id that is and the two verbs that free it. The bare refusal names a 32-hex id nobody can act on.
conflicts
Consolidate the seat’s memory: every claim that replaces an earlier one (a rewrite, a new object under the same head, a correction, an explicit supersedes) closes the earlier one’s window and names it. Candidate contradictions from the geometry of the seat’s memory: the landscape binary reads the pack’s embeddings at the point scale and prints the lowest passes between single memories, which on a record of planted contradictions were the contradictions nine times in ten. The replacement rule reads words; this reads distance, in any language. A candidate is for a person or consolidate to judge; nothing is written here. landscape is an optional habitat: absent, this says so.
consensus_steps
ljos-consensus first, then vissue consensus, both under the pack’s trust rows when there are any. Missing bins are skipped.
consensus_steps_anchored
consensus_steps passing the personas’ anchors to both settles as --susceptibility-of, so a persona holds its ballot as much as it says.
consensus_steps_for
consensus_steps_anchored with the model flags the issue’s tags ask for on the model crate’s settle.
doctor
Which habitats answer: binaries on PATH, the pack over PACKSET_URL, the deed store, the tracker, the claim graph.
doctor_seat
The seat’s own rows: binaries, pack, host key, deed store, tracker, claim graph. What a sitting checks; the runner rows are onboarding.
due
What the pack holds for review now.
due_of
The live atoms whose review is due at now (RFC 3339 UTC), soonest first. A claim that has never entered the review clock has no due_at; it is due now, and grading it puts it on the clock. Trust and persona rows are weighed, not recalled, and never come up.
due_report
The review clock as ljos due prints it: the due atoms, then the summary.
enclose
Deeds to enclose: the satchel’s needs plus what the pack cites, once each.
enclosed_atoms
Every atom in a satchel’s data/atoms/*.jsonl.
finish
Close a sitting: remember the lesson when there is one, fire the island the issue’s title activates, complete the session node, and learn from the outcome when one is named. Without a lesson the report says so, because a sitting that taught nothing worth two sentences is rare and worth noticing.
format_consolidation
The pairs a consolidation closed or would close, one a line, then the count and whether it was applied.
format_doctor
format_due
format_hits
One line per hit: score, how many scorers named it out of how many ran, kind, id, age, text. The age is the one column a reader needs to lay the hits on a timeline; the count is what the hook keys on.
format_hubs
One line per hub: score, links, id, text.
format_island
One line per activated memory: activation, seed mark, id, text.
format_steps
glob_matches
A glob over a command line: * matches any run of characters, ? one. The match is on the whole line, so rm -rf * is rm -rf and anything after, and *sudo* is sudo anywhere.
graded
Grade one review: recalled moves the atom out, lapsed brings it back sooner.
handover
Pack a slice of the seat into out: the tracker’s satchel, the pack’s atoms, the deeds both cite, sealed, and signed when a host key is set.
harnesses_from
Parse the runners file. An absent file is no runners, not an error.
harnesses_path
Where the runners are described: $XDG_CONFIG_HOME/ljos/harnesses.toml.
healthy
Whether every required habitat answers.
hook_call
Read a hook call from the runner’s JSON, or from plain text (an argv under argv law). Fields: hook_event_name, tool_name, tool_input (its command, else every string value joined), prompt.
hook_context
The context the hook injects: the island the cue activates, standing preferences first because they bear on what to do, then lessons. Empty when the pack holds nothing on it or does not answer; a hook that fails must not stop the runner, so this never errors.
hook_output
The hook’s answer in the runner’s JSON: additionalContext under the event that fired. Empty context is no output, which the runner reads as no opinion.
hook_output_ruled
hook_output carrying a rule’s verdict on a tool call: deny or ask as the runner’s permission decision, with the rule’s reason. On a prompt or an argv line the verdict is a line of text.
identity_or_seat
The identity a ballot is cast under: the persona named, else the runner’s seat name when LJOS_SEAT is set, else none (the tracker’s own default, VISSUE_AGENT or user@host).
island_entities
The domains an issue’s island speaks to: the entities of the memories its title activates, most frequent first, eight at most. What learn scopes its rows to.
join
learn
The rows every voter holds on every other after outcome is known: a voter whose ballot was refuted shrinks by beta, floored at TRUST_FLOOR; a missing row starts at one. Complete, so the settle sees the whole graph.
learn_about
learn writing rows scoped to about: the domains the issue’s island speaks to, so that being wrong about one topic does not cost a voter its standing on every other. An empty about is the unscoped rule.
learn_anchors
The personas after an outcome: one whose ballot the outcome refuted moves its anchor toward one by 1 - beta of the gap, so a persona that keeps being wrong listens more; a vindicated one keeps its anchor. The personas that voted are the only ones touched. Acemoglu, Como, Fagnani and Ozdaglar (doi:10.1287/moor.1120.0570) show what a stubborn wrong voter does to a pool; this is the seat’s remedy.
learn_and_write
learn_about and learn_anchors together, written to the pack: the rows, then the personas the outcome moved. Returns what was written.
learn_record
Learn from an outcome by the record: each voter’s hits and misses so far, this outcome added, give its accuracy with one of each smoothed in, and the rows are the log odds of that scaled to the best voter at one (calibration_weights). Measured against multiplicative shrinking (Hedge) on voters of known accuracy, the record reaches the batch calibration and the shrink does not: a voter is weighed by what it got right, not by how many times it has been punished. Rows are complete over the voters and scoped to about.
learn_shared
learn_about with a fixed share of recovery: after the Hedge step every row moves toward one by share of the gap, so a voter refuted long ago is not held down forever and the best voter can change (Herbster and Warmuth, doi:10.1023/A:1007424614876). Zero is plain Hedge; the seat’s default.
needs_of
The accessions a satchel’s description says it needs.
node_for
The claimdag node standing for issue, minted with the tracker id as its summary when the graph does not hold it yet.
now_utc
Now, RFC 3339 UTC to the second, the stamp the pack writes.
on_path
onboard
Register the server and install the skill for one runner named in the runners file. json registers nothing and returns the entry to paste. dry reports without writing.
onboard_from
pack
The pack client. With nothing set it speaks to 127.0.0.1:8761 about the seat workspace; PACKSET_URL points elsewhere, PACKSET_WORKSPACE names another workspace, and PACKSET_URL=off is the one way to have no pack.
packset_consolidate
The rule a write applies on arrival, run over what the pack already holds. Without apply nothing is written; the pairs are reported.
packset_forget
Retire one atom from the workspace the cwd resolves to, optionally naming the deed that withdrew it.
packset_hubs
The claims the pack’s link graph turns on, highest first: what matters in this seat’s memory by its own connections, before any query.
packset_island
The memories a task activates: the pack’s island around the cue. With fire, the strongest of them fire together and their links gain weight.
packset_search
packset_search_as_of
packset_search_opts asked of the pack as it stood at as_of (RFC 3339; a date alone reads as its start): only memories live then answer, what was withdrawn since included and what was learnt since left out. None is now. This is the question “what did the seat know when it decided that”, and the pack keeps every record so it can be asked.
packset_search_opts
packset_search with a limit and the cross-encoder rerank: the writer scores the top hits against the query with its reranker, which costs a model call and buys precision. For a brief or a person reading, not for the hook.
packset_write
packset_write_as
packset_write as a persona: the claim carries the persona’s entity, so what a persona learned comes back to it first in its next brief and stays in the seat’s one pack. A persona accumulates its own lessons the way a reviewer does; the seat still reads them all.
panel
A panel for a runner with no MCP: one brief per persona written to out, named <persona>.md, and the lines that run it. A runner starts one subagent per file, each ends with the ballot its brief names, and ljos consensus ISSUE settles.
panel_steps
The two readings beside a settle, when the pack holds what they need: the surprisingly popular answer when two or more voters forecast the others (predict), and the EigenTrust standing of the voters when trust rows exist. Both are the model crate’s verbs.
persona_atom
The persona atom for the pack: kind persona, the view as text.
persona_entity
The entity a persona’s own claims carry, so a brief can find them.
personas_from_pack
The personas in the seat’s pack.
personas_of
The live personas: the latest persona atom per name.
policy_line
policy_with_memory
The argv line, then what the pack knows that bears on it: the memory a policy layer injects beside its verdict. The line prints even when the pack is down; the memory is the part that may be empty.
policyd_bin
POLICYD_BIN, else ljos-policyd on PATH.
post_claim
POST one explicit claim. Callers pass Remember/Prefer only.
predictions_json
Forecasts as ljos-consensus surprising --predictions takes them.
predictions_of
The latest forecast per agent on an issue.
receive
Check a satchel that arrived: manifest, deed receipts, signature, and what the atoms hold; with import, POST the atoms into this seat’s pack.
records_from_atoms
The latest record per voter among the trust atoms that carry one.
release
Hand a session node back before it is terminal: ready again, assignee cleared, generation moved.
resolve_assignee
Resolve an --assignee / MCP field. A shared name (grok, seat, you) is treated as omitted so two conversations do not share one occupancy slot.
review_summary
One line on the state of the review clock: how many are due, how many are scheduled, and when the next one comes up. An empty due with a next date is a clock that is running; an empty due with nothing scheduled is a seat that has remembered nothing.
rows_about
The rows that apply to an issue about topic: every unscoped row, and every scoped row one of whose domains is among the topic’s words.
rules_from_pack
The rules in the seat’s pack.
rules_of
The live rules in a set of atoms.
run
run_as
run with VISSUE_AGENT set to identity, so a ballot or a claim is recorded under a persona’s name rather than the seat’s.
run_captured
run_fed
Run a habitat’s verb with input on stdin.
seat_name
The name this seat claims and votes under when none is given: LJOS_SEAT (a runner’s registration sets it to the runner’s name, so two runners on one host hold separate claims), else the session id the runner stamped, else VISSUE_AGENT, else seat.
server_entry
The MCP server entry any runner that reads JSON accepts.
session_end
When a session ends, the memories injected during it fire together: they served one sitting, so their links gain weight and the next sitting like it walks a heavier path (Hebb, through the pack’s fire). The seen file goes with the session. Returns how many fired; nothing to fire, or no pack, is zero and not an error, since a hook must not stop a runner from ending.
settle_flags_for
The model flags an issue’s tags ask for, beside the rows and anchors. The kind of work sets the dynamics: broad runs bounded confidence.
sitting
Open a sitting on an issue, in the protocol’s order, and stop at the first habitat that does not answer: doctor, cards, the review clock, the island the issue’s title activates, the working set, the timeline, the claim. One verb, so the loop that makes the seat a memory runs every time and not only when somebody remembers to run it.
skill_text
The skill file a harness loads: front matter, then the protocol.
tcb_check
One line from ljos-policyd check -- argv. None if the binary is absent or failed to start. Absence is not a deny.
timeline
The issue’s timeline, the three stores read as one dated list, oldest first: the tracker’s logbook (creation, state changes, claims, notes), the deeds the issue cites with the time each was produced, and the memories the issue’s title activates with the time each was written. The reader gets time as data, not as stamps to do arithmetic on: each line carries its age and the gap since the line before it, and a later line supersedes an earlier one on the same matter.
topic_words
The words an issue is about, for scoping trust rows: its title, lower case, three letters or longer.
trust_atom
A trust atom for one row. why are deed accessions it cites.
trust_from_pack
The live trust rows in the seat’s pack.
trust_json
Rows as the consensus takes them: [[from, to, weight], ...].
trust_rows
The live rows in a set of atoms: the latest trust atom per (from, to).
verdict_for
The verdict the rules give a command line: the first deny wins, then the first ask, else none. Returns the rule that fired.
work_id
A claimdag id for a name: the name itself when it is already 32 hex, else FNV-1a 128 of it. One tracker id maps to one node; one assignee to one actor.
write_persona
POST one persona.
write_prediction
POST one forecast. expect is an option name or {option: share}.
write_rule
POST one rule.
write_trust
POST one trust row.
write_trust_record
write_trust carrying the voter’s record on the row.

Type Aliases§

Standing
A voter’s record: how often the outcome agreed with its ballot, and how often not, carried on every trust row into that voter.