Repository navigation
Warning: There are no backward compatibility guarantees and no migrations until v1, as the README says. A pool written by v0.6.0 or earlier may not load in v0.7.0: storage record formats changed (issue #109), and functions stored under an earlier normalization (
from bb.pool import ..., bare-hashbb.ref) no longer run — add them again. Keep your pool in git, and expect to re-save when 0.x releases move.
v0.6.0 made trust verifiable: signatures, anchored proofs, reviews bound to the exact hash they read. v0.7.0 is about the other side of sharing: two people working at the same time. A pool travels through git, so every record bb writes had to become either byte-identical between two writers, named by its own content, or cushioned by a nonce — so that no two people can ever write one file with different contents. This release also records what names mean in each language (a glossary of senses), rebuilds the command line for people and agents, writes every hash with 0x so what bb prints can be typed back, and takes the first swing at "is anybody thinking the same thought?" with bb search near.
What changed since v0.6.0
Pools that merge under git (issue #109)
object.jsonholds only what its hash determines — no author, no date, no normalization version. Two people saving one function write the same bytes. Who saved a function and when is told by its earliest lineage step, and that step is signed: it names its key, so the signed step is what vouches for a function, and functions no longer name an author themselves.- Mappings are written with sorted keys: the bytes on disk are the same for everyone who saves the same mapping, so two pools write identical files.
- Dates are out of the records. A mapping, a sense or a worklog message is content-addressed, so a date inside it would make two people's copies differ: each date is its own file under
pool/created/, named by the hash of what it says, with a random nonce so neither the file nor its proofs can conflict when pools merge.bb historyreads the earliest. - Signatures are named by their own bytes (
FILE.<id>.sig, the<id>the start of the signature's SHA256) and a file may have several: two people signing one record never write one name. What a signature vouches for is read from the signature itself, and each record kind has its own namespace, so a mapping's signature can never pass for a lineage step's. - Anchoring proofs joined the same discipline:
FILE.<id>.pending.ots, thenFILE.<id>.anchored.ots, each named by its own bytes, created once and never written over (the client is given copies to upgrade). Two people stamping one file merge.bb anchorremains the only command that reaches the network; saving never anchors. - The shared list of peers is one file per entry (
trust/<hash>.signer), so two people publishing themselves never write one file. - Naming a signature is part of signing: a signed lineage step names its key (
public_keyis part of its id), and a step given its metadata (a rewrite inbb update) is never signed, so nobody's step id is forged by machine rewriting.
A glossary of senses (issue #101)
bb glossary new NAME@LANG "definition"records a sense: what an identifier means in one language. Senses are content-addressed underpool/glossary/<lang>/, signed as mappings are, and never superseded or removed.- A mapping can name the sense of each of its names (
terms,{visible name: sense hash}), which changes no hash: documentation is still free.bb showand drafts note them in# bb: termlines. - Saving settles the sense of each name — with
--term=NAME=0xHASH(NAME=noneunlinks), else what the parent mapping had, else the only sense of a new name, else a question at the terminal; with no answer coming from a terminal, a warning, links nothing, and nothing is blocked.--termis for senses;--pickstays for functions.--no-glossarylinks nothing new. bb glossary newrefuses a sense close to one already there (spelling or wording), listing them, unless--force. The same record twice is a no-op.bb glossary show NAME@LANGtells one name's senses and where they are used;bb glossary synonymsandbb glossary homonymsreport the rest.bb history 0x<hash>names a sense like any other record, with its date and signatures.
A command line rebuilt (issue #106)
argparseis gone. The module docstring is the one usage text, printed bybb --help, and a test holds it andCLI_COMMANDSto the same account: what the help promises, bb accepts, and nothing more.bb searchtakes subcommands:bb search query [WORD...]andbb search near X. The old flags say what to write instead.--showis now--preview:bb scratchpad FILE --previewandbb edit NAME FILE --previewlist the--pickand--termchoices to come, and save nothing.--refactor,--atand--updateare gone from the edit flow: save first, thenbb update(all that a function uses) orbb refactor(one version swapped for another).bb scratchpad --refactor=ROOTbecame--update=ROOT, after the command it runs.bb rmisbb remove;bb latestisbb search resolve;bb logisbb history.- Old habits get an answer, not a traceback: short options are refused with the long form to write, removed commands get their replacement, and a refusal names the exact
--pickto pass. Which makes the CLI scriptable by agents: questions bb would ask at the terminal it never asks with--no-ask— it prints the flag instead.
Hashes are written 0x
- Everything bb prints — plain output,
--json,# bb:markers,bb.refin stored code — writes hashes with0x, so what bb prints can be typed back into the next command. A bare hash is refused (helper_refuse_bare_hash), and an unambiguous prefix does, 6 to 64 hexadecimal characters: what bb prints about one record can name it, andbb history 0x<prefix>resolves to a function, a step, a message, a snapshot, a mapping, a review or a sense. - Uppercase hashes read the same everywhere; a mapping prefix matches mapping hashes only,
--picktakes0xas identifiers do.
Is anybody thinking the same thought?
bb search near Xranks the pool by closeness to a function, a hash, or your own file (closeness to the draft you are writing), across languages. Three signals, fused by reciprocal rank: structure (Jaccard on code shingles), words (BM25 over character trigrams of names, docstrings and code), and shared pool dependencies. Each match says why it ranked — the fused number only orders.bb auditlists, for your languages, the pairs above the similarity threshold and any one code held under several of your names — as pairs ordered by structure, because something always ranks first and sampling never decides anything: that word falls to a human.
bb search --similar is gone; --near says what it is.
History, updates, and repairs made precise
bb historylists every record at its own date — functions, lineage steps, worklog messages, snapshots, mappings, reviews, senses — links mappings and lineage steps, and shows signatures (Signed:), the best first.bb updateis all or nothing over the whole tree: it walks lineage steps, deepest first, moves only the names in that language, requires review whether or not there are checks, and saves only when every check passes; pins never move.bb search query --outdatedlists the debt, andbb search query --pinnedfinds the pins.bb refactoris all or nothing for every language of its root, and moves only the names whose language is ready; a pinned version that has moved on blocks the whole rewrite (--rewrite-pinsrewrites pins that have moved on, on purpose) — otherwise nothing is saved.- Callers now say when they wait for a translation:
bb search, drafts andbb updatetell what a name waits for (lineage_waits), since a version newer in another language only is not debt — it waits for you to translate. A dependency is followed in the caller's language once translated there; a rename happens only when one name can be meant. - One name on one code is one function: an edit landing a name where another current function of that name already sits is refused; a fork (
bb edit --fork) starts its own lineage on purpose. A lineage with several ends is listed, and asked about, andbb showshows from it alone what the choices are, each other candidate with its--pick. - Free-standing strings besides the function's own docstring are refused when saving — a nested docstring or a mid-body string would be hashed, and bb no longer suggests comments (comments are not saved).
- A stored object is re-checked against its hash before every path that shows, runs, edits, compiles or rewrites it (
object_check_hash, as in v0.6.0), andbb removenow refuses to remove a function that is in use —--forceis gone.
Smaller
- A review names no other review: written once, a new verdict is another file and which one counts is read, not recorded — of the trusted reviews one key holds on a function, the latest
createdcounts, a tie going to a rejection, andbb review listprints each review's id. - Fixed
bb updateon Python 3.12+ (a comprehension variable shadowedname) andbb search --nearon a file; docstrings are read withinspect.cleandocso Python 3.13's stripped indentation changes nothing. CI runs the matrix 3.11–3.14. bb skills— the agent-facing reference — is kept to what an agent may use: no leaked docstring blocks or internal names, and bb now says what the pool is and how to share one (issue #109).
Where to chime in
Open issues where the design is still soft. Comments, counter-proposals and "this is wrong because…" all welcome.
- bb tree --complexity (#105): audit the complexity of a function and everything it depends on.
- Symbolic checks (#94): a check that returns a property is proved by Z3 for every input in a domain, or yields a counterexample; how should bb hint at property testing when a proof is out of reach?
- Predicate typing (#93): a type is a predicate stored in the pool, and entry/exit asserts state a function's domain and result.
- How close is "close"? (#95):
bb search nearshipped this release; the issue stays open on what "close" should mean next. - Shell completion (#82): bash, zsh and fish, now that the command line is one docstring.
Good first issues: #79 (audit CLI error messages), #77 (proofread and translate the README into your language) and #76 (a fourth natural language in the "langue du feu" transcript). #81 asks for a transcript in your own language.
As ever: pool records are append-only, signatures gate nothing (only reviews decide what may run), and bb anchor is the only command that reaches the network. Keep the whole $BB_DIRECTORY in git.