basic cli and local http server setup - #24
Draft
samepant wants to merge 4 commits into
Draft
Conversation
|
Verdict: Hi @samepant — thanks for the submission! Here's my first-pass read (a human judge decides eligibility). BogKit usage
Structure checklist
Template checklist
Note: The PR is marked "draft." Please fill in the submission template and pick exactly one category so a human judge can evaluate it properly. My review is based only on the diff shown; Automated first pass by bog-auto-judge (claude-opus-4-8). Human judges make the final call. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
draft pr for seeing how useful a cli that can generate a http server backed by arbitrary fold programs can be
from fable:
bogkit CLI + bog-serve: local HTTP serving for fold pipelines
Implements phases 0–3 of
docs/bog-cli-plan.md: scaffold a BogKit project,serve any fold pipeline over HTTP with the API generated from the pipeline
itself, and an OpenAPI doc that cannot drift from behavior.
New crates
cli/— thebogkitCLIbogkit new <name> [--kind server|embedded]— scaffolds intoexamples/;embedded reproduces
scripts/new-project.shexactly; server (default) is afold pipeline served by bog-serve
bogkit dev [-p name] [--fresh]—cargo runplus conventions: stable datadir (
~/.bogkit/data/<name>),$BOG_DATA_DIR,$PORT(default 7877),project inferred from cwd
bogkit api [--port]— pretty-prints the running server's/openapi.jsonbogname reserved for the future compilerserve/—bog-serveCore idea: a fold program's API surface is exactly (input type at the front,
named terminal sinks at the back). Everything between is closures that never
appear in the API — so the whole HTTP layer is generated.
App(unkeyedStream) andKeyedApp(KeyedStream) builders; usermainstays a plain fnPOST /insert|/remove(unkeyed),PUT|GET|DELETE /docs/{key}(keyed),
POST /batch— every batch is one atomicwtx; every writereturns a monotonic commit
seqGET /views/{name}[/{key}]dispatched through aViewstraitimplemented on fold's reader types (orphan-rule friendly, tuple-composed);
all sink kinds covered: count, bag, table, stats, histogram, ranked,
multimap, inverted index, bm25, hnsw
GET /views/{name}/search?q=&k=(text) andPOST {vector, k}(raw vector);TextQuerywrapper opts an HNSW view intotext queries by registering the pipeline's encoder — encoder/index dim
mismatch is a compile error
GET /watch(SSE, one{"seq"}event per commit) andGET /views/{name}/watch?desc&limit(fresh view payload per commit — e.g.a live top-10)
.get(path, |readers, req| ...)— handler gets the samereader tuple as
rtx, one consistent snapshot, results in the standard{seq, data}envelope/openapi.json(validates against the OpenAPI 3.1 spec) and/schema(pipeline fingerprint) assembled from the same values the routerdispatches with
changed pipeline refuses to start with a clear error
{"error": ...}JSON with field-level serde detailRwLockmirrors fold's model (rtx: &self/wtx: &mut self) — parallel snapshot readers, one writer, multi-client access to apreviously single-process database
fold changes (small, coordinated)
name()(enables generic dispatch/docs)Hnswshared state:Rc<RefCell>→Arc<Mutex>— pipelines with vectorindexes are now
Send + Sync(servable across threads); also removes alatent double-borrow panic
pub use fjall;re-export (downstream layers nameSnapshotwithoutversion skew)
Examples / docs / CI
examples/search-server— the search example served: same pipeline, plusgenerated CRUD/search routes and a custom
/search/hybridRRF endpoint.github/workflows/cli.yml— builds CLI, runs bog-serve tests, validatesgolden OpenAPI docs against the spec, scaffolds both project kinds and
compiles them
Tests (51 total)
fingerprint mismatch (
should_panic)subscriber; seqs unique and gapless, snapshots never torn
UPDATE_GOLDEN=1to re-record), spec-validatedKnown gaps (deferred, tracked in the plan doc)
KeyedRankedhas noViewsimpl yet