8000 Simplify wording in docs and code comments · Issue #973 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

Simplify wording in docs and code comments #973

Backlog

Description

@adityamukho

Make the listed passages easier to read without changing API names, syntax, measurements, or guarantees. Replace claims and metaphors with the actual behavior or a short example. This is a wording audit, not a claim about who or what wrote the passages.

Scope: default snapshot 4ba287c2d18802aed4bba2301af7b81c7528b968; public docs, contributor docs, Rustdoc and comments. Historical plans and source were screened for candidates and reviewed in context, not read manually line by line. The current wiki contains short redirects to the docs site and needs no wording changes. A spot check of the maintained v2.x docs found the parallel passages below. Generated files, data, and third-party text are out of scope.

User-facing docs

  • README.md:12–14: “the SQLite of bi-temporal graph databases” / “Think SQLite, but for connected data with full history”. Use one description: “Minigraf is an embedded graph database written in Rust. It stores a graph and its history in a .graph file, and you query it with Datalog.”
  • README.md:18: “Watch time travel … Scrub transaction time and valid time”. “Open the visualizer and move the transaction-time and valid-time sliders to see the graph change.”
  • README.md:20–24: “Vision” / “natural graph traversal” / “Time travel through history”. Use “What Minigraf does”. Use “Follow relationships across multiple hops with recursive Datalog rules” and “Query by when a fact applied and when it was recorded.”
  • README.md:27–29: “execute thousands of times” / “Embed anywhere” / “you're done”. “Parse and plan once, then execute the query with different values.” Replace the blanket platform claim with the supported platforms. Point readers to Minigraf::open("data.graph") without promising there is no other setup.
  • README.md:43–52: “fundamentally better” / “not an afterthought” / “Perfect for temporal” / “literally edges” / “the entire language fits in a system prompt”. Use a short reachable example and explain what the recursive rule does. Distinguish relationship-valued facts from scalar attributes. Remove the assistant-accuracy and prompt-size claims unless backed by measurements.
  • README.md:194–204: “No other database offers this combination” / “Graph Native” / “WASM Ready”. “Here is how Minigraf compares with these projects.” Use criteria the table can substantiate (e.g. browser WASM vs WASI); define or remove “Graph Native”.
  • README.md:220–222: “releases in lock-step” followed by another product slogan. “All bindings publish alongside every core release, including prereleases.” Delete the repeated SQLite/Datomic slogan.
  • README.md:239–245: “exact knowledge state” / “Pairs well … what did we believe at time T?”. “Query the facts that Minigraf had recorded when the agent made the decision.” If keeping the vector-store example, say what each stores and don't imply that transaction time identifies the writer.
  • PHILOSOPHY.md:3–5: “not trying to replace Neo4j … replace serde_json” / “graph memory layer”. “Minigraf is a library for applications that need to save and query a local graph without running a database server.”
  • PHILOSOPHY.md:9–18: “Better Philosophy Alignment” / “do less, do it perfectly” / “Smaller surface area = fewer bugs, faster to production”. “Why we keep the query engine small.” Explain that the project uses established Datalog algorithms; remove broad causal claims not demonstrated here.
  • PHILOSOPHY.md:20–28: “Datalog makes it natural” / “3-4 months of proven patterns”. Show one temporal predicate and say what time it compares. Delete the retrospective estimate unless it is labelled as a historical estimate.
  • PHILOSOPHY.md:30–42: “Graph Traversal is MORE Powerful” / “first-class” / “native, not bolted on”. “Follow links with recursive rules.” After the example: “reachable follows links until it finds no new destinations.”
  • PHILOSOPHY.md:50–54: “Unique Market Position” / “no one else offers this combination”. “Design goals: embed the database in the app, store it in one file, and keep both transaction and valid time.” Drop unsupported market exclusivity.
  • PHILOSOPHY.md:58–60: “Be small, not feature-complete. Be reliable, not cutting-edge.”. “Like SQLite, Minigraf runs inside the application. We limit what the database does so we can spend more time testing storage and recovery.”
  • PHILOSOPHY.md:64–89: “It should just work” / “and you're done” / “embedded-first” / slogan in “Target statement”. State concrete setup: add the library and open a file. This needs no connection string, configuration file, or server. Delete slogans that repeat that point.
  • PHILOSOPHY.md:176: “before existing ones are bulletproof”. “Do not add features while known correctness or durability bugs remain in the affected code.”
  • PHILOSOPHY.md:291–307: “see any point in history” / “compliance built-in” / “Perfect … Ideal … Great”. “Query recorded history by transaction time or valid time. That can help with audits; applications still own compliance.” List supported environments without rating them.
  • PHILOSOPHY.md:319–322: “learning-friendly implementation” / “Readable … Well-documented … Clear”. Point readers to the architecture docs and the relevant Rust source instead of rating the code's clarity.
  • PHILOSOPHY.md:341–356: “Not enterprise-focused” / repeated vendor comparisons. Group concrete exclusions: no built-in RBAC, operational audit logging, high availability, distribution, or vector search. Keep the distinction between fact history and audit logging.
  • PHILOSOPHY.md:360–363: “Audit-heavy … bi-temporal = compliance”. “Store both timelines so an auditor can see what was recorded at the time and what was corrected later.”
  • ROADMAP.md:5–9: “be boring, be reliable, be embeddable” / “window-compatible value handling” / “planned, exploratory, and other future work”. Open with the work the file tracks. For aggregates, say which values avg, sum, min and max include or link to the documented rules without the shorthand.
  • ROADMAP.md:109: “per-file coverage gates that actually gate”. “CI fails when a file falls below its coverage threshold (ci(coverage): raise storage/WAL coverage gates and add branch coverage gates #396).”
  • ROADMAP.md:149: “regression alerting that is not silently muted”. “CI now delivers benchmark regression alerts (ci(bench): regression alerts have been muted since #301; fix alerting and noisy thresholds #393).” Name the previous silence condition if useful.
  • ROADMAP.md:249–266: “grow the ecosystem without expanding the core” / “Annotated end-to-end scenarios”. “Build tools and examples outside the database engine.” Name the three sample applications.
  • CHANGELOG.md:44: “the last statement that writes a fact decides it”. “When several statements in one transaction write the same fact, commit() keeps the last statement's write.”
  • CHANGELOG.md:268: “Release certified aggregate groups” / “Effective grouping tuples … argument certification”. “Return each completed aggregate group without waiting for the rest of the input when the selected key order permits it.” Split the eligibility rules, proof sources, and fallback into separate sentences.
  • CHANGELOG.md:362: “durable API/run evidence … establishes numeric comparisons” / “JVM/WASI lanes”. “The audit verified that each of the 427 native and 26 binding benchmarks had at least three independent v3 runs with numeric comparisons.” Keep the link and summarize the other checks separately.
  • CHANGELOG.md:1385: “first-class bindable values”. “Use these attributes in a Datalog :where pattern to bind their values to variables.”
  • docs/CONFIGURATION.md:7–16: “how the embedder controls” / “query text is gated”. “Applications can use allow_overrides to choose which query keywords may change these settings. This does not restrict settings changed in application code.”
  • docs/DURABILITY.md:59–61: “working trees” / “a WAL exists as a recovery guard”. Keep the copy-on-write term, but say when it happens and what the WAL is for: “Before writing the first temporary tree page, the transaction makes sure a WAL exists so it can recover after a crash.”

Contributor and benchmark docs

  • CLAUDE.md:47–53: “Zero-configuration … just works” / “Bi-temporal first-class”. “The library opens a local database without a server or config file.” / “Store and query both transaction time and valid time.”
  • CLAUDE.md:310: “first-class … not an afterthought”. “Preserve transaction time and valid time in storage and queries.”
  • CONTRIBUTING.md:78: “Error paths matter … happy paths”. “Test error cases as well as successful calls.”
  • .github/pull_request_template.md:20: “Error paths are tested, not just happy paths”. “Tests cover both successful calls and failures.”
  • docs/BENCHMARKS.md:5–14: “nightly lanes” / “routes … histories … artifact provenance” / “this file claims none”. “Nightly JVM and WASI benchmarks.” Say there are 14 JVM and three WASI cases, which runtimes the workflow pins, and that Bencher holds each platform's timings.
  • docs/BENCHMARKS.md:18–23: “X08 map … assigns … refusal … nightly IDs” / “work around one fixed failure”. “Correctness tests cover the failures listed in X08. C08 measures index repair after one kind of corruption; C30 measures rollback after one fixed failure. Neither times how quickly an error is returned.”
  • docs/BINDING_BENCHMARKS.md:3–12: “accepted … evidence remains historical evidence” / “identical … CI companion” / “activates no mobile lane”. Say what the older report measures, where the adapter is tested, and that no scheduled mobile benchmarks were enabled because none of the simulator/emulator cases met the criteria.
  • docs/BINDING_BENCHMARKS.md:14–29: “once-resolved core SHA” / “checkout identities” / “F1 option (b) design” / “reporting-CI guard”. “Resolve the core commit once and use it for the whole matrix. Record that commit and the workflow commit.” Describe which files the two checkouts need; link the design label only if it helps trace the decision.
  • docs/BINDING_BENCHMARKS.md:311–312: “a young-history signal, not a regression finding”. “The alert used only three earlier measurements, so it was not enough to establish a regression.”
  • docs/testing/924-incoming-refs.md:11–12: “raw VAET walk … checks only that prefix before charging” / “No partial list escapes” / “Temporary state follows inspected distinct pairs”. “Seek the target in VAET. Count and decode matching records one at a time. If the record limit is reached, return no partial results. Temporary memory grows with the distinct (source, attribute) pairs inspected, not the requested limit.”

Matching wording on the maintained v2.x line

  • README.md:12–43: same slogans, platform claims and broad Datalog comparisons. Apply the matching plain-language edits above, retaining version-specific behavior.
  • README.md:126–154: market-exclusivity claim, undefined comparison labels, and “in lock-step”. Apply the matching plain-language edits above, retaining version-specific behavior.
  • PHILOSOPHY.md:3–60: same market-positioning and recursion copy. Apply the matching plain-language edits above, retaining version-specific behavior.
  • PHILOSOPHY.md:244: “in lock-step”. Apply the matching plain-language edits above, retaining version-specific behavior.
  • CLAUDE.md:16–22: “just works” / “Bi-temporal first-class”. Apply the matching plain-language edits above, retaining version-specific behavior.
  • CLAUDE.md:227: “first-class” / “not an afterthought”. Apply the matching plain-language edits above, retaining version-specific behavior.
  • CONTRIBUTING.md:131: “in lock-step”. Apply the matching plain-language edits above, retaining version-specific behavior.

Public Rustdoc and JS docs first

  • src/error.rs:1 — “Structured runtime error codes surfaced through” → “Runtime error codes returned in MinigrafError.”
  • src/browser/mod.rs:480 — “The JSON shape is” → “The JSON string has this format.”
  • src/browser/mod.rs:573–579 — “Later writes are outside this bound 8000 ary. Its own flush failure…” → “It does not wait for later writes. If this call’s flush fails, it returns [STG-048]; if an earlier flush failed, it returns [STG-046].” Keep IndexedDB, close/reopen, and memory/OPFS behavior.
  • src/browser/mod.rs:979–987 — “before lifecycle or argument checks”; “a plain object discriminated by status: complete links or an exhausted budget” → “before checking whether the transaction has finished or validating arguments”; “Check the returned object’s status to tell whether it contains the complete list or a limit was reached. A partial list is never returned.”
  • src/db.rs:1375 — “A checkpoint is not a durability boundary” → “In Full mode, the commit syncs the WAL before returning. In Normal mode, a checkpoint (or a later Full commit) also makes the earlier unsynced WAL entries durable. Reopening replays entries that were not checkpointed.” Verify against docs/DURABILITY.md; do not carry forward the unqualified guarantee.
  • src/lib.rs:164–167 — “This thread’s path events … paths the nightly acceptance tests guard” → “Return and reset this thread’s query event counts. Nightly tests use these counts to check which execution strategies ran (Bench: qualify the #841 shape-sweep nightly candidates #863). Requires test-hooks.” Hidden test hook, but intended as human-readable output documentation.

Code comments: production internals

  • src/browser/mod.rs:157–159 — “Reserve the durability boundary synchronously … promise body is deferred” → “Queue this flush before returning the JavaScript promise. Internal barriers always resolve; the caller receives errors from its own operation.”
  • src/browser/mod.rs:680–681 — “Preserve the existing memory contract … Failure belongs to Db, not this pfs” → “Make imported data visible in memory before flushing it. Record any flush error on Db, not on the replacement storage.”
  • src/browser/mod.rs:1230 — “Empty staging still has a durability boundary” → “Validate before applying staged facts. With no facts, return an empty flush that still waits for earlier writes.”
  • src/error.rs:349 — “Single source of truth: (code, code string, message template, category)” → “Registry of error codes, display strings, message templates, and categories.”
  • src/error.rs:2080–2086 — “rides through the crate’s existing … plumbing … Recovered at the public API boundary by … walking the error chain” → “The macros wrap this in anyhow::Error, so callers can still use ? and .context(). When converting to MinigrafError, use the first CodedError in the error chain.”
  • src/error.rs:2093–2101 — “by definition the cold path … pure binary-size cost for a path that … has no per-call-site specialization to gain” → “Keep the registry lookup and template formatting out of line so every error site can call the same code. The small argument array is still built inline at each site.”
  • src/graph/storage.rs:1130 — “single source of truth for retraction semantics over facts” → “Apply the same retraction rules to every fact batch.” Keep explanation about which assertions survive.
  • src/query/datalog/parser/statement.rs:4–10 — “each fact’s shape, 5 materialisation, 6 valid windows … Today’s whole-input code … earliest phase that has one” → “The parser checks tokens, EDN structure, the command, fact structure and options, fact conversion, then valid-time windows. It reports the first error in the earliest failing phase. To keep that ordering while holding one fact at a time, the reader skips that phase and all later phases after finding an error, but continues checking the earlier phases.”
  • src/query/datalog/parser/statement.rs:381–382 — “Phase 4 for one fact: its shape and per-fact map, as … check each fact” → “Check one fact’s vector and options map using the same rules as parse_transact and parse_retract (phase 4).”
  • src/query/engine/ids.rs:40–42, 89, 94 — “What value probes read once … made by the first query that needs it”; “What value probes read, to add to” → “Cache shared by value probes within one query (Recursive rule query 50–10,000× slower since #700: delta run hash-joins a whole attribute (v3) #721). Allocate it on first use; boxing keeps Stream small enough for the allocator’s thread cache.” For accessors: “Return the value-probe cache, if allocated” and “Get or create the value-probe cache.”
  • src/query/engine/mod.rs:56–58, 72 — “Path events of queries this thread ran … which of the paths a nightly acceptance test guards each query took” → “Per-thread counts of execution events checked by nightly acceptance tests (Bench: qualify the #841 shape-sweep nightly candidates #863). Count only in tests and test-hooks builds.” Reset accessor: “Return and reset this thread’s event counts (Bench: qualify the #841 shape-sweep nightly candidates #863).”
  • src/query/engine/plan.rs:143–144 — “logical candidate stays on the hash path until snapshot resolution certifies the complete effective grouping tuple” → “Use hash grouping unless the snapshot confirms the input is ordered by the full grouping key (perf(query): proved Sort omission, one-group count and partition windows #641, perf(query): extend ordered Aggregate beyond one-key count groups #781).”
  • src/query/engine/plan.rs:152–153 — “comparator of a certified partition prefix … prove adjacency, not semantic UUID or keyword order” → “Comparison used to check that equal partition keys are adjacent. DICT IDs group equal values together but do not sort them by UUID or keyword value.”
  • src/query/engine/recursive.rs:214–217 — “Reconsider each round, before opening operators … a value map already built is free to reuse … cap bounds both costing work and the alternative’s seed” → “Choose the join strategy before each round. A small in-memory relation can avoid scanning the whole attribute. Keep AVET probes for file-backed data or when a value map already exists. Limit both the work of estimating cost and the number of rows used by the alternative.”
  • src/query/engine/scan.rs:49–53,90–97 — “What value probes read once for the whole query … reads it once”; “An attribute’s reads”; “committed triples a pending record of it decides” → “Cache value-probe data across rule rounds and outer rows (Recursive rule query 50–10,000× slower since #700: delta run hash-joins a whole attribute (v3) #721).” For the per-attribute fields: “Pending facts by encoded value and committed triples they replace or suppress.”
  • src/query/engine/scan.rs:110–115 — “Where the read of derived rows is … as an index into the spec’s” → “Position in the derived-row scan. Store the relation’s index in the scan specification and the offset of the next row.”
  • src/storage/backend/file.rs:130–142 — “admitting only callers”; “fails CLOSED rather than admitting a second handle it cannot account for”; “genuinely lock-incapable filesystem” → “Check and record path under one mutex so two threads cannot both open it as writers. This protects ProceedUnlocked when the kernel lock is unavailable. If the mutex is poisoned, refuse the open. This helper lets tests exercise that race without a filesystem that lacks locks.”
  • src/storage/backend/file.rs:298–304 — “burn the budget on a certain [failure]”; “paying the full retry budget” → “Do not retry a lock already held by this process: it cannot be released while this call is waiting.” Keep bounded retries for a lock not known to be local.
  • src/storage/verify.rs:319 — “checking each entry’s shape” → “checking the fields of each entry.” Keep the checks of the inverse maps and what else is verified.

Bench harness, tests and CI

Historical design notes (lower priority than live docs)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0