megahal-cli-v0.2.0
First release on crates.io. Renames the inner bidirectional Markov crate from markov-chain to megahal-markov to avoid a name conflict, exposes new APIs in the facade, and fixes four algorithm bugs relative to the C reference.
Added
MegaHal::save_brain_to_writer/load_brain_from_readerfor
in-memory brain serialization without filesystem I/O.MegaHal::train_from_readerfor training from anyBufReadsource.MegaHal::generate: a no-learn variant ofrespond.MegaHal::set_fallback_reply/set_fallback_greetingfor replacing
the hardcoded "I don't know enough..." and "Hello!" messages.MegaHalErrorfor reader and writer errors.megahal-clicrate withcargo install megahal-clifor themegahal
binary, extracted from the workspace root.cargo binstall megahal-cli
also works, pulling the prebuilt binary from the matching GitHub release.- Runnable examples under
crates/megahal/examples:chatbot(stdin
loop),game_hud(no-learngeneratewith a tight iteration budget),
andbrain_persist(save/load via reader/writer).
Changed
- Renamed the
markov-chaincrate tomegahal-markov. The name
markov-chainis held on crates.io by an unrelated 2017 crate. SymbolId's tuple-struct field is no longer public; construct via
SymbolId::new(value). Thesymbol-corecrate's API is documented as
unstable; consumers should depend on themegahalfacade.- Expanded the
megahalcrate-level rustdoc with an API tour, concepts
section, brain-file format note, and a recipe for shipping a
pre-trained brain viainclude_bytes!. - Running
megahalwithout--brainnow defaults to persisting the brain
to the user's data directory instead of running with no persistence. MegaHal::train_from_filenow streams the file line-by-line, meaning
a mid-file UTF-8 decoding error leaves the model partially trained
instead of validating UTF-8 upfront.
Fixed
capitalizeno longer upper-cases the letter after a!/./?when
no whitespace follows (e.g.a.b.cnow correctly producesA.b.c).- Reply generation no longer echoes the user's input when that was the
only thing the model could produce; falls back to the canned reply
instead. - The backward generation phase now runs even when the forward phase
produces no tokens, matching the C reference behavior. babbleno longer panics when a context node'susagecount is zero;
treats that case as sentence-terminating.